Posts

Showing posts from June, 2010

jstl object not getting paramaters from jsp -

i have bean linked correctly in jsp page: <jsp:usebean id = "productmanager" scope = "session" class = "smithd81.inventorymanager"> <jsp:getproperty name = "productmanager" property = "productlist" /> </jsp:usebean> i can verify works, because following line allows me length: products in list = <%= productmanager.getproductlist().size() %> the end goal here iterate on objects in list display values, why coming blank?! any potential welcome, however, of mention package name has capital letter, i've attempted refactor , change twice now, , when breaks whole project. in following block, first line shows how many items in list. next lines, however, nothing. <p>it ${fn:length(productmanager.productlist)}</p> <c:foreach var="p" items="${productmanager.productlist}"> <div> <form action="inventory" method="post"...

ios - Programmatically create UIToolbar with default height -

there number of questions regarding height of uitoolbar , don't see 1 height obtained dynamically. there way create uitoolbar correct default height? create toolbar 0 height, call sizetofit . toolbar have default height. uitoolbar *toolbar = [[uitoolbar alloc] initwithframe:cgrectmake(0, 0, width, 0)]; [toolbar sizetofit];

java - Zend Studio 10 crashes with Android SDK and ADT -

i downloaded new zend studio 10 trial version , under it's welcome page included android developer tools. after has made update, tried create sample android project upon received error android sdk missing. went android developer website , downloaded latest android sdk (for linux (im running ubuntu 12)). told zend studio folder was, on received error adt outdated. entered repository ( https://dl-ssl.google.com/android/eclipse/ ) in install new software , performed android adt update version 22. after proceed link sdk zendstudio 10. marvelous , got access android manager (if i'm correct) download different api versions etc. performed update tools well.. after update made zend studio restart (i still couldnt make sample project). upon loading of ide, crashes in 5 seconds. so, looked @ errorlog (zend's) , hint got was: a fatal error has been detected java runtime environment: sigsegv (0xb) @ pc=0xaeba3e08, pid=32629, tid=2867575616 jre version: 6.0_27-b27 java vm: ope...

compiler construction - C - program throwing segmentation fault -

i trying write compiler program in c (ubuntu, gcc) using jack crenshaw's tutorial http://compilers.iecc.com/crenshaw/ . however, written in pascal, , relatively new c, tried write 1 best could. i need help. segmentation fault occuring. see valgrind's output: ==3525== invalid read of size 1 ==3525== @ 0x80484c0: getchar (in /home/spandan/codes/compiler_1) ==3525== 0x8048aad: init (in /home/spandan/codes/compiler_1) ==3525== 0x8048acd: main (in /home/spandan/codes/compiler_1) ==3525== address 0x0 not stack'd, malloc'd or (recently) free'd ==3525== ==3525== ==3525== process terminating default action of signal 11 (sigsegv) ==3525== access not within mapped region @ address 0x0 ==3525== @ 0x80484c0: getchar (in /home/spandan/codes/compiler_1) ==3525== 0x8048aad: init (in /home/spandan/codes/compiler_1) ==3525== 0x8048acd: main (in /home/spandan/codes/compiler_1) i post part of code here relevant valgrind's stack trace. rest can foun...

audio - Opening files in another computer c# -

i have program button, when clicked, executes sound located in download folder. question how execute sound on computer if path finding different. you need path file run it. if don't have path - have search it. pick base directory think file is. if don't know - whole drive. write recursive function search said folder recursively. test each file ever search condition is, i.e. file name, file hash, etc. for example: string searchforfile(string searchpath, func<string, bool> searchpredicate) { try { foreach (string filename in directory.enumeratefiles(searchpath)) { if (searchpredicate(filename)) { return filename; } } foreach (string dirname in directory.enumeratedirectories(searchpath)) { var childresult = searchforfile(dirname, searchpredicate); if (childresult != null) { return childresult; ...

java - why the setIsrunning(false) method ‘s caller is "main" Thread -

public class run { public static void main(string[] args) { try{ runthreas runthreas=new runthreas(); runthreas.start(); //thread.sleep(2000); runthreas.setisrunning(false); system.out.println("已经赋值为false"); }catch (exception e){ e.printstacktrace(); } } } class runthreas extends thread{ private boolean isrunning=true; public boolean isrunning(){ return isrunning; } public void setisrunning(boolean isrunning){ system.out.println(thread.currentthread().getname()+"set"); this.isrunning=isrunning; } @override public void run() { super.run(); system.out.println(thread.currentthread().getname()+"run"); system.out.println("进入run"); while(isrunning){ system.out.println("i running"); } system.out.println("线程被停止了"); } } the setisrunnning() method belongs runthread ,so think should called instanse of runthread , invoked ...

C++ | List iterator not incrementable -

i trying iterate through list , then, if object's plate number matches 1 given through parameters, , if toll (calculated in toll()) less or equal given cents, remove/erase object list. keep getting error list iterator cannot incremented , i'm clueless how fix it. void one_time_payment(string& plate_number, int cents) { // todo: rewrite function std::list<licensetrip>:: iterator it; (it = listlicense.begin(); != listlicense.end(); std::advance(it, 1)) { if (it->plate_number().compare(plate_number) == 0) { cout << "matching plate found" << endl; if (it->toll() <= cents) { cout << "can paid" << endl; = listlicense.erase(it); //error: list iterator cannot incremented } } } cout << "end of iterator" << endl; } this is, i'm guessing, not compile error rather assertion triggere...

sql - How to find regions where total of their sale exceeded 60% -

i have table interest_summary table 2 columns: int_rate number, total_balance number example 10.25 50 10.50 100 10.75 240 11.00 20 my query should return in 2 columns or string 10.50 10.75 because adding total exceed 60% of total amount added together could suggest logic in oracle? select min(int_rate), max(int_rate) ( select int_rate, nvl(sum(total_balance) over( order total_balance desc rows between unbounded preceding , 1 preceding ),0) part_sum interest_summary ) part_sum < (select 0.6*sum(total_balance) interest_summary) fiddle

Unable to debug why ImportPSModule fails when calling Powershell cmdlets from C# -

i trying call "connect-msolservice" cmdlet c# getting "... 'connect-msolservice' not recognized name of cmdlet ..." error. pointers on how debug problem appreciated. i based project on office dev center sample office 365: manage users calling windows powershell cmdlets c# first importpsmodule of "msonline" module. when open office dev center sample in vs 2015 works expected when create own project not. struggling bottom of why error in in project not in sample. have done far is have both projects (sample , mine) in same solution reduced both projects down console applications removing unnecessary dependencies , references the sample had hard reference system.management.automation changed nugget reference (both worked) when tried each in project still got error tried basic powershell commands (e.g. get-process) in project , worked tried use importpsmodulesfrompath , full path module in importpsmodule neither worked tried check if ge...

Populate HTML table with SQL data and PHP -

i trying populate table using a few loops. first loop fills table headers users in row, no problem that. the problem populating tds rows right ticket number. i can numbers in order column in single td, not how should work something this, --------------------- user1 | user2 | user3 --------------------- 00001 | 00004 | 00007 00002 | 00005 | 00008 00003 | 00006 | 00009 --------------------- and should be, --------------------- user1 | user2 | user3 --------------------- 00001 | 00004 | 00007 --------------------- 00002 | 00005 | 00008 --------------------- 00003 | 00006 | 00009 --------------------- you idea. the code using that, <table class="table table-hover"> <thead> <tr> <th scope="row"> <?php $username = functionname(); ($username->rewind(); $username->pointer < $username->size; $username->next()) { $record...

How to reduce the noise of impulse in image? -

i want remove impulse noise in image. know noise reduction methods average. think doesn't make sense when use average method reduce noise in image. because, the average methods don't know noise whether impulse noise or not. want know how remove impulse noise in image? would give hint? linear filters not removing impulse noise. order statistics filters deliver better results preserve image information better.

javascript - Prevent child element from collapsing with twitter bootstrap -

i have following list: root child1 child2 the root should collapsible not children. following code both collapse if click on 1 of them. how can accomplish prevent children being collapsed? <li data-toggle="collapse" data-target="#root"><a href="#">root</a> <ul class="nav nav-list collapse" id="root"> <li><a href="some_url">child1</a></li> <li><a href="some_url">child2</a></li> </ul> </li> edit: better approach describe want. root collapsed start. if click on root should show children (works code above) , if click root again should hide children (works too) once children displayed click on child. click trigger collapse , hides children again. (this i'm trying prevent) jsfiddle: http://jsfiddle.net/mgcdu/4537/ move data-toggle , data-target attributes a element, like <...

angular - Angular2 Routing from Navbar (AppComponent) -

i'm having issue routing in angular2 routing creates new object , keeps old object. my navbar , [home] button resides in appcomponent. .. app.html <a class="navbar-brand" [routerlink]="['auth']">home</a> <router-outlet></router-outlet> .. the router defaults authcomponent @ start. .. app.component.ts @routeconfig([ { path: '/', as: 'auth', component: authcomponent, useasdefault: true } ]) .. i'll demonstrate scenario logging message in authcomponent's constructor. .. auth.component.ts constructor(private _router: router) { console.log("constructing authcomponent"); this.router = _router; } .. the response clicking home button produce constructing authcomponent everytime clicked creating new object. (i can confirm old objects still exist) i want able route somewhere , route authcomponent while still having access data set previously. see plunker . i'm using 2....

tk - Perl FileSelect omit unused buttons -

Image
i using module tk::fileselect file selection processing. below code use generate fileselect window my $win = mainwindow->new()->fileselect(); $win->show; and here window produced: i think window looks great, there 2 buttons never need use - reset , home buttons want remove them displayed window. have looked @ link list of configuration options can't seem find 1 this. appreciated! reset , home buttons not configurable in tk::fileselect . if want can either patch lib, or can try remove buttons after fileselect have created them. neither solution being recommended.

What is a concise way to test outputs of a function in java? -

is there easy way chain testable function calls concise block run , increment score when test comes positive? following class test. public class weather{ public weather(float temp, int day, int month, int year){} public float gettemp(){} public void setcelsius(){} public void setfahrenheit(){} public boolean iscelsius(){} public string tostring(){} } a typical test case consists of setting celsius, , fahrenheit, getting value, , match string. weather testme = new weather(100.6f, 31, 7, 1997); if(testme.tostring().equals("july 31, 1997. temperature 100.60 c.")) { score+=1} if(testme.gettemp() == 100.6f) {score+=1} if(testme.iscelcius()) {score+=1;} testme.setfahrenheit(); if(testme.tostring().equals("july 31, 1997. temperature 213.08 f.")) { score+=1} if(testme.gettemp() == 213.08f) {score+=1} if(!testme.iscelcius()) {score+=1;} testme.setcelcius(); if(testme.iscelcius()) {score+=1;} i repeat on , on again, can testing can shortened? ...

SignalR version for .Net 3.5 -

we use .net 3.5 our server. if want use signalr our server, version of signalr appropriate? i've worked 2.0.0 on 3.5 installation while , worked ok. used notifications though. have @ link: https://www.nuget.org/packages/nivot.signalr.client.net35/

python - raspberry pi 2- not able to install scikit-image -

yup checked :- upgrading skimage version on raspberry pi but after running : pip install scikit-image collecting scikit-image using cached scikit-image-0.12.3.tar.gz complete output command python setup.py egg_info: warning: no files found matching '*.pyx' under directory 'cython/debugger/tests' warning: no files found matching '*.pxd' under directory 'cython/debugger/tests' warning: no files found matching '*.h' under directory 'cython/debugger/tests' warning: no files found matching '*.pxd' under directory 'cython/utility' gcc: internal compiler error: killed (program cc1) please submit full bug report, preprocessed source if appropriate. see <file:///usr/share/doc/gcc-4.6/readme.bugs> instructions. unable find pgen, not compiling formal grammar. traceback (most recent call last): file "<string>", line 1, in <module> file "/tmp/pip-build-yrftcz/scikit-image/setup.py", ...

c++ - Link error with a defined destructor -

i've searched through many unresolved external symbol (lnk2019) problems on , of them problems forgot put constructor definition in .cpp file or .cpp file not included in building problem. the linker gives me errors saying have unresolved external: //error on notationinstrument.obj inotationinstrument<class notation::notationtrack>::~inotationinstrument<class notation::notationtrack> (i got lnk2001 erros well. 'unresolved external symbol' error) yet destructor defined. since it's destructor of interface, derived class (notationinstrument) have destructor overrides base's destructor. , notationinstrument destructor defined. notationinstrument.h #include "inotationinstrument.h" #include "notationtrack.h" #include <vector> namespace notation { class notationinstrument : public inotationinstrument<notationtrack> { public: notationinstrument(); ~notationinstrument(); std::...

sql - what will be the regular expression for allowing alphanumeric characters, space, hypen in between, dot at the end or in between -

i new regular expression. using regular expression in sql query. , want display records contain other than: alphanumeric characters, white spaces, hyphen(-) in between string, dot(.)in end , in between string. have been able alphanumeric characters , spaces. hyphen , dot creating problem. for eg: "first.name", "firstname." should not come ".firstname" should come in result. and "first-name" should not come "-firstname" , "firstname-" should come in result. as of have done this. select * my_table column1 '.%' or column1 '-%' or regexp_like(column1 ,'[^[:alnum:]^[:blank:]]'); the above query working in way allows dot , hyphen @ place in string. , not places want discussed above. can me in this. i've create table yours , statement select * tmp x '.%' or x '-%' or x '%-'; works fine - . , - :)

javascript - custom print function, print contents not showing on first event trigger -

to quick , precise please see fiddle .on first click on button has label of "print", new window open (print contents) , print dialog popup , should have contents have set content there's no content showing, there title of print dialog. if click again (second click) button has label of "print", contents of print dialog showing, ideas or clues what's going on? help, suggestions, recommendation make show? here raw code <button>print</button> <div id="print"> <table> <thead> <tr> <th>name</th> <th>gender</th> <th>age</th> <th>address</th> </tr> </thead> <tbody> <tr> <td>jason guatamala</td> <td>male</td> <td>18</td> <td>somewhere</td> </tr> </tbody> </table> </div> the jquery $(document).ready...

python - Confusion about the return value of the built-in function input -

Image
here problem: you driving little fast, , police officer stops you. write code compute result, encoded int value: 0=no ticket, 1=small ticket, 2=big ticket. if speed 60 or less, result 0. if speed between 61 , 80 inclusive, result 1. if speed 81 or more, result 2. unless birthday on day, speed can 5 higher in cases. my code: speed = int(input()); birthday = input(); if (not birthday): if (speed <= 60): print(0); elif (speed >= 61 , speed <= 80): print(1); elif (speed >= 81): print(2); elif (birthday): if (speed >= 61 , speed <= 65): print(0); elif (speed >= 81 , speed <= 85): print(1); and output: what doing wrong? when receive input input() , not boolean, assume here, rather string. thus, should checking if (birthday == "true") and elif (birthday == "false")

JavaPOS Installation not compatible with Windows 10, therefore I need to write my own jpos.xml file. Which files to include? -

ive been researching ins , outs of javapos, jcl, jdk, paths , classpaths while trying figure out how can print line on epson tm-t20 receipt printer using javapos. since javapos installation disc (that came printer) not install correctly on windows 10 (thinks installing on linux), need create own jpos.xml file. needs contain device entries printer. (i have tried fresh javapos adk download epson , older version without success). this setup far.... i have extracted latest jcl. instead of setting classpath jcl binary files (jar files), ive placed them in java ext directory. i extracted java "src.zip" located in jdk1.8.0_74 jdk1.8.0_74 directory "src". i have placed "jpos" folder containing jpos source files "src" folder, can import them test application. i have studied other jpos.xml (including postest/2 & starmicronics eg.) idea of entries mine needs contain. ive placed jpos.xml in java "src" folder. here jpos.xml.... ...

extjs - Ext.Net - Create Ext.MessageBox.confirm in code behind -

there way create ext.messagebox.confirm in code behind? try: public void myfunction() { x.msg.confirm("message", "it'ok??", new messageboxbuttonsconfig { yes = new messageboxbuttonconfig { handler = "companyx.it_s_ok()", text = "ok" }, no = new messageboxbuttonconfig { handler = "companyx.it_s_ko()", text = "ko" } }).show(); } [directmethod(namespace = "companyx")] public void it_s_ok() { //your ok function } [directmethod(namespace = "companyx")] public void it_s_ko() { //your ko function }

python - Basic Socket Chat Program Using Multithreading Raises Errors -

i making basic chat program using socket , multi threading. program connected , when message sent client raises error on server side when executed: exception in thread thread-1: traceback (most recent call last): file "c:\python27\lib\threading.py", line 810, in __bootstrap_inner self.run() file "c:\python27\lib\threading.py", line 763, in run self.__target(*self.__args, **self.__kwargs) file "c:\users\jclarke14\desktop\server - 2.py", line 25, in check_for_data data = c.recv(1024) file "c:\python27\lib\socket.py", line 174, in _dummy raise error(ebadf, 'bad file descriptor') error: [errno 9] bad file descriptor i beginner , new multi-threading , socket. doing wrong? here code client: #check incoming data def check_for_data(): while true: data = s.recv(1024) print "other: " + data print #send data def send_data(): while true: message = raw_input(...

r - ggplot2 geom_errorbar in reshaped data -

in data.frame appended trend device sensitivity @ 2 distances measurement t date, facetted monitor. pretty straightforward in ggplot2 . first melt data usinge reshape2 package data.melt <- melt(big_df[,c(1:3,6)],id=c("date","monitor")) then use ggplot2 ggplot(data.melt, aes(x=date, y=value, col=variable)) + geom_point() + facet_wrap(~monitor) i add geom_errorbar these points. problem have error bars differ 50cm , 100cm measurements , unsure how define limits. i.e if variable = sensitivity.100cm set limits value+/-error.100cm , variable = sensitivity.50cm limits = value+/-error.50cm . how can best approach task? structure(list(date = c("18/10/2012", "19/10/2012", "22/10/2012", "23/10/2012", "23/10/2012", "26/10/2012", "29/10/2012", "31/10/2012", "11/01/2012", "11/02/2012", "11/06/2012", "11/08/2012", "11/09/2012", ...

java - how to implement TextWatcher when my Json is ready? -

i newbie in android development, , facing problem project, want connect app local host, have seen ways , picked simplest 1 using json, stopped on way of implementing textwatcher adding in code. rest of things have done requires on steps. please take @ code , tell me mistake? this java code: public class myactivity extends activity implements textwatcher { httpclient httpclient; private httppost mhttppost; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); string[] mobilearray = {"laptops","iphone","windowsmobile","blackberry","webos","ubuntu","windows7","max os x"}; arrayadapter adapter = new arrayadapter<string>(this,r.layout.list_item,mobilearray); listview listview = (listview) findviewbyid(r.id.listview); listview.setadapter(adapter); httpclient = new defaulthttpclient(); mht...

Vaadin - Align icon on button -

Image
i'm working on simple back/forward-navigation vaadin existing of 2 buttons, each label , icon (arrows left , right). navigator = getui().getnavigator(); if (!stringutils.isempty(backviewid)) { backbutton = new button(backbuttoni18n, iconcache.fast_rewind_button.geticonresource()); backbutton.addclicklistener(getbackbuttonlistener()); } if (!stringutils.isempty(nextviewid)) { nextbutton = new button(nextbuttoni18n, iconcache.fast_forward_button.geticonresource()); nextbutton.addclicklistener(getnextbuttonlistener()); } how can align icons on each button? looks "<< back" ">> next", because icons aligned on left , text aligned on right side. want align icon next-button on right side , text on left, make "<< back" "next >>". i hope can me that. cheers, hendrik if you're using valo, relatively easy. need add style name shipped theme forwardbutton.adds...

Swipe error when using SWRevealViewController and UIScrollView (Swift) -

i have problems when using swrevealviewcontroller , scrollview. created sidebar menu follow instructions below (swift 2.0 & xcode 7.): sidebar menu tutorial swift 2.0 you see following picture: swrevealviewcontroller conflict uiscrollview how handler it?. appreciated, thank. the following code: @iboutlet weak var scrollview: uiscrollview! @iboutlet weak var menubutton: uibarbuttonitem! override func viewdidload() { super.viewdidload() //revealviewcontroller().delegate = self //self.scrollview.delegate = self // additional setup after loading view. let vc0 = fsmainswipevc(nibname: "fsmainswipevc", bundle: nil) self.addchildviewcontroller(vc0) self.scrollview.addsubview(vc0.view) vc0.didmovetoparentviewcontroller(self) //---- let vc1 = fsdetailswipevc(nibname: "fsdetailswipevc", bundle:nil) var frame1 = vc1.view.frame frame1.origin.x = self.view.frame.size.width vc1.view.frame = frame1 ...

ssas - How to calculate margin percent in MDX -

i have dimension divides single fact value members. ie. ([dim].[member1], value), ([dim].[member2], value) .. can calculate dimension members margin single value? using calculated member formula nested iif as: create member currentcube.[measures].[margin] iif([dim].[member1] = [dim].[member1].&[x], sum([dim].[member1].&[x],[dim].[member1].&[y], value) / ([dim].[member1].&[x],value), iif([dim].[member1] = [dim].[member1].&[y], sum([dim].[member1].&[y],[dim].[member1].&[f], value) / ([dim].[member1].&[y],value), iif([dim].[member1] = [dim].[member1].&[f], sum([dim].[member1].&[f],[dim].[member1].&[y], value) / ([dim].[member1].&[f],value), etc... formula long, 150 rows :)

wordpress - enable CORS to call JSON REST from Cordova App -

i'm making app apache cordova ... , need take post wordpress site . please , before duplicate read points below : so , installed rest api v2 : http://v2.wp-api.org/ enabled cors this: < ? header ( " access- control-allow -origin : * " ) ; ? > in header.php of theme , in wp-content/plugins/json-api/singletons/api.php i have try install this: https://wordpress.org/plugins/wp-cors/ call method rest api: jquery.ajax({ type: "get", url: "myurl", contenttype: "application/json; charset=utf-8", datatype: "json", success: function (data, status, jqxhr) { alert("suucess"); } }); the result same , firebug returns me cors locked , can not make demands external ... how fix ?? hi there's no need add theme header, add code below wp-content/plugins/js...

node.js - Cutoff appears in output mp3 from request.pipe function, while making request to AVS api -

i have developed nodejs-client replaces javaclient provided avs (alexa voice service) sample code. the code used makes post request, , pipes output mp3 file. many times output mp3 not complete , broken end, , beginning. eg. desired mp3 file duration 9sec, output file 8sec long or 6sec long, or complete 9sec long. its random behaviour. code used make api request , redirect o/p file below. let me know whats wrong here, new request piping. var options = { url: 'https://access-alexa-na.amazon.com/v1/avs/speechrecognizer/recognize', headers:{ 'content-type':'multipart/form-data', 'transfer-encoding':'chunked' }, formdata: formdata }; var destination = fs.createwritestream(path.join(__dirname,outputfile)); //request.debug = 1; request.post(options, function optionalcallback(err, httpresponse, body) { //console.log(httpresponse); if(body.length < 100){ console.log(body); } console.log("\n\r----processing done (...

java - NullPointerException occured while using Binder.transact()? -

this question has answer here: what nullpointerexception, , how fix it? 12 answers here mainactivty discard method pasted here makes code shorter u guys public class mainactivity extends activity { private button btn1,btn2; private binder binder; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); btn1 = (button)findviewbyid(r.id.btn1); btn2 = (button)findviewbyid(r.id.btn2); btn1.setonclicklistener(new onclicklistener() { @override public void onclick(view v) { // todo auto-generated method stub intent intent = new intent(); intent.setclass(mainactivity.this, secondservice.class); bindservice(intent, connection, bind_auto_create); } }); btn2.setonclicklistener(new onclickliste...

c++ - System() function, and calling internet explorer from it, DevC++ -

i tried making program that'd take website info, feed system() start website. i'm aware characters (\, ",') don't fed output directly, used escape sequences. i wrote program, command prompt refuses go past c:\ path. if copy paste command displayed program, internet explorer gets launched. case isn't program. can tell me error? here code: #include<iostream> #include<cstdlib> using namespace std; int main() { cout<<"please enter website wish visit: "; string website,web; cin>>web; web= " " + web; website = "\"%programfiles%\\internet explorer\\iexplore\""+web; cout<<"\n"<<website<<endl<<endl<<endl; system(website.c_str()); return 0; } pass in double double quotes : website = "\"\"%programfiles%\\internet explorer\\iexplore\"\""+web; the system("something") call r...

java - Upload file via rest service -

i want upload files restservice. found in web, still can't fix problem. maybe because i'am using spring in rest service?! here code: html <input type="button" value="upload document" id="button"> <input id="filetoupload" type="file"> jquery jquery("document").ready(function () { $("#button").on("click", function () { var fileinput= $('input[name="fileinput"]')[0].files[0]; var data = new formdata(); data.append('file', fileinput); $.ajax({ url: '.../upload', type: 'post', data: data, cache: false, contenttype: false, processdata: false, success: function(data){ alert("successfully."); }, error: function(data){ alert("failed."); ...

Remotely Debugging Opera for Android -

i attempting remotely debug opera android. have installed android sdk, have remote debugging checked on phone, chrome on pc, android 4.3, , have been able remotely debug in chrome , firefox. following instructions remotely debugging opera android , says: connect desktop device start opera android, , enable debugging entering opera:debug in address bar , checking “enable” checkbox in resulting page, seen below. when type address, don't resulting checkbox message "this webpage not available webpage @ chrome://debug/ might temporarily down ...etc..." , address bar shows: opera://debug/ i've got latest version of opera (35). ideas?

ios - how to bypass the local connection in swift -

i want test local web service call check data server. don't know make connection local host in swift here provide sample code practiced override func viewdidload() { let request = nsmutableurlrequest(url: nsurl(string: "http://localhost:9000/api/v1/entitylist")!) var theconnection: nsurlconnection = nsurlconnection(request: request, delegate: self, startimmediately: true)! } func connection(connection: nsurlconnection, canauthenticateagainstprotectionspace protectionspace: nsurlprotectionspace) -> bool { return true } func connection(connection: nsurlconnection, canauthenticateagainstprotectionspace protectionspace: nsurlprotectionspace) -> bool { return true } func connection(connection: nsurlconnection, didreceiveauthenticationchallenge challenge: nsurlauthenticationchallenge) { if (challenge.protectionspace.host == "http://localhost:9000/api/v1/entitylist") { challenge.sender!.usecredential(nsurlauthenticationchallen...

c# - How can I get all nested items from a collection? -

Image
i have collection of items. 1 item can have item, , item can have item. on. i not know how many levels of nested items can have item. level of nested items can defined @ run-time. class person { person person; public person(person _nestedperson) { person = _nestedperson; } public bool isselectedperson { get; set; } public string name { get; set; } } and how items( person ) can nested: ilist<person> list = new list<person>(); (int startindex = 0; startindex < 5; startindex++) { list.add(new person(new person(new person(new person(null) { name="bill", isselectedperson=true})) { name = "jessy", isselectedperson = false }) { name = "bond", isselectedperson =true});//3 nested persons list.add(new person(new person(null) { name = "kendell", isselectedperson = true }) { name="rosy", isselectedperson=true});//2 nested persons //the next t...