Posts

Showing posts from April, 2012

visual studio 2010 - Result is getting 0 when using Operator Overloading in C# -

hi have below program , new c#, using system; using system.collections.generic; using system.linq; using system.text; namespace unaryoperatoroverload { public class unaryoperator { private int number1; private int number2; private int result; public unaryoperator() { } public unaryoperator(int number1, int number2) { number1 = number1; number2 = number2; } public static unaryoperator operator +(unaryoperator opr) { unaryoperator obj = new unaryoperator(); obj.result = obj.number1 + obj.number2; return obj; } public void showdata() { console.writeline("the sum of 2 numbers : " + result); } } public class program { static void main(string[] args) { unaryoperator opr = new unaryoperator(20, 30); opr.showdata(); console.readline(

objective c - UnwindToList from IOS Tutorial does not activate -

i have followed "start developing ios apps today" tutorial. the application has built expected. following block has not worked. o link buttons unwindtolist: action 1) in project navigator, select main.storyboard. 2) on canvas, control-drag cancel button exit item in add-to-do-item scene dock.if don’t see exit item in scene dock instead see description of scene, click zoom in image: ../art/zoom_in_2x.png button on canvas until see it.a menu appears in location drag ended. 3) choose unwindtolist: shortcut menu.this action added xyztodolistviewcontroller.m file. means when cancel button tapped, segue unwind , method called. 4) on canvas, control-drag done button exit item in thexyzaddtodoitemviewcontroller scene dock. 5)choose unwindtolist: shortcut menu. all other directions on tutorials have worked. build compiles without error. when app runs in simulator user clicks done or cancel, focus not move todolist scene. stays on add item screen. any ideas on ha

Google+ sign in, PHP one-time-code/server-side flow without "Silex/twig" -

Image
example code google+ sign-in server-side apps // create state token prevent request forgery. // store in session later validation. $state = md5(rand()); $app['session']->set('state', $state); // set client id, token state, , application name in html while // serving it. return $app['twig']->render('index.html', array( 'client_id' => client_id, 'state' => $state, 'application_name' => application_name )); question: how server-side work without silex/twig ? i use client library(php) please test codes works fine index.php <?php session_start(); $data['state'] = md5(uniqid(rand(), true)); $_session['state'] = $data['state']; ?> <html itemscope itemtype="http://schema.org/article"> <head> <!-- begin pre-requisites --> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js">

ios - Apple Mach O Linker Error -

hope guys know how fix one. need add framework link binary can't find 1 add. ld /users/chrismac/library/developer/xcode/deriveddata/sum-cyzxwtuyfesisgfvermcafpbmtgv/build/products/debug-iphonesimulator/sum.app/sum normal i386 cd /users/chrismac/documents/sum export iphoneos_deployment_target=7.1 export path="/applications/xcode.app/contents/developer/platforms/iphonesimulator.platform/developer/usr/bin:/applications/xcode.app/contents/developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" /applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /applications/xcode.app/contents/developer/platforms/iphonesimulator.platform/developer/sdks/iphonesimulator7.1.sdk -l/users/chrismac/library/developer/xcode/deriveddata/sum-cyzxwtuyfesisgfvermcafpbmtgv/build/products/debug-iphonesimulator -f/users/chrismac/library/developer/xcode/deriveddata/sum-cyzxwtuyfesisgfverm

qt - How does QTcpSocket write data to client? -

Image
i wanna make simple qt app can perform task image below: i have learnt fortune server examples , want app combination of fortune server , fortune client. dialog.cpp void dialog::on_btnlisten_clicked(bool checked) { if(checked) { listener = new serversock(this); if(!listener->listen(qhostaddress::localhost,ui->boxport->value())) { qmessagebox::critical(this,tr("error"),tr("cannot listen: %1").arg(listener->errorstring())); ui->btnlisten->setchecked(false); return; } else { qdebug() << "server listening port" << listener->serverport(); ui->btnlisten->settext(tr("listening")); this->setwindowtitle(tr("listening , running")); } } else { listener->close(); listener->deletelater(); ui->tmblisten->settext(t

c# - StackOverflowException in GetChildRows -

datarow[] arr; arr = (datasset.tables["director"].rows[1]).getchildrows("fk_filmdir"); visual studio throws stackoverflowexception second row , don't why,it should return 2-3 datarows. what's wrong code? le: public void showchildren() { int id = listboxparent.selectedindex; list_film = new list<string>(); datarow[] arr; arr = (ds.tables["director"].rows[id]).getchildrows("fk_filmdir"); foreach (datarow r in arr) { string s = ""; s = r[0] + " " + r[1]+ " " +r[3]; list_film.add(s); } listboxchildren.datasource = list_film; listboxchildren.refresh(); daf.update(ds, "film"); ds.acceptchanges(); } this function , exception occurs @ refresh()

.net - c# references a uses b that inherits from c -

i have classes a,b,c this: //class in console application has reference class library has class b public class { public void usebobject() { b binstance=new b(); // error c defined in assembly not referenced must add reference contains c... } } //class library reference library contains c class public class b : c { public string name{get;set;} } my question if b has reference c , has reference b why need have reference c? not make sense no? assume class c defined below, defines property called propertyinc public class c { public string propertyinc {get;set;} } then when use c's public members through b's instance this. public void usebobject() { b binstance=new b(); binstance.propertyinc = "whatever"; } how come compiler know propertyinc ? did gave clue type is? or how compiler chance know whether such property exist ? well, argue compiler can find using assembly reference of asselblyb(assembly b lives)

What is the most efficient way to sort hashes in ruby? -

i trying sort 20 hashes in ruby based on 1 of attributes of array. want return top 3 hash keys , don't want have compare each one. here example below of similar trying sort. want sort based on powerrank. ["green", {:price=>24.88, :numreviews=>822, :avgstarsrank=>41.0, :reviewsrank=>28, :powerrank=>73.976}] ["steve", {:price=>14.96, :numreviews=>3, :avgstarsrank=>40.0, :reviewsrank=>0, :powerrank=>42.992000000000004}] ["joey", {:price=>40.27, :numreviews=>814, :avgstarsrank=>44.0, :reviewsrank=>28, :powerrank=>80.054}] ["board", {:price=>14.96, :numreviews=>3, :avgstarsrank=>40.0, :reviewsrank=>0, :powerrank=>47}] ["john", {:price=>40.27, :numreviews=>814, :avgstarsrank=>44.0, :reviewsrank=>28, :powerrank=>16}] for this, want array ["joey", "green", "board"]. suggestions on how tackle issue? edit: here examp

php - How to build sitemap with session parameters -

i want build sitemap site have problem on how write url in every url in site add number (auto incremental number). for example site: www.example.com when user enter site id, a: www.example.com/?i=1 , when enter inner page same parameter, such as: www.example.com/result/?i=1 but when other user enter site i=2, , etc ... how can build sitemap ? thank you for urls have parameters, can use preservedrouteparameters force value parameters match. allows use querystring , route parameters in urls don't pertain page. <mvcsitemapnode title="some page" controller="home" action="about" preservedrouteparameters="id"/> this make node match each of following urls. http://www.example.com/home/about http://www.example.com/home/about/?id=1 http://www.example.com/home/about/?id=12345 do note typically desirable in cases "id" has nothing identifying page. page (or record) identifiers, should create node every &q

networking - What is "Jargon" on Port 148? -

anyone know "jargon" protocol/service/whatever-it-is? have googled looking @ dozens of websites, emailed iana contact (no response), etc. jargon listed port 148 ... cronus-support sometimes. imho, jargon example internet protocol unfinished bill weinman's book "writing internet services in perl"

Replace fragments in Android -

i can't replace fragments using codes below. mean second fragment appeared under first fragment. first fragmnent didn't hide expected. wrong here? lot! my activity : public class mainactivity extends activity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); final fragmentmanager fm = this.getfragmentmanager(); final fragment fragmenttwo = new fragmenttwo(); button fmchangebutton = (button) this.findviewbyid(r.id.fmchangebutton); fmchangebutton.setonclicklistener(new onclicklistener(){ @override public void onclick(view v) { fragmenttransaction ft = fm.begintransaction(); ft.replace(r.id.fragment1, fragmenttwo); ft.commit(); } }); }; }; activity_main.xml <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_par

stream - Send logs to web page with node.js -

i have issue while trying send logs of app front. i want send logs of specific docker container web page. can attach console works can't manage send stream simple webpage displays happening container. how can ? i tried use socket.io circular json error, , can front end [object object] , nothing else. here function use attach container : docker.containers.attach(containerid, {logs: true, stream: true, stdout: true, stderr: false, tty: false}, function(err, stream){ stream.pipe(process.stdout); //this shows happens inside container. want send output web page }) a friend wrote https://github.com/soulou/node-docker-stream post here other people can @ awesome repo.

python - Moving scraped data using BeautifulSoup to csv -

it seems critical able move data you've scraped using beautifulsoup csv file. i'm close succeeding somehow each column in csv file 1 letter scraped info, , it's moving last item scrape. here's code: import urllib2 import csv bs4 import beautifulsoup url = "http://www.chicagoreader.com/chicago/bestof?category=4053660&year=2013" page = urllib2.urlopen(url) soup_package = beautifulsoup(page) page.close() #find in div class="bestofitem). works. all_categories = soup_package.findall("div",class_="bestofitem") print(winner_category) #print out winner categories see if working #grab text in tag: match_categories in all_categories: winner_category = match_categories.a.string #move csv file: f = file("file.csv", 'a') csv_writer = csv.writer(f) csv_writer.writerow(winner_category) print("check dropbox file") the problem writerow() expects iterable. in case receives string , splits individu

python - pass keyword to mark end room -

i have noticed people used mark end of rooms pass keyworkd as def f(): in range(10): do_something(i) pass pass i don't understand why. there advantages? i know pass keyword nothing , equivalent of { } in other languages. question more related convection. example maybe people have marking end of long room. do think python's indention sensitive grammar harmful? if answer "no" , using pass mark end nothing clutter cleanness brought in python's indention sensitive grammar. if answer "yes" , using pass mark end workaround ambiguity brought in python's indention sensitive grammar. in python, there no {} , end , semantic white spaces. for example, consider following ruby code: def f in 0...10 = * 2 print(i) end end and equivalent python code: def f(): in range(10): = * 2 print(i) with 1 wrong keystroke ( tab ): def f(): in range(10):

tomcat - Getting a 404 There is no Action mapped for namespace error -

Image
i'm working struts2 web application. running fine. actions getting mapped , application correctly redirects pages. however, when same particular module (related file upload), fails! don't understand what's wrong, i've tried various combos of "/" , , still can't page re-direct. doing wrong? my struts.xml : <?xml version="1.0" encoding="utf-8" ?> <!-- <!doctype struts public "-//apache software foundation//dtd struts configuration 2.0//en" "http://struts.apache.org/dtds/struts-2.0.dtd"> --> <!doctype struts public "-//apache software foundation//dtd struts configuration 2.1//en" "http://struts.apache.org/dtds/struts-2.1.dtd"> <struts> <constant name="struts.enable.dynamicmethodinvocation" value="false" /> <constant name="struts.devmode" value="false" /> <consta

I am trying to solve the error message 'incompatible ranks 0 and 1 in assignment' in a fortran 95 program. -

i writing program in fortran find velocity of parachuting person in relation time. keep getting error can't fix. new programming , appreciated. the error is v(i+1)=v(i)+[32-((c*v(i)*v(i))/m)]*(h) 1 error: incompatible ranks 0 , 1 in assignment @ (1) and program is program para integer :: real :: v(11) !velocity real :: q !initial velocity real :: h !time step real :: c !drag coefficient real :: m !mass ! gravity equal 32 ft/s^2 write (*,*)'enter time step' read(*,*)h write(*,*)'enter initial velocity' read(*,*)q write(*,*)'enter drag coefficient' read(*,*)c write(*,*)'enter mass' read(*,*)m i=1,10 ! 1 10, 1 being interval. end v(i+1)=v(i)+[32-((c*v(i)*v(i))/m)]*(h) q=v(1) end program you cannot use [] normal parenthesis in expressions. array constructor, [ items ] means array items elements. end do should after line.

python - Unexpected behaviour in gui -

for 2 days suffering strange error, can not understand problem asking help. have unique feature. def find_config(self, path): dic = list(path.split('/')) print dic size = len(dic) print '/'.join(dic) when run within class constructor, works fine, when run inside event handler button, hangs on join function. constructor: class mainwindow(qtgui.qmainwindow, ui_mainwindow): def __init__(self): qmainwindow.__init__(self) self.setupui(self) self.filepath = "" self.action_open.activated.connect(self.file_open_func) print self.find_config('/home/juster/asdfa/main.c') the handler button: def file_open_func(self, path = 0): try: self.filepath = 0; if not path: self.filepath = qfiledialog.getopenfilename(self, 'open file', self.rootpath, "c/c++ (*.c);; (*.*);; makefile (makefile)") else:

c# - Printing T.Values from Sorted Dictionary -

Image
im trying print values sorted list, dont come want. the problem here t.value new class created. public sorteddictionary<string, node> nodemap = new sorteddictionary<string, node>(); (...) foreach (node n in nodemap.values) { console.writeline(n); } here output: you should override tostring() method in node class expect @ output.

c# - Get Distinct values out of List<Object> -

i have list contains instances of beam class. each of these beam objects has elevation property. list<beam> beams = new list<beam> {beam1, beam2, ...}; public class beam { public double elevation; } now want create list<double> contains distinct elevations. example how write method accepts beams list below var beam1 = new beam { elevation = 320); var beam2 = new beam { elevation = 320); var beam3 = new beam { elevation = 640); var beam4 = new beam { elevation = 0); list<beam> beams = new list<beam> {beam1, beam2, beam3, beam4}; and gives removing duplicate elevations: listofelevations = {0, 320,640} 1) make beam implement icomparable: public class beam : icomparable { public double elevation; //consider changing property, btw. public int compareto(object obj) { if (obj == null) return 1; beam otherbeam = obj beam; return this.elevation.compareto(otherbeam.elevation); } } 2) use

android - Saving Map Marker Reference -

i wondering if me, trying save reference newly created marker in concurrenthashmap, seem have no problem storing reference when try retrieve app crashes , throws nullpointer exception, below how store , retrieve marker. storing in mmarkers private map<latlng, marker> mmarkers = new concurrenthashmap<latlng, marker>(); latlng currpos = new latlng(map.getcameraposition().target.latitude,map.getcameraposition().target.longitude); marker marker = map.addmarker(new markeroptions() .position(currpos) ); mmarkers.put(currpos, marker); locationcount++; sharedpreferences.editor editor = settings.edit(); editor.putstring("mlat"+ integer.tostring((locationcount-1)), double.tostring(marker.getposition().latitude)); editor.putstring("mlng"+ integer.tostring((locationcount-1)), double.tostring(marker.getposition().longitude)); editor.putint("locationcount", locationcount)

android - scroll view shows the button part of the page first -

i created activity using scroll layout. when activity start, see buttom part of page, need scroll see top. know how solve problem? (to see top part of page first when activity start?) tried search web scroll view, didn't find details specific problem. thanks lot! if scrollview root of view, may happen because view inside scrollview gaining focus. try add attribute android:focusableintouchmode="true" view located @ top of scrollview , tell if worked ;)!

c - fscanf writes output in index of variable -

i trying write c program monitor temperatures of processor. test program read integers file using fscanf. surprise not work under conditions. using following code: #include <stdio.h> #define corecount 3 int main() { int c=0; int core[corecount]={0}; file *cmd[corecount]; (c=0; c<=corecount; c++) //read input , store in 'core' { cmd[c]=fopen("testinput", "r"); printf("c=%d\n", c); fscanf(cmd[c], "%d", &core[c]); printf("core[c]=%d, z=%d\n", core[c], c); fclose(cmd[c]); } (c=0; c<=corecount; c++) //print input { printf("core%d: %d ", c, core[c]); } printf("\n"); } it compiles without error. works expected until third (and last) call of fscanf: 'c' gets value 42 (which 'core' should actually): c=0 core[z]=42, z=0 c=1 core[z]=42, z=1 c=2 core[z]=42, z=2 c=3 core[z]=1, z=42 segment

c# - PhotoCatureDevice.SetCaptureResolutionAsync crashing on Lumia 1020 while working 820 -

there 3 lines of code work fine on 820, crash on lumia 1020: var captureresolutions = photocapturedevice.getavailablecaptureresolutions(camerasensorlocation.back); var captureresolution = captureresolutions.first(); await _cameraeffect.photocapturedevice.setcaptureresolutionasync(captureresolution); as can see, first avilable resolutions, select first 1 (which is, @ least using debugger, hightest possible resoltion exposed on photocapturedevice default, both on 820 , 1020, , set capture resoltion. as said, works fine on 820, on 1020, crashes without error message - though, of course, have attatched debugger! doesn't trigger breakpoints after line. when leave out last line , capture without changing reolution, works fine, has 640x480 resolution (and that's of, course, far low)

c++ - Efficient Multinomial result -

i've got multinomial class private: unsigned int power; double *factors; i'd know if there more efficient way calculate multinomial's result given argument? my current code is: double multinomial::calculatefor(double x) const{ double sum = this->factors[0]; double prod = 1; for(size_t = 1; <= this->power; i++){ prod *= x; if(this->factors[i]){ sum += this->factors[i] * prod; } } return sum; } i see 2 ways speed computation up. conditional branches can slow computations on modern pipelined processors, may avoiding conditional speed things up. see why processing sorted array faster unsorted array? of explanation. using horner's method saves on number of multiplications. put together, these lead to: double multinomial::calculatefor(double x) const { double sum = this->factors[this->power]; (size_t = this->power; > 0; ) sum = this->factors[

php - $(Id).submit() on javascript -

i have problem following code: here's javascript $(document).ready(function(){ $("#visualisercarte").submit(function(){ $.post("store.php",{longitudes:longitudes,latitudes:latitudes}); alert('ok'); var mapoptions = { zoom: 13, // center map on chicago, usa. center: new google.maps.latlng(tableaupoints[0].lat(),tableaupoints[0].lng()) }; map = new google.maps.map(document.getelementbyid('map-canvas'), mapoptions); var flightpath = new google.maps.polyline({ path: tableaupoints, geodesic: true, strokecolor: '#ff0000', strokeopacity: 1.0, strokeweight: 2 }); flightpath.setmap(map); }); }); and here php <script src="google_map.js"></script> <?php $displayform= true; if (isset($_post['vue'])){ $displayform= false; }

c++ - Is there any way to use cout for debugging while running an ncurses program in another window? -

i'm playing around simple ncurses program move sprites around screen. of backend logic in c++. apparently xcode won't ncurses @ all, need other way debug program. don't know c or unix - there way have program spawn terminal window, run alongside window ncurses running? i'd able use cout in window monitor state of program. use gdb , "attach" command attach running process.

Dijkstra's algorithm in python -

i trying implement dijkstra's algorithm in python using arrays. implementation. def extract(q, w): m=0 minimum=w[0] in range(len(w)): if w[i]<minimum: minimum=w[i] m=i return m, q[m] def dijkstra(g, s, t='b'): q=[s] p={s:none} w=[0] d={} in g: d[i]=float('inf') q.append(i) w.append(d[i]) d[s]=0 s=[] n=len(q) while q: u=extract(q,w)[1] s.append(u) #w.remove(extract(q, d, w)[0]) q.remove(u) v in g[u]: if d[v]>=d[u]+g[u][v]: d[v]=d[u]+g[u][v] p[v]=u return d, p b='b' a='a' d='d' g='g' e='e' c='c' f='f' g={b:{a:5, d:1, g:2}, a:{b:5, d:3,

Wifi socket communication with android phone -

i ask, how this wireless socket communicates android phone? i trying buy wireless socket, control through own code. these wireless socket has app developed them. possible source code or know how communicate wireless socket , control? as mentioned, use wireshark (or shark root if have android device rooted). socket looks similar 1 aldi australia selling (under brand name bauhn, it's orvibo socket, rebranded). if same, check out sample node.js code i've posted on over github (this code controls orvibo allone, controls orvibo s10 / s20 sockets too) the short of is: the socket communicates via udp on port 10000 you need know mac address of socket you send discovery packet socket replies you 'subscribe' socket in order control it when send on / off packets socket, replies in turn it's current state edit: there's further breakdown of protocol here: http://pastebin.com/0w8n7ajd . credit goes nozza87 on ninja blocks forum 2016 edit: co

ios - Core Data Crashing When Pushing to View -

Image
so first time working core data, , far hasn't been best experience. application far consists of 2 uitableview controllers , single viewcontroller. app asks user enter name of list on uialert , saves core data, , name of list put first tableview. far good. user clicks on name of list , pushes them contents on list, empty because hasn't been populated yet. problem when go populate app crashes. don't the viewcontroller. i'm lost i'll put necessary code here if there's more let me know. thanks! error argv char ** 0xbfffeda8 0xbfffeda8 data model: the .m add items list: - (nsmanagedobjectcontext *)managedobjectcontext { nsmanagedobjectcontext *context = nil; id delegate = [[uiapplication sharedapplication] delegate]; if ([delegate performselector:@selector(managedobjectcontext)]) { context = [delegate managedobjectcontext]; } return context; } - (id)initwithnibname:(nsstring *)nibnameornil bundle:(nsbundle *)nibbundleornil

file io - C - regarding the EOF function -

i trying mess around file input in c, integer values in matrix format. instance, if have file like... 4 5 7 3 6 8 5 2 5 7 3 4 9 4 8 7 i confused eof command do. know can use check end of file, if wanted test end of row? if wanted print diagonal right left ( 3,5,7,9 ). know have go row row, set counter counts @ each iteration find length of rows, print out last value of row, deduct pointer 1 , go onto next row. how can this? in, eof file whole, or there c command can more directly define row lengths , such. a typical c program reads multiple lines this: char line[max_line_size]; while (fgets(line, sizeof(line), inputfile) != null) { /* line */ } the part says "do line" should something. 1 thing in case parse line, , 1 of numbers in it. 1 depend on line number (which have keep track of self), first number first line, second number second line, etc. when have numbers (i.e. when loop ends) want data. after loop ends, can use feof or ferror see if ende

c# - ASPX-Handler calls full website lifecycle again -

my aspx website has css files , js files linked ashx files. example got <script type="application/javascript" src="/javascript.ashx"></script> in markup. when debug website in chrome (newest version without add-ons) calls entire life cycle again. for test purposes cleared processrequest method of handlers , accessed directly. ( http://localhost:1234/javascript.aspx ). after handler finished processrequest method jumps default() constructor of default.aspx (after continues run through whole life cycle obviously). think after request chrome did access ( http://localhost:1234/ ) in background unknown reason , called life cycle of default.aspx seperately ispostback = false , iscallback = false . the weird thing in internet explorer 11 not face problem. how can be? problem of chrome only? appear when using live version? there work around? ok found out caused by: web.config contained <customerrors mode="on" redirectmo

Why does the C# compiler go mad on this nested LINQ query? -

Image
try compile following code , you'll find compiler takes >3 gb of ram (all free memory on machine) , long time compile (actually io exception after 10 minutes). using system; using system.linq; public class test { public static void main() { enumerable.range(0, 1).sum(a => enumerable.range(0, 1).sum(b => enumerable.range(0, 1).sum(c => enumerable.range(0, 1).sum(d => enumerable.range(0, 1).sum(e => enumerable.range(0, 1).sum(f => enumerable.range(0, 1).count(g => true))))))); } } can explain curious behavior? cs version: microsoft (r) visual c# compiler version 4.0.30319.17929 os name: microsoft windows 7 ultimate os version: 6.1.7601 service pack 1 build 7601 i believe it's related type inference and/or lambda generation (when type inference has go in opposite direction normal), combined overload resolution. unfortunately, supplying type parameters do

c# - How to dynamically add lables for every name in MYSQL database? -

i have mysql database , trying first name , last name of every student put in database , dynamically show them label in wpf form, here got far string connstr = "server=localhost; database=login; uid=root; pwd=password"; mysqlconnection connc = new mysqlconnection(connstr); mysqlcommand command; connc.open(); // label[] labels = new label[n]; try { command = connc.createcommand(); command.commandtext = "select first_name, last_name students"; command.executereader(); messagebox.show("s"); } catch (exception ex) { messagebox.show("something went wrong: " + ex.tostring()); } { connc.close(); } so how add entry's in database label? executenonquery method executes query. can't values it. you need use executereader @ least values. can read column values in while statement mysqldatareader.read() method. method reads query row row . also use using statement dispose mysqlconnection , mysql

objective c - NSArrayController automatically selects all new items on `add:` action -

Image
i have nsarraycontroller bound nstableview . table view has standard + / - buttons. when press + button triggers add: action of nsarraycontroller new item in list automatically selected, prevents user editing text in nstextfield inside of cell. in ib selection property of table view multiple not checked multiple-selection shouldn’t possible , not possible “by hand”. i had change highlight none work around problem no longer able delete individual columns, kind of fine in case, wondering how solved, ideally without implementing delegate (i prefer hook stuff bindings such standard case). if understand correctly, every time add item nsarraycontroller, gets selected in nstableview . have selected preserveselection , deselected avoidemptyselection of nsarraycontroller? have uncheck "selectinsertedobjects".

sql - ORACLE Managing Locked Accounts -

ok i'm doing course in oracle , got question part of project. know system table can query following information. the utility should able identify each locked account locked because of invalid login attempts. utility should further unlock accounts have been locked more week. i know dba_users shows locked accounts show why account locked. can't use identify if there locked case of invalid login attempts. also know how unlock them. have @ column: account_status (in dba_users). surprisingly - information of reason lock there... http://docs.oracle.com/cd/e11882_01/server.112/e40402/statviews_5081.htm#refrn23302

Password authentication fails when trying to connect to postgresql from clojure with jdbc -

i'm learning web development in clojure , i'm not @ expert in either postgresql or jdbc. i'm going through "web development clojure" book , i'm stuck because cannot connect postgresql database, although believe have followed tutorial step step. i connected psql with sudo -u postgres psql then created admin user password 'admin' postgres=# create user admin password 'admin'; create role then created database named reporting : postgres=# create database reporting owner admin; create database no complaints far. then clojure code, attempt connect database , create table : (ns reporting-example.models.db (:require [clojure.java.jdbc :as sql])) ;defining db connection (def db {:subprotocol "postgresql" :subname "//localhost/reporting" :user "admin" :password "admin"}) ;function creating 'employee' table (defn create-employee-table [] (sql/create-table :employee

search in json and give the result as json for likely string values in php -

i have set json data. in have return json key , value pair in php. used json follows [{ "id": "1995", "name": "banahatti" }, { "id": "5074", "name": "kolhapur(maharashtra)" }, { "id": "2356", "name": "bmbur" }, { "id": "906", "name": "ammla" }, { "id": "536", "name": "puttur" }, { "id": "1308", "name": "poogolam" }, { "id": "1217", "name": "sarangpur" }, { "id": "826", "name": "hiriyur" }, { "id": "24911", "name": "himmatnagar" }, { "id": "3993", "name": "podili" }] in json values , have search , json ,if give name value starting b means have re

c# - Memory consumption on Windows Phone 8 is 3 times what is on Windows Phone 7 -

i'm developing app runs on both wp7 , wp8. after finished started running performance analysis improve app overall performance. the app written wp7, have projects run on wp8 add features in-app-purchase, lockscreen , on. when ran memory analysis on wp7, app averaged 50mb of ram throughout execution, acceptable value, weird thing when ran same xap on wp8 device app uses on average 150mb of ram. i searched around web , found nothing related issue. i used lumia 800 , lumia 510 make analysis on wp7., , use lumia 520, 820 , 925 make analysis on wp8 devices. i'm using visual studio 2012. i considered bug on vs2012, app crashes on lumia 520 (with out of memory, after while) never crashes on lumia 800 or 510. the app heavy on images, of them exact size used on phone (never more 50 100x100 jpg pictures displayed in app @ same time). any suggestions , solutions welcome. edit: memory differences i'm talking running home view, performance analysis test simply, lau

php - how to open in new tab the pdf in virtuemart product? -

i have pdf every product in virtuemart , open pdf in new tab. in virtuemart in configuration/shopfront checked box show pdf view icon. now have found line in html firebug tool the a href tag have change can't find in joomla files add target="_blank" atribute. you need file components/com_virtuemart/views/productdetails/tmpl/default.php it better copy file , paste templates/your_template/html/com_virtuemart/productdetails/ , under line if (vmconfig::get('pdf_icon', 1) == '1') { write like echo '<a href="'.$link.'&format=pdf" target="_blank">pdf</a>';

Algorithm for sensor network distribution -

i need algorithm distributing sensors in given space. space might have obstacles. each sensor has reach radius (for communicating each other) , need cover entire area, considering radius. goal minimize number of sensors used , maximize area covered. anyone? thank you. you have define trade-off between area covered , number of sensors used. otherwise if have area covered except small bit, won't know whether or not add sensor cover little bit. rephrase problem covering maximal amount of area fixed given number of sensors. if have visible region polygonal region holes (obstacles), believe problem solved , need review literature. if have arbitrary defined spaces , obstacles don't know if known solution exists.

Can't get JavaScript SSN Form Validation to work -

i new js , trying when enters ssn number in field, gives them alert telling them not put ssn number in there. html: <form name="card" action="#"> <input type="text" name="field" class="name social" size="60" placeholder="first , last name"> <input type="text" name="field" class="phone social" size="60" placeholder="phone number"> <input type="text" name="field" class="email social" size="60" placeholder="email(name@example.com)"> <select class="select"> <option value="my card has not yet arrived">my card has not yet arrived <option value="direct deposit">direct deposit <option value="suggest card">suggest card <option value="issues card.com">issues card.com

java - Need help wiith Activity view and Admob -

can give me idea on this @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); mdosave = true; // force landscape , no title room setrequestedorientation(activityinfo.screen_orientation_landscape); requestwindowfeature(window.feature_no_title); adview = new adview(this); adview.setadsize(adsize.banner); adview.setadunitid("a15341caf10045c"); adrequest adrequest = new adrequest.builder().build(); adview.loadad(adrequest); // if user has never accepted eula show again. msettings = getsharedpreferences("solitairepreferences", 0); //setcontentview(r.layout.main); mmainview = findviewbyid(r.id.main_view); msolitaireview = (solitaireview) findviewbyid(r.id.solitaire); msolitaireview.settextview((textview) findviewbyid(r.id.text)); relativelayout layout = new relativelayout(this); relativelayout.layoutparams adparams = new relativelayout.layoutparams(relativelayout.layoutparams.wrap_content, relativelayout.layoutpara