Posts

Showing posts from August, 2014

sql server - Collation conflict with temp table -

the collation of tempdb latin1_general_100_ci_ai . collation of database latin1_general_100_ci_ai . yet following sql statement: select * ##citiesmapping cm inner join cities on cm.cityname=cities.name returns: cannot resolve collation conflict between "sql_latin1_general_cp1_ci_as" , "latin1_general_100_ci_ai" in equal operation. the server default collation latin1_general_100_ci_ai check tables involved well: select name, collation_name, object_name(object_id) sys.columns object_name(object_id) in ('cities')

Wordpress- Function defined in functions.php is not found -

i have following setup in wordpress theme: in functions.php have defined function called function listing_pins() in functions.php have add_action('wp_enqueue_scripts', 'load_scripts'); function load_scripts() { wp_enqueue_script('googlecode_regular', get_template_directory_uri().'/js/google_js/google_map_code.php',array('jquery'), '1.0', true); } and google_map_code.php file header("content-type: text/javascript"); include_once("{$_server['document_root']}/wp-load.php"); $general_latitude = get_option('wp_estate_general_latitude',''); $general_longitude= get_option('wp_estate_general_longitude',''); $place_markers=listing_pins(); .... i'm not gonna list whole functions since don't think not relevant question. the setup above works on server on client setup receive fatal error : call undefined function listing_pins(

lua - Error while useing a Method of a Metatable 'attempt to call method (a nil value)' -

i error 'attempt call method 'dot' (a nil value)' while running following code: -- vector2 class vector2 = {x = 0, y = 0, magnitude = 0, unit = nil} function vector2.new(xvalue,yvalue) local tmp = {} setmetatable(tmp,vector2) tmp.x = xvalue tmp.y = yvalue tmp.magnitude = math.sqrt(tmp.x * tmp.x + tmp.y * tmp.y) if tmp.magnitude ~= 1 tmp.unit = tmp/tmp.magnitude else tmp.unit = tmp end return tmp end -- arithmetic function vector2.__add(a,b) if getmetatable(a) == getmetatable(b) return vector2.new(a.x+b.x, a.y+b.y) end end function vector2.__sub(a,b) if getmetatable(a) == getmetatable(b) return vector2.new(a.x-b.x, a.y-b.y) end end function vector2.__mul(a,b) if tonumber(b) ~= nil return vector2.new(a.x*b, a.y*b) end end function vector2.__div(a,b) if tonumber(b) ~= nil return vector2.new(a.x/b, a.y/b) end end function vector2.__unm(tmp) re

c# - Is there a state that needs to be reset in between shaders -

i starting out shaders using xna , ran behavoir didn't understand immediately. i created simple scene textured box , ground sit on, composed of single textured quad using repeating texture (so texture coordinates 0,0 10,10 make repeat 10 times). both of these used basiceffect class. i followed tutorial create first shader , used cube - nothing more shader returns color of texture @ coordinate coordinate, giving me same textured cube had before. however strange happened - ground solid color 2 blurry edges , 1 instance of proper texture in corner. texture no longer repeating. changed order in drew cube , ground no effect, commenting out cube solved things. then looked in shader code, copied tutorial, , saw specified clamp addressu , addressv. changing wrap fixed everything, still leaves me question - why texture wrapping logic of 1 shader affecting basic shader? normal behavoir, there kind of state saving need do, or indicate might have bug in code? groundeffect.view =

javascript - Append parameter 'form id' with the URL -

i have code of html (django + jinja) . <div class="span10 well"> {% k in values.chat %} <label> text : {{k.text}} </label> <label> {{k.date_time}} </label> {% endfor %} <form action = "#" method = "post" id = {{key}} name = "reply_form"> {% csrf_token %} {{ form.as_p }} <input type = "submit" value = "sent" class="btn btn-primary"> </form> </div> since, there many chats , correspondingly reply submit button , key, want when reply specific chat, carries key , process chat accordingly. what need append url form id parameter. how can achieve this? you can create hidden input field <input type="hidden" name="chat_key" value="{{key}}"> this way can track chatroom person responding setting value id of chatroom. edit: since using django, on backend val

ios - How to set the default-state Image for UIButton? -

i totally confused. want set image default-state of list of uibuttons. in not work. assigned image buttons inside setter of outlet-collection image appears if button highlighted want image set except button selected. code far : -(void)setcardbuttons:(nsarray *)cardbuttons { uiimage * cardbackimage = [uiimage imagenamed:@"card-back.jpg"]; (uibutton * button in cardbuttons) { [button setimage:cardbackimage forstate:uicontrolstatenormal|uicontrolstatehighlighted]; [button setimage:nil forstate:uicontrolstateselected]; } _cardbuttons = cardbuttons; } i dont know doing wrong ? how can set image of default-state-button without using ib ? there few states can use, make sure set them correctly. copy , paste xcode , fill in images tabbing through. might worth while refreshing memory reading the apple doc this . [button setimage:<# normal image #> forstate:uicontrolstatenormal]; [button setimage:<# selected image #> fors

xml parsing - Android dont get the whole data -

i trying download xml file server , use xmlpull parsher handle doesnt download whole data everytime. if try wait download (thread sleep). have idea why happen or how solved problem? function download file /*xml read*/ private string downloadurl(string myurl) throws ioexception { inputstream = null; int len = 100000; try { url url_get = new url(myurl); httpurlconnection conn = (httpurlconnection) url_get.openconnection(); conn.setreadtimeout(15000 /* milliseconds */); conn.setconnecttimeout(15000 /* milliseconds */); conn.setrequestmethod("get"); conn.setdoinput(true); // starts query conn.connect(); = conn.getinputstream(); string contentasstring = readit(is, len); return contentasstring; // makes sure inputstream closed after app // finished using it. } { if (is != null) { is.close(); } } } public string readit(inpu

algorithm - Using c and bit shifting to solve a specific requirement -

i have 16 letter alphabet. given sentence, count frequency of each letter, , encapsulate frequencies in 1 number using clever bit shifting. lets assume sentences 100 letter each, , assuming no letter occurs more 31 times, this: a: occurs 2 times -> 0010 b: occurs 10 times -> 1010 c: occurs 7 times -> 0111 etc. now, concatenation this: 001010100111... i concentrated frequencies above. store number easily, wanted convert binary above 64 bit unsigned int. my other requirement have long , re extract frequencies per letter. so, need able generate decimal parse individual frequency bits. how in c? can bit shifting , additions of frequencies means i'm overlapping frequencies. other issue when extracting frequencies, how know how many bits shift since trailing 0s insignificant , not saved in decimal important in algorithm. any clever ideas? thank you. you have 2 problems: mathematical problem , coding problem. let's ignore math problem moment. ca

html - Is it viable to ignore Webkit/Mozilla specific CSS as a developer in 2013? -

this fall under 'encouraging debate' category of stack overflow i'd people contribute answers beyond point question closed 'unconstructive'. as migrating cross-platform, cross-browser solution flash, finding variability of html/css , it's different browser implementation extremely frustrating. mulling on all-encompassing html/css layout provided template site, i'm horrified number of browser-specific css selectors (like -webkit , -moz) aim 'fix' layout issues in legacy/future browsers. how web designer go squaring demons different rendering engines, , necessary them learn nuances of engines webkit, mozilla , trident? viable ignore these additions styling language in order leverage simplicity? every reference book/tutorial i've read seems glaze on these issues, , web seems made of many specific snippets of css address specific issues. i'm not looking condescending answers. i'm aware of mess of html specification , implementation.

Apache OpenNLP: How do I implement a dictionary based entity recognition? -

i have downloaded jar files eclipse. http://opennlp.apache.org/documentation/1.5.3/apidocs/opennlp-tools/index.html how do following: 1.) able add own names , tags. 2.) able names , tags in dictionary. 3.) configure between case sensitive , insensitive. for example, let's say, add name "mike smith" name tag "author". if have text has name, should able recognize there along tag. please give actual java code!!! i have asked similar question here: is possible conduct 'context analysis' precise entity extraction opennlp? general concensus 2 steps, first identify if sentence contains author, second find name. i in 1 step (where analysis of corpus includes words within way determine context of name)

user interface - Using GUI causes "Sleep?" making Audio stutter/stop -

okay, title says. for example, use naudio playback record (loopback if want). and if click on gui (the top part, can move window). cause "sleep", , when happens current activity (audio playback) stops. , continues afterwards. but want remove that, don´t know other application has it, it´s how programming. please keep simple, extremely new c#. i guessing on bakckgroundworker or something, couldn´t work. so hopping more concrete answer. this me not understanding using main thread in window form cause on gui run on it. meaning, if move gui, movement priority on rest of code, else paused if run on thread. perhaps differ object object, in scenario case, moved separate thread , it´s solved.

jquery - Showing different Size of an Image based on the Width Available -

i have 2 column layout on website has on 100 slides on it. each slide contains image , video on it. slides have video on them , doesn't. since both image , video on same row, share width of slide 50% - 50%. now, question how can make width of image 100% automatically if there no video on slide. should happen on page load slides loaded simultaneously user slides left or right. following html:- <div class="body-content"> <h1 class="content-title"> heading </h1> <p> // main image. <img src=".jpg link comes here"></p> // side video. on pages without video, div wouldn't exist. <div class="profile-video red-border"> <div class="field field-name-field-video field-type-file field-label-hidden"> <div class="field-items"><div class="field-item even"> <div

python - wxPython toolbar issue -

i have problem code: import wx class example(wx.frame): def __init__(self, *args, **kwargs): super(example, self).__init__(*args, **kwargs) self.initui() def initui(self): toolbar = self.createtoolbar() qtool = toolbar.addlabeltool(wx.id_any, 'quit', wx.bitmap('texit.png')) toolbar.realize() self.bind(wx.evt_tool, self.onquit, qtool) self.setsize((250, 200)) self.settitle('simple toolbar') self.centre() self.show(true) def onquit(self, e): self.close() def main(): ex = wx.app() example(none) ex.mainloop() if __name__ == '__main__': main() when run it, get: traceback (most recent call last): file "...\maintest.py", line 34, in <module> main() file "...\painter3d\maintest.py", line 29, in main example(none) file "...\maintest.py", line 8, in __init__ self.in

ruby on rails - Heroku not serving files from assets -

i'm trying out heroku host our current rails 4.0.0 project. although seems regular issue heroku users, none of solutions have found have made difference me. the server not serving of our images, css, or js our assets. i've tried adding gems: gem 'rails_log_stdout', github: 'heroku/rails_log_stdout' gem 'rails3_serve_static_assets', github: 'heroku/rails3_serve_static_assets' gem 'rails_12factor' and setting config options in production.rb to: config.action_dispatch.x_sendfile_header = "x-accel-redirect" config.serve_static_assets = true config.assets.initialize_on_precompile = false in various combinations server still not load of assets. to clear, , in case i've missed simple, i'm making these changes, committing code github, executing git push staging master . development machine windows 8 machine. edit here output executing git push staging master : counting objects: 11, done. delta

java - Simple client server program with local IP address -

i'm trying started basic client server stuff. have java server socket program running on 1 of computers. android phone running simple application , acting client. want phone able connect java program on computer. the client tries connect computer's local ip address, can't connect. ioexception. here's android code i'm using: try { echosocket = new socket("192.168.0.19", 7077); system.out.println("length: "+ "socket created!"); } catch (unknownhostexception e) { system.out.println("length: "+ "don't know host."); } catch (ioexception e) { system.out.println("couldn't i/o " + "the connection."); } if run both client , server, on computer , try connect computer's local ip (same above), works fine. want connect phone. any ideas need do? edit: here's stack trace: 07-21 1

vb.net - Disable winform button on sheet Activate event -

i want set buttons property enable = false when worksheet activates. wrote thought pretty straight forward code: private sub dsbemployeeboard_activateevent() handles me.activateevent dim navform new frmnavigation navform.btnmoveforward.enabled = false end sub however, when sheet activates button not disable. missing something? buttons default enable property set true , no other code controlling property. 1.check event trigger. 2.check enabled false after assign. 3.maybe need refresh form.

php - phpinfo() is not working -

i have php installed on centos server. however, when running phpinfo() inside script test it, receive html, not interpreted information. can see folders php. can see php.ini in etc folder. php not seem working. mean test.php file looks this: <?php phpinfo(); ?> and response looks this: <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "dtd/xhtml1-transitional.dtd"> <html><head> <style type="text/css"> body {background-color: #ffffff; color: #000000;} body, td, th, h1, h2 {font-family: sans-serif;} pre {margin: 0px; font-family: monospace;} a:link {color: #000099; text-decoration: none; background-color: #ffffff;} ... and on. what seems problem , how solve it? if copy html returned, paste html file, , run there, can see formatted result, not running test.php. assume php not loaded somehow... if in interpreted html can see : **server api apache 2.0 handler virtual directory support disabled conf

javascript - Variable value check isn't working -

i have <div> i'm clicking on change value of variable. variable changes if(oneorzero == 0) never works. continues == 0 . though variable different, still acts same. doing wrong? edit: i left part out. after change variable, need check onmousedown function see if worked. issue. var oneorzero = 0; var onmousedownfunction= function() { if(oneorzero == 0){ alert('one or 0 equals 0'); //do }; if(oneorzero == 1){ alert('one or 0 equals 1'); //do }; }; $('.class').click(function(){ val_class = $(this).attr('value'); if(val_class == '0'){ $(this).attr('value','1'); oneorzero = 1; }; if(val_class == '1'){ $(this).attr('value','0'); oneorzero = 0; }; }); $(canvas).mousedown(onmousedownfunction); place inside click event. the way have written execute once when page loads. also use console.log instead of alert lot mo

Deploying Django app's local postgres database to heroku? -

i unsuccesfully getting django app deployed on heroku use local postgres db. my database settings follows: databases = { 'default': { 'engine': 'django.db.backends.postgresql_psycopg2', 'name': 'mydb', 'user': 'foo', 'password': 'bar', 'host': 'localhost', 'port': '', } } everything runs fine locally. following instructions https://devcenter.heroku.com/articles/django , add following bit code bottom of settings file: import dj_database_url databases = {'default': dj_database_url.config(default='postgres://foo:bar@localhost/mydb')} secure_proxy_ssl_header = ('http_x_forwarded_proto', 'https') however, produces following error: operationalerror @ / not connect server: connection refused server running on host "localhost" (127.0.0.1) , accepting tcp/ip connections on port 5

ios - How can I use methods defined in this delegate? -

i'm new ios development, , i'm playing interface trying understand concepts. provided sdk(which compiled , can't it) has following definitions: @class hrmonitor; @protocol hrmonitordelegate - (void) hrmon: (hrmonitor*) mon heartrateupdate: (double) hr; // , others @end @interface hrmonitor : nsobject <nsstreamdelegate>{ } -(id) init: (id) _delegate; -(void)startup; does have idea how can use heartrateupdate method defined in protocol hrmonitordelegate ? read in ios developer library, have have interface conforms delegate hrmonitor : nsobject <hrmonitordelegate> call methods in protocol. that's not provided in api. or can use init method? how should pass _delegate ? conform interface delegate init hrmonitor, passing interface instance _delegate then - (void) hrmon: (hrmonitor*) mon heartrateupdate: (double) hr of interface called make interface conforms delegate, , call method of when need, remember check delegate not nil , respon

python StringBuilder for MySQL query execution -

i trying query database 1 of columns python variable: weeknum = "week" + str(i) #i either 2, 3, 4, 5 cur.execute("select %s golden_table ngram = %s , hash_tag = %s", (weeknum, tup[0], tup[1])) note sql table: golden_table includes 4 columns: week2 week3 week4 week5 . however, python or mysql not treating value of weeknum column. instead returned query value "weeki." above. in java, know way around stringbuilder class. what equivalent way of solving problem in python? what better way solve in python? all appreciated, , let me know if need more information. if python version recent (2.6+). use format. weeknum = "week" + str(i) #i either 2, 3, 4, 5 query = "select {0} golden_table ngram = %s , hash_tag = %s".format(weeknum) cur.execute(query, (tup[0], tup[1]))

youtube - Google drive embed NO iframe -

is there way embed google drive video without using iframes? just can youtube video: <object width="320" height="180"> <param name="movie" value="http://www.youtube.com/v/uhk6wfnda5s&amp;showinfo=0"> <param name="wmode" value="transparent"> <embed src="http://www.youtube.com/v/uhk6wfnda5s&amp;showinfo=0" type="application/x-shockwave-flash" wmode="transparent" width="320" height="180"> </object> the suggested embed code google docs (using iframe) is: <iframe src="https://docs.google.com/file/d/0b7cq5xvluigrqljunuhpqvltz0u/preview" width="640" height="385"></iframe> it's possible not officially supported. after study of result generated iframe embed google drive , iframe youtube i've digged youtube js player api , found out it's possibl

Python __init__.py vs sys.path.append/insert -

i know there are ton of how-to import python modules not in path, have yet come across using python's __init.py__ vs sys.path.insert. method better? there obvious drawbacks either, performance? 1 more "pythonic?" one scenario can think of, have program users download , put in whatever directory, don't know absolute path (unless programatically). folder structure is working dir __init__.py foo.py src/ my_utils.py __init__.py i don't see difference between using __init__.py or changing sys.path. there scenario can think of make difference? part 2 of question is, why have anything able import modules subdirectories? i'm new python, maybe i'm not understanding why fiddling path or creating init files boilerplate. me, seems unnecessary complication. if have "dir" in current working directory , "import dir.my_utils," don't see why have list want able import in __init__.py. apologies if dup

MS Access How to get the sum of each products of rows combination? -

suppose have table field value: v1, v2, v3, v4 when combines 2 rows: sum = v1*v2 + v1*v3 + ... + v3*v4 when combines 3 rows: sum = v1*v2*v3 + v1*v2*v3 + ... + v2*v3*v4 basically combination of rows first, , sum of each combination's product. have written vba class task, it's clumsy, calculate every combination 1 one. know there easier way job? sql query or linear algebra, way simplified process welcomed. thanks. ms access isn't capable of doing without vba. jet sql capable of summing data in aggregate, there no product aggregate, , jet sql doesn't support user-defined aggregates. if post code, may able suggest improvements.

Actionscript associative array constructor? -

this seems silly ask this, there way make associative array in actionscript right in variable declarations? e.g. private var stages:array = [ "name" : "ny stage", "location" : "new york", "capacity" : 15000 ] instead, way i'm doing (1): declaring array top , creating rest of array in class constructor: private var stages:array; public function playstage(){ stages["name"] = "ny stage"; stages["location"] = "new york"; stages["capacity"] = 15000; } can top (without creating object)? don't use array create associative array. if read array documentation, recommends against practice. use object instead. here's link documentation on how create associative arrays: associative arrays in as3 to iterate on keys of associative array (this used length well), can use this: var oobj:object = { "name" : "pear", &

ASP.NET Error when exporting report (Crystal Report to PDF) -

Image
i'm having error when want export crystal report pdf local machine. based on understanding, says context null. how trace values from? in advance! below code appear me problem. response.write("<script>") response.write("window.open('" & resolveurl("~\report\rpthandler.ashx?p=user_id|date&v=" & user_id & "&t=0&n=porderprocessingcard.rpt&c=orcl_po") & "','_blank')") response.write("</script>") the solution check on parameter , value passing to. example above, calling 2 parameters (user_id , date) while i'm passing 1 value it. therefore prompt such error. hope helps :)

Rails: submit child model in nested form -

i've researched while on topic haven't found real solution trying achieve. i'm working nested one-to-many nested form (project has many tasks). , each task has many attributes, e.g. type, assigned_individual, due_date, etc. got no problem having parent project , nested child model tasks saved/updated on 1 submit. need achieve seems opposite of effort. need 1 ajax save call each task besides global submit. when task list gets long, users don't have worry losing have written earlier other tasks. can click save button , get's feedback saying has entered task has been saved. currently project in form_for wrapper, , tasks in fields_for partial these simplified version of have right now. here form in edit.html.erb <%= form_for @project |f| %> <p>f.text_field :title</p> <p>f.text_field :author</p> <%= render :partial=> 'tasks', :collection=> @project.tasks %> <%= f.submit 'submit' %> <% e

css - p:selectOneMenu list not displaying properly -

i have p:selectonemenu in xhtml. list not displaying properly. list have near 70 items. when click on selectonemenu, list populate upwards instead without scrollbar , can't see items. <td valign="top"><p:selectonemenu id="fr1022_combo_box_ctpy" value="#{pc_fr1022.w_facility.ctpy}" styleclass="selectonemenu"> <f:selectitems value="#{pc_fr1022.w_facility.facilityctpylist}"></f:selectitems> </p:selectonemenu> </td> i believe way have used f:selectitems incorrect. should <f:selectitems value="#{pc_fr1022.w_facility.facilityctpylist}" var="facility" itemlabel="#{facility.name}" itemvalue="#{facility.value}" /> hth

html5 - How to use 'TouchStart' events in Jquery Mobile -

in html5:- in footer store data cuming dynamically , footer part should move touch not whole window footer should move data present in footer left right <div data-role="page" id="page1"> <div data-role="footer" data-position="fixed" id="footer"> <div class="menu" id="menu_button1" id="scroll_menu" onmouseover='this.style["overflowx"]="scroll";' onmouseout='this.style["overflowx"]="visible";'></div> </div> </div> in jquery:- using ajax calling data dynamically in stored data in footer part of htm5 in there want use touch event how can use plz me out function callmenuconnection() { $.support.cors = true; $.ajax({ type: "post", url: "one.html", contenttype: "text/xml",

java - How to return a json respone or redirect to other view depending on the condition? -

i have search criteria depending on list result . if list contains 1 data want return edit view of particular data.if list contains more 1 data want return jsonresponse show data table . i tried did not data table nor did view if(reservationgriddatapage.getsize() > 1){ gridjsonresponse jsonresponse = reservationgridhelper.prepareresponse(reservationgriddatapage); jsonresponse.setitotaldisplayrecords(gridmanager.gettotalsearchedreservations(pagerequest, null, entitystatecode, searchparams)); jsonresponse.setsecho(secho); return jsonresponse; }else{ long entitykey = null; list<reservationgriddata> content = reservationgriddatapage.getcontent(); (reservationgriddata t : content) { entitykey = t.getid(); } redirectview redirectview = new redirectview("/xxx/editres?id="+entitykey); return new modelandview(redirectview); } just return view name of type string . then, if reservationgriddatapage.getsize() >

Javascript - How to get all elements and do same thing on each of them -

i want divs in div(id = room) , same javascript code on each one. i think should this get element id room -> divs inside -> on them(change each class "grass") or using loop. how that? please don't use jquery. modern browsers (ie9+): var divs = document.queryselectorall('#room div'); [].foreach.call(divs, function(div){ div.classname = 'green'; });

jquery - Check all checkbox does not work -

in jsfiddle code: <script type="text/javascript"> function checkall() { var checked = $("#checkall").is(':checked'); $(".check_row").attr("checked", checked); } </script> <div> <input type="checkbox" id="checkall" onclick="checkall()" />check <br /> <input type="checkbox" class="check_row" />one <br /> <input type="checkbox" class="check_row" />two <br /> <input type="checkbox" class="check_row" />three <br /> <input type="checkbox" class="check_row" />four <br /> <input type="checkbox" class="check_row" />five <br /> <input type="checkbox" class="check_row" />six <br /> </div> "check all" checkbox works first time. can me

ibm mobilefirst - IBM Worklight - How to silently update the application's web resources? -

i want silently update web resources of application using direct update feature. i did not manage find related documentation that. can give me idea on how proceed? i generated apk application app version 1.0. with modifications in ui generated 1 more apk version 1.1. now again change generated apk third version v 1.2.(latest) now intention if user has apk 1.0 should update user version deprecated , provide link latest version. if user has apk version 1.1 has alert user update available. these things able achieve using direct update. when trying same silent update not working. the property you're looking for updatesliently set true in initoptions.js. work, required connectonstartup set true well. it seems working in worklight 6.0, fail in worklight 5.0.6; have opened defect this. in case, steps have described incorrect. these steps direct update, silent or not: create app, add environment build , deploy launch app on device c

java - Installation issues in hadoop,hbase,zookerper in single node in debian -

i trying install hadoop,habse,zookeeper in local machine. facing problem in zookeeper connection. below hbase master log: 2013-07-21 22:01:24,603 info org.apache.zookeeper.zookeeper: client environment:java.io.tmpdir=/tmp 2013-07-21 22:01:24,603 info org.apache.zookeeper.zookeeper: client environment:java.compiler=<na> 2013-07-21 22:01:24,603 info org.apache.zookeeper.zookeeper: client environment:os.name=linux 2013-07-21 22:01:24,603 info org.apache.zookeeper.zookeeper: client environment:os.arch=amd64 2013-07-21 22:01:24,603 info org.apache.zookeeper.zookeeper: client environment:os.version=3.2.0-4-amd64 2013-07-21 22:01:24,603 info org.apache.zookeeper.zookeeper: client environment:user.name=gaurav 2013-07-21 22:01:24,604 info org.apache.zookeeper.zookeeper: client environment:user.home=/home/gaurav 2013-07-21 22:01:24,604 info org.apache.zookeeper.zookeeper: client environment:user.dir=/home/hbase/hbase-0.94.6.1/bin 2013-07-21 22:01:24,605 info org.apache.zookeeper.zo

c# - .SELECT statement using lambda and Entity Framework -

i struggling here in using .select statement. here snippet of code; var payoutsperlocation = locations.select(l => l.payouts); foreach (var payouts in payoutsperlocation) { console.writeline(payouts.sum(pos=>pos.amount)); } where in location list, , 1 location has 1 or more payout. want payouts. the above code's result below 0 0 0 0 0 0 it should sum of amount of payouts per location. seems don't records of payout. when tried using code below (for testing if getting payout); var payoutsperlocation = locations.firstordefault().payouts; foreach (var payout in payoutsperlocation) { console.writeline(payout.amout); } there payout location. guys think doing wrong here? any appreciated. i don't know why it's giving zeros, shouldn't evaluate linq expressions inside foreach loop anyway. causes many round-trips database. try this: var sumperlocation = locations.select(l => l.payouts.sum(p => p.amount)); foreach (var sum

Converting hex to dec C++ -

convert hex: cout << hex << int(x) << endl; how convert conversely, hex dec? enter hex number simple: cin >> hex >> x; you can use std::dec io manipulator : std::cout << std::dec << int(x) << endl; note necessary if have used std::hex or other means manipulate base of std::cout . otherwise need take no action: default int decimal.

android - SetListAdapter Not Working -

hey ive been trying use own layout use new setlistadapter rss feeds wont show up. think something's wrong part of code. can me please.:( @override protected void onpostexecute(list<rssitem> result) { listview itcitems = (listview) findviewbyid(r.id.rsschannellistview); setlistadapter(new arrayadapter<string>(rsschannelactivity.this, r.layout.rssfeedreader_layout, titles)); itcitems.setadapter(_adapter); itcitems.setonitemclicklistener(new listlistener(result, local)); } private void setlistadapter(arrayadapter<string> arrayadapter) {}

In html, check one checkbox from 2 checkbox without JQuery -

this question has answer here: html select 1 checkbox in group 10 answers i'm having 2 checkbox. need check one. know using jquery , it's easy . default option in html. i'm having 2 checkbox. thanks. code: <input type="checkbox" value="1" name="foo" /> <input type="checkbox" value="2" name="foo" /> and option change height , width of check box? css. hi in html use radio button.,.... simple alterantive..less code..which improves performance well..optimized solution <form action=""> <input type="radio" name="foo" value="1"> <br> <input type="radio" name="foo" value="2"> </form>

python - xmms2 track change detection for pynotify? -

i have written little script show current track playing on xmms2 on notification widget using xmms client , pynotify, when run can see widget popup current artist , title using xmmsclient methods. can give hints how detect track change notify automatically without having run script manually? you connect client library main loop, , register listener via broadcast_ playback_current_id method. if want playing id when script starts can call playback_current_id method. here small adaptation of tutorial6 in xmms2-tutorial.git uses glib mainloop drive connection: import xmmsclient import xmmsclient.glib import os import sys import gobject def cb(result): if not result.is_error(): print "current: %(artist)s - %(title)s" % result.value() ml = gobject.mainloop(none, false) xc = xmmsclient.xmms("stackoverflow") xc.connect() conn = xmmsclient.glib.glibconnector(xc) xc.broadcast_playback_current_id(lambda r: xc.medialib_get_info(r.value(), cb

PHP/MySQL Insert multiple rows into a table -

im using code: <?php if(isset($_post["submit"])) { $num = $_post['number']; ($i = 0; $i < $num; $i++) { if($i==0) { echo '0'; $answer1 = $_post["answer1"]; $answer2 = $_post["answer2"]; $answer3 = $_post["answer3"]; $answer4 = $_post["answer4"]; $answer5 = $_post["answer5"]; $answer6 = $_post["answer6"]; $answer7 = $_post["answer7"]; $answer8 = $_post["answer8"]; } else { echo 'no 0'; $answer1 = $_post["answer1$i"]; $answer2 = $_post["answer2$i"]; $answer3 = $_post["answer3$i"]; $answer4 = $_post["answer4$i"]; $answer5 = $_post["answer5$i"]; $answer6 = $_post["answer6$

.net - Scanning un-referenced assemblies with StuctureMap -

i using structuremap di in asp.net mvc project. have divided libraries following 3 dlls. core services data (contains repositories) the core contain interfaces , services , data contain implementation. now when setup structuremap in website need tell scan services , data assemblies contain implementation of core interfaces mean have reference them both in web project although depends on service project depends on data project. to me referencing these 2 dlls in web project not make sense spoils benefit of abstraction? can 1 please explain me if need reference these assemblies or not , advantage of using separate interfaces in first place? the web project composition root of application. composition root 1 single place in application composes object graph application. don't have reference assemblies composition root, can scan assemblies using convention, it's not worth effort imo. by having composition root reference dependencies flatten out dependen

windows runtime - Performance issue when show RichTextBlock inside ScrollViewer -

i have richtextblock in scrollviewer, when content of richtextblock long, there serious performance issue. fyi, actual height of richtextblock 580000. how can solve problem? imho, richtextbox should support virtualization out of box. if still face performace issue should consider third-party vendors telerik, syncfusion or devexpress.

html - CSS calc() subtract negative value -

is ok subtract minus number, this? width: calc(35% - -20px); because if above, behaves differently if this: width: calc(35% + 20px); here can see difference: http://nightly.gamempire.it/ put window of browser < 1200px , > 1000px analyze #gallery_thumb element actually see has: calc(35% - -20px) if change calc(35% + 20px), breaks (the #gallery_thumb less higher #gallery_img). why this? can not subtract negative number? calc() native css way simple math right in css replacement length value (or pretty number value). has 4 simple math operators: add (+) , subtract (-) , multiply (*) , , divide (/) . more info link two link three calc() function browsers compatibility

c - missing [heap] section in /proc/pid/maps -

i'm experimenting simple c program keeps allocating memory: for ( = 0; < 10000; ++ ) { array[i] = malloc( 1024*1024 ); if ( array[i] == null ) { break; } printf("sleeping...%d\n", i); sleep( 60 ); } full code pasted here: http://tny.cz/2d9cb3df however, when cat /proc/pid/maps , no [heap] section. why? 08048000-08049000 r-xp 00000000 08:11 17 /data/a.out 08049000-0804a000 r--p 00000000 08:11 17 /data/a.out 0804a000-0804b000 rw-p 00001000 08:11 17 /data/a.out 0804b000-0805e000 rw-p 00000000 00:00 0 b74c6000-b75c8000 rw-p 00000000 00:00 0 b75c8000-b7775000 r-xp 00000000 08:01 3539272 /lib/i386-linux-gnu/libc-2.17.so b7775000-b7777000 r--p 001ad000 08:01 3539272 /lib/i386-linux-gnu/libc-2.17.so b7777000-b7778000 rw-p 001af000 08:01 3539272 /lib/i386-linux-gnu/libc-2.17.so b7778000-b777b000 rw-p 00000000 00:00 0 b7797000-b779a000 rw-p 00000000 00:00 0 b779a000-b779b000 r-xp 00000000 00:00 0

Buggy CSS Transitions when Video Element not present -

hi in process of developing website . please understand work in progress. i have menu bar when scrolled, stick top , background fade in , border slide out. here screenshot of example of does. what makes more strange when there video element present not this. can try deleting video element page , starts doing it. (located in < header>, < div class="feature-content">, < video> ) i have never seen before css transition. have tried firefox 17 , chrome 27 mac. does have ideas ? :) edit : apologise not remembering had restriced acess server redirect, has been fixed. :) turns out animate.css. removing started working correctly again.

javascript - Html5 canvas game, creating a map much bigger than viewing canvas -

so let me start off saying trying create large image or room, 5000 3750, , have canvas or viewing area 800 599, following player piece. did find guide on how this, using background , player drawn in java script (not taken sprite sheet). have sprite sheet background, , player, have gotten player work on background drawn javascript, not taken sprite sheet want do. here of code: // wrapper "class" map (function(){ function map(width, height){ // map dimensions this.width = width; this.height = height; // map texture this.image = null; } // generate example of large map map.prototype.generate = function(){ ctxbg.drawimage(imgsprite,0,2250,5000,3750,0,0,5000,3750); } // draw map adjusted camera map.prototype.draw = function(context, xview, yview){ var sx, sy, dx, dy; var swidth, sheight, dwidth, dheight; // offset point crop image sx = xview; sy = yview; // dimensions of cropped im