Posts

Showing posts from August, 2013

HTML form data to JSON(php) -

i passing data mobile via api server.for have made html form,which has combination of text boxes,labels, select boxes, etc.now on button click want convert form data json format.what possible way it. like example, <label for="register_email">email:</label> <input type="text" name="email" id="register_email" /> <label for="register_password">password:</label> <input type="password" name="password" id="register_password" /> <label for="register_password_confirmation">password confirmation:</label> <input type="password" name="register_password_confirmation" id="register_password_confirmation" /> <input type="submit" value="register" /> so when user enters data,after click form data should converted json format. in other page... <?php if(isset($_post)) { foreach($_

php - Changing specific html table row by jquery.ajax -

i have html table generated php querying mysql table. <table> <tr> <th>sl</th> <th>id</th> <th>article name</th> <th>publish status</th> </tr> <?php $i = 1; foreach ($obj->showallfromtable('pattern') $pattern) { extract($pattern); ?> <tr> <td><?php echo $i++; ?></td> <td><?php echo $id; ?></td> <td><?php echo $pattern_name; ?></td> <td id="publish_<?php echo $id; ?>" class="status_pattern"> <?php echo $publish; ?> </td> </tr> <?php } ?> </table> i want change status of article clicking on 'publish' cell of corresponding article row. trying use ajax method of jquery purpose shown in following: <script type="text/javascript"> $

I have WCF(odata) services how can i get response in android -

i have wcf(odata) services database values client mobile. how can response service , store in local database. if give example useful me there different possible java libraries connect client odata source. give 1 of following try: odata4j apache olingo jaydata (you can find more libraries on odata.org ) each of them capable read/write odata source. further information on storing data on android devices, recommend android develoeprs

asterisk - SIP/2.0 500 Service Unavailable issue -

Image
i getting sip/2.0 500 service unavailable, created sip trunk nexmo server. status 200 ok. when call on trunk through mobile server getting sip response 500 "service unavailable" 119.xx.xx.x:5060. detailed log please go through attachment! appreciated. did set freepbx server this: host=sip.nexmo.com type=friend insecure=port,invite qualify=yes allow=ulaw,alaw dtmfmode=rfc2833 fromuser=apikey secret=apisecret register string apikey:apisecret@sip.nexmo.com

php - Fatal error: Uncaught exception 'Zend_Db_Table_Exception' -

i using zend1.12. placed index.php public root folder , changed configuration after throwing below error. i getting following error , configuration looks fine. fatal error: uncaught exception 'zend_db_table_exception' message 'no adapter found application_model_content' in /var/www/html/library/zend/db/table/abstract.php:756 stack trace: #0 /var/www/html/library/zend/db/table/abstract.php(740): zend_db_table_abstract->_setupdatabaseadapter() #1 /var/www/html/library/zend/db/table/abstract.php(269): zend_db_table_abstract->_setup() #2 /var/www/html/library/zend/db/table.php(77): zend_db_table_abstract->__construct(array) #3 /var/www/html/application/views/scripts/common/topnav.phtml(2): zend_db_table->__construct() #4 /var/www/html/library/zend/view.php(108): include('/var/www/html/a...') #5 /var/www/html/library/zend/view/abstract.php(888): zend_view->_run('/var/www/html/a...') #6 /var/www/html/application/layouts/scripts/front_hea

Display dialog box on top right corner in android activity -

how display dialog box in top right corner in android activity. below code dialog box item.xml <tablelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="150dp" android:layout_height="wrap_content" > <com.customtogglebutton android:id="@+id/togglebutton2" android:layout_width="150dp" android:layout_height="wrap_content" android:textoff="@string/off_txt" android:texton="@string/on_txt" /> </tablelayout> activitymy.java dialog_box = new dialog(activitymy.this); dialog_box.setcontentview(r.layout.item); dialog_box.show(); do window window = dialog.getwindow(); windowmanager.layoutparams wlp = window.getattributes(); wlp.gravity = gravity.top | gravity.right;

how to create the special table to wrap my data in python? -

Image
here data. ['date', 'x1', 'x2', 'x3', 'x4', 'x5'] ['2014-02-26', '302964.13', '11715.30', '1389.87', '404.63', '304354.00'] ['2014-02-25', '297672.69', '7406.57', '1733.45', '345.70', '299406.14'] ['2014-02-24', '297957.19', '9933.49', '1514.91', '345.56', '299472.10'] ['2014-02-21', '312826.51', '9365.13', '1308.66', '266.03', '314135.17'] ['2014-02-20', '325884.05', '10152.87', '1576.65', '483.17', '327460.70'] ['2014-02-19', '330013.56', '17205.76', '1729.29', '709.73', '331742.85'] ['2014-02-18', '327645.32', '11282.95', '1359.65', '190.63', '329004.96'] ['2014-02-17', '

android - Provide own root-certificate for HTTPS-connection? -

currently app connects (special) webserver via http retrieve data there via get/post , httpclient. now plan switch on https. problem: webpage i'm communicating uses cacert root certificate not available on android devices, users connection fail. cacert provides root certificates @ http://www.cacert.org/index.php?id=3&lang=en . there possibility use these certificates https connection? don't expect install silently whole system, me enough provide special httpclient connection. thanks! ok, found solution including code example here: http://developer.android.com/training/articles/security-ssl.html

objective c - Arrange small images inside large UIImageView and zoom it in IOS -

i have project needs arrange 81 small images(tiles) in large uiimageview , zoom uiimageview . have make 3 such uiimageviews (example: red tiles, blue tiles , yellow tiles [all 3 belongs single sheet]) , switch 1 depending upon zoom scale. i have done using catiledlayer .but not able switch 1 ,that means red yellow) depending upon zoom scale. using catiledlayer shows tiles loading in screen not acceptable client. what have done yet.... i put small images inside small uiimageviews. arranged uiimageviews inside large uiimageview. made 3 such large uiimageviews.i added uiscrollview main view subclassing , adding 1 of uiimageview it. able switch red yellow , vice versa depending on zoom scale. problem when make 3 large uiimageviews shows memory warning continuously , when press next button load next sheet (with 3 similar large uiimageviews), application crashes. please me , resolve issue because in big trouble. many many in advance.

c# - Listview not shown in asp.net -

Image
i have tried implement listview in asp.net. can't output. make mistake don't know. pls me. my model aspx <asp:listview id="listview1" runat="server"> <itemtemplate> <div> <asp:table runat="server" > <asp:tablerow> <asp:tablecell width="40%"> <asp:label id="label17" runat="server" font-bold="true" font-size="medium" text='<%#eval("roomtype") %>'></asp:label> </asp:tablecell> <asp:tablecell width="20%"> <asp:button id="button1" runat="server" text="search" /> </asp:tablecell> </asp:tablerow>

Android app call to .NET web service -

i have created .net web service , trying fetch data using xmlpullparser android app getting http/1.1 500 internal server error this sample httprequest: post /companyservice.asmx/adduser http/1.1 host: 192.168.141.1 content-type: application/x-www-form-urlencoded content-length: length username=string&password=string&phonenumber=string&emailid=string&position=string&address=string and android code is: httppost httppost = new httppost("http://192.168.141.1/companyservice.asmx/adduser"); try { // add data list<namevaluepair> namevaluepairs = new arraylist<namevaluepair>(6); namevaluepairs.add(new basicnamevaluepair("username", "aaa")); namevaluepairs.add(new basicnamevaluepair("password", "a")); namevaluepairs.add(new basicnamevaluepair("phonenumber", "a")); namevalue

boost - Error in CodeBlocks C++ program and how to set default main class -

i have included boost library in codeblocks c++ project. now, in file boost/function.hpp there include statement #include <boost/preprocessor/iterate.hpp> however error in codeblocks when try , compile: /home/arvind/documents/workspace/browser/boost/function.hpp|15|fatal error: boost/preprocessor/iterate.hpp: no such file or directory| what doing wrong here? have included boost library is. also, cannot find screen/option set main class (which execute). how do this?(i new codeblocks hence question). your boost includes seem in non-standard/system directory : /home/arvind/documents/workspace/browser , must tell compiler there (gcc -i command-line switch). go project->build options->search directories->compiler , add directory boost includes are. don't have codeblocks install right here from here . if can, recommand installing boost on system once , instead of copying files in codeblocks workspace.

ios - issue in NSPredicate for NSString -

in application using coredata.amount values stored in coredata nsstring. in interface builder have 2 textfields.when enter amount on textfields amounts accept minimum value , maximum value.i want amounts between minimum , maximum amounts have entered. what solution.i goes through way example not worked on project because want convert string integer on nspredicate method. my code is nspredicate *p1= [nspredicate predicatewithformat:@"(amount.intvalue => %@) && (amount.intvalue <=%@)", text1.intvalue,text2.intvalue]]; note amount stored nsstring in coredata nspredicate *p1= [nspredicate predicatewithformat:@"(amount.intvalue => %@) && (amount.intvalue <=%@)", text1.intvalue,text2.intvalue]]; you shouldn't comparing numbers , strings. compare 1 or other. in case, want compare numbers. should change source data stored in model number. => should >= %d integer parameter format, , text1.intvalue retu

ios - Shared instance of c file in objective c? -

i working on chess engine in c/objective-c , rewrote large part of engine in straight-c improve speed. question is, have 3kb of tables initialize in c file don't want reinitialize every time function file called. if regular objective-c class create shared instance. however, core of engine in 2 .h , .c files. should make of tables used engine static? persist between multiple other files calling functions in engine? should make static struct hold tables? i'm not sure best approach here. thanks! example: test.h: int getint(int index); test.c: static int integers[4] = {1,2,3,4}; int getint(int index) { return integers[index]; } every time call getint file, reallocate 'integers'? or reuse same array? want prevent unnecessarily reallocating bunch of static arrays. ok, did accessor on static variable... a static initialized once, initialized once per launch. can keep way, or change global access without calling function. this code typically inl

asp.net - Default Content Type Attribute value for Page Directive -

if content type of page directive not mentioned default content type page directive ?? <%@ page language="c#" autoeventwireup="true" codebehind="page.aspx.cs" inherits="page" %> in case value of contenttype ?? the default value "text/html", mentioned in documentation contenttype property : the http mime type of output stream. the default value "text/html" .

Can't see linked commits in Github issues -

we link our commits related issues mentioned here but today can't see commit link in issues? (maybe github don't support feature more or there bug) how can see commits related issue in situation?

c# - Get better results with SpeechRecognitionEngine -

speechrecognitionengine works pretty well, if have loaded grammars select correct one. if completly different 2 loaded grammar trigger of loaded grammars. how can make trigger if 1 of loaded grammars? my code looks loading grammar var builder = new grammarbuilder(text); recognitionengine.loadgrammarasync(new grammar(builder)); full code https://github.com/andersmalmgren/freepie/blob/speech/freepie.core.plugins/speechplugin.cs i solved using confidence level, can make better using wizard , teach recognitionengine more accurate

vbscript - how to interact with combo boxes in testcomplete 10? -

i using c sharp .net application , testcomplete not recognising combo boxes using object spy. , since cannot map , object spy doesn't not give me methods related combo boxes e.g.. clickitem function. please give workable solution or alternative access items in combo boxes . it looks testcomplete doesn't recognize app correctly. check version of testcomplete , version of .net framework installed on computer (and 1 used build app). testcomplete may not support .net framework version use. example, if using testcomplete 9.31, works .net framework 4.5 , earlier. if .net framework 4.5.1 used in app, need use testcomplete 10.

spring mvc - InitBinder on multiple form objects -

can have @initbinder on several data in same form? i have spring form contains select dropdown of object , 2 datafields, have initbinder on dates otherwise error on submit. need bind dropdown object. i have type has 2 dates , category , , category need bind because can not empty on save. think me validate form to. can have in type controller? @initbinder public void initbinder(webdatabinder binder) { simpledateformat dateformat = new simpledateformat("yyyy-mm-dd"); dateformat.setlenient(false); binder.registercustomeditor(date.class, new customdateeditor(dateformat, true)); binder.registercustomeditor(category.class, "category", new categoryeditor(categoryservice)); } and editor: public class categoryeditor extends propertyeditorsupport { private categoryservice categoryservice; public categoryeditor(categoryservice categoryservice) { this.categoryservice = categoryservice; } @override

xslt - Saxon-HE-9.5.1.4 Extracted XML node doesn't contain the root element namespace -

extracting particular element(node-set()) ex. <bbb> following xml payload ignores root element namespace included in results <soapenv:envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="http://www.sonoasystems.com/schemas/rentacar"> <soapenv:body> <bookcar> <size80k> <aaa> <bbb/> </aaa> </size80k> </bookcar> </soapenv:body> </soapenv:envelope> result : on using saxon9.5.1.4 <bbb xmlns="http://www.sonoasystems.com/schemas/rentacar"/> on using saxon9.0 <bbb xmlns="http://www.sonoasystems.com/schemas/rentacar" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"/>

Postgresql collation -

is posible define collation connection? i'm connecting postgresql server 9.3 via php pdo. know can set collation server, column or define in select statement need connection. thank you. i don't think can set collation in connection. however, if need change collation data representation , not ordering, can add following parameters connection string: lc_monetary (string) sets locale use formatting monetary amounts, example to_char family of functions. acceptable values system-dependent; see section 22.1 more information. if variable set empty string (which default) value inherited execution environment of server in system-dependent way. lc_numeric (string) sets locale use formatting numbers, example to_char family of functions. acceptable values system-dependent; see section 22.1 more information. if variable set empty string (which default) value inherited execution environment of server in system-dependent way. lc_time (string) sets locale

javascript - Multilevel list menu with JSON and jQuery Mobile -

i try reach following structure a list of (distinct!) categories category 1 category 2 category n and each category links posts within category. , posts link content post 1 cat 1 --> content post 1 cat 1 post 2 cat 2 --> content post 2 cat 1 question: don't know how create distinct list of categories leads posts. solutions? this json example (this json api plugin in wordpress) {"status": "ok", "count": 10, "count_total": 20, "pages": 2, "posts": [ { "id": 86, "type": "post", "slug": "inaktiviert", "url": "http://localhost/wordpress/?p=86", "status": "publish", "title": "post 1 cat1", "content": "his content post1 cat 1.", "date": "2014-03-04 15:09:51", "modified&qu

Why the result is not correct using python to know the line numbers of a file -

i want know line numbers of file following code but result not correct:the true file line number == console result number + 1 is problem in "open().readlines()" ? if there contents in last line, result correct import os import os.path abspath = os.curdir while true: print '\nplease select file want know line nums:' print os.listdir(abspath) filename = raw_input() absfilepath = abspath + '//' + filename if os.path.isfile(absfilepath): count = len(open(absfilepath).readlines()) print 'the ' + filename + ' file line nums is>>>' + str(count) + '>>>' else: print 'please check filename or input not file' you shouldn't use readlines() here, unnecessarily loads whole file memory. following snippet more memory-friendly: with open(filename) f: line_count = sum(1 line in f)

html - height: 100% for <div> inside <div> with display: table-cell -

Image
here 2 column markup using display: table , display: table-cell css declarations: html: <div class="table"> <div class="cell"> <p>text <p>text <p>text <p>text <p>text <p>text <p>text <p>text </div> <div class="cell"> <div class="container">text</div> </div> </div> css: .table { display: table; } .cell { border: 2px solid black; vertical-align: top; display: table-cell; } .container { height: 100%; border: 2px solid green; } but .container block not fill parent cell vertically. here example on jsfiddle: http://jsfiddle.net/mgrdp/2 . what have | what need please, not propose js solution. when use % setting heights or widths, set widths/heights of parent elements well try updated fiddle http://jsfiddle.net/

visual studio 2010 - How do I configure IISExpress for multiple web workspaces when using TFS with VS2013? -

some history... for time i've been using vs2010 tfs developing web site work on using multiple workspaces; example, workspace dev1 might have code partially implemented new feature, i'll fire 2nd instance of vs2010 , open same solution in workspace dev2 fix bug. within solution file, port number fixed if open 1 instance in workspace url testing starts http://localhost:8251/core/... . if opened 2nd copy, vs2010 detected first instance, checked out solution file , assigned random port number. hence url might start http://localhost:12345/core/... . obviously, port number unimportant of time, it's convenient have fixed testing. all worked under vs2010 using 'internal' webserver (cassini). open multiple instances of vs2010 using solutions in difference workspaces , there never 'cross activation' opening page in 1 instance accessed files different workspace. ...end of history. we're moving vs2013 , 'internal' webserver has been removed ii

validation - Doctrine: Validate Model Data using Annotations -

in doctrine, there way validate model data using annotations? bellow example in c# public class productmd { [stringlength(50),required] public object name { get; set; } [stringlength(15)] public object color { get; set; } [range(0, 9999)] public object weight { get; set; } } so when property name empty give error. unfortunately, starting doctrine2 there no validation component integrated orm anymore . if, example, you're using doctrine2 symfony2, can take advantage of validation framework component using @assert annotations in doctrine entities. if don't use framework, or if framework use not provide validation component, can use doctrine's lifecycle callbacks provide custom validation in @prepersist , @preupdate (for more information, take here ). in case, there's more manual work done still sounds reasonable solution.

c# - How is it possible that an item is partial published while it is in a initial workflow step using Sitecore? -

for project i'm using sitecore workflows. have strange issue new created comment functionality workflows. new comments (submitted form on website visitor) linked workflow. there 3 workflow states: waiting approval approved rejected three fields defined in comment template: name email message the comment linked workflow in comment templates standard values. when run publish or full publish comment template field "name" , "email" published live website while comment in review state "waiting approval". did know how possible , how can fix this? thanks lot. jordy my guess be, "name" , "email" fields marked "shared". if so, not versioned , therefore not parttake in workflow. untick "shared", , mark them "versionable".

How do I initialise a folder over ssh in git? -

i want push local repository onto web server which not have git using ssh. possible, or need git repository such github this? i tried: git init --bare ssh://user@host.com/public_html/test error message: fatal: cannot mkdir ssh://user......../test/: invalid argument this error came before had enter password. folder exists. but didn't work. can't find information in git book. you need have git on server, once have installed, you'll access server , run (on server): git init --bare ~/repository.git then in local git repository, you'll add remote git remote add origin user@host.com:~/repository.git if not have local git repository created, need clone , can start use , make push / pulls origin git clone user@host.com:~/repository.git and push master branch (or want) it: git push origin master i hope you.

c# - Difference between: (object) o == null and (((object) o) == null -

i tried check arguments null, , found question in mind: what's difference between: if ( (object) o == null ) ... and if ( ((object) o) == null ) ... edit: variable o can of reference type (with overloaded == operator on not). if ((object) o) == null) ... is mistake. maybe want write if (((object) o) == null) ... so cast o object test if equals null it same thing except in if (((object) o) == null) ... made explicitly (human friendly) () all these notations accomplish same test.

asp.net mvc 3 - Check, Nothing is changed in Model values MVC3 -

i've model following: public class page { private readonly indiantime _g = new indiantime(); public page() { createdon = _g.datetime; properties = "published"; tags = "page"; relativeurl = string.empty; } public string path { { return (parentpage != null) ? parentpage.heading + " >> " + heading : heading; } } [key] public int id { get; set; } [stringlength(200), required, datatype(datatype.text)] public string title { get; set; } [stringlength(200), required, datatype(datatype.text)] public string heading { get; set; } [maxlength, required, datatype(datatype.html)] public string content { get; set; } [display(name = "reference code"), scaffoldcolumn(false)] public string referencecode { get; set; } [required] [remote("checkduplicate", "page", errormessage = "ur

jquery - slideToggle called twice in IE8 only -

i have footer slides up/down when page bottom reached, problem is called twice in ie8 reason. can force called once per page scroll? $(window).scroll(function() { if($(window).scrolltop() + $(window).height() == $(document).height()) { // $('.footer .open').click(); $('#page-footer').slidetoggle(); console.log('log'); } }); try hope you $(window).unbind('scroll').scroll(function() { if($(window).scrolltop() + $(window).height() == $(document).height()) { // $('.footer .open').click(); $('#page-footer').slidetoggle(); console.log('log'); } });

ios - How do I save/load back the data after closing the app in multitasking for iPhone? -

i have created app requires adding , showing information added in table view. however, may close apps in multitasking. i know how being done whereby after closing app, can still continue last close application (or after reboot). current implementation: example (added information in , before closing app) list no. 1 list no. 2 example: (after closing app , relaunching it: nothing displayed) -nil- wanting implement: example (added information in , before closing app): list no. 1 list no. 2 list no. 3 example: (after closing app , relaunching it: displays shown before closing app) list no. 1 list no. 2 list no. 3 i have been searching around answers no avail. hope can help. thanks! code retrieving , displaying data in tableview: uitableviewcell *cell = [tableview dequeuereusablecellwithidentifier:@"class" forindexpath:indexpath]; msddatacontroller *dc = [msddatacontroller sharedinstance]; nsarray *dataarray = [dc getallelement];

Javascript compare not working -

i have condition in javascript below function check() { var amount = document.getelementbyid('pamount').value; var quantity = document.getelementbyid('qty').value; var pmin = document.getelementbyid('pmin').value; var pmax = document.getelementbyid('pmax').value; var stock = document.getelementbyid('stocks').value; if (amount > pmax) { alert('price should not more maximum price'); return false; } if (amount < pmin) { alert('price should not less minimum price'); return false; } if (quantity > stock) { alert('please enter quantity no more maximum'); return false; } if (quantity < 1) { alert('please enter valid quantity'); return false; } } and here html fields <input type="text" value="" data-toggle="tooltip" data-placement="top" class=

mongodb - How to add a sub document model in a collection collection or populate it -

i tried ask question, guess wasn't clear enought since nobody answered, going give specific scenario code here. the context simple, let's imagine weekly tournament, each tournament composed games, composed players. so have 3 schemas: tournamentschema { games: [ { type: mongoose.schema.types.objectid, ref: 'game' } ] players: [ { _user: { type: mongoose.schema.types.objectid, ref: 'user' }, points: { type: number } } ] //the total amount of points user made tournament } gameschema { players: [ { _user: { type: mongoose.schema.types.objectid, ref: 'user' }, points: { type: number } } ] //the total amount of points user made specific game } playerschema { pseudo: { type: string }, email: { type: string }, points: { type: number } // total amount player made // (on every tournaments). } everything

c# - Static factory method vs public constructor -

background: here's code i'm working on. first, base class, account class holds information account , has methods part change values of class's properties. public class account { private string _username; [...] public string username { { return _username; } } [...] public account() { } public account(string[] args) { [...] } public virtual void changepassword(string newpassword) { [...] } } then, have class when account has been created, have named activeaccount. contains of logic actions want use account possible once account has been created. classes need not included explain question; use imagination assume classes may do: public class activeaccount : account { private list<conversation> _conversations; [...] public list<conversation> conversations { { return _conversations; } } [...] private activeaccount() { } public static activeaccount createaccount(account account) { // navigate url, input

email - outgoing mail is not working in magento ver. 1.8.1.0 -

i new magento in mail sending settings have given host ip address(say 123.456.78.753) , port number 22. host localhost , port number 25 . can find code sending mail when new account open, or product updated in cases.

.net - There is a property to determine whether a Form (and it's controls) is loaded? -

i clarify know how check if form loaded setting boolean variable flag (ex: dim formisloaded boolean ) , setting true after load event of form, restrict usage of [enum].parse method causing exceptio in coden. but not i'm asking for, not typicall question, please continue reading... i have eventhandler this: ''' <summary> ''' indicates resulting batch command redirection. ''' </summary> private commandredirection reg2bat.commandredirection = reg2bat.commandredirection.standard private sub kryptonradiobutton_commandredirections_checkedchanged(sender object, e eventargs) handles _ kryptonradiobutton_commandredirection_standard.checkedchanged, kryptonradiobutton_commandredirection_error.checkedchanged, kryptonradiobutton_commandredirection_all.checkedchanged, kryptonradiobutton_commandredirection_none.checkedchanged if cbool(sender.checked) commandredirection = [enum].pa

Youtube App Scheme URL for iOS/Android? -

i have used 2 different scheme url ios/android. works fine in both devices. but can't understand why different in youtube scheme url? ios youtube scheme url : youtube://the.youtube.video.url android youtube scheme url : vnd.youtube://the.youtube.video.url vnd.youtube://ttajgj9njla** (youtube:// can't work scheme ) appreciate inputs on how resolve this from ios7 onwards, vnd.youtube works fine.

java - Tomcat 500 error with JSP page - the only JSP contents is if/else -

i hope well. i come php background , have had work on project based on java - found out jsp pages quite similar php. have tried make page has "string" variable declared, called account. check if account administrator, if can see admin menus. however, works fine me in firefox , chrome, customers using same browser seeing 500 error. please see details below logs, have no idea means know simple if statement shouldn't cause (stupid language). mar 06, 2014 8:51:59 org.apache.catalina.core.standardwrappervalve invoke severe: servlet.service() servlet [jsp] in context path [/test] threw exception [an exception occurred processing jsp page /test.jsp @ line 126 123: </ul> 124: </li> 125: <% 126: if (account.equals("sysadmin")) { %> 127: <li> 128: <a href="#" target="_gts">assettrack</a> 129: <ul> stacktrace:] root cause jav

php - mysql warning: Cannot set query -

i'm having mysql statement query table 10+ millions of rows, joining other table more rows, works ok if select rows within date-range of 1 month, increase date-range (and more results, on 900 results actually) i'm getting mysql warning title of question, results returned. anyone knows warning means? edit: warning: cannot set query. here written query. solved. caching problem, after caching turned off works. it looks missing 2nd table name query members so please try update clause from members_data to from members_data, members

java - jbpm6 example application rewards-jsf deplyment error -

i getting below error when deploying rewards-jsf application. please advise. 07:18:41,768 error [org.jboss.msc.service.fail] (msc service thread 1-7) msc00001: failed start service jboss.deployment.unit."rewards-jsf-6.0.1-snapshot.war".weldservice: org.jboss.msc.service.startexception in service jboss.deployment.unit."rewards-jsf-6.0.1-snapshot.war".weldservice: org.jboss.weld.exceptions.deploymentexception: weld-001409 ambiguous dependencies type [usergroupcallback] qualifiers [@default] @ injection point [[field] @inject private org.jbpm.examples.util.rewardsapplicationscopedproducer.usergroupcallback]. possible dependencies [[managed bean [class org.jbpm.examples.util.rewardsusergroupcallback] qualifiers [@any @default], producer method [usergroupcallback] qualifiers [@any @default] declared [[method] @applicationscoped @produces public org.jbpm.kie.services.cdi.producer.defaultusergroupinfoproducer.producecallback()]]] @ org.jboss.as.weld.services.weld

android - How to run shell command in unrooted device -

$adb push ./asl-native /data/local/asl-native $adb shell /system/bin/chmod 0777 /data/local/asl-native above 2 lines can executed in unrooted android device using runtime.getruntime().exec() command in program. is there way run below command in unrooted device. (note:this command run correctly in rooted device) $adb shell "/data/local/asl-native /data/local/asl-native.log" & if possible using jni or ndk,please explain steps. reference: asl(android screenshot library) you can try this:( 01234abc device) 1) adb -s 01234abc shell 2) shell@android:/ $ run-as com.nitesh.tiwari hope :)

c# - Why function GetRow returns null? -

i wanted first row of datagrid, variable row returns null, not know why ? using method of getrow: public static datagridrow getrow(this datagrid grid, int index) { datagridrow row = (datagridrow)grid.itemcontainergenerator.containerfromindex(index); if (row == null) { // may virtualized, bring view , try again. grid.updatelayout(); grid.scrollintoview(grid.items[index]); row = (datagridrow)grid.itemcontainergenerator.containerfromindex(index); } return row; } public void kraj_wybierz(object obj) { datagrid dg = obj datagrid; //dg has got 11 items var row = dg.getrow(0); } xaml: <stackpanel x:name="wszystkiezdarzeniastackpanel2"> <datagrid xmlns:local="clr-namespace:allsportsbets102" x:name="zdarzeniadatagrid" tabindex="7" isreadonly="false" headersvisibility="column"

debugging - Visual Studio 2013; just my code - mycode.json -

i'm trying figure out mycode.json file can used in combination "just code" service of visual studio 2013. it's not making sense me know not "just code" is: http://blogs.msdn.com/b/visualstudioalm/archive/2013/11/25/just-my-code-for-asp-net-in-visual-studio-2013.aspx this scenario have project using jquery libraries , own custom js file, called myconsents.js want able debug only, reason debugger keeps jumping jquery libraries. how mycode.json file looks like { "eval" : "mycode", "function" : "library", "scriptblock" : "unrelated", "mycode" : [ "myconsents.js" ], "libraries" : [ "*.min.js", "jquery.*.js", "jquery-*.js" ], "unrelated" : [ ] } i hope can provide solution thanks i found visual studio ignoring mycode.json file because had put javascript-style commen

passwords - Freeradius radcrypt encrytion in PHP -

i'm looking solution in php similar output of radcrypt. i've looked mcrypt , can't seem figure out cipher , setting should use. mcrypt wants salt add encryption radcrypt doesn't seem have salt. anyone knows cipher and/or settings of radcrypt are? you don't need mcrypt this. these passwords hashed , not encrypted. the radcrypt script built bit of perl . relies on perl's built-in crypt function , has semantics similar the standard crypt function . php also provides crypt . until 5.3, php used same exact functionality, called in same exact way, generating same hashes. starting in 5.3, php's implementation became bundled language instead of relying on external libraries, allowing additions , enhancements. the radcrypt script automatically produces salt, using 2 characters des , 8 md5: $salt = ($opt_md5 ? '$1$' : ''); ($i = 0; $i < ($opt_md5 ? 8 : 2); $i++) { $salt .= $saltc[rand 64]; } $salt .= '$

c# - Consume web service in windows 8 app -

i made app in windows phone & want make windows 8 store app stuck on point want web service in store app. i use webclient in wp don't know how access web service in windows 8 store app. web service return data in json format deserialize & store in variable in wp. how done in windows 8 store app. what use windows 8 in place of webclient my webservice made in php. please me on this

c# - DbContext not available -

i developing application using web form , database first approach (linq sql). have not been able dbcontext class. not reference it. have visual studion 2010 service pack 1 , mvc 3 installed. what doing wrong? dbcontext class entity framework. linq sql should datacontext . using database first approach, there should class inherited datacontext . search under .dbml file in solution explorer. if have northwind.dbml generated context class should have name northwinddatacontext .

how to pass string variable to linq select new {} section -

ii want make search functionality linq multiple columnnames stored session variable. i'm using 1 method: public void fillgrid(string commandname,string columnname, string searchtext) that has 3 string variable stores session value. now want pass columnname query: var query1 = (from p in db.posts join c in db.categories on p.category_id equals c.id join u in db.users on p.user_id equals u.id (p.touser_id == user_id || p.touser_id == null) && p.user_id != user_id orderby p.sent_datetime descending select new { id = p.id, title = p.title, publisher = u.first_name + " " + u.last_name, touser = p.touser_id, publishdate = p.sent_datetime, isfile = p.isfileattached, categoryname = c.category_name, status_name = (from s in db.status (s.

android - How can I know if a user has returned to my app? -

i want know if user has returned app. i mean, if user opens app , press home button (not button) , sees home screen reopens app using launcher icon. how can determine user performed action? is onresume() method right 1 this?

casting - Java typecasting confusion -

this question has answer here: java's +=, -=, *=, /= compound assignment operators 11 answers take these 2 snippet example: case 1: scanner s = new scanner(system.in); int n = s.nextint(); /** take user input **/ n *= double.negative_infinity; and case 2: int k=10; double kk = 10.10; int rst = k*kk; in both cases, not doing typecasting side, case 1 executes , prints value of n correctly case 2 throws error, can not convert double int . why difference? the first works , second doesn't because *= += -= etc add automatic cast . if, example, change second example to; int k=10; double kk = 10.10; k*= kk; it should work. alternatively add explicit cast rst = (int)(k*kk);

javascript - How to hide fields when radio button is selected with jquery in Prestashop checkout -

what have: 2 radio buttons , several fields. what want: - when radio button "delivery address" show: addres1, postcode , city - , hide id_state field. - when other button selected "delivery carrier office" selected hide fields: address1, postcode , city - show id_state (i use select carrier offices) i use several .tpl files in checkout page showing radio buttons. radio buttons order-carrier.tpl file: <div class="delivery_options"> {foreach $option_list $key => $option} <div class="delivery_option {if ($option@index % 2)}alternate_{/if}item"> <input class="delivery_option_radio" type="radio" name="delivery_option[{$id_address}]" onchange="{if $opc}updatecarrierselectionandgift();{else}updateextracarrier('{$key}', {$id_address});{/if}" id="delivery_option_{$id_address}_{$option@index}" value="{$key}" {if isset($deliver