Posts

Showing posts from February, 2015

visual c++ - Different values depending on floating point exception flags set -

short question: how can setting _em_invalid exception flag on fpu result in different values? long question: in our project have turned off floating point exceptions in our release build, turned on zerodivide, invalid , overflow using _controlfp_s() in our debug build. in order catch errors if there. however, results of numerical calculations (involving optimisation algorithms, matrix inversion, monte carlo , sorts of things) consistent between debug , release build make debugging easier. i expect setting of exception flags on fpu should not affect calculated values - whether exceptions thrown or not. after working backwards through our calculations can isolate below code example shows there difference on last bit when calling log() function. this propagates 0.5% difference in resulting value. the below code give shown program output when adding new solution in visual studio 2005, windows xp , compile in debug configuration. (release give different output, that's

qt - How to specify libraries only for Android platform build in .pro file? -

i'm trying use qtcreator (2.7.2) + qt (5.1.0) build application runs on both desktop (linux) , mobile (android) platforms. to achieve this, need use different pre-built libraries depending on target platform. how specify in .pro file? the wizard offers linux/mac/windows platform choice like unix:!mac { message("* using settings unix/linux.") libs += -l/path/to/linux/libs } i've tried android { message("* using settings android.") libs += -l/path/to/android/libs } but both build targets unix:!mac gets executed/evaluated. so question is: how detect build target (called "kits" in qtcreator) in .pro file , change library definitions accordingly? i've far found out how specify platform (which seems platform i'm building on , not for) or build variant release/debug. other things i've found should prefix lib+= target platform win32:lib+= . again, won't work android . maybe i'm using wrong syntax platform (android

javascript - Remove self <a> tag -

this question has answer here: jquery replace tag tag text [duplicate] 2 answers i have litte bug, in menu there's links has no hrefs (like empty link). if has no href, want remove keep text. this got: $('.mainmenu a, .mainmenu *').each(function(){ var href = $(this).attr('href'); if(!href) { console.log($(this).html()); //remove <a> element, how? } }); help please? you need unwrap contents then $('.mainmenu a:not([href])').contents().unwrap() :not filter out elements without href tag .contents() returns jquery object contains contents - text .unwrap() removes anchor tag around it

HMAC in client side JavaScript and identity spoofing -

cryptojs has functions create hmac message , secret key. how can secure considering secret key must stored in plain sight in javascript source deployed on client ? anyone can take key , issue similar requests server under identity of original client of api. isn't "identity" problem hmac supposed solve ? all in all, not understand purpose of hmac in client side js since key can't kept secret. is there use case computing hmac in javascript ? javascript has webrtc 2 clients can communicate peer-to-peer, scenario clients can generate , use own "secret". there cases client -> server usable well. if server "dynamically" serving javascript insert "secret" based on clients current session/login. assuming using https (if not there man in middle slurping "secret") it's not unreasonable assume communication server signed specific "secret" (even on unsecured http) belongs client.

php - Putting User Selected Attachments into mysql DB -

i have form customer service reps can insert call logs. want have allows user select file upon form submit uploaded database. can provide example or resource might lead me in right direction? uploading files using post i'm assuming want store file on server , not put database (large numbers of files inserted in database blobs incredibly bad performance). front-end in short, create upload field in form: <form enctype="multipart/form-data" action="__url__" method="post"> send file: <input name="call-log" type="file" /> <input type="submit" value="upload log" /> </form> storing file then handle upload: $uploaddir = '/var/www/uploads/'; $uploadfile = $uploaddir . basename($_files['call-log']['name']); if (move_uploaded_file($_files['call-log']['tmp_name'], $uploadfile)) { echo "file valid, , uploaded.\n"

wpf - not able to edit a file -

i using vs2010 , want remove namespace because dont need it. got struck. if remove dll, error namespace doesn't exist, , if remove namespace, vs2010 says files edited outside of source editor. if click make changed namespace , same error, if click no, same error namespace doesnt exist. not using namespace anywhere in code. i can keep dll in reference know why error there. bug? regards

multithreading - Excel VBA QueryTable callback function after table refresh -

this question has answer here: excel vba - querytable afterrefresh function not being called after refresh completes 2 answers i writing/maintaining excel vba application there multiple querytables linked ms sql server databases. users of application can alter sql query each table manipulating various ui controls on excel document. one of issues have come across querytables there use of multi threading. each querytable on document has original state must restored after query ran. instance, if querytable1 had base query of select * example_table and user selected inputs on controls create select * example_table object_oid = '10' i need original state restored. code below snapshot of how accomplishing this sub refreshdataquery() 'dependencies: microsoft scripting runtime (tools->references) dictionary (hashtable) object dim querysheet worksh

twig - Error in my Symfony project after run composer update command -

i have run command composer update on top of project directory , after reload page surprise error , don't know cause or how fix this: runtimeexception: autoloader expected class "twig_extensioninterface" defined in file "/var/www/html/vendor/twig/twig/lib/twig/extensioninterface.php". file found class not in it, class name or namespace has typo. any advice?

c# - Timer Elapsed Event with Kinect SDK -

so i'm using kinect sdk make application, , it's going well! i'm trying make button take picture, want code taking picture delayed people have time pose. i've tried using system.threading.thread.sleep(3000); happens whole thing freezes (yes know that's sleep does...) , uses first frame anyway. i'm trying use timer , timed event, keep getting errors due inability make static (kinect thing). public class timer1 { private system.timers.timer atimer; public void main() { atimer = new system.timers.timer(3000); //this problem is. i'm getting "cannot access non-static member of outer type 'kinectbutton.mainwindow' via nested type 'kinectbutton.mainwindow.timer1' atimer.elapsed += new elapsedeventhandler(takepicture); atimer.interval = 1000; atimer.enabled = true; } } [private void takepicture(object sender, elapsedeventargs e) { bitmapsource image = (bitmapsource)videostream.s

Installation of RVM on Ubuntu Server 12.04 -

i running vm ubuntu server 12.04. try install ruby on rails application , first of needed install curl (which done) , try install rvm. i following installation guide : ruby on rails installation i @ step when have run rvm check. won't load when try enter : source ~/.rvm/scripts/rvm update : i have folder /usr/local/rvm when try run : rvm requirements he says : program 'rvm' not installed.... but did command : \curl -l https://get.rvm.io | bash -s stable as shown in tutorial, or didn't install ? have no errors... see : thank using rvm! -sh: 1: source: not found any ideas? relatively new ubuntu. in advance as message says: -sh: 1: source: not found where sh current shell - rvm not compatible it, need use bash: sudo apt-get install -y bash && sudo chsh -s $(which bash) i have not tested steps might adjust system.

java - Maximum precision below unlimited? -

i using bigdecimal make calculations. ran into: java.lang.arithmeticexception: non-terminating decimal expansion; no exact representable decimal result. the answer problem posted here: arithmeticexception: "non-terminating decimal expansion; no exact representable decimal result" this means, there division unlimited decimals, bigdecimal tells me cannot calculate result exactly. avoid have call bigdecimal.setscale(something, rounding_mode); edit: the problem set maximum possible value. use mathcontext precision below unlimited ( mathcontext(precision) ) same problem occurrs there. there need value below mathcontext.unlimited ... does know how accomplish that? moved second question to: why there no bigdecimal.setprecision() method? thank you! oliver first question: there no such thing bigdecimal.unlimited . doesn't make sense. 1 less infinity? because docs don't explicitly mention default mathcontext of bigdecimal, have assume mathcon

postgis - How to expand a polygon to reach a nearby line -

i expand polygon fills empty space between , nearby (and touching in 2 points) line, in the image posted here . can see blue linestring makes empty space on top of pink polygon , want fill polygon. there postgis solution ? havent' found "easy" way. thanks ! the solution similar 1 presented here . in case need buff linestring bit. with p ( select st_makepolygon(st_geomfromtext('linestring(0 0,1 0,1 1, 0 1, 0 0)')) geo ), l ( select st_buffer(st_geomfromtext('linestring(0.0 0.0,0.5 0, 0.7 -1, 1 0)'),0.000000000000001) geo ), bigpoly as( select st_union(geo) geom from( select geo p union select geo l) q ) select st_buffer(st_buildarea(st_interiorringn(geom,i)),0.000000000000001) geo bigpoly cross join generate_series(1,(select st_numinteriorrings(geom) bigpoly)) this give missing piece, need st_union rest, might want check if it's correct 1 if original polygon contains holes.

java - Android makefile include dynamic library runtime error -

i trying write android app making use of jni. i have 1 activity file instantiates class makes call jni function. my cpp code built fine , put @ location libs/armeabi/libapplist.so my java file this. package com.example.applist; public class backend { static { try { system.loadlibrary("applist"); } catch(exception e) { log.d("backend","caught exception" + e); } } public native int creategroup() ; } and makefile below local_path:= $(call my-dir) include $(clear_vars) local_module_tags := optional #only compile source java files in apk. local_src_files := $(call all-java-files-under, src) local_package_name := applist local_certificate := platform include $(build_package) local_prebuilt_libs := libs/armeabi/libapplist.so include $(build_multi_prebuilt) i instantiating class main activity class testing. (new backend();) receive runtime error. can explain doing incor

java ee - CDI Inject fails on maven-embedded-glassfish-plugin -- org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type -

we have webapp, being developed using java ee 7, jsf 2.2 , glassfish 4.0. there 2 particular managed beans circular dependency. usuariocontroller @named @sessionscoped public class usuariocontroller implements serializable { /** snipet **/ @inject private enderecocontroller enderecocontroller; /** snipet **/ } enderecocontroller @named @viewscoped public class enderecocontroller { /** snipet **/ @inject private usuariocontroller esuariocontroller; /** snipet **/ } when webapp packaged , deployed normal glassfish 4.0 installation, works fine. however, during development use maven-embedded-glassfish test locally inside ide. , app deployment fails following exception. severe: exception while loading app : cdi deployment failure:weld-001408 unsatisfied dependencies type [enderecocontroller] qualifiers [@default] @ injection point [[backedannotatedfield] @inject private net.jhm.exemplo.view.usuariocontroller.enderecocontroller] org.jb

sql - Heredocs, variables and single quotes in BASH and MySQL -

i'm trying send data remote mysql database using bash script on gnu/linux, various errors.. here's line that's not working: mysql --host=192.168.0.100 --user=petercapaldi --password=mypassword mystartrekcharacterbase << eof insert myfourlegs values ('$person','$thetime','$thetime','$thedate','$dayofweek'); eof and (just in case): mysql --host=192.168.0.100 --user=petercapaldi --password=mypassword mystartrekcharacterbase << eof insert myfourlegs values (\047$person\047,\047$thetime\047,\047$thetime\047,\047$thedate\047,\047$dayofweek\047); eof scrap that. fault - missed first field in database. single quotes work should heredocs.. (i.e. '$variable' prints 'myvariable' $variable prints myvariable).

DNS: if I delete @ A record, will * CNAME be honored? -

without boring on details, site's target must set in dns hostname , not ip . i have cname record of * , appears @ record takes precedence, * cname ignored. can safely delete @ record ? * cname honored? short answer yes. longer answer dns servers give specific answer can , fall less specific. way verify cname working query entry not exist on dns server. long answer can safely remove record , well. the record have ttl (time live). when first delete record take while removed caching dns servers. means continue records answer while, once expires cname start being used.

true type fonts - r wordcloud external ttf vfont not recognized -

i've installed 'extrafont' package in order install external font library duality via ttf_import() method. however, when specifying font via wordcloud method, receive following error: installation command: # assuming font file, duality_.ttf, in working directory (see link font above) font_import(".",false,pattern="duality") wordcloud command: wordcloud(ap.d$word, ap.d$freq, scale=c(8,2), min.freq=10, vfont=c("duality","plain"), random.order=false, rot.per=0, use.r.layout=false, colors=pal2, fixed.asp=false) output: error in strwidth(words[i], cex = size[i], ...) : invalid 'vfont' value [typeface -2147483648] in order verify font indeed installed, issued following commands > choose_font("duality") [1] "duality" > fonts() ....[49] "waree" "duality" how come duality font not visible vfont parameter of wordcloud? , how make visible

java - how to use utility class to start intent android -

i updating code company app , there 20 activity classes download pdf , display using code: public void showpdf() { file file = new file(environment.getexternalstoragedirectory()+"/pdf/read.pdf"); packagemanager packagemanager = getpackagemanager(); intent testintent = new intent(intent.action_view); testintent.settype("application/pdf"); list list = packagemanager.queryintentactivities(testintent, packagemanager.match_default_only); intent intent = new intent(); intent.setaction(intent.action_view); uri uri = uri.fromfile(file); intent.setdataandtype(uri, "application/pdf"); startactivity(intent); } the code working, has been replicated in 20 classes (seems bad me) , put single class each activity class imports, when try this, things getpackagemanager() , startactivity(intent) no longer work. how can structure class make happen? or going wrong way. public class pdfutlity{ public static void

forms - deactivate two buttons until submit is clicked -

i need know how can deactivate 2 buttons until submit button clicked..i using javascript code deactivate 2 not work. here form: <form name="receta" id="receta" method="post"> <div class="row-fluid grid"> <div class="span4"> <label><b>lugar: </b></label> <input type="text" class="input-block-level" value="" name="lugar" /> </div> <div class="span4"> <label><b>nombre : </b></label> <input type="text" class="input-block-level" value="" name="nombre" /> </div> <div class="span4"> <label><b>edad : </b></label> <input type="text" class="span4" value="" name="eda

symfony - symfony2 contact form error on rendering to the view page -

hey i'm new in symfony2 framework need helo. this code contact form , when i'm trying render form view page gets error see code bellow , error also. if 1 knows might problem please let me know.. thanks! contacttype.php <?php // src/aleksandar/intelmarketingbundle/resources/views/contacttype.php namespace aleksandar\intelmarketingbundle\form\type; use symfony\component\form\abstracttype; use symfony\component\form\formbuilderinterface; use symfony\component\optionsresolver\optionsresolverinterface; use symfony\component\validator\constraints\email; use symfony\component\validator\constraints\length; use symfony\component\validator\constraints\notblank; use symfony\component\validator\constraints\collection; class contacttype extends abstracttype { public function buildform(formbuilderinterface $builder, array $options) { $builder ->add('name', 'text', array( 'attr' => array(

Calling parent constructors in R with multiple inheritance -

i'm trying have class call parent constructors, callnextmethod calls first parent. namely, if have setclass('a') setclass('b') setclass('c', contains = c('a','b')) and define initialize methods three, printing 'in a', 'in b', , 'in c', respectively, callnextmethod in initialize method of c, prints 'in a'. there way dispatch constructors? (and yes, know multiple inheritance bad; i'm trying implement notion of mixins , happens appropriate way it)

syntax - In CoffeeScript, what is the existential operator for and how do you use it? -

this question has answer here: how coffeescript's existential operator work? 1 answer i see sorts of questions existential operator on so, none of them ask fundamental question of "what for" , "how use it?" thought i'd ask here. the answer here suffice answer question, problem question title doesn't suggest that. result, it's hard find question google search. so, intention here make easier learn operator google search. btw, aware of section in the little book on coffeescript titled "aliases & existential operator", reason don't explanation. doesn't make me feel "i it". the existential operator provides more concise , expressive way handle null , undefined properties. instead of if (user && user.url && user.url.indexof('foo')) you can do if user?.

ruby - Retrieving CallSid for incoming call -

when ruby script makes outgoing calls through twilio, it's piece of cake me find, output, , reuse call sid later such : @client = twilio::rest:client.new account_sid, auth_token call = @client.account.calls.create({ :from=>'inc', :to=>'out', :url=>'url', :method=>'get'}) puts call.sid this works fine outgoing calls make myself. the issue when try call sid incoming calls. get '/greeting' do twilio::twiml::response.new |r| r.say 'hello. welcome.' r.gather :numdigits => '1', :action => '/greeting/handle-gather', :method => 'get' |g| g.say 'for x, press 1. y, press 2. z, press 3.' end end.text puts twilio::twiml::request.callsid callsid = incoming_cid end the incoming_cid stored in mysql database later. i'm not sure if twilio::twiml::request.callsid correct way request parameters twil

c# - File gets locked after setting attributes -

i have method saves object file. object gets modified , saved multiple times. problem when i'm trying save object second time same file, i'm getting unautorizedaccessexception. here code: public void save(string path) { string filename = string.format("{0}\\{1}", path, datafilename); using (filestream fs = new filestream(filename, filemode.create)) { binaryformatter formatter = new binaryformatter(); formatter.serialize(fs, this); file.setattributes(filename, fileattributes.hidden); } } what's interesting, if comment line file.setattributes(filename, fileattributes.hidden); problem disappears. how comes? , how can solve problem? msdn says filemode.create : specifies operating system should create new file. if file exists, overwritten. requires fileiopermissionaccess.write permission. filemode.create equivalent requesting if file not exis

how to set file as a variable in bash -

i new in bash scripting set files variables in loop in bash script. have code: a=home/my_directory/*.fasta b=home/my_directory/*.aln in {1..14} # have 14 files in my_directory file extension .fasta clustalo -i $a -o $b # clustalo command of clustal omega software, -i # input file, -o output file done i want use fasta files in my_directory , create 14 new aln files. code doesnt work because clustal program doesnt recognize set files. if can thankful. if know there 14 files, this: for in {1..14}; clustalo -i home/my_directory/$a.fasta -o home/my_directory/$b.aln done if want process of *.fasta files, many there are, do: for file in home/my_directory/*.fasta; clustalo -i "$file" -o "${file%.fasta}.aln" done to understand this, ${file%.fasta} gives $file .fasta extension stripped off. if want store file names in variable first, best thing use array variable. adding parentheses around variable assignment,

python - reading an array with multiple items (working on two items not three) -

code below reads text file (containing different arrays) , breaks down separate elements. have working fine arrays 2 sub items, not third. for example - file works fine: ('january', 2, [('curly', 30), ('larry',10), ('moe',20)]) . staff = dict() item in filecontent: month = filecontent[0] section = filecontent[1] name, hours in filecontent[2]: staff[name] = hours print ("month:" + month) print ("section: " + str (section)) print ("".join("%s has worked %s hours\n" % (name, hours) name, hours in staff.items())) overtime = int(input ("enter overtime figure: ")) print ("".join("%s has worked %s hours \n" % (name, (hours + overtime)) name, hours in staff.items())) but have different month third array element (a bonus figure), example: ('february', 2, [('curly', 30, **10**), ('larry',10, **10** ), ('moe',20, **10**)]

javascript - JS Statement for Client Side Alert in .aspx.vb -

i new hard coding & vs. have created couple applications using .aspx beginning understand little more. i have form (.aspx) has yes/no dropdown box, if user selects yes, it's necessary populate following empty text box (textbox13 "reason/comment"). , need add client side alert message (using js, have found answer) have tried using samples have found. problem is, none of examples need. so far, did create .js page: $('#mp_form').submit(function(e) { if(!$.trim($(this).find('textbox13'="text"').val()).length){ e.preventdefault(); alert('if critical, must provide reason/comment.'); } }); } i added in master page, , understand need statement in aspx.vb page function. think onsubmit want not sure how write if, statement. can please me out? thanks! kathy have @ following jsfiddle . there's input , button. text in input use following: $('#inputid').val(); in case inputid comment,

Magento Add Event onlick on System Configuration Custom Module Field -

nowhere can find definition search. in mymodule namespace/modulename/etc/system.xml have: <faq_input translate="label"> <label>question collor: </label> <comment>example: #000000</comment> <frontend_type>text</frontend_type> <sort_order>20</sort_order> <show_in_default>1</show_in_default> <show_in_website>1</show_in_website> <show_in_store>1</show_in_store> </faq_input> i need add onclick event like: <input type="text" onclik="code(myevent)" value="xxx" > you need use <frontend_model> , can find examples in core (eg in app/code/core/mage/catalog/etc/system.xml ). the frontend model must block inheriting mage_adminhtml_block_system_config_form_field , has _getelementhtml() method can apply own code form element before rendering it. eg : protected function _getelementhtml(varien_data_form_

Android-Html: Is there any way to implement spoilers? -

sorry bad english. i'm parsing xml feed , want know, there way replace <blockquote>...</ blockquote> text spoiler? (collapsible block, e.g. "read more") you can write jquery, can reduced markup issue if use jquery mobile's collapsible or bootstrap collapse . edit : actually, if never going run in legacy browser, may able simplify lot css3. see example: http://www.cssportal.com/css3-preview/showing-and-hiding-content-with-pure-css3.php#sec1

paypal - Sandbox server access denied in Java app (works fine with cURL) -

i'm attempting simple pay call using adaptive payments api. receiving following exception: java.security.accesscontrolexception: access denied (java.net.socketpermission svcs.sandbox.paypal.com resolve) here's bit of java code give idea of i'm doing. httpclient httpclient = new defaulthttpclient(); httppost httppost = new httppost("https://svcs.sandbox.paypal.com/adaptivepayments/pay"); httppost.setheader("x-paypal-security-userid", user_id); httppost.setheader("x-paypal-security-password", password); httppost.setheader("x-paypal-security-signature", signature); httppost.setheader("x-paypal-application-id", application_id); httppost.setheader("x-paypal-request-data-format", "json"); httppost.setheader("x-paypal-response-data-format", "json"); /* bunch of stuff build json , put in entity */ httppost.setentity(entity); httpresponse httpresponse = httpclient.execute(httppos

ios - Unable to alter UIButton in EKEvent code -

i'm trying create button when pressed creates calendar event, , changes title of said button "event created" or perhaps creates an alertview same effect. code far: - (ibaction)addtocal:(id)sender { ekeventstore *store = [[ekeventstore alloc] init]; [store requestaccesstoentitytype:ekentitytypeevent completion:^(bool granted, nserror *error) { if (!granted) { //code handle not-granted } else { //code create event [event setcalendar:[store defaultcalendarfornewevents]]; nserror *err; [store saveevent:event span:ekspanthisevent error:&err]; [[nsuserdefaults standarduserdefaults] setbool:true forkey:[nsstring stringwithformat:@"%@sub", prevdest] ]; [[nsuserdefaults standarduserdefaults] synchronize]; [addreminder settitle: [nsstring stringwithformat:@"subscribed!"] forstate: uicontrolstatenormal]; uialertview *alert

java - Making a custom icon for a JFrame -

well wondering if make icon image jframe. know posible, because, let me say, not digging java logo. well if hava use frame object will. can tell me, know possible! first, have have image file on computer. can named anything. example, call 1 "pic.jpg". next, need include in files application using. example, if you're using netbeans, click on "files" in left hand side of ide (not file in menu, mind you). drag picture's file on folder houses main package. include available use in code. inside method define jframe, can create image this: image frameimage = new imageicon("pic.jpg").getimage(); you can set iconimage frame this: jframe frame = new jframe("title"); frame.seticonimage(frameimage); hope that's helpful. note: reason image object has created because image abstract , cannot instantiated saying new image(); props you, btw, kid. wish have started learning programming when age. keep @ it!

Failure on git subtree push with crazy output -

i created git subtree following instructions here - https://help.github.com/articles/working-with-subtree-merge perhaps unfortunely, did normal tortoisegit push on repository contained subtree. reason, changed file subtree listed in tortoisegit's changelist (it legitimately changed, btw), thought "oh! neat! tortoisegit automatically supports subtree!", went ahead , committed , did normal tortoisegit push. then test tortoisegit did thought, got clone of repository subtree located, , pulled. sadly, did not change subtree thought pushed in tortoisegit... so wasn't sure happened, resorted installing git-subtree , trying different variations of push command on subtree until seemed work - git subtree push --prefix=prime origin/prime prime/master git subtree push --prefix=prime prime prime/master git subtree push --prefix=prime/ -u prime/master git subtree push --prefix=prime/ prime/master git subtree push --prefix=prime/ prime prime/master git subtree push

mercurial - Django busting /static content -

what best stage in django append file timestamp urls start /static/ ? example urls: http://mydomain.com/static/css/... http://mydomain.com/static/img/... http://mydomain.com/static/js/... is there app , work mercurial vcs? you can try django-compressor this app combines several css/js files 1 file. , generates unique name file. example: {% load compress %} {% compress css %} <link rel="stylesheet" href="/static/css/one.css" type="text/css" charset="utf-8"> <style type="text/css">p { border:5px solid green;}</style> <link rel="stylesheet" href="/static/css/two.css" type="text/css" charset="utf-8"> {% endcompress %} result like: <link rel="stylesheet" href="/static/cache/css/f7c661b7a124.css" type="text/css" charset="utf-8">

ruby on rails - How to return appropriate header for Tire search results? -

if go www.leapfm.com , make search lets "dubstep" return of dubstep songs. however, header still listed "top songs" i'd instead change search results "dubstep" 5 when search made. i tried hacky solution didn't work <% if tire.search.results %> <h6>search results:</h6> <% else %> <h6>top ranked songs</h6> <% end %> any ideas? i'm using this gem and here's documentation the problem more or less making "top songs" header change, , search results returning in index makes difficult. a simple check against parameters work: <% if params[:query].present? %> <h6>search results:</h6> <% else %> <h6>top ranked songs</h6> <% end %>

javascript - Highcharts - change color while hovering over a slice in pie chart -

i have simple pie chart that's green , change slice color red once hover on it. i'm trying api, it's not working... here's jsfiddle: http://jsfiddle.net/tdkgw/4/ trying via states/hover method, it's not working: states: { hover: { brightness: 0, color: 'red' } } any idea on how can have slice you're hovering on (or mouseover) have red fill? , change green once mouseout. thanks you can catch mouseover event on point , set fill, catch mouseout of series, , "recover color" setting default. plotoptions: { series: { states: { hover: { enabled: false } }, point: { events: { mouseover: function () { this.graphic.a

lamp - iphone: a local server to test my app -

the app i'm developing, needs interact server, accomplish operations: save user's data, retrieve data other users, services , on... before paying rent space on server, i'd test app making interact server located on computer, simulating real lamp server localhost. did ever tried same? can suggest me lamp server can use locally? suggest other solution in place of 1 i'm seeking? thanks help while server running make requests own ip address. i'm confident work while using simulator, , work app. in terms of finding lamp server software mac... should check out mamp allows simulate server on mac.

gtk - Python : Returning a pyGTK object for packing -

how pass gtk object among classes , functions ? i have gui class, gtkwindow, , have player class, vbox play button , slider, , gst pipeline playbin. (pseudo-code) class player(object): def __init__(self): self.play_button = gtk.button() self.slider = gtk.hscale() self.hbox = gtk.hbox() self.hbox.pack_start(self.play_button, false) self.hbox.pack_start(self.slider, true, true) def getbox(): return self.hbox class gui: def __init__(self, dname = none): player = player() playerbox = playerbox.getbox vbox = gtk.vbox() vbox.pack_start (playerbox, false, false, 1) but typeerror: gtk.box.pack_start() argument 1 must gtk.widget, not instancemethod maybe it's not right way it, , boxes must live in same class everytime..? you neglected call getbox method. instead of playerbox = player.getbox , need write playerbox = player.getbox() . writing former extracts functi

Spring Controller method executed twice -

i have integrated spring security spring mvc , seeing strange behaviour. every method in controller executed twice same request. googled quite bit didn't much. closest find http://forum.springsource.org/archive/index.php/t-83158.html tried suggestions without success. here web.xml : <servlet> <servlet-name>appservlet</servlet-name> <servlet-class>org.springframework.web.servlet.dispatcherservlet</servlet-class> <load-on-startup>0</load-on-startup> </servlet> <servlet-mapping> <servlet-name>appservlet</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> <listener> <listener-class>org.springframework.web.context.contextloaderlistener</listener-class> </listener> <filter> <filter-name>springsecurityfilterchain</filter-name> <filter-class>org.springframework.web.filter.delegatingfilterproxy</filter

compiler errors - Signal is connected to following multiple drivers -

i trying run following , receive error: here's verilog code: module needle( input referrence,input penalty,output index[7:0]); //inout input_itemsets; //input referrence; //input penalty; //output index; parameter max_cols=8; // wire index[7:0]; wire referrence; wire penalty; //wire input_itemsets; genvar i,idx; generate for( = max_cols-4 ; >= 0 ; i=i-1) for( idx = 0 ; idx <= ; idx=idx+1) begin assign index[i] = (idx + 1) * max_cols + (i + 1 - idx); //assign index = (idx + 1) * max_cols + (i + 1 - idx); //input_itemsets[index] <= maximum( input_itemsets[index-1-max_cols]+ referrence[index], //input_itemsets[index-1] - penalty, //input_itemsets[index-max_cols] - penalty); end endgenerate endmodule and here's warnings , errors receive: warning:hdlcompiler:413 - "/home/suriyha/monajalal/needle_t1/needle.v" line 39: result of 4-bit expression truncated fit in 1-bi

c# - Is it possible to pass a Session variable (object) to an API as a parameter? -

i have web page search criteria. once user selects wants , inputs keywords search, re-directed page shows results of search. this session object contains of information of search: var projectsearchcriteria = (gblprojectsearchcriteria) session[gblconstants.session_project_search_criteria]; is there way me pass object api? like so: [httpget] public list<string> getepisodes(gblprojectsearchcriteria psc) { var projectsearchresult = new projectsearchresultcontroller(); var gblprojectsearchresultlistdata = projectsearchresult.getprojectsearchresultlist(psc); return (from gblprojectsearchresult item in gblprojectsearchresultlistdata select item.title).tolist(); } the reason why want because search criteria massive , exists don't want api have 38032823 parameters. is possible? how it? alternatives? web api binds parameters either uri, query string, etc. or request body. if want bind thing else, outside of request

c - How would I go about making this udpclient asynchronous using pthreads? -

how go making udpclient asynchronous using pthreads? want make sure udp datagram won't lost , don't want client program wait forever , not able send more messages /*udpclient.c program */ #include <stdio.h> #include <stdlib.h> #include <string.h> #ifdef win #include <winsock.h> #include <windows.h> #endif #ifndef win #include <sys/types.h> #include <arpa/inet.h> #include <sys/socket.h> #endif /* here details of sockaddr_in structure , sockaddr structure these declarations copied winsock.h struct in_addr { struct holds 32 bit ip address union { struct { u_char s_b1,s_b2,s_b3,s_b4; } s_un_b; struct { u_short s_w1,s_w2; } s_un_w; u_long s_addr; } s_un; #define s_addr s_un.s_addr struct sockaddr_in { notice structure 16 bytes long short sin_family; u_short sin_port; struct in_addr sin_addr;