Posts

Showing posts from January, 2010

What is the maximum debuglevel for a Python httplib -

these docs not maximum debug level is. i need know that. i went through httplib.py , code littered following statement: if self.debuglevel > 0: this means there 2 levels. debuglevel less or equal zero debuglevel greater zero yes have been better documented. also time need check such information, can @ code. here favorite approach locate source file particular module. >>> import httplib >>> httplib.__file__ '/opt/local/library/frameworks/python.framework/versions/2.7/lib/python2.7/httplib.pyc' now can open following file go through it's source code /opt/local/library/frameworks/python.framework/versions/2.7/lib/python2.7/httplib.py

c# - asp.net Internet Explorer image cache? -

i'm writing asp.net app in c#. in program image of schedule grid has lines drawn on depending on selections user. when user selects day, image redrawn show scheduled time"lines" day. works fine in chrome, , firefox, in internet explorer(9) image won't change day, displays whatever first image regardless of day user selects afterward. i used code on code-behind because thought caching image, didn't resolve issue. pointers? response.cache.setnostore(); response.cache.setcacheability(httpcacheability.nocache); (a standard clean grid image loaded, drawn on, renamed , saved different local folder. new image loaded image control on screen. happens every time user changes days.) you refer ms's documentation on avoiding image caching: http://msdn.microsoft.com/en-us/library/w9s3a17d(v=vs.71).aspx and place in page_load method: response.cache.setcacheability(httpcacheability.nocache) but since naming file @ run time, name file differently each time (maybe u...

Class not found for UIMA pear fle -

i new in uima. working pear files annotation purposes pubmed xml file. have installed julie lab medline reader uima collection reader file , lingpipe gazeteer analysis engine. have run cpe generator , tried proper annotated words, failed that. following error occurred: the class de.julielab.jules.reader.reader.medlinereader not found descripotor file=file/c:/apache-uima/examples/descriptor/collection reader/julie-medline-reader 1.7/desc/medlinereaderdesciptor.xml causedby: org.apache.uima.resourceinitializationexception:the class de.julielab.jules.reader.reader.medlinereader not found caused by: java.lang.classnotfound exception de.julielab.jules.reader.reader.medlinereader it great me give me solution error. have in medlinereader collectionreader descriptor in pear at c:/apache-uima/examples/descriptor/collection reader/julie-medline-reader 1.7/desc/medlinereaderdesciptor.xml and @ typesystem imports: <typesystemdescription> <imports> <import location="...

eclipse - Download Google's API in Android SDK Manager -

Image
according android documentation, google api included in android 4.0.3(api15), however, did not download me , there no option me add third party apis anywhere (see image below) is there way add google apis google inc.? thanks! i googled question, , turned out stackoverflow question regarding matter. maybe solution you. eclipse/android: can't install google apis targets basically says need update adt plugin eclipse. try performing update shows in adt (can see in image posted) good luck

php - Use Javascript to keep track of a function unique to each div -

so here goal, need able determine color of background of div user clicks on. each div has function determines background. how use javascript keep track of functions or easier send data url can compare predetermined code? <?php "session_start" ?> <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>untitled document</title> </head> <?php $cols = array( "#000000", "#ffffff", "#0000ff", "#008000", "#800080", "#ff0000", "#ffff00", "#dd7500", "#4fd5d6", "#cd6090", ); function getrandomcolor1() { global $cols; $num_cols = count($cols); $rand = array_rand($cols); $rand_col = $cols[$rand]; u...

sql server 2005 - SQL Pivot Table isn't working -

sql 2005 i have temp table: year percentmale percentfemale percenthmlss percentemployed totalsrvd 2008 100 0 0 100 1 2009 55 40 0 80 20 2010 64 35 0 67 162 2011 69 27 0 34 285 2012 56 43 10 1 58 and want create query display data this: 2008 2009 2010 2011 2012 percentmale 100 55 64 69 56 percentfemale - 40 35 27 43 percenthmlss - - - - 10 percentemployed 100 80 67 34 1 totalsrvd 1 20 162 285 58 can use pivot table accomplish this? if so, how? i've tried using pivot have found no success. select percenthmlss,percentmale,percentfemale, percentemployed,[2008],[2009],[2010],[2011],[2012] (select percenthmlss,percentmale, percentfemale, percentemployed, totalsrvd,year @temptable)as t pivot (sum (totalsrvd) year in ([2008],[2009],[2010],[2011],[2012])) pvt this result: percenthmlss percentmale percentfemale percentemployed [2008] [2009] [2010] [2011] [2012] 0 55 40 80 null 20 null null null 0 64 35 67 null null 162 null null 0 69 27 34 null null null 285 null 0 100 0 100 1 n...

php - Loading the 500.shtml page when there is error -

file.php <?php ini_set('display_errors', 0); if(){ echo 'test'; ?> i want hide error , show 500.shtml page, see google chrome error page. // 500.shtml <!doctype html public "-//ietf//dtd html 2.0//en"> <html><head> <title>500 internal server error</title> </head><body> <h1>internal server error</h1> server encountered internal error or misconfiguration , unable complete request.<p> please contact server administrator , inform them of time error occurred, , might have done may have caused error.<p> more information error may available in server error log.<p> </body></html> chrome shows it's own page 5xx-errors.

MobFox in Android - MobFoxView fails to instantiate -

i using mobfox android. have mobfoxview in 1 of layouts. runs fine when compile android 4.0.3. however, wanted try , build 2.0.1, , won't work. on visual editor following error: the following classes not instantiated: - (open class, show error log) see error log (window > show view) more details. tip: use view.isineditmode() in custom views skip code when shown in eclipse in error log see: com.mobfox.sdk.mobfoxview failed instantiate. java.lang.nullpointerexception @ com.mobfox.sdk.mobfoxview.<init>(mobfoxview.java:189) @ sun.reflect.nativeconstructoraccessorimpl.newinstance0(native method) @ sun.reflect.nativeconstructoraccessorimpl.newinstance(nativeconstructoraccessorimpl.java:39) @ sun.reflect.delegatingconstructoraccessorimpl.newinstance(delegatingconstructoraccessorimpl.java:27) my mobfox view code is: <com.mobfox.sdk.mobfoxview android:id="@+id/mobfoxview" android:layout_width="fill_parent" android:layout_height="50dp" mode=...

Getting button list from a window menu - AppleScript -

Image
i can main menu item , have been able use system events select , click specific button in window. running issue want 'handles' of buttons belong popup 'sheet'. instance, "airplay" button in itunes: i can button click open sheet using similar this: click button 10 of window "itunes" of application process "itunes" of application "system events" and use key code manually scroll , down, though looking efficient , elegant solution of selecting specific button want (by name ie: "computer" in case) i using accessibility inspector , can info menu: <axapplication: “itunes”> <axwindow: “itunes”> <axmenu> <axmenuitem: “airport express”> attributes: axrole: “axmenuitem” axroledescription: “menu item” axparent: “<axmenu>” axenabled: “1” axposition: “x=1070 y=798” axsize: “w=146 h=22” axtitle: “airport express” axhelp: “(null)” axselected (w): “1” a...

database - How to connect MS ACCESS DB with my asp.net website -

i trying connect ms access db asp.net website. when run code(on localhost only) not show error or exception wait server response. following code : string connection = "provider =microsoft.ace.oledb.12.0; datasource=i:/adittya/test.accdb"; string query = "select * test"; oledbconnection con = new oledbconnection(connection); oledbcommand cmd = new oledbcommand(); cmd.commandtext = query; cmd.commandtype = commandtype.text; oledbdatareader dr = cmd.executereader(); datatable dt = new datatable(); dt.load(dr); testgrid.datasource = dt; testgrid.databind(); one more thing db in pen-drive location static. do have problem code or cannot connect db present in pen-drive. try data source as datasource=i:\\adittya\\test.accdb

charts - Charting with F# does not take in Seq? -

following real-world functional programming blog drawing bar , column charts, trying draw histogram data stored @ set of tuples (data_value, frequency) in lazy sequence. it not work unless convert sequence list, error message being in case of sequence " the ienumerable 't not support reset function ". there way generate histogram/chart etc. using .net library lazily-evaluated sequence? also (ok newbie query alert), there way make chart persist when program run console? usual system.console.readkey() |> ignore makes chart window hang, , otherwise disappears in instant. i've been using "send interactive" see results til now. the problem sequences (of type seq<t> , alias ienumerable<t> ) generated using f# sequence expression notation not support reset method. method required charting library (because needs obtain data each time redraws screen). this means that, example, following not work: seq { x in data -> x } |> fsharpchart....

android - need to reduce spinner font size and width -

i need reduce font size , width of spinner means need small spinner.below copy code of spinner. my code:in main.xml: <spinner android:id="@+id/fromspinner" android:layout_width="100dp" android:layout_height="30dp" android:layout_marginleft="50dp" android:layout_margintop="-20dp" android:prompt="@string/country_prompt" android:entries="@array/from_spinner"/> in strings.xml:choose country <string-array name="from_spinner"> <item>chennai</item> <item>salem</item> <item>delhi</item> <item>mumbai</item> </string-array> ` you need use custom view , inflate using adapter full control. if define array in strings.xml , assign entries have limited control. can have control using html format in xml itself. for example: bolding entry (this works) <item><b>chennai</b></item> i don't know if work size try out.... ...

iphone - What is a action or IBAction method? -

possible duplicate: iboutlet , ibaction i'm relatively new objective c, not programming in have experience both c , python. wondering ibaction method , can do, , how incorporate program. and, if possible, there way in c bypass method , write in c? in advance ibactions of type void . however, want use ibaction instead sake of interface builder. interface builder integrated service in xcode use design application, , attach layout code. interface builder 'knows' want connect because of 1 of 2 types. once define iboutlet or ibaction in code, literally drag , drop connect in interface builder. can use ibaction, example, if want make touch event listener (or along lines). you can read more iboutlets , ibactions apple developer page on topic @ https://developer.apple.com/library/mac/#documentation/general/conceptual/devpedia-cocoaapp/targetaction.html (it's article os x developers, still applies ios since 2 built similar frameworks).

ios - UITableView: using moveRowAtIndexPath:toIndexPath: and reloadRowsAtIndexPaths:withRowAnimation: together appears broken -

Image
i want use ios 5's nifty row-movement calls animate tableview match model state changes, instead of older-style delete-and-insert. changes may include both reordering , in-place updates, , want animate both, rows need reloadrowsatindexpaths . but! uitableview appears plain wrong in handling of row reloads in presence of moves, if updated cell shifts position because of moves. using older delete+insert calls, in way should equivalent, works fine. here's code; apologize verbosity compile , run. meat in domoves: method. exposition below. #define thisworks @implementation scrambledlist // extends uitableviewcontroller { nsmutablearray *model; } - (void)viewdidload { [super viewdidload]; model = [nsmutablearray arraywithobjects: @"zero", @"one", @"two", @"three", @"four", nil]; [self.navigationitem setrightbarbuttonitem:[[uibarbuttonitem alloc] initwithtitle: #ifdef thisworks @"\u0001f603" #else @"\u0001f4a9...

xaml - C# textbox keydown triggered twice in metro applications -

i m working on c# , xaml metro applications. have textbox , want once enter pressed in textbox new textbox appears. instead of 1 textbox, m getting 2 textboxes. did debugging n realized triggerd twice. not able figure out why triggerd twice. here code of application private void textbox_keydown_1(object sender, windows.ui.xaml.input.keyroutedeventargs e) { if (e.key == windows.system.virtualkey.enter) { //code producing textbox } } when m debugging, once above block executed, going layoutawarepage.cs , control sent ths code snippet private void coredispatcher_acceleratorkeyactivated(coredispatcher sender, acceleratorkeyeventargs args) { var virtualkey = args.virtualkey; if ((args.eventtype == coreacceleratorkeyeventtype.systemkeydown || args.eventtype == coreacceleratorkeyeventtype.keydown) && (virtualkey == virtualkey.left || virtualkey == virtualkey.right || (int)virtualkey == 166 || (int)virtualkey == 167)) { var corewindow = window.current.corewindow; var downstate = co...

java - Event Pattern Detection with Reaction/ECA rules on Stream of Events using AND, OR and SEQ -

Image
i have event stream events set of attribute/value-pairs, like: e1 = {(id, val), (attr, val), (attr, val), ... } want detect simple patters using snoop style event algebra, namely and, or, seq , no parentheses. example: e1 , e2 or e4 , e identifier. now, want use event processing engine track event stream , react, in case pattern found. rules similar ruleml eca rule in example: <rule style="active" ...> <on> e.g. e1 seq/and/or ... </on> <do> alert </do> </rule> these rules ought generated/parsed list. awesome, if recommend me cep engine able detect simple patterns stated above. i've tried esper , prova (prolog + java), not manage "parse" patterns list set of rules. highly appreciated! does know, if drools might trick? especially, need able use and,or,seq within on/when-part of rule. java - event pattern detection reaction/eca rules on stream of events using and, or , seq - stack overflow stack overf...