Posts

Showing posts from June, 2012

python - How to find the relationship, or ratio, between these hex colors? -

i'm looking implement similar http://colorschemedesigner.com/ in program i'm writing, , i've taken 3 sample colors, , colors tool found fits within scheme, , reverse-engineer pattern here, try , figure out how create own tool, since doesn't provide api, far can tell. i've pulled 3 colors here, 1 degree of hue apart each other, colors follows, master color being color entered tool. color rbg hls mstr hex: ff0000 255 0 0 (0.0, 0.5, 1.0) frst hex: bf3030 191 48 48 (0.0, 0.46862745098039216, 0.5983263598326359) scnd hex: a60000 166 0 0 (0.0, 0.3254901960784314, 1.0) thrd hex: ff4040 255 64 64 (0.0, 0.6254901960784314, 1.0) frth hex: ff7373 255 115 115 (0.0, 0.7254901960784313, 1.0) color rbg hls hex: ff0700 255 7 0 (0.004575163398692812, 0.5, 1.0) hex: bf3330 191 51 48 (0.003496503496503489, 0.46862745098039216, 0.5983263598326359) hex: a60400 166 4 0 (0.004016064257028125, 0.3254901960784314, 1.0) hex: ff4540 255 69 64 (0.004363001745200675, 0.6254901960784314, 1....

asp.net mvc - Prevent JsonResult from auto-formatting Dates -

i'm writing cloud based program utilizes utc date saving server, , convert on round trip. problem is, instance in cloud autoconverting jsonresult datetime values according localization settings on browser obtaining result. i have gone through tons of steps make sure server side code on both levels returning proper data, , on instances, , no javascript code on page making change either (even removed javascript date formatting in case), have traced out firebug determine exact point changes, when page receives json result jsonresult method. said, have debugged values before being sent page, , proper, , on response, modified based upon browser location.... has had similar problem? value returned:date(1341792000000) 07/08/2012 17:00 should be: date(1341817200000) (07/09/2012 12:00am) thanks i ended getting proper results, many modifications application. did lot of stuff make happen... first, implemented timezone.js listing of timezones used within application, , used jstz curr...

gtk - Why isn't my toolitem's proxy menu item being used? -

i want show custom menu item toolitem when in toolbar's overflow menu. seems purpose of set_proxy_menu_item method. however, when set proxy menu item via using method, has no effect on overflow menu. still uses default menu item (with toolitem's name label). here simple project (in vala) reproduces problem. creates tiny window containing toolbar 3 buttons. window should small enough 1 of these buttons in overflow menu. when view overflow menu, should see "proxy" menu item edit_button . instead, see "edit". what doing wrong? void main(string[] args) { gtk.init(ref args); mainwindow main_window = new mainwindow(); main_window.show_all(); gtk.main(); } public class mainwindow : gtk.window { public mainwindow() { destroy.connect(gtk.main_quit); title = "main window"; gtk.box main_box = new gtk.box(gtk.orientation.vertical, 6); add(main_box); gtk.toolbar toolbar = new gtk.toolbar(); main_box.pack_start(toolbar, false, false); gtk.toolbutton new_b...

External Program Configuration zend studio -

Image
in eclispe, able go run > external tools > external tools configuration , see option called "program" on left. there can add configuration runs external perl script, in case 1 scps file i'm working on remote server. is possible in zend studio? can't see "program" option in configuration panel - left pane blank. hoping there's straightforward answer this, thanks! this matter of configuration filtering. filtering pull-down menu (see screenshot) , uncheck "filter configuration types" option.

keylistener in java not working -

i want java program running in background default, use keylistener call changewallpaper class. changewallpaper class definently works, keylistener not call method. keyevent changed later it's testing. import java.awt.event.keyevent; import java.awt.event.keylistener; public class listener implements keylistener { public static void main(string[] args){ } @override public void keyreleased(keyevent arg0) { int key = arg0.getkeycode(); if (key == keyevent.vk_up) { changewallpaper.main(); } } @override public void keytyped(keyevent arg0) { int key = arg0.getkeycode(); if (key == keyevent.vk_up) { changewallpaper.main(); } } @override public void keypressed(keyevent arg0) { int key = arg0.getkeycode(); if (key == keyevent.vk_up) { changewallpaper.main(); } } } a keylistener not listen keyboard events indiscriminately - listens events on particular component, when component has keyboard focus. have attach listener addkeylistener method or similar. see java how write key listener ...

c# - WndProc in my WPF app not 'handling' WM_INPUT event -

[edit] here's i've gleaned mouse input handling far. note i've learned via bunch of different sources , via experimentation, don't take gospel: 1) mouse event originates mouse move 2) setwindowshookex(wh_mouse_ll) handler lowlevelmouseproc sees event first 3) os/app framework handles mouse event @ high level (mouse cursor moves) 4) wm_input event picked app event queue , handled wndproc (although handling @ time not stop mouse cursor moving in step 3). 5) message dispatched via componentdispatcher 6) previewmousemove , mousemove events triggered , may handled app. based on this, think way ensure mouse cursor doesn't move filter via wh_mouse_ll. of course, i've mentioned earlier in post, there isn't sufficient information @ point know device mouse event coming from, it's or nothing filtering, doesn't meet requirements. [edit] i've verified i'm able drop events hooking wh_mouse_ll , returning value larger 0 handler. need figure out how matc...

Set a Jenkins variable after reading console log line / value --OR-- using the variables used by scripts / commands what Jenkins calls -

i dont need following: how set jenkins env variable or how use environment variables in jenkins / windows shell / ant / etc scripts. what need opposite of that. summary: 1. have jenkins job: abc_build 2. job calls .bat file (which calls ant code / target packaging / building build). creating build, job know what's new build label name , ant storing in variable called "new.build.label". file used build.xml. (a note novice users: if want call many windows commands (.bat / .cmd or commands creates windows shell) then, should call using "call script.bat -dparam1 -dparam2...." way). now, job calls .bat file (which calls ant code /target) , uses 1 of parameter value gets generated first .bat file / ant package target call (i.e. "new.build.label"). separate .bat command call call new session of ant code/target, need pass value of "new.build.label" during call of step. file used here deploy.xml. basically, i'm trying see how can set ...

ruby on rails - When attempting to void a Hold on balanced payments that had been captured, why is the response a Hold with is_void == true? -

when using balanced payments ruby gem (https://github.com/balanced/balanced-ruby), , using balanced::hold#void method on balanced::hold instance captured, getting balanced::hold has is_void property set true . that doesn't seem make sense... desired functionality? here's output rails console: https://gist.github.com/3063419 i not sure if desired functionality. happy log issue if thinks doesn't make sense. ah, seems balanced client, in lib/balanced/resources/hold.rb#l26 not handle exception thrown when save invoked. the proper fix be: def void self.is_void = true begin save rescue balanced::error self.is_void = false raise end end i'll file github issue.

iphone - Reading a Text file in xcode -

first off, i'm complete beginner. this might stupid question, here goes: i'm working on app contains latin texts users can view , read. i'm using xcode 4 storybord function. theway app built: user selects author - book - app shows text. i kind of confused because need have various text files, depending on users choice. as have done or embedded files resource , using below code read-out files in .h file -(nsstring *)readfile:(nsstring *)filename; in .m file -(nsstring *)readfile:(nsstring *)filename { nslog(@"readfile"); nsstring *appfile = filename; nsfilemanager *filemanager=[nsfilemanager defaultmanager]; if ([filemanager fileexistsatpath:appfile]) { nserror *error= null; nsstring *resultdata = [nsstring stringwithcontentsoffile: appfile encoding: nsutf8stringencoding error: &error]; if (error == null) return resultdata; } return null; } may you enjoy coding :) edit what have done according date change on 1 button click , @ time of viewwillap...

drupal - Add range to each option in a dropdown menu array instead of single value? -

edit: my original post included @ bottom of issue, vague, i'm trying update make myself more clear. there section of site users submit reviews of businesses. in 1 such field, select whether or not had bar tab. given options of none, drinks, food, , both. when submit option stored in database float value, none being stored 0, drinks 1, food 2, , both 3. avg of these values single field display on pages of businesses. so, if business has average value of .5 bar tab shows "none", value of 1.2 "drinks", etc. i have view displays teasers of business pages, , users can filter results results of fields on business page. have dropdown menu display options filter, i'm not sure how assign range each value in array instead of single value. here's have: $options = array( '' => 'any', '0' => 'none', '1' => 'drinks', '2' => 'food', '3' => 'both', ); as can see, if user ...

multithreading - Application design for parallel collection processing -

i'm experimenting system.collections.concurrent namespace have problem implementing design. my input queue (concurrentqueue) getting populated fine thread doing i/o @ startup read , parse. next kick off parallel.foreach() on input queue. i'm doing i/o bound work on each item. a log item created each item processed in foreach() , dropped result queue. what kick off logging start reading input because may not able fit of log items in memory. best way wait items land in result queue? there design patterns or examples should looking at? i think pattern you're looking producer/consumer pattern . more specifically, can have producer/consumer implementation built around tpl , blockingcollection . the main concepts want read are: task , blockingcollection , taskfactory.continuewhenall (will allow perform action when set of tasks/threads finished running). bounding , blocking in blockingcollection . allows set maximum size output collection (for memory reasons) ,...

iphone - Request with NSMutableURLRequest -

i tried make login page make user authenticate website. tried like: nsurl *myurl = [nsurl urlwithstring:@"https://www.freelancer.com/users/onlogin.php"]; nsmutableurlrequest *request = [nsmutableurlrequest requestwithurl:myurl cachepolicy:nsurlrequestreloadignoringlocalcachedata timeoutinterval:60]; nslog(@"ispost"); [request sethttpmethod:@"post"]; [request setvalue:usernamefield.text forkey:@"username"]; [request setvalue:passwordfield.text forkey:@"passwd"]; nsurlconnection *theconnection = [[nsurlconnection alloc] initwithrequest:request delegate:self]; if (!theconnection) { uialertview *alert = [[uialertview alloc] initwithtitle:@"network error" message:@"could not login!" delegate:nil cancelbuttontitle:@"ok" otherbuttontitles:nil]; [alert show]; [alert release]; return; } i got erroras followed: 2012-07-07 10:09:37.354 auth[6062:f803] ispost 2012-07-07 10:09:37.357 auth[6062:f803] *** terminating...

MongoDB,Mongoose,Nodejs,Object id -

Image
i trying query based on time stamp in object id,saw posting below can query mongodb objectid date? not work mongoose driver.does knows way .it complains no reference objectid mongodb,mongoose,nodejs,object id - stack overflow stack overflow questions developer jobs documentation beta tags users current community help chat stack overflow meta stack overflow communities sign up or log in customize list. more stack exchange communities company blog tour start here quick overview of site center detailed answers questions might have meta discuss workings , policies of site learn more stack overflow company business learn more hiring developers or posting ads log in sign up learn, share, build each month, on 50 million developers come stack overflow learn, share knowledge, , build careers. join world̢۪s largest developer community. sign up ...