Posts

Showing posts from January, 2011

python - Django manage.py only returning list of subcommands and options -

i'm sure i'm overlooking simple, i've tried multiple times , still run same problem. i have installed python 2.7.1 , django 1.2.4 on windows vista . i create project using django-admin startproject projectname . creates folders , files needed. i try running manage.py runserver , receive in return available commands , options manage.py. what missing here? see no output other this. thanks in advance. have run manage.py runserver , if have, try python manage.py runserver ?

jqGrid navigator - how to specyfy settings globally? -

i'm using navigator jqgrid , i'm repeating on , on settings such as: savekey: [true, 13], closeonescape: true, closeafteradd: true how can define these settings globally grids on current page? i know how specyfiy jqgrid settings globally, have problems navigator. sample navigator definition looks this: $("#dictionaryelementsgrid").navgrid( "#dictionaryelementspager", { search: false, edit: true, add: true, del: true }, { // edit options: savekey: [true, 13], closeonescape: true, closeafteredit: true }, { // create options: savekey: [true, 13], closeonescape: true, closeafteradd: true } ); the object jquery.jgrid.edit responsible default setting of add , edit forms, can include in common javascript code following: jquery.extend(j...

delphi - Get source line number from map file for a DLL -

when exe raised exception message "access violation @ address xxxxxxxx...", address xxxxxxxx hex value, , can source code line number caused exception, looking @ map file. details below ( by madshi @ ee ): you need substract image base, $400000. furthermore need substract "base of code" address, stored in image nt headers of each module (exe/dll). it's $1000. can check value has using freeware tool "peprowse pro". it's field "base of code" in "details" of "optional header". you'll find image base address there. my question is : how source line number dll ? same calculation apply? thanks! note 1: map file generated delphi , i'm not sure if matters. note 2: i've been using jcl debug couldn't catch exception seems occurred @ startup of dll (an office add-in, actually). same calculations apply, following note: instead of image base address of exe you'll ne...

tfs2010 - Resolve/Close TFS Scenario only with inactive children / links -

my company uses tfs 2008 msf agile process template. in process of planning upgrade tfs 2010. use scenarios container functional requirements linked development tasks, bugs, etc. in order save state of scenario 'resolved' or 'closed', enforce development task or bug linked scenario closed. tfs 2008, these links, in tfs 2010 plan use child work items. i have been reviewing work item type definition schema , msdn documentation, nothing jumping out @ me solution problem. can done? in advance help! what want cannot done directly. saving of work item called notification (rather decision). means can tfs api stuff in event after done. cannot block it. however, there ways "effect" of looking for. if modified template parent work item (i think called scenario) had state control ( not field ) read make clients don't use normal visual studio controls can change value. (this worked around users, take effort break rules). but there 1 mor...

Is there a reason why Python's ctypes.CDLL cannot automatically generate restype and argtypes from C header files? -

for example, nice able this: from ctypes import cdll mylib = cdll('/my/path/mylib.so',header='/some/path/mylib.h') instead of from ctypes import * mylib = cdll('/my/path/mylib.so') mylib.f.restype = c_double mylib.f.argtypes = [c_double, c_double] mylib.g.restype = c_int mylib.g.argtypes = [c_double, c_int] my experience python suggests either close has been done , haven't been able find it, or there reason not to. either of these case? i asked myself same question , before traveled down road far, ran ctypesgen: http://code.google.com/p/ctypesgen/ it handle of you, although need little learning front. use ctypesgen generate 1 version of python bindings subversion bindings. works well.

functional programming - Error with functions inside tuples in Haskell -

i'm playing little haskell , i'm stuck error, using snd function tuple (string, list). snd ("felix felices",[("escarabajos machacados",52,[f1,f2]),("ojo de tigre sucio",2,[f2])]) error - cannot find "show" function for: *** expression : snd ("felix felices",[("escarabajos machacados",52,[f1,f2]),("ojo de tigre sucio",2,[f2])]) *** of type : [([char],integer,[(integer,integer,integer) -> (integer,integer,integer)])] the thing is, if remove f1, f2 , f3 (they functions) code works fine, returns list. why happening, why can't put function inside tuple's second position? you can put functions tuples. can't display them - ghci wants show result , print it. how should show (convert string) functions? can't, or @ least nobody felt choosing 1 way of doing (which propably flawed anyway - @ least can't think of approach doesn't have holes huge can see them). therefore, ...

gwt - how to remove the focus on disclosure panel's header -

i noticed whenever click disclosure panel's header, got focused, namely can see black dotted border around header, there way can rid of that? thanks. you can achieve setting css style outline:0 on disclosure header: .gwt-disclosurepanel .header { outline:0; } see http://css-tricks.com/removing-the-dotted-outline/ need remove outline a anchor element.

javascript - Can this type checks with "object" be improved? -

if (typeof !== "object" && typeof b !== "object") { return == b; } ... // check pairwise equality of object & b using `for in` is same if (typeof !== "object") { return == b; } is there b typeof b === "object" change semantics? are there horrible edge cases should aware of? comparisons between object , native type have non-intuitive boolean equality or disequality? including bugs in browser (i mean ie6!) the second check not quite same first, no, because javascript weakly typed @ least consider " .tostring() effect", others. example these fail first check, pass in second: var = "[object object]"; var b = {}; or, bit simpler (showing case may want consider...but passes both checks): var = 0; var b = "0"; one fix value and type check === which strict comparison operator , type checking well...but i'm not entirely sure that's you're after, since curr...

html - Internet Explorer JavaScript - newline characters crashing script -

i have onclick event in javascript have chosen format below: <a href="" onclick = " $('.white_content').html('<img src=\'/making.gif\'>'); $.ajax({ url: '/show_album.php?id=<?=$album['id']?>', type: 'get', success: function(data){ $('.white_content').html(data); }, error: function(){ alert('failed'); } }); return false;"> in firefox, fine, in internet explorer 8 script crashing because of way have layed out code in new lines instead onclick attribute. does know way fix this? still developing page , others using similar code , keep clean layout opposed on 1 line. if inspect onclick attribute in internet explorer developer tools find each line seperated several strange boxes assume represent unknown characters, in ie, causing error. do followin...

iphone - Push/Pop View Controller EXC_BAD_ACCESS -

anyone know why if push/pop localsearchviewcontroller, exc_bad_access error after 5 push/pops if (localsearchviewcontroller == nil) localsearchviewcontroller = [[localsearchviewcontroller alloc] init]; cbaappappdelegate *app = (cbaappappdelegate *) [[uiapplication sharedapplication] delegate]; [app.navbarcontroller.navigationbar sethidden:yes]; [app.navbarcontroller pushviewcontroller: localsearchviewcontroller animated:yes]; i don't know if cause if crash unless have overwritten view controller's init method, should using designated initialiser instead: - (id)initwithnibname:(nsstring *)nibname bundle:(nsbundle *)nibbundle and if have method defined in implementation file, make sure calling super on too. if doesn't solve problem, can try , find code crashing setting breakpoints through method , within localsearchviewcontroller well. on release problem somewhere in code. [edit add] here's co...

.net - Alert that a WPF UserControl's dependency property must be set? -

i find when create wpf user controls, because need expose couple of additional dependency properties. typically, properties must set control work in intended way, , there no meaningful default value (because, example, property bound else). when comes using/consuming controls, week or more after creating user control, never remember properties need set in markup. i can't imagine way make these "required" in xaml editor, there good/standard place throw meaningful exception if/when property has not been set? you add them "required" designer category can @ least find them later. mark clr property [category("blah")] attribute. lame might suffice.

Using custom form builders with nested models in Ruby on Rails -

i'm using nested model form technique railscast 197 (asciicast here ). i'm running problem setup, need use custom form builder 1 of nested models' partials. i've got working, sort of, modifiying link_to_add_fields_helper, so... def link_to_add_fields(name, f, association) new_object = f.object.class.reflect_on_association(association).klass.new fields = f.fields_for(association, new_object, :child_index => "new_#{association}", :builder => answerformbuilder) |builder| #was... #fields = f.fields_for(association, new_object, :child_index => "new_#{association}") |builder| render(association.to_s.singularize + "_fields", :f => builder) end link_to_function(name, h("add_fields(this, \"#{association}\", \"#{escape_javascript(fields)}\")")) end so see setting both nested models answerformbuilder kinda solved problem, it's not elegant since both questions , answers ...

android - Keeping count of notifications in a broadcast receiver -

i trying keep count going on number of unread notifications in broadcast receiver , have number of unread notifications display differently accumulate every time receiver fired going re-initialize , clear out count. how can keep control of count, going have create class keep variables? seems lot of work simple if you're looking persist value between instantiations of broadcastreceiver, store result in private preferences object. can read stored value in @ beginning of each onreceive() , , write out @ end. like: public static final string prefs_name = "com.examples.myapplication.prefs"; public static final string key_count = "notificationcount"; private int currentcount; public void onreceive(context context, intent intent) { sharedpreferences values = context.getsharedpreferences(prefs_name, activity.mode_private); currentcount = values.getint(key_count, 0); //sets 0 if not in prefs yet //do magic work here //write value sto...

flash - Event action on clicking a hyperlink from a textbox -

Image
restating question simpler.... i want able link action script event clicking text within text box.the thing can see create basic hyper link, not apply action: i have been messing around on hour can't see way apply actionscript , tutorials on internet seem target actionscript 3 or not want. the reason there background music site , when youtube launched, needs muted. know code mute , have done on custom objects before, can't see way apply script textbox hyperlink. whilst ideally way, happy consider solution resulting in opening page , muting site. to honest, tried doing quick switch as3, there many problems need addressing, rather spend time converting site html/jquery or silverlight.... hope there small have overlooked can done without many changes needed. you can textevent.link event listen user clicks on link in textfield: import flash.text.textfield; import flash.events.textevent; var textfield:textfield = new textfield(); textfield.htmltext = ...

I need to write a SQL query which can fetch data and can b exported in XL sheet -

i need write sql query can fetch data , can b exported in xl sheet. scenario there 2 tables , b. b child of , there 1 many relation (means b can have many children of a). b has column c can have 2 values 1 or 2. requirement i need show in report - each record of table a, count of "number of child records having value 1 in column c of table b", count of "number of child records having value 2 in column c of table b" , count "total number of child records in column c". something perhaps: select a.pk, sum(case when b.c = 1 1 else 0 end) totalc1, sum(case when b.c = 2 1 else 0 end) totalc2, count(b.c) totalchildren inner join b on a.pk = b.fk_to_a group a.pk

c# - Storing related timed-based data with variable logging frequencies -

i work data logging system in car racing. developing application aids in analysis of logged data , have found of query functionality with, datasets, datatables , linq useful, i.e. minimums, averages, etc. currently, extracting data native format data table , post-processing data. working data channels logged @ same rate, i.e. 50 hz (50 samples per second). start writing logged data database platform independent, , extraction process doesn't have happen everytime want analyze dataset. which leads me main question... have recommendation best way store data related time, logged @ different rates? have approximately 200 channels logged , rates vary 1 hz 500 hz. some of methods have thought of far are: creating datatable data @ 500 hz using double.nan values between actual logged samples creating separate tables each logging frquency, i.e. 1 table 1 hz, 10 hz, , 500 hz. creating separate table each channel relationship time table. each time step indexed, , table of d...

iphone - How to know which cell is tapped -

how can index path of cell has been selected tableview? i not have index path also. have tableview object me. use delegate's method tableview:didselectrowatindexpath: proper way of obtaining selected cell.

javascript - GWT Application throws 'JavaScriptException' in IE only, stack trace has no helpful information -

my gwt application throwing javascriptexception @ point. issue occurs in internet explorer (both ie 8 , ie 8 running ie7 mode). the stack trace follows: com.google.gwt.core.client.javascriptexception: (error): invalid argument. number: -2147024809 description: invalid argument. com.google.gwt.dev.shell.browserchannelserver.invokejavascript(browserchannelserver.java:195) com.google.gwt.dev.shell.modulespaceoophm.doinvoke(modulespaceoophm.java:120) com.google.gwt.dev.shell.modulespace.invokenative(modulespace.java:507) com.google.gwt.dev.shell.modulespace.invokenativeobject(modulespace.java:264) com.google.gwt.dev.shell.javascripthost.invokenativeobject(javascripthost.java:91) com.google.gwt.core.client.impl.impl.apply(impl.java) com.google.gwt.core.client.impl.impl.entry0(impl.java:188) sun.reflect.generatedmethodaccessor51.invoke(unknown source) sun.reflect.delegatingmethodaccessorimpl.invoke(unknown source) java.lang.reflect.method.invoke(unknown source) com.google.gwt.dev.s...

java - Reading windows .CSV files in Mac OS X -

i need read , display .csv files in java application. .csv files have european special accented characters (french) displayed correctly when run app in windows, but, when run app under mac os x, special characters corrupted. how can keep , show characters in both systems? can check if using different default charsets? charset.defaultcharset() here 2 possible pointers: java : how determine correct charset encoding of stream how find default charset/encoding in java?

c - "Undefined symbol <function> first referenced in file <file>" link error -

i'm writing first program in c class; i've managed out of syntax errors, i'm getting strange error when gcc tries link object files together. prints below: gcc -o proj04.support.o proj04.driver.o undefined first referenced symbol in file convert proj04.driver.o i've looked around few answers, none make sense me. i'll post files i'm using make program below, , if you've got answer appreciate help. seems pretty basic error, it's silly didn't do. makefile (posting first because suspect issue here) # comments # comments proj04: proj04.support.o proj04.driver.o gcc -o proj04.support.o proj04.driver.o proj04.support.o: proj04.support.c gcc -wall -c proj04.support.c proj04.driver.o: proj04.driver.c gcc -wall -c proj04.driver.c header file (provided professor, unchangeable, 1 line long): int convert( int, unsigned, char[], int ) imple...

silverlight - Is there an event that fires when a binding is updated? -

is there event fires when binding updated? for example, i'd create behavior applied combobox every time combobox's itemssource updated. the simple solution can think of is, when say, want capture itemsource change event. happens when load data or source data associated change, raise property changed event actual data source change , intercept event , ever need item source change.

javascript - How do you make Greasemonkey Click a link that has specified text? -

alright want click link changes has same text name. heres example of code might be <a href="unlock.php?confirm=md5hashere">click here</a> here starter script that. note uses jquery , assumes running firefox or using tampermonkey, if on chrome. // ==userscript== // @name _your_script_name // @include http://your_server.com/your_path/* // @require http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js // @grant gm_addstyle // ==/userscript== /*- @grant directive needed work around design change introduced in gm 1.0. restores sandbox. */ //--- note contains() text case-sensitive. var targetlink = $("a:contains('click here')") if (targetlink.length) window.location.href = targetlink[0].href see also: adding keylistener , using javascript click link in greasemonkey "normal" button-clicking approaches not working in greasemonkey script? choosing , activating right controls on ajax-driv...

Android import non-built-in type in AIDL -

is there specific have import non-built-in type in aidl interface? mediaplayer. when try import compile error "couldn't find import class android.media.mediaplayer". i'm afraid can't reference android.media.mediaplayer aidl interface. include mediaplayer in aidl file, needs have associated aidl interface file or needs parcelable. neither of these true. could describe in more detail trying achieve? there better approach solve problem.

With paypal checkout, what info can we get using their API? -

if checks out , pays on paypal's site, information can transaction? do have api can pull orders month, , can customers information also? i've found: easy-to-read reports view summary of account activity each month, including monthly sales, transaction details, , profit , loss. link: https://merchant.paypal.com/cgi-bin/marketingweb?cmd=_render-content&content_id=merchant/express_checkout which suggests can pull orders month, don't know if they're talking doing via api or website. wanting via api? well, can information buyer, , information order. i've found url, update answer when find out if can pull orders month or not: https://cms.paypal.com/us/cgi-bin/?cmd=_render-content&content_id=developer/e_howto_admin_ipnintro if scroll down "a sample ipn message , response", lists stuff can paypal after payment copmleted. i'll keep looking more info, think that's pretty it. hope helps.

jquery - Hovering over icons in jqGrid -

i've got incons displaying in columns within jqgrid indicate invoice has been sent or pdf has been created. i've added alt text icons in hope have text let non familiar users know icons mean alt text not being displayed. i've got feeling way hover states on rows work. i've tried disabling no avail. i hoping there kind of onhover event query column user on , display text way there isn't either. i'm stumped. how around this? the alt attribute screenreaders (i.e. visually impaired), non-graphical devices, , placeholder image fails load (this depends on browser). for tooltip effect, want set title attribute instead. example, hover mouse on reputation number in flair below question. then, using webkit browser such chrome, "inspect element" , you'll see title attribute in html.

inro sql question -

we starting subqueries, , have bit of toughie(for me, anyways). have customers table, has attribute of creditlimit. have orders table has ordernum, orderdate,quantity, amount. need increase credit limit of customer has order exceeds credit limit. then, take customer , update credit limit plus 1000. help. i'm assuming there primary-foreign key relationship between customers , orders table. update customers set customers.creditlimit = customers.creditlimit + 1000 exists ( select * orders orders.amount > customers.creditlimit , orders.customernumber = customers.customernumber )

scripting - PowerPoint VBA: which command (or a set of commands) would create ppt frames out of my .jpg pictures? -

i have few .jpg files in c:\my_folder here names: pic_1.jpg , pic_2.jpg , pic_3.jpg , pic_4.jpg , pic_5.jpg . what command or group of commands in power point vba should use in order able automatically create several frames in powerpoint each frame contain 1 picture? this vbscript creates new powerpoint presentation , adds 2 slides it, each picture. need adjust picture's location , size suit taste. you'll need utilize scripting.filescriptingobject enumerate images if want automatically grab whatever pictures exist in directory embedding presentation. if want script can save presentation calling pptpresentation.saveas after slides generated. the msdn documentation located @ http://msdn.microsoft.com/en-us/library/ff746873.aspx . dim pptdoc dim pptpresentation dim pptslide set pptdoc = wscript.createobject( "powerpoint.application" ) pptdoc.visible = true set pptpresentation = pptdoc.presentations.add( true ) ' add new slide blank layout ...

android - Adapter and inflater -

what use of adapter , inflator in android? simple difference between adapter & inflator adapter : it acts abridge between data , view,its responsible populate views inflator : it helps in customizing layout/views

(iphone) adding a shadow to layer -

i'd add shadow uiimageview has image layers. i've tried self.layer.shadowoffset/shadowopacity route, it's slow.. when want add shadow, call addshadowlayerwithoffset method below expected call drawrect , add shadow.. drawrect isn't getting called. what missing here? - (void)drawrect:(cgrect)rect { syslog(log_debug, "in drawrect, isshadowed: %d", isshadowed); if (isshadowed == true) { cgcontextref currentcontext = uigraphicsgetcurrentcontext(); cgcontextsavegstate(currentcontext); cgcontextsetshadow(currentcontext, cgsizemake(100, 100), 3); [super drawrect: rect]; cgcontextrestoregstate(currentcontext); } else [super drawrect: rect]; } - (void) addshadowlayerwithoffset: (int)offset { // self.layer.shadowoffset = cgsizemake(offset,offset); ...

c++ - How to achieve strncpy() functionality with strncpy_s() function? -

there're cases when need strncpy() funcitonalty - example have function in predefined interface passed address of buffer , size of buffer: hresult somefunction( char* buffer, size_t length ); and documented can copy null-terminated string there length no more length - if of length length don't null-terminate string , caller knows string ends @ either null character or @ length length whichever happens first , works. of course use strncpy() that hresult somefunction( char* buffer, size_t length ) { const char* tocopy = ... size_t actuallength = strlen( tocopy ); if( actuallength > length ) { return e_unexpected; // doesn't fit, can't reasonable } strncpy( buffer, tocopy, length ); return s_ok; } now have code , need migrate visual c++ 7 visual c++ 9. compile , see warning strncpy() unsafe , should instead use strncpy_s() . strncpy_s() designed null-terminate buffer, can't use direct replacement in above scen...

Android Overriding home key -

as question suggests know can't override home key event if emulator of android 2.2 see application car home has overridden of keys home, end call. now, point how have done it? tried peep source code of app surprise not available or unable find it, don't think later case. i agree @romain guy you can't override behaviour of home button. what car home app does: has defined launcher. can define yours launcher, , notified when home screen launched. check out : intent.html#category_launcher please note doesn't mean app/activity notified when home button pressed can override behaviour of it, notified when system launch home screen. both different things. in type of notification, android has sent app (which executing) frozen state, , won't have control on what's happening. this far know. guess @romain guy may correct me if wrong @ place.

objective c - Custom callout view with button over a MKMapview in iOS 3.0 -

i created subclass of mkannotationview when selected display callout view (similar mkpinannotationview) subclass of uiview button , text now. callout added annotation view. problem have button put in callout view never trigger action, not seem respond touch event. the reason create new mkannotationview because need display more text , 2 buttons in annotation view , not find way achieve regular mkpinannotationview callouts. code: - (mkannotationview *) mapview:(mkmapview *) mapview viewforannotation:(id ) annotation { if(![annotation iskindofclass:[csmapannotation class]]) return nil; csmapannotation* csannotation = (csmapannotation*)annotation; customannotation *customannotationview=[[[customannotation alloc] initwithannotation:annotation reuseidentifier:nil] autorelease]; mkpinannotationview* pin = nil; pin = [[[mkpinannotationview alloc] initwithannotation:customannotationview reuseidentifier:@"identifier"] autorelease]; [pin setp...

c# - How to handle Object reference not set to an instance of an object when using LINQ and let? -

i have following code data companies: xdocument doc = xdocument.load(new stringreader(searchpayload)); xnamespace ns = configurationmanager.appsettings["webservicenamespace"]; var businesses = (from node in doc.descendants(ns + "searchresultsrecord") let abn = node.element(ns + "abn") let mainname = node.element(ns + "mainname") let legalname = node.element(ns + "legalname") let maintradingname = node.element(ns + "maintradingname") let othertradingname = node.element(ns + "othertradingname") let mainbusinessphysicaladdress = node.element(ns + "mainbusinessphysicaladdress") select new { name = new { organisationname = (string)maintradingname.element(ns + "organisationname"), ...

.net - Get class name and property name from an expression () => MyClass.Name -

this mot duplicate, couldn't find proper question. i want "myclass.name" () => myclass.name . how define method parameter , how convert expression string? that expression<func<string>> , have: void foo(expression<func<string>> selector) {...} or void foo<t>(expression<func<t>> selector) {...} however, note syntax myclass.name refers static property; if want instance property might need more expression<func<myclass,string>> - example: static void foo<tsource, tvalue>( expression<func<tsource, tvalue>> selector) { } static void main() { foo((myclass obj) => obj.name); } as implementation; in simple case , can expect body memberexpression , so: static void foo<tsource, tvalue>( expression<func<tsource, tvalue>> selector) { var member = ((memberexpression)selector.body).member; console.writeline(member.reflectedtype.n...

How to iterate properly over the search results of a DMultiMap (DeCAL) in Delphi? -

i using dmultimap container decal delphi 6 store data. key string can appears several time in map. i wonder how iterate on objects given key. will code: function iterateoverobjects(map: dmultimap); var iter: diterator; begin iter := map.locate(['abc']); while iterateover(iter) begin // value... end; end; returns objects of 'abc' key? or returns objects of map starting first object 'abc' key? edit: tested. returns objects of map starting first object 'abc' key. best way iterate on 'abc'? edit: tested version (i've changed used findif, because investigated doesn't use fast locate, loops through items): edit2: because previous test bad, i've edited function make work properly. looks same name's answer, changed not confuse incorrect function. function iterateoverfound(map: dmultimap; var iter: diterator; const obj: array of const): boolean; begin if diiteration in iter.flags begin a...

asp.net mvc - facebook c# sdk login problem -

recently decided switch 5.0.3 verison of facebook c# sdk library. 1 of modifications had change script in login view : fb.init({ appid: '<%: facebookcontext.current.appid %>', status: true, cookie: true, xfbml: true }); which facebook.facebooksettings.current.appid , used work fine. compilation error s0103: name 'facebookcontext' not exist in current context my webconfig set correctly think, in mvcwebsite sample included in library. ideas can wrong? you need register facebook namespace in page or via web.config. or manually type full namespace: '<%: facebook.facebookcontext.current.appid %>'

nosql - What is the difference between a Graph Database and a Network Database? -

what difference between graph database (e.g. neo4j) , network database (e.g. ids, codasyl)? in principle same thing? the network databases codsasyl still more or less based on hierarchical data model , thinking in terms of parent-child (or owner-member in codasyl terminology) relationships. means in network database can't relate arbitrary records each other, makes hard work graph-oriented datasets. example, may use graph database analyze relationships exist between entities. also, network databases use fixed records predefined set of fields, while graph databases use more flexible property graph model , allowing arbitrary key/value pairs on both nodes/vertices , relationships/edges.

asp.net - Auto-generate ReST web services documentation/WADL -

we creating rest web services using asp.net , openrasta. is there tool can us: create wadl file or/and create human readable api documentation similar decribed resources/http methods supported each resource, etc ? for openrasta, it'd possible use uridecorator have help-like uris defined resources (such /myresource$help). can rewrite uri before parsing yo can document easily, parse teh uri, find resource type, , rewrite /help/{resourcetype} from there register resource system: resourcespace.has.resourcesoftype() .aturi("/help/{resourcetype}") .handledby() .renderedbyxxx() then can create handler return documentation resource. example use ioperationcreator service know http methodds available , input arguments, use icodecrepository see media types may accepted input, , potentially media type serialization calling codec , generating html friendly view of it. that's definitly area we're going work on next version. ...

Deploying WCF service and silverlight in SSL -

i have silverlight application ssl service. if deploy service without ssl works right, if activate ssl , change endpoint http://myservice https://myservice in servicereference.clientconfig, , change in web.config: endpoint "basichttpbinding" "webhttpbinding" service dont work , produce next error: unhandled error in silverlight application [arg_nullreferenceexception] arguments: debbuging resource string ar unavalible i dont know if wrong or need more... etc. in advance need help. you can't convert service endpoint webhttpbinding because silverlight supports basichttpbinding. secure services silverlight, need create basichttpbinding transport level security. then, create service behavior specifies httpsgetenabled="true". have included sample below: service side web.config <bindings> <basichttpbinding> <binding name="securebasichttpbinding" closetimeout="00:01:00" opentimeout=...

How to check iPhone network type GSM or CDMA -

in application need check network type gsm or cdma (for verizon). found ctcarrier class contains property mobilenetworkcode, don't wanna hardcode value each providers. there other ways check it? please help. you through model#, again, have hardcode list of model# , compare them.

xslt - Some outpost result using two condition -

i have transform xml file should check field id '0', field id '1' , sum field id '2'. example have: <document> <line id="0"> <field id="0">mar</field> <field id="1">doc1</field> <field id="2">2</field> </line> <line id="1"> <field id="0">mar</field> <field id="1">doc2</field> <field id="2">3</field> </line> <line id="2"> <field id="0">aaa></field> <field id="1">doc4</field> </line> <line id="3"> <field id="0">mar</field> <field id="1">doc1</field> <field id="2">4</field> </line> </document> result ...

Get count from Powershell Group-Object -

i trying stats our code. works fine 1 module: function counttestcases($path=$pwd) { get-childitem $path -recurse -include *.java | where-object {-not $_.psiscontainer } | select-string "extends componenttestcase", "extends databasedependenttestcase" | group-object pattern | select-object count } but want run across modules csv output this: module,#componenttestcase,#databasedependanttestcase module1,20,30 module2,12,1 unfortunately, if add | select-obejct count it doesn't work (although name does). not sure how around without writing code... i couldnt simpler find way.. seems works get-childitem $path -recurse -include *.cs | select-string "int", "string" | group-object pattern -ashashtable | foreach { new-object psobject -property @{ int = $_['int'].count; string = $_['string'].count; module = 'mymodulename'} } | select module, int, string the output ...

how to share user preferences between projects with multiproject trac? -

i've multiproject trac setup works single project, intertrac links fine too. problem users have provide preferences every project. there easy way around , have user preferences shared among projects? thanks, viktor you should take @ tracusersyncplugin promise that. it's marked "beta" , "unfinished", may want join in more development, @ least you'll have starting point.

c++ - calling const member function -

i have called const member function of object. i created object on mainwindow, den called get_size() after setting size previously. calling get_size() method of base class gtk::window. it gives error: ‘gtk::window’ not accessible base of ‘mainwindow’. mainwindow inherited gtk::window class class mainwindow: gtk::window { }; what reason this. inhertance private default classes. need derive gtk::window publicly: class mainwindow: public gtk::window {

many to many - Linq query, a connection table issue -

i want write query presents every event ( tbl_events ) objects ( tbl_objects ) related him (relation type — m:n). i have problem tables connection tables (association class) holds foreign keys of 2 tables connects. for intance, tbl_events connected connection table named tbl_object_has_tbl_events tbl_objects . here structure of connected tables: tbl events has: eventid, eventname tbl_object has: objectid, objectname tbl_object_has_tbl_events: eventid, objectid here tried write: ilist datalist = (from devent in app.gliduscontext.tbl_events. join dobject in app.gliduscontext.tbl_objects on devent.tbl_objects equals dobject.objectid select new { devent.eventname, dobject.objectname}).tolist(); i can't reach connection table tbl_object_has_tbl_events my question how can implement such query, when have m:n relationship. thanks. update generation of many-to-many relationship: -- -------------------...

semantic web - Named Graphs and Federated SPARQL Endpoints -

i came across working draft sparql 1.1 federation extensions , wondered whether possible using named graphs (not detract usefulness of aforementioned draft). my understanding of named graphs little hazy, save thing have gleamed reading specs comprises rules around merger, non merger in relation other graphs @ query time. since doesn't satisfy understanding, question follows: given following query: select ?something named <http://www.vw.co.uk/models/used> named <http://www.autotrader.co.uk/cars/used> { ... } is reasonable assume query processor/endpoint or should in context of named graphs following: check named graph exists locally if doesn't perform following operation (in case of above query, use second named graph) get /sparql/?query=encodedquery http/1.1 host: www.autotrader.co.uk user-agent: my-sparql-client/0.1 where encodedquery includes second named graph in from named clause , where clause amended accordingly respect graph cla...

data binding - WPF Dependency Property Question -

i'm new wpf, , i'm trying thought simple task - display value of field in business object changes during program. know how "force" change manually changing textbox.text property in c#, i'm learning wpf want "right" way, , means databinding. question #1: far understand it, choice either use dependencyproperty or implement inotifypropertychanged in business object, right? question #2: here generic version of code in attempted go dependencyproperty route. markup: button x:name="nextbutton" content="click" grid.row="2" click="nextbutton_click" /> textbox x:name="mytextbox" grid.row="1" text="{binding source=mytest, path=name, updatesourcetrigger=propertychanged, notifyonsourceupdated=true}"/> code-behind: namespace dependencytest2 { /// /// interaction logic mainwindow.xaml /// public partial class mainwindow : window { private int i; ...

java - Sending UDP packages from ANDROID 2.2 (HTC desire) -

i have lan , want send upd message android (htc desire) pc. theres wlan router between them. problem is, upd message never gets pc. code on android.: package org.example.androidapp; import java.net.datagrampacket; import java.net.datagramsocket; import java.net.inetaddress; public class udpclientand { public void sendudpmessage(int port) throws java.io.ioexception { datagramsocket socket = new datagramsocket(); inetaddress serverip = inetaddress.getbyname("192.168.1.110"); byte[] outdata = ("ping").getbytes(); datagrampacket out = new datagrampacket(outdata,outdata.length, serverip,50005); socket.send(out); socket.close(); } } i choose high port on booth sides. the permissions on android are: uses-permission android:name="android.permission.internet" uses-permission android:name="android.permission.change_wifi_multicast_state" the server-side pc simple programm receivin...

Sparql: Arithmetic operators between variables? -

hi have query this: select ?a ?b { ?c property:name "mything"@en ?c property:firstvalue ?b ?c property:secondvalue ?a } how can divide first nuber , second? idealy somthing this: select ?a/?b { ?c property:name "mything"@en ?c property:firstvalue ?b ?c property:secondvalue ?a } thank you in sparql 1.1 can using project expressions so: prefix xsd: <http://www.w3.org/2001/xmlschema#> select (xsd:float(?a)/xsd:float(?b) ?result) { ?c property:name "mything"@en ?c property:firstvalue ?b ?c property:secondvalue ?a } you may alternately use xsd:double(?var) cast double, xsd:integer(?var) cast integer , xsd:decimal(?var) cast decimal. note sparql specifies type promotion rules example: integer / integer = decimal float / double = double if need result in guaranteed datatype can cast whole divide expression e.g. prefix xsd: <http://www.w3.org/2001/xmlschema#> select (xsd:double(xsd:float(?a)/xsd:float(?b)) ?result...

graphics - 3-d animation in C++ -

i doing scientific project in c++ , need draw simple animated 3-d images of moving atomic groups. , convenient graphics library that? general remarks appreciated. work in linux. thank in advance, roman opengl of course, one library use glut that. have on http://nehe.gamedev.net/

python - Uploading to BlobStore in Google App Engine from a Command Line Java Application -

here server side code blobstore uploading command line application: public class uploadservlet extends httpservlet { private static final logger log = logger.getlogger(uploadservlet.class.getname()); private final blobstoreservice bs = blobstoreservicefactory.getblobstoreservice(); protected void dopost(final httpservletrequest request, final httpservletresponse response) throws servletexception, ioexception { final map<string, blobkey> blobs = bs.getuploadedblobs(request); final blobkey blobkey = blobs.get("blob"); if (blobkey == null) { log.severe("blobkey null!"); response.sendredirect("/error.html"); } else { response.sendredirect("/image?blob-key=" + blobkey.getkeystring()); } } /** * generates custom single use blobstore url's needed upload blobstore programmatically. */ protected void doge...

c - Why is this code blocking? -

i have code takes short while complete. i'd handled on separate thread blocked io. implemented following, when calling thread runs background_picture_save() , seems block. why? i'm trying save_picture() function work background process. static void * threaded_save_picture(void * p); static void * threaded_save_picture(void * p) { char optarg[512]; strncpy(optarg, p, sizeof optarg); optarg[sizeof optarg - 1] = '\0'; fprintf(stderr,"%s()::%s\n",__function__,optarg); save_picture(optarg); pthread_detach(pthread_self()); return(p); } /* threaded_save_picture() */ extern void background_picture_save(const char * const optarg); void background_picture_save(const char * const optarg) { pthread_t thrd; (void)pthread_create(& thrd, null, threaded_save_picture, (void *) optarg); } /* background_picture_save() */ take ambiguity out of observations. run program gdb, when main thread blocks print backtrace ...

javascript - Switching between two different classes jQuery -

having trouble getting following code work: $('#changemode').button().click(function(){ $('#playfield').toggle(function() { $(this).switchclass("gridview","plainview"); }, function() { $(this).switchclass("plainview","gridview"); }); }); i cannot switch following div's class. <div id="playfield" class="gridview"></div> any ideas? edit: tried this: $('#changemode').button().click(function(){ if ($('#playfield').attr('class') == "gridview"){ $('#playfield').removeclass("gridview"); $('#playfield').addclass("plainview"); } else { $('#playfield').removeclass("plainview"); $('#playfield').addclass("gridview"); } }); and seems work fine, heck? i wasn't aware of switchclass, perhaps thinking ...

abaddressbook - Is it possible to corrupt somehow data in iOS AddressBook via AB API? -

to write fields strange symbols, instance. did come across such issues? i'm evaluating opportunity of storing custom string field in iphone ab , want know, if there risk corrupt ab. upd: i mean, can bad ab data, contacts.app stops working? hey have app stores data in address book. of course can corrupt user data if not careful coding. address book api apple gave developers ability , bad coding can delete or manipulate wrong contacts etc. apple has guide lines in address book documentation can treat user address bok carefully. way right read docomanttion carfolly , test application before distribute

php - Drupal, searching dynamically created pages -

my drupal site contains page product details generated database based on product id. 1 requirement product details searchable. drupal search indexes static pages. how can index details generated in dynamic pages. edit1: using php filter generate page. ex drupalurl/products/id1, drupalurl/products/id2, drupalurl/products/id3 pull different content db. hook_update_index - might solution problem. need "render" dynamic fields , send them indexer using hook.

java - Swing applet componets are invisable untill interacted with -

i trying make applet simple login screen, if use normal components works fine if use swing components object wont show until clicked on. use regular components need masked password field (if there non swing version please let me know). i trying vertical placement in top left corner. public class rdpapplet extends japplet { jbutton connect; jtextfield username; jpasswordfield password; jlabel usernamelabel; jlabel passwordlabel; //(snip) public void paint(graphics g){ } public void start(){ } public void stop(){ } public void init(){ swingutilities.invokelater(new runnable() { public void run() { jpanel panel = new jpanel (new gridbaglayout()); gridbagconstraints gbc = new gridbagconstraints(); gbc.insets = new insets(2,5,1,1); gbc.weightx = 1.0; gbc.anchor = gridbagconstraints.west; gbc.gridwidth = gridbagconstraints.remainder; usernamelabel = ne...

reporting services - Query data for the last day of previous month into SSRS Report Cell -

i'm in process of building report , i'm stuck 1 requirement. 2 of columns in output of stored procedure accomplishments , updatedate . have write expression accomplishment field such takes accomplishments values corresponding latest date in previous month in updatedate column.. there multiple accomplishment values every month , of them updated @ different dates.. please help.. this did: ' select * ( select row_number() on (partition projectid order updatedate desc) rn, * from tablename where updatedate between dateadd(mm, datediff(mm, 31, getdate()), 0) , dateadd(mm, datediff(mm, 0, getdate()), 0)' ) x where rn = 1 courtesy naomi n msdn forums..

Wiping temporary files for security -

i working on application displays data database. right working on set of modules generate html page, including both text , images, display in web browser (built program msie), , gives user option print it. in destructors of these classes have instructions delete temporary files created, may contain official use information. over weekend got thinking should first overwrite data 0's (or other bytes) , delete them. i've heard patterns of bytes used in file wiping , single pass may not enough, yet can't think of reason why. i've done research , read on wikipedia, , seems single pass going work well. also, adding "no-cache" meta-tag in html sufficient assure msie doesn't copy data own cache directory? there 2 programs know on unix systems. have check out if available on windows, either native or cygwin or that, or maybe may find them useful study how it. srm available on sourceforge shred - part of gnu coreutils both of them use ...

Entity Framework - Generic Transaction Methods -

we're using transactions entity framework, might switching other orm in future. what's best way implement following... begintransaction(); //some update/insert/delete operations here entity.name = "joe"; savechanges(); endtransaction(); we don't want use "using" statement we need work nested transactions you can use transactionscope ... , can nest in try/catch/finally if want to, though "using" statement easier. there specific reason don't want use "using"? i've used both quite success, , supports nested transactions. http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx http://msdn.microsoft.com/en-us/library/bb738523.aspx

Internet Explorer does not load images cross domain -

i using qualtrics create survey. in survey included pictures using html different website. works in browser internet explorer 8 doesn show pictures cross domain. i looking html or javascript code allow access loading pictures otehr domains... thanks uh, if have page @ http://www.example.com/foo.html , should able put image on page like: <img src="http://www.example.org/bar.jpg"> ...just fine. what links like? happens if try load link directly in ie8's location bar?

How do I upload a file from an android device to a restful wcf service? -

i'm building android app , need upload photo taken camera. need upload restful wcf service. have looked @ many tutorials can't seem working. think problem lies wcf service. not exceptions response 400 bad request. since wcf service running on localhost, using 10.0.2.2 access android emulator. able call other service methods on local service 1 fails. java httppost httppost = new httppost("http://10.0.2.2:53943/imageservice/uploadinspectionphoto"); file photo = new file(environment.getexternalstoragedirectory(), "01.jpg"); multipartentity t = new multipartentity(); t.addpart("t", new filebody(photo)); //t.addpart(new formbodypart("t", new filebody(photo))); tired httppost.setentity(t); httpresponse response = httpclient.execute(httppost); wcf [servicecontract] [aspnetcompatibilityrequirements(requirementsmode = aspnetcompatibilityrequirementsmode.allowed)] [servicebehavior(instancecontextmode = instancecontextmode.percall)] publ...