Posts

Showing posts from February, 2010

c# - Convert string with XML to datatable, list or something more manageable? -

without having manually parse file, .net have convert string xml xmlelement , datatable , list or that's more manageable? this actual string. string stored in xmlnode object (this xmlnode.outerxml ), not know how convert can use: <ni> <nss>20150927</nss> <gp>addon</gp> <ns>counterblah1</ns> <ns>counterblah2</ns> <ns>countersales</ns> <ns>counterblah4</ns> <ns>counterblah5</ns> <ns>counterblah6</ns> <nv> <nad>style=1,rfu=1,id=132</nad> <r>0</r> <r>15</r> <r>8</r> <r>3</r> <r>2</r> <r>2</r> </nv> <nv> <nad>style=1,rfu=1,id=433</nad> <r>0</r> <r>15</r> <r>30</r> <r>3</r> ...

php - WP-CLI error in connecting to the database -

this common wp-cli error while using mamp. installed wp-cli, exported php version mamp using wp_cli_php variable recommended instructions. output of $ wp --info is: php binary: /applications/mamp/bin/php/php5.6.2/bin/php php version: 5.6.2 php.ini used: /applications/mamp/bin/php/php5.6.2/conf/php.ini wp-cli root dir: phar://wp-cli.phar wp-cli global config: wp-cli project config: wp-cli version: 0.20.1 i've followed along solutions this, i'm still getting timeout , error in connecting database. have mamp running while running wp-cli commands. ideas? after seeing comment here issues if-statements can have wp-cli when used in wp-config file, went , checked mine. config file using number of if-statements set $config_file variable. commented out entire block , set $config_file = "path_to_config" . seems have done trick.

c# - How to create Master Detail from datagridview -

this code inserts in database private void btnsave_click(object sender, eventargs e) { byte[] imagebt = null; filestream fstream = new filestream(this.txtimgpath.text,filemode.open,fileaccess.read); binaryreader br = new binaryreader(fstream); imagebt = br.readbytes((int)fstream.length); // byte[] pic = stream.toarray(); try { condb.open(); oledbcommand command = new oledbcommand(); command.connection = condb; command.commandtext = "insert abaanacc (ccspn_code,ccfname,cclname,ccmname,ccdob,ccgender,ccschool,caclass,ccvillage,ccsiblings,ccguardian,cccontact,ccimage)" + " values ('" + spn_codetxt.text + "','" + txtfname.text + "','" + lnametxt.text + "','" + mnametxt.text + "','" + dobdtpicker1.text + "','" + gendercombobox.text + "','...

opencv - Unhandled microsoft c++ exception cv exception at memory location -

i developped project vs , opencv on x64 computer , i've problem line: model->train(image, labels); image , labels not empty i've got error: unhandled exception @ at 0x774fc42d in facerec_video.exe: microsoft c++ exception: cv::exception @ memory location 0x0015ef38. if click "continue", program continue , works. furthermore, if set breakpoint on line , step step, error message doesn't appear , program works too. how resolve problem ? thanks

angularjs - Front end material design stack with angular.js -

i trying better @ coding , trying figure out front end stack need. have red lot , lot of tools , don't know ones work or not. currently idea web app design principles of material design google , use angular logic of front end. i have red , used these tools: angular.js, material design lite, angular-material, polymer, ionic, bootstrap, materialize , other various material design frameworks. i playing demo wanted try out material design lite went further , ended needing polymer input drop-down components. playing further more mdl found out not sufficient bootstrap used work , have in it, don't me wrong mdl. ionic has features local server , easy set of template app other nice things export ios,android app, push notifications, ended deleting ionic.css cause interfering mdl , polymer i asking more experienced web app developers me out stack dilemma. out of mind can free , develop more. also tools grunt, bower , on? 1 best in case? note: if u got interested end cak...

java - Why am I getting "Unsupported Major Minor Version 52.0" compile time error? -

i have spring project running on jre 8.0. reason, in application context xml file, i'm getting following error tag: <context:component-scan base-package="com.myproject.controller" /> error: error occured processing xml 'com/myproject/controller/protocol/fetchresponsebody : unsupported major.minor version 52.0'. see error log more details servlet-context.xml /eyecontrol/src/main/webapp/web-inf/spring line 19 spring beans problem the class in question annotation follow: @target({ elementtype.type, elementtype.method }) @retention(retentionpolicy.runtime) @documented @responsebody public @interface fetchresponsebody { } the thing is, i'm getting error on pc. laptop not have error @ all. also, regardless of compile time "error", not seem have issues running whether through eclipse or through terminal. the run-as configuration selected jre8.0 , build path contains same jre. issue doesn't hinder progress sure hall annoy...

Web Scraping with Python: RuntimeError maximum recursion depth exceeded -

i'm trying scape data website updates (here i'm using aapl stock off of yahoo finance). code doesn't run. i've tested every part individually, still error saying "runtimeerror: maximum recursion depth exceeded". in advance troubleshooting! import time import lxml, requests bs4 import beautifulsoup url= "http://finance.yahoo.com/q?uhb=uh3_finance_vert&fr=&type=2button&s=aapl" def printpriceaapl(): r = requests.get(url) soup = beautifulsoup(r.content, "lxml") print (soup.find(id="yfs_l84_aapl").string) #id of current stock price time.sleep(60) while true: printpriceaapl() edit: full error: traceback (most recent call last): file "c:/users/sjung/documents/printpriceaapl.py", line 15, in <module> printpriceaapl() file "c:/users/sjung/documents/printpriceaapl.py", line 11, in printpriceaapl print (soup.find_all(id="yfs_l84_aap...

How to open the web page preview inside Visual Studio Code? -

Image
given visual studio code based on chrome web kit could open preview inside editor panel ? according this page , feature highly requested ! well now, based on dan shryock's answer here , this post , here did: install nodejs live-server npm install -g live-server run live-server @ project folder create live-view.md file in (place wherever want. put @ base folder of projects since can use whatever i'm working on): <div style="border:1px solid #777;position:absolute;left:10px;top:10px;bottom:10px;right:10px;"> <iframe src="http://localhost:8080/"; width="100%" height="100%" frameborder="0" /> </div> open live-view.md in second/split pane in vs code , click "open preview" button (top right of file). now whenever save see changes show in live-preview.

android - How to find if Url is Audio/Video -

i have simple question want identify url audio/video , not. everthing working fine have problem url shown text/html on content-type like url below shown text/html in content type: http://dl.blugaa.com/hd.blugaa.com/f613178a0d993f8645ed530896937a22/cizuv/70%20hazaar-(mr-jatt.com).mp3 but url shown audio : http://mp3light.net/assets/songs/393000-393999/393496-the-hills--1439131681.mp3 can explain me why , how identify url best way. in advance there no way identify content of response until execute http request. can have url ending extension, buy response still different. recommend trying parse response http request, , if doesn't work or headers in response not matching expected one, popup error message.

Want to get width of View(LinearLayout) at Runtime in Android -

how can dynamic width of linearlayout @ runtime? i mean, want width of linearlayout @ runtime , when linearlayout visibility "gone" , linearlayout width "match_parent" in xml layout file. i can width using ongloballayoutchangelistener , onpredrawlistener if our view(linearlayout) " visible" state, not @ "gone" state. is here solution problem? thank time. simply fetch reference linearlayout lets call "ll" , call "ll.getwidth()" gives thewidth in pixels...

javascript - Snap.js right sidebar not showing -

i'm trying create 2 draggable sidebars snap.js. right sidebar isn't displayed, instead of there left sidebar. codepen demo: http://codepen.io/anon/pen/pjrezg var snapper = new snap({ element: document.getelementbyid('content'), hyperextensible: false }); var addevent = function addevent(element, eventname, func) { if (element.addeventlistener) { return element.addeventlistener(eventname, func, false); } else if (element.attachevent) { return element.attachevent("on" + eventname, func); } }; addevent(document.getelementbyid('open-left'), 'click', function(){ if( snapper.state().state=="left" ){ snapper.close('left'); }else { snapper.open('left'); } }); $('#open-right').click(function(){ if( snapper.state().state=="right" ){ snapper.close('right'); }else { snapper.open('right'); } }); ...

Google Calendar API: Disabling alerts for Apple Calendar synced to Google Calendar -

i'm using google calendar api google python client library create calendar , events in user's google calendar. events i'm creating intended list, all-day events , shouldn't have alert notifications. i'm creating event this: event = { 'summary': summary, 'start': { 'date': start_date }, 'end': { 'date': end_date }, 'reminders': { 'usedefault':false } } i'm using reminders.usedefault disable alerts on google calendar. problem have apple calendar (ical) synced google calendar , in apple calendar app, events have alerts enabled default , spammed alerts of dozens of events create each day. there way turn off corresponding alerts in apple calendar synced google calendar using google api, or strictly in domain of apple's calendar app? to disable reminders, should set usedefault=false , add empty override reminder section.

Can a symbolic-ref in git reference the current upstream branch? -

i can git: echo "ref: head" > .git/h and can use “h” in place of head in every place accepts commit-ish, e.g. git log h or git show-branch h origin/master . is possible same upstream branch of head? represented @{u} (or head@{upstream} in long form), git log @{u} , git rebase --onto @{u} or git show-branch head @{u} . trying put of these symbolic-ref this: echo "ref: head@{upstream}" > .git/u will result in error: $ git show u warning: ignoring dangling symref u. warning: ignoring dangling symref u. fatal: ambiguous argument 'u': unknown revision or path not in working tree. use '--' separate paths revisions, this: 'git <command> [<revision>...] -- [<file>...]' don't that; use git symbolic-ref create symbolic references. instance, git symbolic-ref u head "correct" command create .git/u symbolic reference head (which in turn symbolic reference current branch, unless head...

rust - Is there a way to print a nicely formatted table to the console? -

is there way print nice table console using rust language? in python world, create numpy array or pandas dataframe hold data values , output them console, looking this: f1 f2 f3 m1 m2 m3 0 14.000000 3.000000 19.000000 37.000000 28.000000 239.000000 1 14.279622 4.046231 19.202175 36.720378 26.228172 238.797825 2 14.530399 5.098601 19.413289 36.469601 24.454171 238.586711 3 14.755486 6.153470 19.633712 36.244514 22.681652 238.366288 is there way in rust arbitrary precision? i have looked @ vector , array datatypes. while multidimensional arrays possible in rust, have not seen print nicely formatted tables 1 above.

installation - Building linuxbrew (homebrew) standalone version on Ubuntu 14.04 -

the primary question i'm trying build linuxbrew standalone installation on ubuntu 14.04.3 lts, script in original link broken. ideal answer script sets correctly in 1 go. i've improved script run fewer hiccups. current progress towards fixing script i'm not able past crti.o error when building gcc via linuxbrew part of standalone setup. however, found resources explaining problem: stackoverflow crti.o file missing stackoverflow cannot find crti.o askubuntu crti.o old launchpad bug i searched file , right there! find -name crti.o ./.linuxbrew/lib/crti.o ./.linuxbrew/cellar/glibc/2.19/lib/crti.o i'm on following compiler error crtn.o : /home/hbr/.linuxbrew/cellar/binutils/2.25.1/x86_64-unknown-linux-gnu/bin/ld: cannot find crti.o: no such file or directory /home/hbr/.linuxbrew/cellar/binutils/2.25.1/x86_64-unknown-linux-gnu/bin/ld: cannot find -lc /home/hbr/.linuxbrew/cellar/binutils/2.25.1/x86_64-unknown-linux-gnu/bin/ld: cannot find crtn.o: n...

javascript - underscore.js - create array of unique items from objects embedded in a list of objects -

i've been trying use underscore.js in meteor project i'm working on, can't seem figure out how transform set of objects. the objects (there's 15k, these two): [{ "_id": "a_0011223344", "taggedusers": [{ "id": 1122244453, "username": "john123" }], "field": "abc" }, { "_id": "a_0011223345", "taggedusers": [{ "id": 1122244454, "username": "bill123" }, { "id": 1122244455, "username": "jim123" }], "field": "abc" }] each object can have 1 or more "taggedusers" objects, , need list of unique "taggedusers.username" fields. meteor not support mongodb's distinct function, trying use underscore.js instead (per i've read , reccomendation in this post ). in server ...

Android Notification not vibrating while on call -

i working on emergency messaging app in android. important part of app showing notifications new message when app in background , user not interacting app. notification requirement phone should vibrate , play notification sound when posting notification notification bar. i have of notification part working , notifications work fine of scenarios. problem facing whenever user on call , receives notification, phone doesn't vibrate or play notification sound notification appear in notification bar. so if user gets notification while on call cannot know notification until gets off call. whole purpose of app emergency messaging cannot afford , want app vibrate , play sound notification comes in. the code using generating notification shown below int requestid = (int) system.currenttimemillis(); pendingintent pendingintent = pendingintent.getactivity(context, requestid,notificationintent, pendingintent.flag_update_current); notif...

c++ - How do I calculate time complexity when having a break statement -

void f ( int a[], int n ) { // args: array a[ ] of size n ( int k = n/2; k>0; k/=2 ) { ( int j = 0; j< n; j++ ) { if ( a[j] >= a[k] ) break; else { int m = a[j]; a[j] = a[k]; a[k] = m; } }}} now, first loop 2 + log base-2 of n (2 + 2nd loop) . that's that. the second (nested) loop problem. if best/worst case scenario, solution constant , linear, respectively. consider if-statement succeeds have time, complexity of nested loop? what tried far 2 + (n/2)(2 + 1) + (n/2)(2 + 3) = 2 + 4n in 2 initialization , comparison, , (n/2)(2 + 1) when if-statement succeeds, , (n/2)(2 + 3) else-statement. but think entirely wrong. think i'm missing break statement ends loop, , becomes confusing. should n/2 what maybe finding out probability of algorithm go if , else statement. can average complexities summing them weighed chance of being executed. have average complexity (obviously not confused worst case complexity). average = p * o(if-sta...

ios9 - AirPrint (UIPrintInteractionController) print warnings with iOS 9, swift 2, XCode 7 -

since updating newest xcode/swift 2/ios 9 keep getting warnings when trying use uiprintinteractioncontroller. these warnings happen when have "print simulator" open. thought app made new single view app single uibutton simple code , still generates warnings. happens on both phone , ipad simulators please help. it's driving me crazy, thank all @ibaction func clicked(sender: anyobject) { let printcontroller = uiprintinteractioncontroller.sharedprintcontroller() let printinfo = uiprintinfo(dictionary:nil) printinfo.outputtype = uiprintinfooutputtype.general printinfo.jobname = "print job" printcontroller.printinfo = printinfo let formatter = uimarkuptextprintformatter(markuptext: "<b>hello world</b>") formatter.contentinsets = uiedgeinsets(top: 72, left: 72, bottom: 72, right: 72) printcontroller.printformatter = formatter if uidevice.currentdevice().userinterfaceidiom == .phone { print...

html - Can't hide a <br> in Bootstrap -

for reason can't hide <br> tags show on small screen sizes. doesn't show small screens. works other screen sizes. works other tags. <br> tags small screen size. <div class="row"> <img src="static/works_3.jpg" class="img-responsive works-photo col-md-4 col-sm-12"><br class="hidden-xs hidden-md hidden-lg"> <img src="static/works_3.jpg" class="img-responsive works-photo col-md-4 col-sm-12"><br class="hidden-xs hidden-md hidden-lg"> <img src="static/works_3.jpg" class="img-responsive works-photo col-md-4 col-sm-12"><br class="hidden-xs hidden-md hidden-lg"> </div> change <br> <div class="hidden-xs hidden-md hidden-lg"></div> it should help

python - ipython on MacOS 10.10 - command not found -

i'm trying ipython working in mac os 10.10. problem: $ ipython returns -bash: ipython: command not found context: i'm running python2.7 on macos 10.10. installed python via brew. info: which python = /usr/local/bin/python brew info python = python: stable 2.7.10 (bottled), head interpreted, interactive, object-oriented programming language https://www.python.org /usr/local/cellar/python/2.7.10_2 (4977 files, 77m) * to install ipython ran pip install ipython[all] so... pip show ipython = --- metadata-version: 2.0 name: ipython version: 4.0.0 summary: ipython: productive interactive computing home-page: http://ipython.org author: ipython development team author-email: ipython-dev@scipy.org license: bsd location: /usr/local/lib/python2.7/site-packages requires: traitlets, pickleshare, simplegeneric, decorator, gnureadline, appnope, pexpect finally, echo $path = /users/[username]/depot_tools:/usr/local:/usr/local/lib:/users/[username]/depot...

c++ - OpenCV: Computing superpixel centroids -

background: i have computed slic superpixels of image using gslicr , gives "per-pixel map" of image superpixels indices (0 number of superpixels-1). this map pointer integer const array ( const int* ) containing indices. i want compute centroids of each superpixel using opencv. coming matlab background, using regionprops : segments = vl_slic(myimage, regionsize, regularizer); stats = regionprops(segments, 'centroid'); centroids = cat(1, stats.centroid); i don't know how done using opencv. questions: (i) how convert const int* array cv::mat ? (ii) how compute superpixel centroids matrix in (i)? as first questions seems answered, focus on second question. used following code compute mean coordinates (i.e. spatial centroids) of each superpixel: /** \brief compute mean coordinates of each superpixel (i.e. spatial centroids). * \param[in] labels matrix of type cv_32sc1 holding labels each pixel * \param[out] means spatial centroids (...

crash - Erlang app fails to start -

when attempt _rel/bin/application_name console, this: {"kernel pid terminated",application_controller," {application_start_failure,lager, {bad_return,{{lager_app,start,[normal,[]]}, {'exit',{{compile_forms,error},[ {glc_code,compile_forms,2,[{file,\"src/glc_code.erl\"},{line,509}]}, {glc_code,compile,2,[{file,\"src/glc_code.erl\"},{line,51}]}, {glc,compile,4,[{file,\"src/glc.erl\"},{line,205}]}, {lager_util,trace_filter,2,[{file,\"src/lager_util.erl\"},{line,374}]}, {lager_app,start,2,[{file,\"src/lager_app.erl\"},{line,221}]}, {application_master,start_it_old,4,[{file,\"application_master.erl\"},{line,272}]}]}}}}}"} (not sure bad_return is, app used start earlier) my lager.app.src has both syntax_tools , compiler included (alongwith goldrush, stdlib , kernel) applications. however, when start lager vanilla erl prompt, lager starts after i've started ...

java - RPS game making it say invalid error -

i made rock paper scissors game cnt figure out how make show invalid error when user enters other r,p,s. helpful if once tell me how make this. im relatively new coder. in advance help import java.util.random; import java.util.scanner; public class rps { public static void main(string[] args) { string userplay; //user's play -- "r", "p", or "s" string computerplay = ""; //computer's play -- "r", "p", or "s" int computerint; string response; scanner scan = new scanner(system.in); random generator = new random(); system.out.println("lets play rock, paper, scissors!\n" + "choose move.\n" + "rock = r, paper" + "= p, , scissors = s."); system.out.println(); //generate computer's play (0,1,2) computerint = generator.nextint(3)+1; //translate computer's randomly generated play //string using if //statements...

c# - "Must declare variable", but when I declare it, "variable already declared" -

this question has answer here: sql server output clause scalar variable 2 answers i'm generating insert sql returns primary key caller. sql generated arbitrary table, can't use scope_identity() because not every table uses identity. when execute query, ms sql complains output var not declared, says it's declared when declare it. damned if do, damned if don't. var parameters = new dynamicparameters(); parameters.add("d", direction:parameterdirection.output, size:8000); // (add input params a, b, c) remoteconnection.execute(sql, parameters); sql: -- error: must declare table variable "@d" insert blacklist (databaseconnectionid,tableschema,tablename) output inserted.id @d values (@a,@b,@c) i declare variable: declare @d int insert blacklist (databaseconnectionid,tableschema,tablename) output inserted.id @d values (@a,@b,@c) ...

how to change a Css Style Class definition with Javascript? -

this question has answer here: how change/remove css classes definitions @ runtime? 6 answers is possible override css classes javascript ? exemple : adding background .iframe style classe. who troll who down voted answer? please provide reason changing style property var iframe = document.queryselector('.iframe'); iframe.style['marginbottom'] = "200px"; changing class property iframe['classname'] = "myclass";

r - Subsetting a Data Table using %in% -

a stylized version of data.table is outmat <- data.table(merge(merge(1:5, 1:5, all=true), 1:5, all=true)) what select subset of rows data.table based on whether value in 1st column found in of other columns (it handling matrices of unknown dimension, can't use sort of "row1 == row2 | row1 == row3" i wanted using output[row1 %in% names(output)[-1], ] but ends returning true if value in row1 found in of rows of row2 or row3, not intended behavior. there sort of vectorized version of %in% achieve desired result? to elaborate, want enumeration of 3-tuples set 1:5, drawn replacement, such first value same either second or third value, like: 1 1 1 1 1 2 1 1 3 1 1 4 1 1 5 ... 2 1 2 2 2 1 ... 5 5 5 what code instead gives me every enumeration of 3-tuples, checking whether first digit (say, 5), ever appears anywhere in 2rd or 3rd columns, not within same row. one option construct expression , evaluate it: dt = data.table(a = 1:5, b = c(1...

java - How to only choose elements in an array with a specific length -

public string[] words={"cat", "dog", "rodeo", "bird", "lookers", "skid"); . // picks random word dictionary, given length of word public string pickword(int size) { } so if user inputs 4, randomly chooses word in word array 4 letters, , randomly. have created rand variable random class that. how choose element in array same number of letters number user inputted. here example method should work solve problem. string[] words; public string pickword(int size){ list ls = new arraylist<string>(); for(int i=0; i>words.length;i++){ if(words[i].length() == size){ ls.add(words[i]); } } collections.shuffle(ls); if(ls.isempty()){ return null; } return (string) ls.get(0); }

c# - How return struct object in MSIL? -

i want set struct field value , return struct instance. code working in classtype , error on structtype . [create setter] public static dynamicmembersetter createfieldsetter(fieldinfo fieldinfo, type declaringtype = null) { if(declaringtype == null) declaringtype = fieldinfo.reflectedtype; var emit = new emithelper(types.object, dynamicsetmemberparams, declaringtype); var isstatic = fieldinfo.isstatic; if(!isstatic) { emit.declarelocal(declaringtype); emit.ldarg_0 .casttype(declaringtype) .stloc_0 .ldloc_0 .end(); } var changetypemethod = typeof(convert).getmethod("changetype", new type[] { types.object, types.type }); var gettypefromhandlemethod = typeof(type).getmethod("gettypefromhandle", new type[] { typeof(runtimetypehandle) }); emit.ldarg_1 .ldtoken(fieldinfo.fieldtype) ...

Issue in frgment replace in FragmentStatePagerAdapter tabhoast matireal design android -

i want integrate tabhoast material design android write below code public class activitypaymentmodule extends appcompatactivity implements materialtablistener { private viewpager pager; private materialtabhost tabhost; private viewpageradapter pageradapter; private resources res; public static int tabposition = 0; private allmethods allmethods; private string titles[]={"tab1","tab2, "tab3","tab4"}; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_payment_module); res = this.getresources(); allmethods = new allmethods(activitypaymentmodule.this); toolbar toolbar = (toolbar) this.findviewbyid(r.id.toolbar); toolbar.settitletextcolor(color.white); toolbar.settitle("demo"); this.setsupportactionbar(toolbar); initcontrols(); setpageradapter(); } private void initcontrols() { tabhost = (materialtabhost)findvi...

mysql - How to log the result of a select query in tMysqlRow to tLogRow in Talend? -

i have simple job 2 components tmysqlrow connected via row/main tlogrow. i have simple select statement in tmysqlrow component have tested directly on db , works , returns single record. when run job says "1 rows in 0.04s" assume means tmysqlrow component getting 1 row db. in tlogrow component have pressed "sync columns" button on basic tab , when edit schema can see columns there. but when run job, logs following: starting job loadcontextvariablesfromdbrecorddemo @ 13:07 30/09/2015. [statistics] connecting socket on port 3714 [statistics] connected |||||| [statistics] disconnected job loadcontextvariablesfromdbrecorddemo ended @ 13:07 30/09/2015. [exit code=0] so @ loss why values not logged? what doing wrong here? regards, scott so got advise talend forum telling me: do need use tmysqlrow component? understand, tmysqlinput component need. directly returns result of query , propagates flow. tmysqlrow component not handle r...

ios - Is there any way to programatically send my iPhone app to the background -

i have iphone app need send background automatically. app defined voip key in background modes should continue running when in background. need app keep running calling exit(0) no good. the app not distributed via app store using private api ok. i have read uiapplication terminate , uiapplication terminatewithsuccess don't seem available anymore already answered quite here: suspend application as poster wrote: quitting application or sending background programmatically violation of [ios human interface guidelines][1], doesn't bode getting through review process: don’t quit programmatically never quit ios application programmatically because people tend interpret crash. however, if external circumstances prevent application functioning intended, need tell users situation , explain can it. depending on how severe application malfunction is, have 2 choices. display attractive screen describes problem , suggests correctio...

sql - ComboBox for values in different rows -

i need combo box in formone shows values tableone based on value: id. below illustrates sample of tableone: id name adress 1 1 1 tom 1 streetname 1 2 2 2 steve 2 streetname2 2 need combo box , related text field showing relevant information based on id record. does have clever solution ? you can use query source: select tableone.id, tableone_1.name, tableone_2.address (tableone left join tableone tableone_1 on tableone.id = tableone_1.id) left join tableone tableone_2 on tableone.id = tableone_2.id group tableone.id, tableone_1.name, tableone_2.address having tableone_1.name not null , tableone_2.address not null;

javascript - How Do Set open popup And get Chacked value in another page -

Image
(1) select book(onchange value) open popup ok. (2)open popup in checked netamount want total in text box. (3)then cheked netamount display record in index page. i want point(2,3). index.php script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script type="text/javascript"> $(function () { $("#debit_id").change(function () { var debit_id = document.getelementbyid('debit_id').value; if(debit_id!="") { window.open("getpopup.php?debit_id="+debit_id,'popup','width=700,height=400,left=200,top=200,scrollbars=1'); } }); }); </script> book : <select name="debit_id" id="debit_id"> <option value="" selected="selected">select book</option> <?php $result1 = mysql_query("select accountname,cid account")or die(mysql_error()); while($row1 = mysql_fetch_array($result1)) if($row1) ...

solr - stored field not retrieved solrcloud -

i getting issue solrcloud stored field not reflecting in search able result see example below: http://solr:port/solr/cloud1_shard1_replica1/select?q=ucid%3addfdf4&fl=ucid&wt=json&indent=true { "responseheader":{ "status":0, "qtime":1157, "params":{ "q":"ucid:ddfdf4", "indent":"true", "fl":"ucid", "wt":"json"}}, "response":{"numfound":1,"start":0,"maxscore":13.710121,"docs":[ { "ucid":"ddfdf4"}] }, but when add ti in fl there no documents found http://solr:port/solr/cloud1_shard1_replica1/select?q=ucid%3addfdf4&fl=ucid,ti&wt=json&indent=true { "responseheader":{ "status":0, "qtime":1727, "params":{ "q":"ucid:ddfd...

Add zero padding to string in JCL -

in jcl, how add "0" padding string string length 10? using tssutil v3 tool jcl. if input "10541", 5 padding added = 0000010541 here's how sort product, if can't solution tssutil: //step001 exec pgm=sort //sortin dd * 24567 1456 47865 24875 1 //sortout dd sysout=* //sysin dd * option copy inrec build=(1,10,uff,m11,length=10) //sysout dd sysout=* output 0000024567 0000001456 0000047865 0000024875 0000000001

javascript - How can i submit hidden values to php using AJAX -

i trying send values html form php page. here in form have values hidden.and 1 text field value has passed php page. index.php: <?php if ($login->isuserloggedin() == true){ ?> <div class="panel panel-default"> <div class="panel-heading"><h4>invite friend</h4></div> <div class="panel-body"> <form action="friend-invite.php" method="get"> <div class="col-md-4 col-lg-4"> <label class="control-label" for="friend">enter email address</label> <input type="email" class="form-control" name="friendemail" id="friendemail" placeholder="sam@uncle.com" required><br> <...

Entity Relationship Model / Relational Model and Normalization of Attributes -

i have following question. if have relation such request = {[request_id: int,status: string,start_time: date]} request_id primary attribute , status , start_time normal attributes. if normalize status string int example ref_status table this. status_id | status name 1 | new 2 | old 3 | finished does through normalization attribute status become entity ? attributes used characterize entity status-id @ same time foreign key different table though holds name hint me entity. i glad if me out this. thank in advance , hope question clear. what you're describing introducing surrogate key status. has nothing normalization. entities in chen's er model represented values , , status can interpreted entity regardless of whether it's represented int in 1 table or string in another.

android - Set Image as backgroundto lock screen and regular screen -

i'm new mobile development - sorry if question stupid. want make application can change (set new image) background lock screen , regular screen (desktop background) questions are: 1) if can it? because read 1 topic , had seen wrote music application(media services) can change background only/ if right? 2) if can - can give me code example or link right topic? btw i'm junior in mobile dev, have hard prog. skills, thank you. regards, david. to set background image: wallpapermanager mywallpapermanager; mywallpapermanager.setbitmap (bitmaptodisplay); before setting image maybe should resize proper dimensions current device, check article handling large bitmaps efficiently for lock screen maybe component useful don't know if there native way of changing image in lock screen

android - Where to integrate PayU payment gateway -

i'm developing android app server in nodejs(javascript). want know side should chose integrate gateway in order make easy , safe payment either server side(nodejs) or client side (android). i glad hear response. thank u. it should in nodejs server. secure salt key , reduce chances of temper in sending/receiving data. example of payumoney integration suggest should in backend. there other advantages keep payment gateway in backend if want give discount customer, change keys change hashing method can done without forcing customer update app. here link payu integration sample code

java - Intercepting Log4J entries -

one of our systems build wrapper around third party customized work flow product cannot change. recently got request capture user activity data persisted else in application logs. these logs files quite few spreading across multiple machines analyzing logs extract required info relatively complex task. creating aspects audit user actions considered ran out giving amount of third party code need decompile , at. there security restrictions activating load-time weaving on production application servers. my initial idea redirect log outputs interested in different file (actually files) , analyze files process data. seems doable when start considering things find lot of issues deal when working files: logs rollover, no transactions, keeping track of processed , not, etc. my second thought implement custom pattern layout , configure used logs interested in. easy write, keeping away third party code in addition sending message log file save log entry table. once in table can want ...

pointers - How do I do a literal *int64 in Go? -

i have struct type *int64 field. type sometype struct { somefield *int64 } at point in code, want declare literal of (say, when know said value should 0, or pointing 0, know mean) instance := sometype{ somefield: &0, } ...except doesn't work ./main.go:xx: cannot use &0 (type *int) type *int64 in field value so try this instance := sometype{ somefield: &int64(0), } ...but doesn't work ./main.go:xx: cannot take address of int64(0) how do this? solution can come using placeholder variable var placeholder int64 placeholder = 0 instance := sometype{ somefield: &placeholder, } note: &0 syntax works fine when it's *int instead of *int64 . edit: no not. sorry this. edit: aparently there ambiguity question. i'm looking way literally state *int64 . used inside constructor, or state literal struct values, or arguments other functions. helper functions or using different type not solutions i'm looking for...

php - Make some categories un-searchable in Magento search bar -

i working on magento theme. new magento. on website search bar working fine have removed product categories website. want make these categories un-searchable. don't know how this? are still searchable. working magento admin panel. please me solve problem. steps should take next? some categories give me error fatal error: call member function getid() on non-object in /home/...../template/catalog/layer/view.phtml on line 122 these aren't categories you're looking for. magento searches products when use search bar, categories attributes here. wouldnt consistent categories : product in category c1 , c2. c1 forbidden in search, happens then? instead of that, can setup searchability each product. in product admin page, in general tab, check visibility field , select catalog . product won't appear on search results (don't forget reindex after that). you can bunch of products using mass actions on manage products page. select products want edit, on...

jquery - AngularJS ui-sortable - unable to move items -

i'm working on angularjs project feature users can move items across arrays. 1 array shown on initialization; when users drag item , mouseover on desired array name, particular array shown instead , users can drop item there. below codepen project illustrate feature: http://codepen.io/anon/pen/ppwpqv i have gotten kinda working, there 2 scenarios i'm experiencing problems: when there 3 arrays, i'm able move items across them (even empty array). last item in array cannot moved. also, placeholder appear after considerable amount of time. when there 2 arrays , 1 empty, i'm unable move items @ all. (try commenting out 1 of non-empty array.) if arrays shown on initialization instead of show on mouseover (i.e. removing ng-show attribute), sortable feature work seamlessly. i've spent time trying figure out didn't managed head around. advice appreciated! js var myapp = angular.module("app", ['ui.sortable']); myapp.controller(...

javascript - Change selected text of a dropdown without changing the text in the option? -

how change selected text of dropdown without changing text in option? ex: if dropdown has code , description both on select wants display code , remove description description should present in dropdown. populating data in dropdown: $.each(jtc12_2_2_reasoncode1list, function(i, item) { $('#jtc12_2_reasonforfailure1').append($('<option>', { value : item.code, text : item.code + " " + item.description })); }); change text of selected option: var jtc12_2_2_reasoncode1code = $("#jtc12_2_reasonforfailure1 :selected").val(); var jtc12_2_2_reasoncode1desc = _.filter(e.data.jtc12_2_2_reasoncode1list, function(item) { return item.code === jtc12_2_2_reasoncode1code; }); jtc12_2_2_reasoncode1desc = jtc12_2_2_reasoncode1desc[0].description; $("#jtc12_2_reasonforfailure1 option[value = " + jtc12_2_2_reasoncode1code + "]...

Check that a *type* of file exists in Python -

i realize looks similar other questions checking if file exists, different. i'm trying figure out how check type of file exists , exit if doesn't. code tried this: filenames = os.listdir(os.curdir) filename in filenames: if os.path.isfile(filename) , filename.endswith('.fna'): ##do stuff this works 'do stuff' file ends in .fna, need check , make sure .fna file there , exit program entirely if not. i tried this: try: if os.path.isfile(filename) , filename.endswith('.fna'): ## stuff except: sys.stderr.write (‘no database file found. exiting program. /n’) sys.exit(-1) but didn't work, skips whole function if .fna file isn't there, without printing error. the for statement in python has little-known else clause: for filename in filenames: if os.path.isfile(filename) , filename.endswith(".fna"): # stuff break else: sys.stderr.write ('no database fi...

maven - Deploying Wildfly EJB via mvn wildfly:deploy not putting jar into local repo. Ejb client can't see ejb dependency -

i'm trying run example "java ee 7 development wildfly". first i've deployed ticket-agency-ejb via mvn wildfly:deploy , didn't install jar local repo, did mvn install though isn't mentioned in book.i can see jar in local repo expected. tried run ticket-agency-ejb-client via mvn package install exec:exec getting error: failed execute goal on project ticket-agency-ejb-client: not resolve dependencies project com.packtpub.wflydevelopment.chapter3:ticket-agency-ejb-client:jar:0.0.1-snapshot: failed collect dependencies @ com.packtpub.wflydevelopment.chapter3:ticket-agency-ejb:jar:0.0.1-snapshot: failed read artifact descriptor com.packtpub.wflydevelopment.chapter3:ticket-agency-ejb:jar:0.0.1-snapshot: not find artifact com.packtpub.wflydevelopment.chapter3:ticket-agency:pom:0.0.1-snapshot -> [help 1] then did mvn deploy in parent project(ticket-agency) , tried run client again, works intended. i'm confused 1) why mvn wildf...