Posts

Showing posts from June, 2013

c# - How to fire-and-forget in WCF when using wsHttpBinding -

i have wcf service hosted in iis , consumed asp.net application. service , client on diferent servers , communicate on internet. message security on wshttpbinding used security model (using x.509 certificate). i tested service fiddler , seems ok unless single call there 4 sessions in fiddler (two round-trips). don't need sessions wcf , want calling threads (which asp.net worker threads), not blocked when calling wcf method. how can achieve fire-and-forget pattern when using wcf service (i can change service contract if needed) ? fire , forget (one-way operation) says operation doesn't return result , client doesn't have wait server processing. has nothing infrastracture calls see in fiddler. first of turn off estabilishsecuritycontext , negotiateservicecredentials in security element (these turned on default) , try again.

Problems with Jackrabbit XPath Query with an OR statement -

i have following xpath query in jackrabbit 2.2 application: //crms:publications/*/*[ @crms:publication-security = '28862' or @crms:publication-security='23459' or @crms:publication-security='23489' ] which causing following exception when executed javax.jcr.query.invalidqueryexception: lexical error @ line 1, column 73. encountered: "@" (64), after : "" statement: $v in //crms:publications/*/*[@crms:publication-security='28862' or @crms:publication-security='23459' or @crms:publication-security='23489'] return $v but if run following query without or's runs fine: //crms:publications/*/*[@crms:publication-security='28862'] it obvious guidance appreciated on doing wrong thanks david it obvious unfortunately. xpath case sensitive 'or' should have been 'or'

asp.net mvc - How is service validation communicated back to the controller? -

i think i'm missing fundamental here, i've been digging on 2 hours, , must overlooking obvious. if so, apologize. i have mvc 3 site, , have service layer controllers talk to, , repository service layer talks (all decoupled using ioc container, that's irrelevant here). domain models ef4 entities, shared between controller, services, , repositories. i have view model signing looks this: public class signupviewmodel { [displayname("email")] [required, regularexpression(@"^.+@.+\..+$")] public string email { get; set; } [displayname("password")] [required] public string password { get; set; } [displayname("confirm password")] [required, compare("password")] public string passwordconfirmation { get; set; } } my user domain model looks this: public class user { public int id { get; set; } public string email { get; set; } public string passwordhash { get; set; } ...

php - How to hide RSS page from everyone except FeedBurner -

i want hide feed except feedburner. when feedburner visits rss page, want them able crawl. when else visits page, redirected feedburner page. how it? my blog written in php. (custom code) additional info: i prefer redirect using head("location: ") method in php instead of .htaccess my rss page is: domain.tld/feed/ the feeburner useragent feedburner/1.0. can use $_server['user_agent'] detect user agent , redirect except feedburner. edit: can use .htaccess in documentation pascal martin provided.

cuda gdb debugging information for dynamically compiled kernels -

i'm dynamically compiling kernels cuda. there way add debugging information binary dynamically generated run-time generated assembly string? want use cuda-gdb on it. thanks. ps can please create tag cuda-gdb? i assuming creating .cubin file .cu file using nvcc, , later using cumoduleload, culaunchgrid , friends launch kernel. in case, can pass "-g" nvcc when converting .cu .cubin. then, can run program under cuda-gdb , place breakpoint in kernel , breakpoint should triggered.

perl - Jailbroken iPhone dev -

i have had great success running perl on jailbroken iphone 4: http://coredev.nl/ now play more functionality corelocation. i'd query gps , orientation data. have osx running in vm , able compile ios apps in xcode. i've been having difficult time learning ins , outs far, , have way of hacking more unix-y i'm comfortable with, server/client networking perl scripts have been writing. for example can download sample code apple, load in xcode, compile after switching off code signing , whatnot, scp app directory /applications, restart springboard, , bam it's on homescreen, happy have of working (through virtual machine no less!), overkill. what if want executable can run perl, spits gps coordinates out on stdout? understand i'll need use corelocation api, shouldn't have deal mvc, right? what p5-gps* packages? http://coredev.nl/cydia/dists/iphone/main/binary-iphoneos-arm/

android WebView change color -

i want change background color of webview when press button.. use use webview.setbackgroundcolor(color.blue); color never changes until load on webview.. know how fix this? thank you! you call invalidate() on webview object. see here .

c - to input data to structure member is a pointer -

#include<stdio.h> #include<stdlib.h> struct test { int x; int *y; }; main() { struct test *a; = malloc(sizeof(struct test)); a->x =10; a->y = 12; printf("%d %d", a->x,a->y); } i o/p there warning warning: assignment makes pointer integer without cast and warning: format ‘%d’ expects type ‘int’, argument 3 has type ‘int *’ how input value *y in struct test to access, need dereference pointer returned expression a->y maniputlate pointed @ value. this, use unary * operator: you need allocate memory y make sure points @ something: a->y = malloc(sizeof(int)); ... *(a->y) = 12; ... printf("%d %d", a->x,*(a->y)); and sure free malloc'd data in reverse order malloc'd free(a->y); free(a);

javascript - IE being stubborn with a drop up/down menu -

i have drop up/down menu located @ http://islandicecream.sitesbyjoe.com (this site i'm building). i'm @ fun part test ie versions , them working best can. the particular trouble i'm having getting ie make links in drop down span 100% of parent container. feel i've tried , still won't behave. any suggestions? found problem. need specify width #nav ul.sub_nav . since there no width specified element, children don't know 100% means. @ least case in ie7.

Cannot sync local with tortoisesvn file versions after running "Update Item To Revision" -

yikes. ran wrong method in tortoisesvn (update item revision) , cannot working copy of 2 files. files added in revision 7166. did update item revision on revision 7165. deleted files. i need them back, cannot restore them. here attempt: (files not local): go repository (head), select each file > "copy working copy". brings files local, in add state. when try commit error "xx file out of date, have update working copy first". know means local @ wrong version (because ran update item revision), don't know how head. how current version of files no longer exist on machine , are, guess, still pointed old revision. see there files in .svn\text-base representing 2 files. should delete can svn update? far, svn update not restore files. my other concern when ran update item revision, there few other files merged or updated. seem have restored them because can commit changes on them. how confirm revision working with, check subversion properties of file? ...

c# - jQuery Calling an ASMX Web Service that Returns Data -

i using jstree organize pages created users. upon right-clicking , pressing "rename" want fire js function hits function in code behind without post (if possible). want grab whichever item's i'm on id , rename in database , update jstree. here sample code-behind function: [system.web.services.webmethod] protected void renamepage(object sender, eventargs e) { datatable dt = new datatable(); using (sqlconnection con = new sqlconnection(global.constring)) { con.open(); using (sqlcommand cmd = new sqlcommand("contentpageupdate", con)) { cmd.parameters.add("@title", sqldbtype.varchar).value = global.safesqlliteral(txtpage.text, 1); cmd.commandtype = commandtype.storedprocedure; cmd.executenonquery(); } con.close(); //update content page repeater using (sqlcommand cmd = new sqlcommand("contentpagegetall", con)) { ...

asp.net mvc - EF4 code-first vs model-first with regards to model validation -

i'm working on one-man asp.net mvc 3 project (i have complete control on database schema , code), , i'm trying decide between going database-first , poco w/ ef4 models, or if should go w/ code-first. the main thing i'm trying achieve decorating models dataannotation attributes can enforce schema validation prior doing persistence. looking @ scott guthrie's article model validation w/ mvc 2, talks article doing code-first (step 2), , doing model-first (or database-first) using "buddy classes" (step 5). i historically have done database design using sql server designer gui (and scripts), i'm more productive that, strictly when comes database design. however, unless ditch idea of decorating models w/ dataannotation attributes validation, violating dry not having model properties in 2 classes, having to, in essence, build schema in 2 places. i'm looking that's had experience both methods (or 1 method), , can offer feedback on way went, wh...

c# - Panel DoubleBuffered property stopped the drawing, is invisible -

i have component, inherited panel, overriding onpaint event draw graph 500 points. since need selection on graph, flickering. have found doublebuffered property when set true, in panel constructor, drawing disappears. debug , see drawing methods still execute there nothing on panel. know why happen? this .net 3.5 - c#. winforms application try { graphics g = e.graphics; //draw _grapharea: g.drawrectangle(pens.black, _grapharea); _drawingobjectlist.drawgraph(g, _mainlinepen, _difflinepen, _dotpen, _dotbrush, _notselectedbrush, _selectedbrush); drawselectionrectangle(g); g.dispose(); } catch (exception ex) { messagebox.show(ex.message); } panel descendant constructor: this.backcolor = color.white; this.setstyle(controlstyles.resizeredraw, true); this.setstyle(controlstyles.userpaint, true); this.setstyle(contro...

ranking - SQL Server Rank() Cap for each column -

i have sql query has 3 int columns, , 3 rank() functions partition by ranks 3 columns. the question is, want rank 5000 each column, , stop after that. there anyway in single query without splitting 3 queries? still want of data first 3 columns, want rank() columns go null after 5000. each partition go 5000. thanks you use case statement. ... case when row_number() on (<partition by>) <= 5000 <rank function> else null end ...

entity framework - How to make EntityFramework add rows in order? -

in sql server database use autoincrementing field id. whenever add new rows table sql server entity want ids keep order of adding rows in entity framework - reason random. call savechanges() after each addobject . that's way control order.

How to design a browser extension/add-on compatible with multiple browsers -

i want develop browser extension/add-on keeps track of url value in address bar. add-on either downloaded local file system or integrated within browser. also, i'm curious know how browser extensions toolyo programmed. (it's demo link of toolyo tool. sorry, didn't find better example whic similar requirement). can please throw light on languages/methods used develop extensions can work in multiple browsers. sorry generic (and vague, well) question. appreciate answers/suggestions. the extension apis browsers add-on functionality (chrome, firefox, etc.) different , of browser-chrome-privileged code must rewritten different browsers. user scripts, alternative add-on architecture, have privilege level of in-page script (except greasemonkey in firefox).

multithreading - Fork and Threads in ruby -

i running program on machine 2 processors, when fork child created native thread or green thread/coroutine. child running concurrently parent or parallel? the working of fork() in general generate new, independent process, duplicate page table, , mark pages owned process called fork() copy-on-write in process. then, fork() returns in both processes (the return value lets respective process know 1 is). on system more 1 processor (or processor cores) can normally (assuming have smp-enabled system, cpu affinity doesn't prevent it) expect 2 processes use both processors, not strictly have guarantee. threads generated in same way on systems (e.g. linux) exception pages owned first process not marked copy-on-write, instead owned both processes afterwards (they use same page table). on other systems, threads may implemented differently, e.g. in user land, in case not benefit multiple cpus threads. as side note, disadvantage of using fork() , running 2 processes instead...

intel parallel studio 2011 - summing in parallel -

i have serial code looks that: sum = a; sum += b; sum += c; sum += d; i parallelize that: temp1 = + b , in same time temp2 = c + d sum = temp1 + temp2 how do using intel parallel studio tools? thanks!!! assuming variables of integral or floating point types, there absolutely no sense parallelize code (in sense of executing different threads/cores), overhead much higher benefit out of it. applicable parallelism in example @ level of multiple computation units and/or vectorization on single cpu. optimizing compilers sophisticated enough nowadays exploit automatically, without code changes; if wish may explicitly use temporary variables, in second part of question. and if ask out of curiosity: intel parallel studio provides several ways parallelize code. example, let's use cilk keywords c++11 lambda functions: #include <cilk/cilk.h> ... temp = cilk_spawn [=]{ return a+b; }(); sum = c+d; cilk_sync; sum += temp; don't expect performance out...

Login required for django Flatpages -

is there easy way put login required decorator flatpages? need modify url conf? (r'',include('django.contrib.flatpages.urls')), thanks, fred the django flatpage model has registration_required boolean field. set true allow logged-in users view page. https://code.djangoproject.com/browser/django/trunk/django/contrib/flatpages/models.py class flatpage(models.model): url = models.charfield(_('url'), max_length=100, db_index=true) title = models.charfield(_('title'), max_length=200) content = models.textfield(_('content'), blank=true) enable_comments = models.booleanfield(_('enable comments')) template_name = models.charfield(_('template name'), max_length=70, blank=true, help_text=_("example: 'flatpages/contact_page.html'. if isn't provided, system use 'flatpages/default.html'.")) registration_required = models.booleanfield(_('registration req...

receive output from java DataOutputStream in a php page -

i have java applet using send file server - on server end want receive on php page. below java code doing sending, on php side of things have checked global arrays , have data passed url, not file data. have searched , scratched on 1 appreciated. string strurl = sendtourl + "?action=post&len=" + imgbytes.length + "&fname=picture.png"; try{ url urlservlet = new url(strurl); urlconnection scon = urlservlet.openconnection(); scon.setdoinput(true); scon.setdooutput(true); if (scon.getallowuserinteraction()) { scon.setallowuserinteraction(true); } scon.setusecaches(false); scon.setdefaultusecaches(false); scon.setrequestproperty("content-type", "text/html"); scon.setrequestproperty("connection", "keep-alive"); scon.setconnecttimeout(transfertimeout); scon.setreadtimeout(transfertimeout); dataoutput...

javascript - Is there any advantage to Ajax get data type XML over Json? -

is there advantage using ajax data formatted xml on json format? should call ajaj? no, no advantage using xml on json @ all. equivalent data have smaller footprint (memory, amount of data) xml, hence popularity. ajax still used when json stands x ;) from wikipedia : despite name, use of xml not needed (json used instead), , requests need not asynchronous.[

c# - Asp.net Calendar How to -

Image
i have question project working on calendar can put comment special day / year i'm using atm asp.net calendar control. here image of idea: here markup code: <%@ page language="c#" autoeventwireup="true" masterpagefile="~/calender.master" codefile="calender.aspx.cs" inherits="_default" %> <asp:content id="headercontent" runat="server" contentplaceholderid="headcontent"> </asp:content> <asp:content id="bodycontent" runat="server" contentplaceholderid="maincontent"> <form id="form1" runat="server"> <asp:scriptmanager id="sm1" runat="server" /> <asp:updatepanel id="up1" runat="server"> <contenttemplate> <asp:calendar id="calendar1" showgridlines="true" cellpadding="15" runat="server" ond...

Internet explorer global javascript files -

i building php mvc website , include several js files.. problem encounter if have example js file containing functions , needed variables can't use them in other js files (i call functions using document.ready() , use jquery make ajax calls). works fine in firefox ie throws error... include js files using html class: function includejs($filename) { $data = '<script src="'.base_path.'/public/js/'.$filename.'.js" type="text/javascript"></script>'; return $data; } this error i'm getting: webpage error details user agent: mozilla/4.0 (compatible; msie 8.0; windows nt 6.1; trident/4.0; slcc2; .net clr 2.0.50727; .net clr 3.5.30729; .net clr 3.0.30729; media center pc 6.0; infopath.3; .net clr 1.1.4322) timestamp: thu, 3 mar 2011 11:53:33 utc message: expected identifier line: 26 char: 21 code: 0 uri: http://localhost/learning/public/js/general.js message: object ...

flex - Playbook AIR SDK images on surface -

i trying write playbook app using air sdk, need surface of kind can load large image onto, subsequently place smaller images on top of , add whole lot scrollpane can pan around screen. i have tried adding image sprite , displaying in group in application image not show up. what correct surface kind should using here , how should loading images? (currently using "embed" , loading image bitmapasset.) thanks edit: var scroll:scrollpane = new scrollpane(); scroll.setscrollcontent(image); scroll.update(); scroll.graphics.beginbitmapfill(icon.bitmapdata); scroll.graphics.drawrect(100,100,56,56); scroll.graphics.endfill(); scroll.update(); this code causes non-moving icon drawn behind scrollcontent, want add on top of scroll content moves it. rather adding images via graphics api, need adding components mentioned in comment. know you're trying use qnx component set, situation little different. ...

ListView Asp.Net control - Assigning strings to Listview columns -

listview web control question: i developed report service web application using asp.net 3.5 , reportingservice2010.asmx. retrieved itemhistorysnapshots following code: itemhistorysnapshot[] itemsnapshots = null; itemsnapshots = rs.listitemhistory(strchildnode); foreach(itemhistorysnapshot snapshot in itemsnapshots) { listview.add (snapshot.historyid.tostring()); listview.add (snapshot.size.tostring()); listview.add(snapshot.datetime.tostring()); } i want create listview 3 columns historyid, size, datetime , want assign string values in foreach loop. please let me know how assign string values listview. want know source control code listview also. thank much. you can use repeater , bind data it, this: code behind: itemhistorysnapshot[] itemsnapshots = null; itemsnapshots = rs.listitemhistory(strchildnode); rpt.datasource = itemsnapshots.select(s => new { historyid = s.historyid.tostring(), size = s.size.tostring(), datetime = s.datetime.t...

asp.net mvc - How to detect whether a browser enables javascript s.t. the master page can make a proper response? -

i developing site using asp.net mvc 3 razor. in _layout.cshtml (the master page) want put logic based on whether or not browser enables javascript. what simplest way make logic? for sake of simplicity, let master page output follows: @if(....)//need modify { <p>javascript enabled...</p>} else {<p>javascript disabled...</p>} there's no way find out on server, therefore there's no way find out before first page loaded. best can put bit of javascript page sets cookie or posts ajax response server telling javascript active, can on subsequent page requests. apart obvious problem of first page load, it's bad strategy since user may switch off javascript in meantime while server still thinks it's active. graceful degradation / progressive enhancement keywords here. make page assume default no javascript active , act accordingly, i.e. serve plain html in either case. include javascript "upgrade" site's functionalit...

.net - Silverlight HyperlinkButton in DataGrid column. Have to click twice -

i have datagrid column has hyperlinkbuttons. have click button twice have button it's supposed do. think first click selects row. i believe may going on event doesn't bubble (or down?) hyperlink button. ideas? edit here's xaml: <sdk:datagrid grid.row="1" x:name="workflowsgrid" margin="6,20,6,0" itemssource="{binding filteredsource,elementname=workflowsfilter}" autogeneratecolumns="false" selecteditem="{binding selectedworkflow,mode=twoway}" selectionchanged="workflowsgrid_selectionchanged"> <sdk:datagrid.columns> <sdk:datagridtextcolumn header="name" binding="{binding description}"/> <sdk:datagridtemplatecolumn header="action" > <sdk:datagridtemplatecolumn.celltemplate> <datatemplate> <contentcontrol content="{bind...

silverlight - Windows Phone 7 Push Notifications Not Showing Up On My Phone when I use PHP service -

i have problems php service. use php send tile update , toast update requests ms notification service. after first request in response have following headers: url: http://db3.notify.live.net/throttledthirdparty/01.00/aahfgdpcydousbbzetpjkomzagaaaaadaqaaaaquzm52ojizoeq2ndjdrki5mevfmeq response: http/1.1 200 ok cache-control: private server: microsoft-iis/7.5 x-deviceconnectionstatus: connected x-notificationstatus: received x-subscriptionstatus: active x-messageid: da8aa692-e9cd-682b-fe1c-22ffe7379414 activityid: cd9c8b0b-26db-4eac-835d-9f9505d7a381 x-server: db3mpnsm016 x-aspnet-version: 4.0.30319 x-powered-by: asp.net date: wed, 20 jul 2011 11:21:42 gmt content-length: 0 array ( [x-subscriptionstatus] => active [x-notificationstatus] => received [x-deviceconnectionstatus] => connected ) but in wp7 app have nothing. when try update tile again: url: http://db3.notify.live.net/throttledthirdparty/01.00/aahfgdpcydousbbzetpjkomzagaaaaadaqaaaaquzm52ojizoeq2ndjdrki...

c# - Print forms across multiple pages -

i have 3 printing methods: printa, printb , , printc (each printing form) . 3 forms need printed across multiple pages. how can print across 3 pages? i know need use the event handler , use currentpage , e.hasmorepages i'm not sure how use it. simply keep track of page number. set 0 in beginprint event , increment every time printpage called. this: int pagenumber; private void printdocument1_beginprint(object sender, system.drawing.printing.printeventargs e) { pagenumber = 0; } private void printdocument1_printpage(object sender, system.drawing.printing.printpageeventargs e) { ++pagenumber; e.hasmorepages = true; switch (pagenumber) { case 1: printa(e); break; case 2: printb(e); break; case 3: printc(e); e.hasmorepages = false; break; } }

gorm - How to implements tablePerHierarchy with disciminator in grails? -

i have class hirarchy : class item {} class participation extends item{} class contribution extends participation{} class question extends participation{} i have table per class so, add tableperhierarchy false in item i need discrimator implements query : class = "contribution" i try lot of implementation it's not working. how ? thanks do want table per hierarchy or table per class? it's not clear in question. with following domain objects, can either way: // item.groovy class item { string x } // participation.groovy class participation extends item { string y } using default, table per hierarchy strategy, 1 table used store items , subclasses of items too. default discriminator column called class , grails use automatically. schema generated grails schema-export looks this: create table item ( id bigint generated default identity (start 1), version bigint not null, x varchar(255) not nul...

php - What is the correct order of statement method calls using prepared statements? -

i want make db secure possible, , 1 of things i've learned use prepared statements...so that's i'm doing. i need confirmation make sure order of execution ok. does following make sense, or missing something? $sql = 'select ...'; $conn = @ new mysqli($host, $user, $pwd, $db); $stmt = $conn->stmt_init(); // initialize prepared statement $stmt->prepare($sql); $stmt->bind_param('i', ...); $stmt->bind_result(..., ..., ...); $stmt->execute(); while ($stmt->fetch()) { ... } $stmt->free_result(); // free database resources other queries $stmt->close(); // close statement $conn->close(); //close database connection i don't need call stmt_init() -- @ least, doesn't seem necessary, according example on page of mysqli::prepare() you might want check : if connection db has been established -- see examples on page of mysqli::__construct() , using mysqli::connect_error . if statement has prepared -- check...

php - Zend_Pdf font problems with german language.....? -

i using zend_pdf class create pdf document . here contents in german language , when write content pdf automatically converts characters some special chars . i not able figure out problem....? i tried code like $str = html_entity_decode($str, ent_compat, "utf-8"); but not taking , showing same result .....!!!!!! please provide code or links helps me........ thanks in advance..... thanks zsub, i got solution using following code : $text = $this->_font->encodestring($text, 'utf-8');

How to add content to tab items at runtime in WPF -

how can add web browser control tabitem in wpf @ runtime? tabitem.content = new webbrowser(); if want multiple controls in tabitem, you'll need use panel , in xaml.

javascript - Can I disable the div id linking with Jquery UI Tab? -

here's demo: http://up.videodetective.com/jeff/strip/2/slider.html it rotates every 5 seconds, scroll bottom of page , wait 5 seconds. when goes next item in slideshow whole page bounces div id is(in case top). which poor user experience in opinion, there way disable moving ever div id is? i've looked online couldn't find anything. oh , way i've tested ff 3.6, chrome, , ie9 if there css issues see heads great, main concern being brought div id. in ccs rule #slider , add #slider { /*...*/ height: 500px; /*...*/ } giving slider value height prevent jump happens when inner elements replaced.

validation - Rails: Save collection of updated records all at once -

as understand it, build method can used build collection of associated records before saving. then, when calling save , child records validated , saved, , if there validation errors parent record have error reflecting this. first question is, correct? but main question is, assuming above valid, possible same thing updates, not creates? in other words, there way update several records in collection associated parent record, save parent record , have updates take place @ once (with error in parent if there validation errors in children)? edit: summarize, i'm wondering right way handle case parent record , several associated child records need updated , saved @ once, errors aborting whole save process. firstly +1 @andrea transactions - cool stuff didn't know but easiest way here go use accepts_nested_attributes_for method model. lets make example. have got 2 models: post title:string , comment body:string post:references lets models: class post < ...

c# - Capture screen on server desktop session -

i have developed gui test framework integrationtesting of our company website on scheduled basis. when fails, it'll take screenshot of desktop, among other things. runs unattended on logged in user on dedicated windows server 2008. the problem taking screenshot on desktop have disconnected remote desktop session from. following exception: system.componentmodel.win32exception (0x80004005): handle invalid @ system.drawing.graphics.copyfromscreen(int32 sourcex, int32 sourcey, int32 destinationx, int32 destinationy, size blockregionsize, copypixeloperation copypixeloperation) @ system.drawing.graphics.copyfromscreen(point upperleftsource, point upperleftdestination, size blockregionsize) @ integrationtester.testcaserunner.takescreenshot(string name) in c:\vs2010\integrationtester\integrationtester\config\testcaserunner.cs:line 144 @ integrationtester.testcaserunner.starttest() in c:\vs2010\integrationtester\integrationtester\config\testcaserunner.cs:line 96...

objective c - Closing a UIpicker in an iphone app -

i'm new iphone dev. app i'm making uses picker input value user. have managed make picker hidden until user hits button. used mypicker.alpha = 0; in viewdidload the picker invisible when program starts. when user hits start button executes code mypicker.alpha=1; . want picker close after user chooses value. how do that? have hints or tutorials ? looked @ few confusing! how make picker appear bottom ? (like keyboard !) one method started using put shade button behind picker, large transparent black button size of screen, color black alpha=0.3 ([uicolor colorwithwhite:0 alpha:0.3f] think was). puts transparent "shade" on rest of screen except picker, similar how looks when use uialertview. hook button sends resignfirstresponder picker. when user done picking, tap anywhere outside picker in shaded area, , button resigns picker, , picker can slid down , button faded out animation. the picker slide up/down animation can done , have code @ home don't...

android - Links sometimes not working in WebView -

this same problem mentioned at: links not working in webview hoever solution provided in there doesn't work me. after playing around little bit, noticed link start working after scrolling screen or if orientation changed. looks freezing screen , getting unlocked after scrolling or if orientation changed. any idea wrong ? thx found more: i using webview inside tab. noticed problem gone if tab not used @ all. i had issue android 4.0.4 hack i've been able come flip landscape if android version 4.0.4, posted problem in xamarin's forums , have had no response in on year. c# use in "oncreate": if (build.version.release == "4.0.4") { requestedorientation = android.content.pm.screenorientation.landscape; }

iphone - Jquerymobile's Tap-hold not working in opera mobile widget emulator -

i tried implementing tap-hold function of jquerymobile given in 1 of demos <!doctype html> <html> <head> <title>jquery mobile events</title> <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a1/jquery.mobile-1.0a1.min.css" /> <script src="http://code.jquery.com/jquery-1.4.3.min.js"></script> <script src="http://code.jquery.com/mobile/1.0a1/jquery.mobile-1.0a1.min.js"></script> <script type="text/javascript"> $( function() { $('body').bind( 'taphold', function( e ) { alert( 'you tapped , held!' ); e.stopimmediatepropagation(); return false; } ); $('body').bind( 'swipe', function( e ) { alert( 'you swiped!' ); e.stopimmediatepropagation(); return false; } ); } ); </script> </head> <body> <div data-role="page" id="home"...

powershell - Modify users based on Office location -

i can't work... ideas? basically, if user in chicago, claim user isn't , falls in else statement. i want collect users in ad. then want @ office location , based on located, set address.... $users = get-adgroupmember "domain users" -recursive | select-object samaccountname foreach ($user in $users) { if (get-aduser -filter {samaccountname -eq '$user' -and office -eq "chicago"}) { set-aduser -streetaddress "66 chicago rd" -city "chicago" -postalcode "60618" -state "il" -country "us" -replace @{ co="united states"; countrycode="804" } } else { (echo $user " not in chicago!")} } can try : $users = get-adgroupmember "domain users" -recursive | select-object samaccountname foreach ($user in $users) { if (get-aduser -filter {samaccountname -eq $user.samaccountname -and office -eq "chicago"}) { set-aduser -streetaddress "66 chi...

python - CUPP (pentest) on google app engine -

do see limitations cupp (http://www.securityfocus.com/tools/7320) running on gae? i see few problems right off: you'll need create web interface script gae not allow long running tasks , looks take while. you'd need recode break work chunks. outbound ftp (for fetching word lists) not supported on gae local file write access not supported (you'd need convert use datastore)

python - Converting untagged corpora to tagged (NLTK) -

i have plaintext corpora, want tag , save, can use further. what's best way this? i have tagger made, can't figure out way change corpora isn't messy take @ other tagged corpora, brown, output examples. give idea of tagged corpus should like. next, load corpus (with plaintextcorpusreader ) , iterate on sentences, tagging each sentence. write each tagged sentence file making string tagged sentence, in ' '.join([tuple2str(t) t in tagged_sent]) (after from nltk.tag.util import tuple2str ). , it's ok if code "messy" long job correctly. you're not looking elegant algorithm here, you're running specific script create custom corpus.

c# - Get the parameter value of method on exception -

is there way know passed method when exception thrown.e.g; convert.toboolean(string mystring) when throws formatexception? here want know mystring when exception thrown? you should using boolean.tryparse . can say bool value; if(!boolean.tryparse(mystring, out value)) { // didn't parse } // parsed

Google Stocks API -

i'm developing bot, , want use google's stock's api shown here: http://jarloo.com/tutorials/google-stock-api/ the problem is, feature request else , don't know lot stocks. see 'undocumented', have links information can each of tags return is? sample return yahoo below. <xml_api_reply version="1"> <finance module_id="0" tab_id="0" mobile_row="0" mobile_zipped="1" row="0" section="0"> <symbol data="yhoo"/> <pretty_symbol data="yhoo"/> <symbol_lookup_url data="/finance?client=ig&q=yhoo"/> <company data="yahoo! inc."/> <exchange data="nasdaq"/> <exchange_timezone data="et"/> <exchange_utc_offset data="+05:00"/> <exchange_closing data="960"/> <divisor data="2"/> <currency data="usd"/> <last data="13.59...

SQL Server & VB.Net issues with stored procedures -

sql server 2008 r2 visual studio 2010 i have 2 tables: first table countries has 3 columns country-id, countryname, cityname . i displaying country name , city name dropdownlist in visual studio. my second table name userselection columns id, country-id, username, date i created form on visual studio has button send information sql server through stored procedure. my stored procedure far is set ansi_nulls on go set quoted_identifier on go alter proc [dbo].[usp_userinput] (@country-id int, @username(75), @date datetime) insert [customapplications].[dbo].userselection ([country-id], [username], [date]) values (@country-id, @username, @date) however when send says many arguments , think because trying send countryname , cityname rather country-id. on how create stored procedure send country-id , still have values populate dropdownlist countryname, cityname. thanks remove - symbol variable name. sql server thinks trying math. need...

How to organize projects on Git server? -

i new git , moving svn. working on setting new git server team. trying understand best way setup projects on git server. is each project want branch , tag own repo in git? in svn, own folder in central svn repository. seems git prefers project own isolated repository. if correct in assuming each project new repository in git, how things grouped? in svn, different teams may have section of svn repo, projects under section. examples maybe grouping frontend projects in 1 folder , services in another. done in git naming te repo prefix or there concept of folders or groups? thanks help! each project ideally own repository. can of course make mega-lith repository of everything, thats suboptimal. i tend make repositories in folders, , use git submodule bring in libraries or dependencies top-level projects. submodule great way version iteration of external repository using.

How to compile java class in different package in command line -

i have java class in different package on same classpath , don't know how compile in command line. javac -sourcepath /path/to/srcdir -cp /path/to/libraries -d /path/to/outputdir

php - problem in web developing in eclipse -

so guys have simple problem. have 2 php sites. 1 contains html form calls "enrol.php" file. have tried uploading them on testserver (127.0.0.1). pages work fine. when click on page1.php (the 1 html form) takes me page2.php but when try same thing in eclipse, nothing happens. checked paths , correct. i 2 other similar files, same thing, , work fine. here code page1.php: <!doctype html public "-//w3c//dtd html 4.01//en" "http://www.w3.org/tr/html4/strict.dtd"> <html> <head> <meta content="text/html; charset=iso-8859-1" http-equiv="content-type"><title>enrol</title> <style type="text/css"> p { font-family: arial,helvetica,sans-serif; font-size: large; } </style> </head> <body> <h1 style="width: 624px;">enrol student</h1> <p style="font-family: helvetica,arial,sans-serif;"><span style="font-size: 11pt; color: bl...

algorithm - How to predict a True/False event -

i have measurements on system (x, y, z, ..) on many trials. system produces true or false output. take data , produce predictor function of x,y, z, best predict system outcome. i used methods approximating smooth outcomes approximating graph, don't know terms search when outcome true/false. search multivariate classification . in case have 2 classes (true , false). the wikipedia article on statistical classification has list of commonly used algorithms. you can search multivariate regression attempts model real value function of several values in case possible values discrete set (0,1). 1 have take decision on whether predicted outcome true or false based on regression function's output (e.g. assume true if output > 0.5 , false if it's <= 0.5). note there https://stats.stackexchange.com/ more detailed answers related analysis of data.

web services - How can i set attributes with NuSoap in PHP? -

i working nusoap build soap server. cant attributes way want. i return value: <return xsi:type="tns:taxatie"> <emailadres optin="1" xsi:type="tns:string">email@domain.com</emailadres> </return> and get: <return xsi:type="tns:taxatie"> <emailadres optin="1" xsi:type="tns:emailadres"> <emailadres xsi:type="xsd:string">email@domain.com</emailadres> </emailadres> </return> anyone know must change? or how should set arrays? this test code: <?php require_once("nusoap.php"); $soapserver = new nusoap_server(); $soapserver->configurewsdl('thijs.test', 'urn:thijs.test'); $soapserver->wsdl->addcomplextype( 'taxatie', 'complextype', 'struct', 'all', '', array( 'emailadres' => array('name' => 'ema...

class - Is there a better way to use Ext.apply to combine child/subobjects into another object? -

i'm trying apply object properties obja objb realised ext.apply flawed (or blessing?) in way applies first level objects together. example: var obja = { name: 'obja', baseparams: { cols: [1,2,3,4,5] } }; //used in subclass var objb = { name: 'objb', baseparams: { limit: 50, sort: 'name' } }; //used in baseclass var objc = { name: 'objc', baseparams: { as_hash: true, limit: 20 } }; ext.apply(objb,obja); //used in subclass ext.apply(objc,objb); //used in baseclass example output: obj = { name: 'obja', baseparams: { cols: [1,2,3,4,5] } }; i'd output instead (expected output): obj = { name: 'obja', baseparams: { cols: [1,2,3,4,5], as_hash: true, limit: 50, sort: 'name' } }; how can achieve without doing this? // subclass: var bptemp = {}; bptemp.baseparams = ext.app...

c# - Get and set the field value by passing name -

i have field in class random name like: class foo { public string a2de = "e2" } i have name of field in variable like: string vari = "a2de" can or set value of field a2de using value of vari ? like: getvar(vari) or setvar(vari) = "e3" you have use reflection. to value of property on targetobject : var value = targetobject.gettype().getproperty(vari).getvalue(targetobject, null); to value of field it's similar: var value = targetobject.gettype().getfield(vari).getvalue(targetobject, null); if property/field not public or has been inherited base class, need provide explicit bindingflags getproperty or getfield .

multithreading - C# multi-thread ping -

i'm working on network monitoring application, pings (not known) number of hosts. far have code below. i've made class pinghost function zping , called of timer once every 2 seconds let 2 pings finish, if 1 of them gets timedout . think better solution generate new thread every ping, ping of every host independent. can give me hint how this? namespace pinguin { public partial class form1 : form { public form1() { initializecomponent(); } private void timer1_tick(object sender, eventargs e) { pinghost caca = new pinghost(); pinghost caca1 = new pinghost(); this.label1.text = caca.zping("89.115.14.160"); this.label2.text = caca1.zping("89.115.14.129"); } } public class pinghost { public string zping(string dest) { application.doevents(); ping sender = new ping(); ...

Rails 3.1 rc4 and Jquery: beginner's question -

i'm new jquery , upgraded rails 3.1 rc4 , i'm starting new project. so far i've figured can convert jquery code coffeescript , place in something.js.coffee, example but: should place pure jquery code? i'm trying simple example work: http://api.jquery.com/hide/ i've tried putting following code in application.js , home.js.coffee nothing worked far.. $("p").hide(); $("a").click(function ( event ) { event.preventdefault(); $(this).hide(); }); thanks in advance either of places you've suggested (application.js or specific coffeescript file) valid - though should written in coffee syntax if you're putting in coffeescript file. you need put code within $(document).ready function work... $(document).ready(function() { $("p").hide(); $("a").click(function ( event ) { event.preventdefault(); $(this).hide(); }); });

gorm - Grails non-existent mapping property -

having problems domain class mappings. domains follows: user domain class user extends secuser { static hasmany = [ratings:rating, searchedresults:results, recommendedresults:results] static mappedby = [searchedresults:"searched", recommendedresults:"recommended"] } rating domain class rating { static belongsto = user artist artist double rating } results domain class results { static belongsto = user def searched def recommended } when compiling gives following error: non-existent mapping property [recommended] specified property [recommendedresults] in class [class ontourtest.user]. any ideas why happening? much! try changing def searched , def recommended in results class actual types (example thing searched , thing recommended ). i'm not sure type they're supposed , think grails doesn't know either. see documentation note: there type-o in documentation ;)

java - glReadPixels() fails to fill ByteBuffer -

well, i'm trying take screenshot window in opengl using lwjgl. here's code: bytebuffer pixels = bytebuffer.allocatedirect(800*600*4); pixels.order(byteorder.nativeorder()); while(!display.iscloserequested()) { glclear(gl_color_buffer_bit | gl_depth_buffer_bit); render(); display.update(); // "screenshot" block if(keyboard.iskeydown(keyboard.key_q)) { pixels.clear(); glreadpixels(0, 0, 800, 600, gl_rgba, gl_unsigned_byte, pixels); pixels.flip(); // pixels.position() , pixels.limit() tells there nothing in buffer // ... } } and... i've tried various versions of code, placing "screenshot" block before display.update(). , using combinations of glreadbuffer(gl_back/gl_front) , gldrawbuffer(gl_back/gl_front) no avail. i've disabled opengl states , rendering, blank screen appears , tried using glreadpixels. blank screen supposes in buffer, nothing in buffer. glgeterror() doesn...

c# - delegate covariance and Contavariance -

consider following code snippet namespace consoleapplication1 { public delegate tresult function<in t, out tresult>(t args); class program { static void main(string[] args) { program pg =new program(); function<object, derivedclass> fn1 = null; function<string, baseclass> fn2 = null; fn1 = new function<object, derivedclass>(pg.mycheckfuntion) fn2=fn1; fn2("");// calls mycheckfuntion(object a) pg.mycheckfuntion("hello"); //calls mycheckfuntion(string a) } public derivedclass mycheckfuntion(object a) { return new derivedclass(); } public derivedclass mycheckfuntion(string a) { return new derivedclass(); } } why delegate call , normal method invocation call different methods. the delegate bound mycheckfuntion(object) @ compile time - you're telling find method accepts object . binding single method - doesn...

php - post message to facebook news feed -

i running ecommerce website in php. when facebook connected users make search or post sale, want automatically post messages user's facebook news feed. wonder how it? articles can read about? thanks, for need take publish_stream permission user. read this

c# - SMO scripting entire database like Studio Management does with Generate Scripts -

i trying set c# tool scripts entire database tables down stored procedures. want schema , data. having hard time finding on net on how properly. think common practice alternative if don't wish dabase using backup or transfer, can't find on subject. can direct me on how or tell me needs done? have found how script tables , stored procedures, want in database can revert if changes database breaks other things. one of reasons going way because know if backup: a.) can corrupt b.) can on server hosting sql server. cannot on local machine if running application remotely sql server. of course assuming cannot rely on unc path or ftp script of kind. have @ http://scriptdb.codeplex.com . tool scripts out database's ddl. for scrripting out data try approach described here: http://sqlblog.com/blogs/ben_miller/archive/2007/10/18/scripting-tables-views-and-data-using-smo-part-3.aspx or try use bcp, wich better alternative bigger databases.