Posts

Showing posts from January, 2011

ms access - How to allow dayname in input string when inputting a date? -

Image
in our continuous form in access want offer combobox show 7 days dayname part of dropdown. the combobox bound date field. can populate combobox in form load event show days in ddd dd/mm/yy format , existing dates happily shown on form so: however if try , pick dropdown error: the value entered isn't valid field. solutions involving unbound combobox won't work continuous form. it's kind of detail, dayname isn't absolutely necessary, , combo works fine without dayname. heavy duty data entry form optimising end user important , having daynames assist him/her. i recreated problem , solution came have combo box row source has 2 columns , hide first column using columnwidths , second column formatted date value. when pick in combo box, value unformulated date value gives no issue. populate combo so: dim integer = 0 6 dim item date item = dateadd("d", i, weekcommencingdate) cbotimedate.additem item & ";" ...

Extracting digits after decimal MATLAB -

i representing chaotic number 15 digits after decimal i.e format long in matlab , want extract 3 numbers each containing 5 digits chaotic number. i.e if chaotic no. 0.d1d2...d15 want (d1..d5),(d6..d10) & (d11..d15). rounding off.i have written following code. num=x(n); a1=floor(num*10^5); disp('a1'); disp(a1); a2=floor(num*10^10-a1*10^5); disp(a2); num=floor(num*10^15); a3=mod(num,100000); disp('a3'); disp(a3); and output is 0.320446597556797 a1 32044 a2 65975 a3 56796 its showing a3 56796 want 56797. please help!!! the problem is, likely, each operation extract group of digits introduces small error, reflected in last digit. an alternative approach avoids this: num = pi; %// example str = num2str(num,'%0.15f'); %// string representation 15 decimal digits str = str(find(str=='.')+1:end); %// keep digits after decimal point = base2dec(reshape(str,5,[]).',10); %'// convert string parts numbers

ios - Pushwoosh Device not receiving notification -

im trying send notification ios device using 'devices' parameter on api object per documentation. below json works if omit 'devices' parameter go every device has app installed. want go device id have specified. im getting device id using [[uidevice currentdevice] identifierforvendor].uuidstring] in objective c. device id doesnt work... massively appreciated! { "request": { "application": "xxxxx-xxxxx", "auth": "xxxxxxxxxxxxxxxxxxxxxxxx", "notifications": [ { "send_date": "now", "content": "this test", "wp_type": "toast", "devices": [ "xxxx-xxxx-xxxx-xxxx-xxxxxxx" ], "wp_count": 3, "data": { "custom": "j...

bash - Build & start hybris 5.1.1 on Linux or Mac OS X -

i installing hybris 5.1.1 complete package for first time & according procedure of web page: https://wiki.hybris.com/display/release5/quick+installation however, when perform step: on unix-related systems (such linux or mac os x), run setantenv.sh entering ./setantenv.sh. by... mlittle-mbook1-2:platform mlittle$ ./setantenv.sh i message... -bash: ./setantenv.sh: permission denied i have tried setting execute permissions chmod 755 platform , did not work.. you have use bash command . ./setantenv.sh

jquery - Can some one explain this line of code from datepicker -

i'm using following jquery script http://www.eyecon.ro/datepicker now i'm making adjustments , came across following line of code, i'm not understanding can tell me what's going on? var fromuser = options.onrender(date); var val = date.valueof(); if (fromuser.selected || options.date == val || $.inarray(val, options.date) > -1 || (options.mode == 'range' && val >= options.date[0] && val <= options.date[1])) { data.weeks[indic].days[indic2].classname.push('datepickerselected'); } //date picked user var fromuser = options.onrender(date); var val = date.valueof(); if (fromuser.selected //if date selected || options.date == val //date set in options || $.inarray(val, options.date) > -1 //date exists in options || (options.mode == 'range' && val >= options.date[0] && val <= options.date[1])) //if date in between selected range of 2 pickers { //mark selected date addi...

c - Linked list representation of a polynomial -

i have write program sum 2 polynomials. purpose, first of all, writing program take 2 polynomials , print them. my program this: #include <stdio.h> #include <stdlib.h> #include <string.h> struct node { int power; int coef; struct node *link; }; int input( struct node *phead); int display( struct node *phead); int main() { struct node *phead= malloc(sizeof(struct node)),*qhead = malloc(sizeof(struct node)); input(phead); display(phead); input(qhead); display(qhead); return 0; } int input( struct node *phead) { //phead //qhead = malloc(sizeof(struct node)); int value; printf("\n\t\tentry of polynomial:\n"); printf("enter coefficient: "); scanf("%d",&phead->coef); printf("enter power: "); scanf("%d",&phead->power); phead->link = null ; printf("enter coefficient,( 0 break ): "); scanf("%d...

matplotlib - (x,y) graph in Python with different colours depending on y value -

this first post , new python. have .dat file 2 columns. can plot ok, want have same graph colour depends on y value. for reason scanning whole file, reading y value , depending on y value append , corresponding x argument on new lists , plot them. however don't same graph. here's code. import numpy np import numpy.random import matplotlib.pyplot plt blackx=[] blacky=[] bluex=[] bluey=[] redx=[] redy=[] x,y=np.loadtxt('input.dat',unpack=true) t,i in zip(x,y): if i<=16966: blacky.append(i) blackx.append(t) elif i>=16967 , i<=17180: bluey.append(i) bluex.append(i) else: redx.append(t) redy.append(i) plt.plot(blackx,blacky,'black') plt.plot(bluex,bluey,'b') plt.plot(redx,redy,'r') plt.show() the problem different graph 3 colours not same graph plt.plot(x,y) any ideas? it looks bluex appending not t, making blue portion (y,y) plot. red , black part right ,...

Generate different docpad collections for different languages -

i want tune multilungual docpad blog pages ended *.ru.md go /ru/ directory, , pages ended *.en.md go /en/ directory. let's initial structire src/ pages/ page1.ru.md page1.en.md page2.ru.md and want: ./ en/ page1.html ru/ page1.html page2.html ./ because going host gh-pages . and same posts. store them in src/ posts/ post-about-docpad.ru.md post-about-docpad.en.md and get ./ en/ posts/ post-about-docpad.html ru/ posts/ post-about-docpad.html how should config docpad? the 1st step renaming documents use dash language so: page1-en.html , , page1-ru.html , instead of page1.en.html , page1.ru.tml — otherwise @kizu correctly points out, cause problems docpad renders extension extension. once done, can add following docpad configuration file: collections: # fetch documents in different languages translate: (database) -> languageregex = /^(.+?)-(en|ru)$/ #docp...

javascript - jQuery Slider is not working properly -

i working on simple jquery slider. js bin code if have more 2 li elements, slide effect works smoothly. 2 li elements(current code), clicking on next shows jerk effect, on click of previous link slide effect works perfect. clue or solution appreciated. in advance. ok, edited. as pointed in comments problem when click on next, there no fist element switch to, switches blank element , appends first element. detailed explanation: quite simple actually. script had 3 'active' slides. current, next , previous. if have 2 slides, have no next slide (due ordering method use), instead of switching next slide switched empty space , placed second slide on it's position (the second slide appears after animation ends 'flickers'). now 'patch' do. basically, you'll understand once try code without patch , remove 'margin-left: -500px' slider wrap, i'll explain anyway. let's imagine instead of list have basic array 2 values. ha...

android - Google Glass File Observer Not Working Properly -

the goal of program (at least in stage) photo glass , display on screen (i using immersion). my class ( extends activity of course) has following: protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_picture_analysis); intent gettheimageintent = new intent(mediastore.action_image_capture); startactivityforresult(gettheimageintent, 25); } which launches camera. after user takes , accepts photo, calls public void onactivityresult method public void onactivityresult(int requestcode, int resultcode, intent data) { // bunch of debug logging inserted log.d("glass", "got pic!!"); log.d("glass", string.valueof(resultcode)); log.d("glass", string.valueof(resultcode==result_ok)); if (data.getextras() != null && requestcode == 25) { log.d("glass", "in if"); //create instance of bundle , ret...

ios - Efficent way to sort 'Person.firstName' under first alphabetically letter -

i iterate through long list of names, assign each 'person' object. person object has firstname , lastname . looking efficent way sort firstnames beginning letter a through z . have come solutions not efficent, or there surely easier way creating '24' arrays each letter of alphabet. for(int = 0; < numberofpeople; i++) { ... if ([person.firstname hasprefix:@"a"] || [person.firstname hasprefix:@"a"]) { [self.lettera_array addobject:person];//nsmutablearray } ... } i similar below example if work objects, unsure: nsdictionary *animals = @{@"b" : @[@"bear", @"black swan", @"buffalo"], @"c" : @[@"camel", @"cockatoo"], @"d" : @[@"dog", @"donkey"], @"e" : @[@"emu"], @"g" : @[@"giraffe", @"greater rhea"], ...

ide - How to start JavaScript project using WebStorm? -

im new javascript , ready start developing first application. i have downloaded webstorm ide , confused on how set things can start coding. specifically, can walk me through how begin project , steps must take able code , 'see' simple "hello world!" application using webstorm? me going. have read webstorm quickstart page? goes on several of points you've requested; specifically: start project scratch, view changes instantly, run , debug application, among other helpful topics.

Can I create a slide show with Balsamiq? -

i'd simulate navigation , basic functionality using balsamiq simulate ios app. i created series of balasmiq layouts , i'd connect these interactive slide show, wherein individual buttons within each layout connects different screen. is possible or have use tool flash? balsamiq allow link elements each other. when select object properties window has "link" dropdown , can link other wireframe file in same directory 1 working on. puts arrow next control working if alt+click arrow go linked form. if export entire directory pdf have presentation work seamlessly links being functional. here tutorial linking: balsamiq linking tutorial

Mongodb authentication using MongoCredential -

i have grails application in im using db.authenticate login page understand method has been deprecated , therefore upgrade application using mongocredential object authentication. however, unlike db.authenticate nicely returns boolean authentication done, mongocredential doesn't return boolean how can go accomplishing code replacement minimal headache. ideally, i'd derive kind of boolean tell me if authentication achieved. patience. im newbie mongodb. this part of code need replace makes use of deprecated method "authenticate": mongoclient mongoclient = new mongoclient("localhost", 27017) db db = mongoclient.getdb("twcdb"); def username = params.username def password = params.password //deprecated method being used in line below. boolean auth = db.authenticate(username, password.tochararray()) if (auth) { userloggedin = params.username ...

Facebook APP User ID -

i created php script, using standard php example on how user information (user id , name) php facebook sdk. i created 2 facebook apps (one before 1 month , second today). when use first app code, right facebook user id when use second app 10152375153xxxxx instead of id. both of these apps have same settings. has fb changed in new apps? as of 4/30/2014 , launch of graph api version 2.0, applications receive called "app-scoped" id instead of canonical facebook user id. benefit users less information being provided app developers , more in control. stops different apps (not owned same developer) associating users , data. https://developers.facebook.com/docs/graph-api/quickstart/v2.0

java - How to compile jars from pom.xml with ant? -

i used maven project configure , ant creating jars of utility classes. when create jars classes build.xml , got compile errors because of third party jars configure maven , these jars not exist in project. if , how fix ? need compile pom.xml build.xml ? or can create jar file maven ? suggestions ? you may use maven ant tasks . they're designed purpose.

ios - linphone compile issue (just downloaded from git) -

Image
i followed instruction here http://www.linphone.org/eng/download/git.html . i open terminal , entered git clone git://git.linphone.org/linphone-iphone.git --recursive (i included --recursive ) but after can't compile, because files missing: you can try , repeat command done " --recursive " part of git clone (that calls git submodule ): cd /path/to/linphone # main parent repo git submodule update --init --recursive and see if there error message, or if missing files show up.

c# - Failed to attach an auto-named database -

Image
so have c# software save data database every time run program , try save data message, please help? try { sqlconnection cnn = new sqlconnection(@"data source=.\sqlexpress; attachdbfilename=c:\users\hp\documents\visual studio 2010\projects\bank_system\bank_system\bank_system.sdf; integrated security=true;user instance=true"); cnn.open(); sqlcommand cmd1 = new sqlcommand("insert user values('" + textbox6.text + "','" + textbox1.text + "','" + textbox4.text + "'," + textbox3.text + ",'" + textbox2.text + "','" + textbox5.text + "')", cnn); sqldatareader dr1 = cmd1.executereader(); dr1.close(); messagebox.show(" record inserted ", " information inserted"); cnn.close(); } catch (sqlexception ex) { messagebox.show(ex.message); } copy database ba...

java - AutomatedWorkflowActionException: Incorrect type defined for automated workflow in Hybris -

i working on workflow in hybris. created workflow template respective workflow actions , decisions. if using admincockpit , performing actions. workflow working fine. but want perform corresponding actions through hmc now. suppose action1 assigned user a. user login through hmc , check inbox. can accept or decline workflow action there. when performing workflow actions through hmc, getting error : de.hybris.platform.workflow.jalo.automatedworkflowactionexception: incorrect type defined automated workflow. containercreationjob should implement de.hybris.platform.workflow.jalo.automatedworkflowtemplatejob[hy--1] code : import de.hybris.platform.workflow.jobs.automatedworkflowtemplatejob; public class abstractordercreationjob implements automatedworkflowtemplatejob { // code } can dig error. please me solve prob. i faced same issue. whenever performing actions through admincockpit, de.hybris.platform.workflow.jobs.automatedworkflowtemplatejob interface re...

ios - Getting error for passed in UserId in tab controller? -

i not sure why keep getting error, pass userid profile view controller on button click push: totaltabcontroller *usertabview = [[uistoryboard storyboardwithname:@"main" bundle:nil] instantiateviewcontrollerwithidentifier:@"usertabview"]; usertabview.userprofileid = userid; nslog(@"the user tota tab %@", userid); usertabview.userprofilename = profilename; [self.navigationcontroller pushviewcontroller:usertabview animated:no]; the nslog prints out correct userid, , have added tab controller in .h file so: @interface totaltabcontroller : uitabbarcontroller { nsstring *userprofileid, *userprofilename; } @property (nonatomic, retain) nsstring *userprofileid; @property (nonatomic, retain) nsstring *userprofilename; and in .m file so: @synthesize userprofileid, userprofilename; - (void)viewdidload { [super viewdidload]; nslog(@"the tab loaded , %@", userprofileid); } but nslog prints out null in .m file......

c# - Can i Pause and Resume a BackgroundTransferRequest in Windows Phone 8.1 Application -

i creating app allows users download content form internet, using backgroundtransferrequest task. but more functionality app want pause , resume same task. possible implement? have tried application fast resume method? if not... go wmappmanifest.xml , right click , view code editor. when there scroll down defaulttask string, example... <defaulttask name="_default" navigationpage="page1.xaml"/> then write in string called activationpolicy="resume" , example <defaulttask name="_default" navigationpage="page1.xaml" activationpolicy="resume"/> after you've done try launch/debug application. try navigate/download something, quit application without killing it. open again , recent action should running! this windows phone 8 > 8.x , hope this! regards!

java - How to add few the same image in one program by using JLabel? -

i'm using swing , i'm trying add picture in program. field = new jformattedtextfield(formatter); imageicon icon = new imageicon("background.png"), icon1 = new imageicon("1.png"); jlabel background = new jlabel(icon); jlabel firsticon = new jlabel(icon1); jpanel center = new jpanel(new gridlayout(0, 1)); public void initcomponents() { this.getcontentpane().add(center, borderlayout.center); center.add(background); field.setbounds(50,50); background.add(field); background.add(fristicon); } with code working, when try add same picture "background.add(fristicon);" again don't see image added first. every new image deleting last icon. you can't add several times same component. i suggest proceed this: for(int i=0;i<n;i++){ jlabel img=new jlabel(icon1); switch(i){ case 0: img.setbounds(x,y,w,h); break; case 1: img.setbounds(x,y,w,h); break; default: ...

computer vision - Extract the points that generate the vectors x and y in the video -

this code example of computer vision system toolbox, generates motion vectors of optical flow. curious extract each video frame array [x, y] coordinate points make these vectors. videoreader=vision.videofilereader('videoname','imagecolorspace','intensity',... 'videooutputdatatype','uint8'); converter = vision.imagedatatypeconverter; opticalflow = vision.opticalflow('referenceframedelay', 1); opticalflow.outputvalue = 'horizontal , vertical components in complex form'; shapeinserter = vision.shapeinserter('shape', 'lines', 'bordercolor',... 'custom','custombordercolor', 255); videoplayer = vision.videoplayer('name','motion vector'); videoinfo = info(videoreader); videoplayer = vision.videoplayer('position',... [100 100 videoinfo.videosize(1:2)+30]); while ~isdone(videoreader) frame = step(videoreader); im = step(converter, frame); of = step(opticalflow, im...

snap framework - What is <|> in haskell? -

i still learning haskell , looking @ snap web framework. in hello world example there thingy looks <|> site :: snap () site = iftop (writebs "hello world") <|> route [ ("foo", writebs "bar") , ("echo/:echoparam", echohandler) ] <|> dir "static" (servedirectory ".") googling surprisingly challenging, , snap documentation uses <|> noun. it, , do? it's method in alternative typeclass in module control.applicative in base package. typically means you're dealing kind of computation can fail , continue. if both x , y typed m a m tags kind of computation we're talking then x <|> y :: m is computation "tries" x , if fails "tries" y . such kinds of computation instantiate alternative .

php - How do I resolve POST asp with REST-client on codeIgniter -

im lost please, how resolve following on codeigniter using rest-cliente library (rest). i try send post, webapp or webresourse based on (asp.net), idea this: getuser() function getuser($id){ //set config of url $config = array('server' => 'http://www.example.com/app/webapp/); //initialize $this->rest->initialize($config); //now here problem @ im lost, try dont understand: $postdata = '__viewstate=/dkekcdmdaekekecnaekeqkenckje&'. '__eventvalidate=/dwrrkckadjeewwrjrdsjejew&'. 'buttonsearch=search&'. 'textfielduserid='.$id.'; $this->rest->option(curlopt_postfields, $postdata); $this->rest->post('query/user.apsx'); //when run this, use debug no show error, return content html of page whitout query of user data. $this->rest->debug(); note: user library rest , curl named within constructor. use request , work perfectly. want post $thi...

c - error: unknown conversion type character 'l' in format - scaning long long -

i'm trying long long console using standard io function scanf . started %lld : scanf("%lld", &rule); that throws: error: unknown conversion type character 'l' in format [-werror=format=] i've found more workarounds , throw errors: scanf("%i64d", &rule); ->error: iso c not support 'i64' ms_scanf length modifier [-werror=format=] scanf("%"scnd64"", &rule); ->error: expected ')' before 'scnd64' am doing wrong? there trick? i'm compiling on recent version of mingw gcc these flags: -pedantic -wall -werror -std=c99 -g -d home=1 for scnd64 , similar, you'd have use #include <inttypes.h> but of supposed work if compiler supports c99. first error message strong indication doesn't, or didn't give right commandline switches.

javascript - AngularJS: How to update view when model changed? -

consider html form <form name="form" class="form-horizontal" novalidate> <div class="form-group"> <label class="col-lg-2 control-label">template</label> <div class="col-lg-4"> <label> <select class="form-control" data-ng-model="templateselected" data-ng-options="transactiontemplate.name transactiontemplate in transactiontemplates"> </select> </label> </div> </div> <div class="form-group"> <label class="col-lg-2 control-label" for="transactionname">name</label> <div class="col-lg-4"> <input type="text" name=...

android - Onclick() in a Parent Fragment does not get called -

i have fragmentpager implementing 3 tabs. inside 1 of tabs need this: if user clicks on button want load fragment inside tab , if user clicks on button b want load fragment b in page. but i'm stuck @ first phase. when click on button onclick method not called. following steps given in slidenerd.com video #10 fragments. i have implemented onclickslistener , added onclick method example. toast message not fire. below code mainactivity , parent fragment (the mentioned tab) , xml. thanks in advance. mainactivity.java public class mainactivity extends actionbaractivity implements actionbar.tablistener { /** * {@link android.support.v4.view.pageradapter} provide * fragments each of sections. use {@link fragmentpageradapter} * derivative, keep every loaded fragment in memory. if * becomes memory intensive, may best switch * {@link android.support.v4.app.fragmentstatepageradapter}. */ sectionspageradapter msectionspageradapter; viewpager mviewpager; @override pro...

Android save user session -

i'm new in android i'm trying save login session , send every time send request server, web service php (zend framework 2). this code identify user: $auth = zend_auth::getinstance(); $identityobj = $auth->getidentity(); it's possible save session , send use web browser without make change in web service. yes, is. have store session using sharedpreferences . the idea is, after login, guess return kind of session id or whatever. need store it. then, in subsequents executions, fetch session before doing request. sharedpreferences preferences = getsharedpreferences("com.blabla.yourapp", context.mode_private); //save preferences.edit().putstring("session", <yoursessiontoken>).commit(); //fetch // second parameter default value. preferences.getstring("session", ""); anyway better read documentation understand doing.

Javascript, getting away from 'this' and using local scope -

in typical js class, calls member functions must preceded this . looking @ technique let me create library of inter-dependent static functions , relying on closure/scope make things bit easier. example: var singleton={ //main entry point // call fn name, args... call:function(){ var args=[]; if (arguments.length==0) { return; } // fn name var fn=arguments[0]; var x; // make args array (x=1;x<arguments.length;x++) { args[args.length]=arguments[x]; } // want rid of part // see below wish // here have access fns below due hoisting in js // put them in map... var fns={ test:test // etc, more not want type/maintain } // ... can // function. var fun=fns[fn]; // instead of that, "override whitespace" , // like: // var fun=['fn_name']; // can index local scope , fn // // log error if not found if (typeof fun=='undefined') { ...

How to merge vertically several csv files in Python? -

i need merge vertically data several csv spreadsheets in python. structure identical, need put 1 table's data on top of following because months on annual survey. tried several methods found googling can't find way simple as: import csv spreadsheets1 = open('0113_re_fscom.csv','r') spreadsheets2 = open('0213_re_fscom.csv','r') spreadsheets = spreadsheets1 + spreadsheets2 spreadsheet csvfile: sales = csv.reader(csvfile) row in sales: print row thanks in advance. r. looks forgot iterate on files. try code: import csv spreadsheet_filenames = [ '0113_re_fscom.csv', '0213_re_fscom.csv', ] filename in spreadsheet_filenames: open(filename, 'r') csvfile: sales = csv.reader(csvfile) row in sales: print row

javascript - Using Jquery and $(this).text() to replace th text -

i'm trying append 2 digit year column header autogenerated me. seems simple problem. have table <table border="1" id="datatable1"> <tr> <th>jan-</th> <th>feb-</th> </tr> <tr> <td>january's data</td> <td>february's data</td> </tr> </table> and jquery $(document).ready( function () { var twodigityear = '14'; $('#datatable1 th').each(function () { var curtext = $(this).text(); if (curtext != "") { var newtext = curtext + twodigityear; $(this).text(newtext); } }); } ); for reason, can see value changed if put console.log in code, web page doesn't change. here's jsfiddle: http://jsfiddle.net/pasadenajacket/ztnvr/#base instead of datatable1 need datatable1 should work. see updated fiddle here

c++ - Why does this code using non-qualified "std::swap" function compile? -

in .cpp file implement bubble_sort algorithm. inside bubble_sort function use swap(a, b). don't specify "using name space std" in cpp file. (actually there no header in .cpp file) still complile program without warning or error. know if want use customary function in bubble_sort function, need @ lease declare function in same file. don't understand why don't need thing swap. below cpp file: bubble_sort.cpp template <typename type> void bubble_sort(type* originarray, int lengthofarray) { int ii=lengthofarray-1; while(ii>0) { (int jj=0;jj<ii;jj++) { if (originarray[jj]>originarray[jj+1]) swap(originarray[jj],originarray[jj+1]); } ii--; } } first, test template code (at least msvc), should instantiate it. moreover, if try code class in std namespace, std::swap() can picked compiler via adl (koenig) lookup .

android - couldn't run Google Map Marker Cluster -

i tried alot added libraries no use , followed documentation make work appreciated here's appear @ logcat: 05-18 17:26:50.480: e/dalvikvm(5818): not find class 'com.google.maps.android.utils.demo.clusteringdemoactivity', referenced method com.google.maps.android.utils.demo.mainactivity.oncreate 05-18 17:26:50.552: e/androidruntime(5818): fatal exception: main 05-18 17:26:50.552: e/androidruntime(5818): java.lang.noclassdeffounderror: com.google.maps.android.utils.demo.clusteringdemoactivity 05-18 17:26:50.552: e/androidruntime(5818): @ com.google.maps.android.utils.demo.mainactivity.oncreate(mainactivity.java:22) 05-18 17:26:50.552: e/androidruntime(5818): @ android.app.activity.performcreate(activity.java:5133) 05-18 17:26:50.552: e/androidruntime(5818): @ android.app.instrumentation.callactivityoncreate(instrumentation.java:1087) 05-18 17:26:50.552: e/androidruntime(5818): @ android.app.activitythread.performlaunchactivity(...

javascript - PhP login redirect stops working after applying CSS and JS to the code -

i trying write simple login code. problem code works , redirects dashboard.php without css , js files. include header file,consisting of css , js, stops working , gets stuck on auth_check.php. here code. main index file ( index.php) - containing login form <?php include('header.php');?> <?php $message = $_get['message']; if($message == 1) { echo ' <div class="alert alert-success"> <button type="button" class="close" data-dismiss="alert"> invalid username or password.</br> &times;</button> </div> '; } if($message == 2) { echo ' <div class="alert alert-success"> <button type="button" class="close" data-dismiss="alert"> have logged out! </br> &times;</button> </div> '; } ?> <di...

c++ - Include statement not working -

i creating own library arduino , have following code: #include <arduino.h> #include <servo.h> class servomotorcontroller { public: servomotorcontroller(int servopin, int motorpin, int angle); void setangle(int angle); void setspeed(int speed); private: servo servo; int servopin; int servoangle; int motorpin; int motorspeed; }; i getting error servo not name type; if #include <servo.h> #include <servomotorcontroller.h> in actual arduino code not error. why include statement not working in c++ lib? here more info: file hierarchy: arduino libraries myservo servomotorcontroller .h servomotorcontroller .cpp servo softwareservo.h softwareservo.cpp servo_program servo_program.ino servomotorcontroller.h file shown above. when use arduino ide include servo library does #incl...

objective c - how to access value form completionHandler and pass it to another view IOS -

i'm trying return string method have 2 class first 1 ui , have 2 input text user , pass , have submit button , 1 doing following method . i'm trying return string other class class , show string in alert . #import "loginpage.h" @implementation loginpage -(nsstring *)responsdata:(nsstring *)loginurl input1:(nsstring *)username input2:(nsstring *)password { nsstring *urlasstring = loginurl; nsstring*test; inusername = username; inpassword = password; nsurl *url = [nsurl urlwithstring:urlasstring]; nsmutableurlrequest *urlrequest = [nsmutableurlrequest requestwithurl:url]; [urlrequest settimeoutinterval:30.0f]; [urlrequest sethttpmethod:@"post"]; // setting username , password nsstring *body = [nsstring stringwithformat:@"sended=yes&username=%@&password=%@",username,password]; [urlrequest sethttpbody:[body datausingencoding:nsutf8stringencoding]]; nsoperationqueue *queue = [[...

javascript - Move inside UL and change LI class if has .has_children class -

i need move inside ul element , change li , children ul class if .has_children present. see example: <ul class="nav navbar-nav"> <li class="first current parent">link1</li> <li class="parent">link2</li> <li class="has_children parent"><a href="#">link3</a> <ul class="dropdown"> <li class="first parent">subitem1</li> <li class="last parent">subitem2</li> </ul> </li> </ul> here when found has_children should change dropdown in parent or root li. ul class dropdown has has_children parent should changed dropdown-menu dropdown-megamenu . need iterative until latest nested level. result should this: <ul class="nav navbar-nav"> <li class="active">link1</li> <li class="">link2</li> ...

What does ⌘-L do in XCode? -

Image
sometimes in xcode hit ⌘-l accident, , white box cursor in middle of screen. i did poking around , it's supposed jump in '[file].m' no matter type, never jumps particular function or file in xcode. sits there , lets me type in it. how feature supposed used? i've read in docs, should allow me navigate (or jump!) specific parts of code. doesn't seem me. am misunderstanding feature, or there not working in copy of xcode? this shortcut jump specific line number. press ⌘-l , enter line number, press enter .

angularjs - How do I test an element and its sub element without running into race conditions? -

i got test: describe('news page', function () { 'use strict'; beforeeach(function () { browser.ignoresynchronization = true; browser.waitforangular(); }); it('should show first run page', function () { var firstrun; firstrun = browser.findelement(by.id('first-run')); firstrun.findelement(by.tagname('h1')).then(function (greeting) { expect(greeting.gettext()).tobe('welcome owncloud news app!'); }); expect(firstrun.isdisplayed()).tobe(true); }); }); sometimes works, both tests fail. works if remove test greeting. if add console.log works, guess race condition. haven't been able find out how chain these things , how prevent race condition.

security - Blacklisting on Google App Engine - users or devices (and not just IP addresses) -

i have couple android apps on playstore, use in-app purchases. use google app engine backend. see users calling apis abnormally/repeatedly (may reverse engineer or hack?). can figure out ip address, gmail id, etc. how prevent these people accessing api? one suggestion use dos.xml but these morons seem change ip addresses, painful keep updating list. is there way in app engine black list users? or computers/devices? if know google(gmail) ids of these ba*t*r*s, how/where report those? this page seems right place start, not clear send email. this page seems more appropriate vulnerabilities, not such case. "viewing top users in administration console" section in dos page says should see table of ip addresses using api frequently. dont see such table in admin console. need paid (google app engine) user? any appreciated. yes, gae allows blacklist, via dos.xml (dos.yaml python or php). if don't want have keep updating ip addresses, may have check us...

osx - What issues could arise when using GCD dispatchAfter() in this use case -

i'm going through book on os x programing refresher , have document app set array controller, tableview etc. chapter calls implementing undo support hand using nsinvocation. in chapter, call adding create employee method , manually, adding outlets nsarraycontroller, , connecting add button new method instead of array controller. instead did method inserting new objects: -(void)insertobject:(person *)object inemployeesatindex:(nsuinteger)index { nsundomanager* undomanager = [self undomanager]; [[undomanager preparewithinvocationtarget:self]removeobjectfromemployeesatindex:index]; if (![undomanager isundoing]) { [undomanager setactionname:@"add person"]; } [self startobservingperson:object]; [[self employees]insertobject:object atindex:index]; dispatch_after(dispatch_time(dispatch_time_now, (int64_t)(.1 * nsec_per_sec)), dispatch_get_main_queue(), ^{ // wait start editing [[self tableview]editcolumn:0 row:index withevent:nil select:yes]; }); } t...

installation - C# can't find properties file, how do I repair this? -

i had properties file called recentfilelist within visual studio 2012 project , removed it. believe .settings file. when run setup project, trying copy files shouldn't care , it's bombing out result. 3 errors (-1007 -6271 , -6103), related same missing file. -6103: not find file "c:\users\charles\documents\visual studio 2012\projects\rallycourses\rallycoursedesigner\bin\debug\properties\recentfilelist.designer.cs what file need edit rid of reference file? tried searching recentfilelist.designer.cs , can't find it. the offending files in situation trying installed installer, had removed them main project. within setup project, there section specify application data -> files . found files in properties section there, removed them, , things working now...

android - How to specify gap around text exactly -

in our company, design team expect exact gap (in pixel) between textview , picture under/above/at left of textview. example, textview , picture under it, gap calculated text's baseline (the bottom of character h) top of picture, example, 48 dp. in xml layout file, use same value 48 dp textview's layout_marginbottom. but, after built, design team capture screenshot , measure gap using photoshop, , proved gap not 48 dp, it's around 50 dp. tried includingfontpadding, not work expect. so, how specify exact gap around text? resolution in photoshop set in pixels per inch official google documentation says android require images set in dpi.while ppi , dpi , not equivalent.android documentation describes relation px = dp*dpi/160. supporting multiple screens . , dashboards need own calculation . can take hear convert ppi dpi