Posts

Showing posts from February, 2011

asp.net - WCF Services - splitting code into multiple classes -

asp.net - WCF Services - splitting code into multiple classes - i'm looking @ developing wcf service first time, bit confused. say i've got windows application going phone call web service, service going phone call our info methods retrieve , save data. now, illustration have 2 classes in our solution, client , product. methods within service have go same class file (e.g. myservice.svc), or can split several classes replicating main info layer, i.e. customer.cs , product.cs. if can split, how these called within windows forms application? each class different end point? at moment can access methods within main class (e.g. myservice.svc), can't see of methods in other classes, though have attributed them "servicecontract" , "operationcontract". i have feeling i'm missing simple somewhere, not sure what. i grateful if nice person point me in direction of tutorial on doing this, every tutorial i've found includes single class ...

How can I assign a "don't care" value to an output in a combinational module in Verilog -

How can I assign a "don't care" value to an output in a combinational module in Verilog - imagine want describe combinational circuit satisfy next truth table: a b | s0 s1 s2 s3 ----------------- 0 0 | 1 d d d 0 1 | 0 1 d d 1 0 | 0 0 1 d 1 1 | 0 0 0 1 (where d stands "don't care" value, is, don't care if value of output 0 or 1) if go through traditional design, can take advantage of these "don't cares" , assign them convenient values resulting equations (and hence, circuit) simple ones. example, alter previous truth table one: a b | s0 s1 s2 s3 ----------------- 0 0 | 1 1 1 1 0 1 | 0 1 0 1 1 0 | 0 0 1 1 1 1 | 0 0 0 1 and final equations (using verilog notation): s0 = ~a & ~b; s1 = ~a; s2 = ~b; s3 = 1; (remember when had take values outputs in k-map grouping much cells can) but if take design using verilog? cannot this: module encoder ( input wire a, input wire b, ...

javascript - Save serialport list with meteor -

javascript - Save serialport list with meteor - i utilize serialport bundle in app (https://github.com/voodootikigod/node-serialport). code working fine on server : meteor.startup(function () { serialport = meteor.npmrequire('serialport'); }); meteor.methods({ serialportsrefresh: function () { serialport.list(function (err, ports) { ports.foreach(function(port) { console.log(port.comname); }); // config.insert(ports); homecoming ports; }); } }); now want save list in collection expose client. best solution ? when uncomment config.insert(ports); i've error : throw new error("meteor code must run within fiber. " + thanks in advance ! thanks eliezer ! here code (not easy me !) : meteor.startup(function () { serialport = meteor.npmrequire('serialport'); listserialports = function(callback) { serialport.list(function (err, ports) { callback(null, ports); }); ...

python - How can I catch a pandas DataError? -

python - How can I catch a pandas DataError? - i have since fixed bug caused dataerror, can not life of me figure out how grab explicitly: try: df["my column"] = df.baddata + df.morebaddata except dataerror: print "caught error!" gives: nameerror: name 'dataerror' not defined then tried pd.core.frame.dataerror , received attributeerror . tried googling not find list of pandas error types. right path dataerror ? python pandas error-handling

How to disable past dates for date range in Eonasdan bootstrap datetimepicker? -

How to disable past dates for date range in Eonasdan bootstrap datetimepicker? - i have disable past dates in eonasdan bootstrap datetimepicker v4, code : $('input#startdate,input#enddate').datetimepicker({ format: 'dd/mm/yyyy hh:mm:ss', startdate: new date() }); $('#datetimepicker').datetimepicker({ mindate:new date() }); twitter-bootstrap-3 datetimepicker

measurement protocol - Tracking personal user identifiable information via Google Analytics -

measurement protocol - Tracking personal user identifiable information via Google Analytics - i'm wondering if possible receive user specific info (frontend or backend) google analytics . for example: user arrives on our site , can read google analytics, hey person xx years , has these interests. i've read blogs google analytics , cookies , should possible extract unique user id (not given google analytics). maybe that's identification start. is possible , if, how? kind regards! what referring demographic , involvement reports. info comes google way of doubleclick cookie. what double click cookie? doubleclick uses cookies improve advertising. mutual applications target advertising based on what’s relevant user, improve reporting on campaign performance, , avoid showing ads user has seen. user id in google analytics: user id enables analysis of groups of sessions, across devices, using unique, persistent, , non-personally identifiable id ...

objective c - Web socket server with IOS client compatibitlty -

objective c - Web socket server with IOS client compatibitlty - i trying develop ios app have socket connection server. client side planning utilize socketrocket library , trying code socket server preferably in nodejs. can advice me socket server library should choose. thanks there obj c library socket.io v0.9.x; (which uses socketrocket also) https://github.com/pkyeck/socket.io-objc check out working example; https://github.com/saturngod/socket.io-with-ios edit: swift client added socket.io guys; http://socket.io/blog/socket-io-on-ios/ works socket.io v1. ios objective-c node.js sockets websocket

java - Selenium Hub Pause Data Stream -

java - Selenium Hub Pause Data Stream - i'm looking way pause info stream of selenium hub. thought wait till hub has finished processing test/batch, set on hold, send kill command node, on headless vm restart, upon reconnect allow info stream continue. thought allow nodes/vm's restart , refresh, potentially avoiding hangups , connection timeouts. thoughts? instead of pausing info stream, can create java class implements testsessionlistener. interface has methods can tell when test starting , ending. can write custom code restart machines after each test or based on other logic. you can refer selenium grid extras project uses this. much more simple illustration on creating grid plugin refer grid plugin tutorial java selenium selenium-grid

DB2 error in stored procedure when using "scroll" cursor -

DB2 error in stored procedure when using "scroll" cursor - i want utilize scroll cursor in db2 stored procedure, absolute position. after declare srcoll cursor declare cursor1 scroll cursor homecoming .... the deploy homecoming errors an unexpected token "scroll" found next "". expected tokens may include: "for".. sqlcode=-104, sqlstate=42601, driver=3.68.61. the procedure simple btw, can assume has cursor declaration , return. i googled lot, still couldn't figure out why, kind of rookie question, please help show pointers, 1000000 thanks! stored-procedures scroll cursor db2

xamarin - Galaxy s2hd Camera Call to showStatusIcon on inactive InputConnection -

xamarin - Galaxy s2hd Camera Call to showStatusIcon on inactive InputConnection - this problem occurs galaxy s2 lineup code xamarin(c#) code,but same error in java code i phone call photographic camera follows: intent.putextra(mediastore.extraoutput, mimagecaptureuri); startactivityforresult(intent, pick_from_camera); start photographic camera intent,this error log print w/iinputconnectionwrapper(27991): showstatusicon on inactive inputconnection when homecoming after capture,activities ondestory , photographic camera app restarts are there issues in galaxy s2 built-in photographic camera app? camera xamarin

FlipSwitch jQuery mobile constructor -

FlipSwitch jQuery mobile constructor - i'm looking way build new flipswitch command within container: <div id="container"/> if run $("#container").flipswitch({ ontext:"stay", offtext:"go"}); html gets generated is: <div class="ui-flipswitch ui-shadow-inset ui-bar-inherit ui-corner-all"> <a class="ui-flipswitch-on ui-btn ui-shadow ui-btn-inherit" href="#"/> <span class="ui-flipswitch-off"/> <div class="ui-flipswitch-input" id="container" tabindex="-1"/> </div> which doesn't contain ontext/offtext labels. do need manually create input or select html element within container or there improve way this? thanks! first create input element become flipswitch, append container div, , initialize widget: var html = '<input type="checkbox" data-role="flipswitch" name="f...

java - Need to set a double value depending on which item(s) are selected from a JList -

java - Need to set a double value depending on which item(s) are selected from a JList - my code far: import java.awt.borderlayout; import java.awt.container; import javax.swing.box; import javax.swing.jframe; import javax.swing.jlabel; import javax.swing.jlist; import javax.swing.jscrollpane; import javax.swing.event.listselectionevent; import javax.swing.event.listselectionlistener; public class testfile2 { public static void main(string args[]) { string size[] = {"small", "medium", "large", "extra large"}; string toppings[] = {"cheese", "pepperoni", "sausage", "spinach", "pepperoncini"}; jframe f = new jframe("pizza"); f.setdefaultcloseoperation(jframe.exit_on_close); jlist list1 = new jlist(size); jlist list2 = new jlist(toppings); container c = f.getcontentpane(); jscrollpane sp1 = new jscrollpane(list1); ...

Read all CSS selectors using jQuery -

Read all CSS selectors using jQuery - what best way read css selectors css $("head > style:eq(0)").html(); ? it varies across browsers. jquery doesn't help here, because inspecting stylesheet info quite unusual thing want do, , older/niche browsers can't @ all. sure need inspect stylesheets? aiming do? var sheet= document.stylesheets[0]; var rules= 'cssrules' in sheet? sheet.cssrules : sheet.rules; (var i= 0; i<rules.length; i++) { var rule= rules[i]; var text= 'csstext' in rule? rule.csstext : rule.selectortext+' {'+rule.style.csstext+'}'; alert(text); } cssrules , csstext standard dom level 2 style properties, rules , selectortext ie<9 compatibility. note ie<9 homecoming recreated rules you'll see eg. padding-bottom: 0pt; padding-left: 0pt; padding-right: 0pt; padding-top: 0pt if original style specified padding: 0 . jquery

managed c++ - Using C++ class functions in C# -

managed c++ - Using C++ class functions in C# - you can utilize c++ class in c# project registering c++ dll in c# project. problem 1 of c++ class has function has 4 parameters, 2 of of type wchar_t , not available in c#. how can utilize function in c# code? c# managed-c++

java - rmi callback gotchas? -

java - rmi callback gotchas? - what need worry when doing callbacks in rmi? need simple client notification mechanism avoid excessive polling. i found online example , looks pretty straightforward, client implements interface extends remote (like server does) , passes server, can phone call methods. i'm guessing remote callback can occur on thread, have assume asynchronous client application's normal threads. else there? two things. rmi callbacks won't work through firewalls rmi callbacks execute on different thread original client phone call server. can unexpected synchronization deadlocks if don't take account. java rmi

javascript - Getting x and y position of mouse pointer relative to an element -

javascript - Getting x and y position of mouse pointer relative to an element - hi can help this? when move mouse pointer of element, retrieve x , y positions relative <div> e.g - when set mouse pointer @ top left point of div expect x of 1 , y of 1. this needs compatible net explorer thanks time. this works, problem was calling onclick event didnt give scrollleft , scrolltop values. should able position using calculations of divs top , left values. function getmousexy(ctrl) { var tempx = event.clientx + document.body.scrollleft; var tempy = event.clienty + document.body.scrolltop; document.getelementbyid('<%=txtxpos.clientid%>').value = tempx; document.getelementbyid('<%=txtxpos.clientid%>').value = tempy; } thanks except lincolnk ! ! lol you seek this function myonmousemove(element) { var e = window.event var relativex = e.screenx - element.scrollleft; var relativey = e.screeny - elem...

google oauth - OAuth2 Troubles with PicasaWeb API -

google oauth - OAuth2 Troubles with PicasaWeb API - i have spent lastly couple of nights bashing head against wall amongst see of conflicting out of date documentation , semi-helpful blog posts were/are appropriate trying do. essentially want write wee personal app download images picasaweb/google+ , store them on local hard disk. i have managed following: figured out gdata api appropriate request private album info (works fine in 'google-logged-in' chrome browser) got right private info gdata url token generated oauth playground. managed oauth2 token https://www.googleapis.com/oauth2/v3/token using jwt. however - when seek access token generate myself forbidden response message 'not authorized view access private'. i pretty stumped - guess service business relationship configured in google developers console doesn't have access personal google stuff google+ photos. when in there can see oauth playground has access. how give app access - , ne...

JavaFX ScrollBar Scene Builder -

JavaFX ScrollBar Scene Builder - so trying add together scrollbar javafx application scene builder, since started learning javafx, don't know how it. example, i'm using stackpane, , have kind of form cant wrap in predefined window size need scrollbar user can scroll through form. referenced code provided oracle: http://docs.oracle.com/javafx/2/ui_controls/scrollbarsample.java.html doesn't help. don't know if because of stackpane, because when run code snippet in hbox(as gave it) works fine. did: scrollbar.setlayoutx(700.0d); scrollbar.setmin(0); scrollbar.setorientation(orientation.vertical); scrollbar.setprefheight(600); scrollbar.setmax(1000); scrollbar.valueproperty().addlistener(new changelistener<number>() { @override public void changed(observablevalue<? extends number> ov, number old_val, number new_val) { pane.setlayouty(-new_val.doublevalue()); } }); scrollbar - fx:id scrollbar...

java - How do I open a link directly onto a web browser -

java - How do I open a link directly onto a web browser - i'm experimenting opening link straight on web browser. snippet of code has no errors. however, when run, website not pop in web browser. how prepare this? if (str1.tolowercase().contains("will pigs fly")) pigs(); public static void pigs(){ try{ string url = "https://www.youtube.com/watch?v=yqo0tfuueay"; string cmd = "cmd.exe /c start " + url; runtime.getruntime().exec(cmd); }catch(exception ex){} } java url

android - SQLite suddenly considers everything as not an error -

android - SQLite suddenly considers everything as not an error - it started on android phone, simple create statement in file within assets/migrations folder (i utilize 3rd party library called activeandroid , 2 years worked okay - did not changed that): create table if not exists auto (brand text); i exception: 04-07 15:31:36.683 15738-15738/? e/sqlitelog﹕ (21) api called null prepared statement 04-07 15:31:36.683 15738-15738/? e/sqlitelog﹕ (21) misuse @ line 63243 of [00bb9c9ce4] java.lang.runtimeexception: unable create application com.activeandroid.app.application: android.database.sqlite.sqliteexception: not error (code 0) @ android.app.activitythread.handlebindapplication(activitythread.java:4394) @ android.app.activitythread.access$1300(activitythread.java:141) @ android.app.activitythread$h.handlemessage(activitythread.java:1294) @ android.os.handler.dispatchmessage(handler.java:99) @ android.os.looper.loop(lo...

cloud9 ide - cloud 9 creating 2 workspaces when I try to create 1 -

cloud9 ide - cloud 9 creating 2 workspaces when I try to create 1 - i signed (free) c9 account; verified email address etc. i selected create new workspace , selected "ruby on rails", "private people invite" (i'm under impression 1 free private workspace?), name "tprord" (abbreviation of course of study i'm taking), , select "create" expected behavior: hoped see in left "my projects" pane, adjacent default "demo-project", new project entitled "tprord". observed behavior: there new 'open , discoverable' project entitled "tprord"; , 'greyed-out' project entitled "tprord" listed 'processing'. when "tprord" selected, expected "start editing" button replaced 1 entitled "cancel creation". i have posted question on cloud9ide.zendesk.com , have started going , forth back upwards - long lags due time zones. has else seen t...

ruby on rails - TypeError Exception: no implicit conversion of Pathname into String when i make a get query -

ruby on rails - TypeError Exception: no implicit conversion of Pathname into String when i make a get query - in controller method, doing this def update_item_category parse.init :application_id => "appid", :api_key => "appkey", :quiet => true puts parse::query.new("brands").eq("brand_id", "5").get end on ".get" getting "typeerror exception: no implicit conversion of pathname string". please help me out. ruby-on-rails ruby ruby-on-rails-4 parse.com type-conversion

Java- Error concerning Generics -

Java- Error concerning Generics - i have class & , inner class work create linked list. info held nodes, generic, , somewhere along line of code screwed involving generics don't know where. 5 errors, first 1 says "type linkedlist not take parameters" think weird because linkedlist interface i'm implementing. rest of them phrased "object cannot converted e". marked they're occurring. figured assignment right don't know what's wrong. if you'd me post interface linkedlist allow me know. public class singlylinkedlist<e> implements linkedlist<e> { private node head; private node tail; private int size; public singlylinkedlist(){ this.head = null; this.tail = null; this.size = 0; } public e get(int index) { //hold info of cur node //and maintain iterating until nail //right index int nail = 0; node pos = this.head; ...

x86 - how to count small and large letters at the same time in assembly? -

x86 - how to count small and large letters at the same time in assembly? - can help me assembly !? know how count letters, little or big one, cannot both @ once. below code counting little letters mov bx, offset buff mov cl, [bx - 1] ;size of string mov dx, 0 ;reset dx cykluss: mov al, [bx] ;reading characters inc bx ;increasing char in string cmp al,'$' ; end of line? je supp cmp al,'a' jl cykluss ; if char < 'a' go start(cykluss) cmp al,'z' jg cykluss ; if char > 'z' go start(cykluss) inc dx jmp cykluss supp: mov bx,dx charp 10 ;macro new line phone call disp ;convert dx number please help me give thanks much just copy-paste , run. to check lowercase , uppercase letters, have check if character between extreme letters : 'a' , 'z', if so, check if character greater or equal 'a', if so, it's lowercase lett...

vba - how can I create a word document with excel code and avoid error notification? -

vba - how can I create a word document with excel code and avoid error notification? - i have next excel vba code create word document template. templatesfolder = replace(thisworkbook.fullname, thisworkbook.name, "") dim wa object, wd object set wa = createobject("word.application") filename = templatesfolder & "templates\" & "temp.docx" set wd = wa.documents.add(filename) i error filename not found until open docx file manually , press allow edit notification. after actions code work well. this happens on new computers running first time excel file. filename homecoming path , file exist!!! how can prevent error? excel vba excel-vba ms-word

filtering - MATLAB multidimensional Filter Array -

filtering - MATLAB multidimensional Filter Array - i designed iir filter fdatool in matlab , exported coefficients header file. copied arrays on matlab , trying plot frequency response. reason arrays multidimensional , i'm not sure how create matlab handle that. this filter coefficients like: num = [ [0.7167852126947,0,0], [1,-1.919646855375,1], [0.4393545211166,0,0], [1,-1.603319802493,1], [0.03175470360035,0,0], [1,-1.942960840584,1], [1,0,0] ]; den = [ [1,0,0], [1,-1.904445073337,0.9382561062801], [1,0,0], [1,-1.837789625289,0.8507293334097], [1,0,0], [1,-1.942552416592,0.9865719866549], [1,0,0] ]; if single dimensional pass them freqz function in matlab so: freqz(num,den); but gives me error above arrays. what's best way plot frequency response of filter? from format of num , den have next presumption: matlab's fdatool default creates second-order-sections iir filters , returns matrix of secon...

gcc - libvorbis.so error adding symbols: DSO missing from command line -

gcc - libvorbis.so error adding symbols: DSO missing from command line - i have next error when create on zaz game on linux mint 17.1 (rebecca) drivers nvidia g98 geforce 8400 make all-recursive make[1]: entering directory `/home/miguel/tmp/zaz-1.0.0' making in po make[2]: entering directory `/home/miguel/tmp/zaz-1.0.0/po' make[2]: leaving directory `/home/miguel/tmp/zaz-1.0.0/po' making in src make[2]: entering directory `/home/miguel/tmp/zaz-1.0.0/src' g++ -g -o2 -o zaz main.o audiobuffer.o mixer.o oggsample.o scene.o settings.o wavesample.o streamingoggsample.o frame_events.o ogvexport.o bezier.o textureloader.o player.o level.o ballpath.o game.o editor.o mainmenu.o menu.o gameloop.o hiscores.o lineeditor.o tests.o profile.o directorylister.o levelset.o splash.o -lsdl -lvorbisfile -ltheoraenc -ltheoradec -logg -lftgl -lgl -lvorbisenc -lsdl_image /usr/bin/ld: ogvexport.o: undefined reference symbol 'vorbis_bitrate_addblock' //usr/lib/i386...

html - Ruby on Rails- Model Views Somehow Become Part of Navigation Bar -

html - Ruby on Rails- Model Views Somehow Become Part of Navigation Bar - i new ror. in app, have a model called clubs , navigation bar on top. however, every view of clubs becomes part of navigation bar reason when app rendered. here's screenshot show mean: this code have: <html> <head> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>bhsclubs</title> <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %> <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %> <%= csrf_meta_tags %> </head> <body> <div class="navbar navbar-fixed-top"> <!--...

excel - how to display a validation list with value from two columns of another tab? -

excel - how to display a validation list with value from two columns of another tab? - i have requirement need apply list validation in such way list should display info 2 columns (of different tab in same excel) combined "-" ? able display single column using named range unable display 2 columns? how can accomplish this? below problem helper column.for new record, not have values in helper column.hence, list doesn't display new records. thanks in advance! so need bit of roundabout: can download illustration sheet here follow steps. here screenshot: first:use helper column c, , concatenate values in a , b using next formyla: =if(isblank(b2:b999),"",concatenate(a2," - ",b2)) drag , fill downwards until cell want, in illustration did until cell c99, cells in column b empty, blank cell in column c. second: create name in name manager (i named trimmedlist in example) , inquire refer next formula, re-create , past...

html5 - File input inside contenteditable div not working on FireFox -

html5 - File input inside contenteditable div not working on FireFox - i have contenteditable div. within div, there input file. however, input file can't browse file. when delete attribute of contenteditable div, input file able browse file. what's wrong? class="snippet-code-html lang-html prettyprint-override"> <div contenteditable="true"> <input type="file"/> </div> versus <div> <input type="file"/> </div> i can confirm behavior (currently not on know-issues on @ caniuse contenteditable) firefox. the whatwg spec on contenteditable states: the contenteditable content attribute enumerated attribute keywords are: empty string, true , , false . empty string , true keyword map true state. false keyword maps false state. in addition, there 3rd state, inherit state, missing value default (and invalid value default). the true state...

Correct paradigm to manage client OpenStack environments -

Correct paradigm to manage client OpenStack environments - i’m setting service allow clients create , manage cloud resources on openstack setup. network requirements of reasonably complex. the problem i’m having deciding how manage resources. openstack provide api allow me crud individual components need to. yet there’s stack create/update methods allow me create network/vms/routers/rules @ once. sense barrier 2nd method have maintain increasingly complex template file client’s network/# of vms grow. yet has benefit of beingness 1 web phone call every alter compared potentially 50 or big environment. is there preferred method handling scenario? openstack

Request_time in nginx. What exactly does it mean? -

Request_time in nginx. What exactly does it mean? - documentation says $request_time is request processing time in seconds milliseconds resolution; time elapsed between first bytes read client , log write after lastly bytes sent client what the lastly bytes sent client mean here? mean server received ack info client or written info socket? maybe else? nginx

Are all session data preserved in client cookie after logout in rails 4? -

Are all session data preserved in client cookie after logout in rails 4? - we used store session action record , moving cookies store in rails 4. understand cookies store, session info stored in client side cookies besides secret token , plan store ids in session. here few questions: after user logs out, session info (for example, user_id , user_group_id ) still preserved in client cookies next login? if user assigned new user_group_id example, old user_group_id stored in client cookies still prevail , blow off app user next login? there online posts talking app blow-off when session object gets changed on server can not updated accordingly on client side (unless alter of secret token). besides 4kb size limit , ids (session) cookie store, there other things (or disadvantage) consider when moving session db cookies store? here low downwards on cookie store. first off, in cookie there permanently 1 time it's set or until user deletes cookie manually someh...

symfony2 - Sonataadmin list field inline edit on empty fields -

symfony2 - Sonataadmin list field inline edit on empty fields - i playing around sonataadmin. have list of users in backend , want create specific fields inline editable within list. ->add('email', 'string', array('editable' => true)) works until there object without value email. able edit email straight long field email got value. when it's empty not able edit within list. symfony2 sonata-admin

sql server - SQL query distict count using inner join -

sql server - SQL query distict count using inner join - need help ensuring below query doesn't homecoming inaccurate results. select @billed = count(a.[counter]) [dbo].cxitems (nolock) inner bring together [dbo].cxitemhist b (nolock) on a.[counter] = b.cxlink b.[eventtype] in ('billed','rebilled') , b.[datetime] between @begdate , @enddate the query "mostly" accurate is, there slight possibility cxitemhist table contain more 1 "billed" record given date range. need count item "billed" 1 time during given date range. you can bring together on sub query limits 1 row each combination of fields used join: select @billed = count(a.[counter]) [dbo].cxitems inner bring together ( select distinct cxlink [dbo].cxitemhist [eventtype] in ('billed','rebilled') , [datetime] between @begdate , @enddate ) b on a.[counter] = b.cxlink you can utilize apply oper...

Python/MySQL: Select data in a for loop -

Python/MySQL: Select data in a for loop - i apologize if seems having problem putting problem words. basically, programming messaging scheme user can send messages other users , view messages in inbox. here screenshots of database , gui like: http://imgur.com/a/ra5di this function displaying messages in inbox: #display message in inbox function def displaymessageinbox(mf, c, vm): recipient = config.nameinput cursor.execute("""select concat('title: ', m.title, '\n', 'from: ', s.sender, '\n', 'sent: ', s.timesent) message m inner bring together sentmessage s on m.id = s.messageid s.recipient = %s""", (recipient)) rows = cursor.fetchall() = 3 message in rows: messageinfo = tk.label(mf, text=message, bg="white", anchor=tk.w, justify=tk.left...

Comments form showing blank comments even when database is empty, rails -

Comments form showing blank comments even when database is empty, rails - i'm building comments section on blog, , far have working point can submit comments , have them appear on page. however, there blank comment on page whether have 10 comments or database empty. *** views/artist/lyrics/show.html.erb *** <%= form_for(@lyric.comments.build, url: artist_album_lyric_comments_path(@artist, @album, @lyric)) |f| %> <%= f.text_area :content %> <%= f.submit "comment" %> <% end %> <% if @lyric.comments.any? %> <% @lyric.comments.each |comment| %> <%= comment.username %> <%= comment.content %> <% end %> <% else %> no 1 has commented. <% end %> *** /controllers/users/comments_controller.rb *** def create @comment = comment.new(comment_params) @comment.user_id = current_user.id @comment.username = current_user.username @comment.lyric_id = lyric.friendly.find(params[:lyric_id])...

Permission denied after using PyInstaller to create Python executable -

Permission denied after using PyInstaller to create Python executable - i've created little web server using bottle framework serve 1 webpage. done python script "hello.py". webpage generated "hello.py", i'm able edit contents of file called "data.txt". works fine when run "hello.py" terminal (python hello.py). but when create executable using pyinstaller run problem. i'm unable write "data.txt" file. error message "permission denied". else in executable works except this! prior creating executable, set "data.txt" permissions 777. didn't help. tried potential solution found here - no luck. looked this: def resource_path(relative_path): """ absolute path resource, works dev , pyinstaller """ try: # pyinstaller creates temp folder , stores path in _meipass base_path = sys._meipass except exception: ...

c++ - How to differentiate scores between names using functions -

c++ - How to differentiate scores between names using functions - i trying create talent show type voting programme using functions. i have bulk of figured out. programme prompts come in name, followed 5 scores, if type "done" rather name, close. i'm using functions bulk of code practice them. my big issue there infinite amount of names (as many user enters) , unaware on how add together 5 scores per name, not know how differentiate between them. 5 scores averaged , person highest average of (3 scores, dropping 2) winner. side note: need drop highest , lowest score of each person, believe figure out illustration function of helpful new them. i've researched lot not find examples similar plenty mine (having perchance infinite amount of contestants.) here code far, function @ bottom me messing around functions hang of them , see if can sums of scores name. #include <iostream> #include <string> using namespace std; void validc...

error handling - What is the exact use of Strict mode Thread policy in android? -

error handling - What is the exact use of Strict mode Thread policy in android? - does strict mode thread policy class help manage/handle errors? if type of errors? strictmode developer tool detects things might doing accident , brings them attending can prepare them. warning: don't utilize strict mode hack network operations on main thread since block ui thread. very bad practice. strict mode help grab "accidental programming" developers strictmode commonly used grab accidental disk or network access on application's main thread, ui operations received , animations take place. keeping disk , network operations off main thread makes much smoother, more responsive applications. keeping application's main thread responsive, prevent anr dialogs beingness shown users. so can utilize strictmode grab disk/network access without crashing app. careful turn off when launching yout app on gp. android error-handling

c - algorithm for arranging coordinates of corner points of a hexahedron in order -

c - algorithm for arranging coordinates of corner points of a hexahedron in order - i have set of randomly ordered 8 corner vortexes of hexahedron (0.0, 0.0, 0.0) (0.0, 1.5, 0.0) (1.5, 1.5, 0.0) (1.5, 1.5, 1.5) (0.0, 1.5, 1.5) (1.5, 0.0, 1.5) (1.5, 0.0, 0.0) (0.0, 0.0, 1.5) i need algorithm arrange these points in order. eg first want print 4 points of front end face , other 4 points of face(both in clockwise direction). above points uniformly spaced (like cube ). need algorithm hexahedron . the "algorithm" inquire simple sorting of vertices such ordered in way want. next function this: void order_hexa(double points[8][3]) { double tmp; int i,j,k,l,m,n=8; k= n-1; // k holds position of lastly interchange. higher elements sorted. while (k > 0) { l= 0; (j=0; j < k; j++) { if ( /*z*/ points[j][2] > points[j+1][2] || ( /*x*/ points[j][2] == points[j+1][2] ...

iphone - How safe is it to upgrade to a beta iOS then downgrade again? -

iphone - How safe is it to upgrade to a beta iOS then downgrade again? - apple responded 1 of bug reports suggesting seek reproduce issue in beta version of next ios. betas before, 1 comes warning that ios [version] beta should installed on devices dedicated exclusively ios [version] beta testing. not install software if not have device dedicated exclusively ios [version] beta testing. i don't have device dedicated exclusively beta testing. i'd resolve bug, ideally upgrade, seek reproduce issue, downgrade device can go on normal development on it. with limited google skills, i've found articles describe doing previous ios beta, tend poorly written , require running third-party app ("recboot"). i'm not going go through process until have more information. i'd hear if has done in past, or knows more how works, , can tell me certainty it's safe or dangerous. there no apple-supported way downgrade, i'd never want depend on do...

javascript - How do I return the response from an asynchronous call? -

javascript - How do I return the response from an asynchronous call? - i have function foo makes ajax request. how can homecoming response foo ? i tried homecoming value success callback assigning response local variable within function , homecoming one, none of ways homecoming response. function foo() { var result; $.ajax({ url: '...', success: function(response) { result = response; // homecoming response; // <- tried 1 } }); homecoming result; } var result = foo(); // ends beingness `undefined`. -> more general explanation of async behavior different examples, please see why variable unaltered after modify within of function? - asynchronous code reference -> if understand problem, skip possible solutions below. explanation of problem the a in ajax stands asynchronous. means sending request (or rather receiving response) taken out of normal execution flow. ...