Posts

Showing posts from September, 2010

deployment - How to deploy two projects with NetBeans that use the same deployed JRE? -

i have 2 java projects in net beans ide 7.3. 1 javafx gui admin console i've built , deployed ("admin.java"); contains minimized jre , installs via single .exe file. second project java datalogger ("datalogger.java") i've deployed in /dist folder , contains "datalogger.jar" lib folder containing "apache-commons-net.jar." the "datalogger.jar" file dependent on settings stored in data files "admin.java," , want able deploy "admin.java's" .exe file customer doesn't need perform other running single .exe file install everything. "datalogger.java" needs use same minimized jre installed via "admin.java's" .exe file. i thought of creating .bat file commands install "datalogger.java" files appropriate %appdata% location(s), doesn't address jre issue. isn't there way generate single bundle net beans accomplish this?

html - WebForms UnobtrusiveValidationMode requires a ScriptResourceMapping for 'jquery'. Please add a ScriptResourceMapping named jquery(case-sensitive) -

i'm building web application using visual studio 2012. i'm attempting add word count textbox. after adding the javascript codes , html codes. receive error stated above. here javascript codeds code : function validatelimit(obj, divid, maxchar) { objdiv = get_object(divid); if (this.id) obj = this; var remaningchar = maxchar - trimenter(obj.value).length; if (objdiv.id) { objdiv.innerhtml = remaningchar + " characters left"; } if (remaningchar <= 0) { obj.value = obj.value.substring(maxchar, 0); if (objdiv.id) { objdiv.innerhtml = "0 characters left"; } return false; } else { return true; } } function get_object(id) { var object = null; if (document.layers) { object = document.layers[id]; } else if (document.all) { object = document.all[id]; } else if (document.getelementbyid) { object = document.getelementbyid(id); } return object; } function trimenter(datastr) { return datastr.replace(/(\r\n|\r|\n...

Cannot get some feed via Graph API -

i cannot feed via graph api. before april, can feed via graph api. have tried if there possibility of wrong environment. find can feed via graph api on server. have 3 server. same os , php version. ip address different. facebook bug? did try facebook explorer https://developers.facebook.com/tools/explorer/ ? go there , choose application maybe application have error using api !! otherwise have install curl servers because php-sdk need curl fetch data api

css - Is it possible to fade a horizontal gradient into a vertical gradient to MASK something -

Image
i have 3 background gradients, horizontal mask, top border , bottom border achieves effect, fading borders background: using code (repeated browser prefixes million times.. ugh): background: linear-gradient(to right, rgba(200,100,40,1) 0%,rgba(250,235,115,0.5) 50%,rgba(200,100,40,1) 100%), linear-gradient(to top, rgba(240,175,30,1) 0%,rgba(240,175,30,0) 2px), linear-gradient(to bottom, rgba(250,235,115,1) 0%,rgba(250,235,115,0) 2px) ; /* w3c */ it's there problem edges of mask full opacity (1) background isn't solid colour (some horizontal grds & inner shadow), resulting in these problems. my solution @ moment modify background code ensure background doesn't start fading until it's past top mask , bottom background colour full before bottom mask. cumbersome , inflexible, not css3 about. i have seen solutions fading out borders ( "fade" borders in css ) should work setting border colour gradient i'm yet see work , thr...

html - CSS colums: continue right sidebar and two colums to one -

i need layout new this. im need 3 column layout underneath horizontal nav bar, need cut first 2 columns off can have "text block" underneath them without affecting continuing right side bar. can table prefer not if there way. http://jsfiddle.net/sjwke/ effect you're looking for? html <div id="wrapper"> <div id="header"> header </div> <div id="colwrap"> <div class="col"> column 1 </div> <div class="col"> column 2 </div> <div id="text"> text </div> </div> <div id="col3"> column 3 </div> </div>

node.js - How to Run "npm install boombot" on Heroku Server? -

i want run npm install boombot , edit files via nano. then, want run node index.js i'm getting errors though when running heroku run npm install boombot --app trooperbot this image of me running it. thank can me , running! i think problem you're thinking heroku server. it's not - it's place deploy , run applications. when heroku run xxx runs command on brand new dyno that's loaded app. "installing" on dyno no avail, go away after exit dyno. read how heroku works understand more this. so approach solving problem, should declare package dependencies in package.json - see here .

winapi - Create AeroGlass effect in windows 8 -

i want create aeroglass effect in application (not whole system) seem microsoft drop feature windows 8, so, have create own. to create effect, i'm going rectangle of image below window of application , apply gauss blur on , finaly draw windows. how can image below windows?

ios - iOS6 Social framework: posting to multiple networks without the UI -

in app, i'm looking allow users post single status both facebook , twitter. i've got own compose window, i'd avoid using built-in slcomposeviewcontroller , since it's not necessary. in searches, i've not found tutorials on how directly post either twitter or facebook using ios6 stuff, it's built-in composer, , docs have proven obtuse weary eyes. any pointers tutorials, sample code, or pointer in right direction appreciated. grab both user's twitter , facebook accounts acaccountstore , , make 2 calls slrequest --one twitter post , facebook. here's class reference slrequest . and check out these examples facebook , twitter . it's worth noting facebook has own sdk alternative slrequest , allows more customization of requests include fql , batch requests , etc. depending on specificity of requirements, may want check out.

android - How to authenticate instagram and like and comment on a pic? -

i making instagram app in show pics of user ( entering name of user ), user without authenticating can see timeline of user. but want user able , comment pic, authentication required, in facebook provide sdk in instagram could'nt find sdk , third party lib. can me in authentication, liking , commenting in instagram?? you can download sdk https://github.com/markchang/android-instagram .

c# - Icon Extraction for Remote Files -

i need show list of file remote server. fetch details of remote server using self hosted web service. i.e. fetch remote server file name , full path json string , show information in treeview [wpf]. need show icons of these files. think can use icon within client desktop application , found 2 solution http://www.codeproject.com/articles/2532/obtaining-and-managing-file-and-folder-icons-using#_rating and wpf's system.drawing.icon.extractassociatedicon however love solution later part doesn't work given file name[i.e. file should present in system, not case me]. try run above code's sample, , icon shown not or clean. so, there better way extract/get associated file icon extension in c#, wpf. thanks. i search more , found codeproject's article suggested way of extracting icon. though still experimenting , in last 2 hours not able show icon in treeview though object seems filled correctly me.

XSLT and XML does not match -

i have xml on doing xslt transformation. xslt receiving other source, have no control on it. problem occurs when there slight difference between xslt , xml. example xml looks this: <a> <b></b> <c></c> </a> later xml changes this: <a> <b> <c></c> </b> </a> so in second case, xslt transformation throws heap space exception. there way can validate xslt against xml? want check if xslt corresponds correct xml. can tell me how can avoid outofmemory exception , if exception, how can prevent application consume jvm heap memory? do have dtd or xml schema? can validate transformation output. validation of transformation without running it, seems run afoul of incompleteness theorem. as preventing transformation eat memory, reliable way prevent sandboxing separate process controlled memory constraints.

GIT PUSH - Is there any way to know which developer actually pushed a code? -

is there way know developer pushed code? merged branch , pushed it. didn't commit branch. pushed. can't see in log shows "pusher". command see in made "push" actually? unless you're using extras log push / pull, committer , author have. said, case last commit not developer pushed remote repository bit weird (i think). because developer have been in possession of commit (if didn't somehow share via usb stick or different remote repository).

java - dealing with a variable of short data type -

i have method in parameter receiving "rowno" of type short. code shown below. private int abcd (int , short rownum) { // method body } now query this. inside method have perform logic when value of rownum 5 , trying this if (rowno == 5) { //perform operation } please advise me whether correct approach short type. that should work fine. when rowno short , expression rowno == 5 equivalent ((int) rowno) == 5 since java implicitly promotes primitive operands. the java language specification says 5.6.2. binary numeric promotion when operator applies binary numeric promotion pair of operands, each of must denote value convertible numeric type, following rules apply, in order: 2 widening primitive conversion (§5.1.2) applied convert either or both operands specified following rules: if either operand of type double, other converted double. otherwise, if either operand of type float, other converted float. otherw...

unix - Can't extract pattern from filename -

getting errors following sed command: echo 20130521_onepki_p107336_app.pfx | sed -e 's/_\([pp][0-9]+\)_/\1/' instead of returning p107336 , returning full filenam 20130521_onepki_p107336_app.pfx . any ideas why happening, , how can restrict output pattern like? the captures should escaped parentheses , can use case-insensitive match i , also, replacing capture part captured part no changes made. 1 matches entire line , replaces captured pattern: sed -e 's/.*_\([pp][0-9][0-9]*\)_.*/\1/'

iphone - RMMapView setCenterCoordinate function is not normally -

i want set center of rmmapview position that's _tempcoordinated2d (cllocationcoordinate2d) normally, should be // _rmmapview rmmapview class [_rmmapview setcentercoordinate:_tempcoordinated2d]; // try [_rmmapview setcentercoordinate:_tempcoordinated2d animated:yes]; // try [_rmmapview setcentercoordinate:_tempcoordinated2d animated:no]; result's wrong. because center of rmmapview move _tempcoordinated2d , move current location. have checked code. doesn't have code that's setcentercoordinate current location. the problem not that. this's problem hasn't occurred , if touch map , move map before run statement setcentercoordinate of rmmapview. i don't know why. sorry bad english. do have usertrackingmode set on rmmapview causing center on user? try setting rmusertrackingmodenone .

object - How to Sum the 2 result query from jquery -

how can sum 2 number jquery. i'm doing here chained select, first select product (book), if select jquery display price. second select page (how many page) if select jquery display price db. tried adding got nan or [object object]. please help. jquery $(document).ready(function () { //disable not 1st select $("#description").attr("disabled", "disabled"); $("#orientation").attr("disabled", "disabled"); $("#page").attr("disabled", "disabled"); //start----------------------compny $("select#company").change(function () { $("#description").html("<option>wait...</option>"); var id = $("#company option:selected").attr('value'); $.post("./includes/select_type.php", { id: id }, function (data0) { $("#description").removeattr(...

php - Yii Bootstrap Navbar .active not applying on some pages -

i have yii project, user yii-bootsrtap. have static pages (like faq , page) user can access navbar. looks this: index | | faq | login ... my problem is, .active class not applying menubar item, when navigate static page. works on other pages, index , login. i using own action render these static pages: // in sitecontroller.php: public function actionstatic($view) { $this->render('static/' . $view); } if you're using cmenu show menu, adding active key actual menu item may resolve problem. if add below specific menu item, show active if controller action you're on 'blog': 'active'=>(yii::app()->controller->action->id=='blog') the full snippet this: $this->widget('zii.widgets.cmenu', array( 'items' => array( 'label'=>'blog', 'active'=>(yii::app()->controller->action->id=='blog') ) );

c# - mvc 4 drop down default value selected -

i want select default value in drop down list policyid = 7 didn't select value, doing wrong? controller: var pm = new managerclass(); ienumerable<myclass> po = pm.getdatafromdb(); ienumerable<selectlistitem> policies = new selectlist(po, "policyid", "policyname", new { policyid = 7 }); viewbag.policies = policies; view: @html.dropdownlistfor(m => m.policyid, viewbag.policies ienumerable<selectlistitem>, new { @class = "dropdown-field"}) just set policyid property on view model value want preselected: var pm = new managerclass(); var po = pm.getdatafromdb(); viewbag.policies = new selectlist(po, "policyid", "policyname"); viewmodel.policyid = 7; return view(viewmodel); since dropdownlist bound policyid property ( m => m.policyid ), value used when deciding element preselected.

fullscreen - Is there a way to show IME on full screen mode of Unity3d Game -

i searching method, how show ime on full screen mode of unity3d game. 1 method : add " -popupwindow" argument game.exe, , set game resolution may native desk resolution. other idea welcome, advanced. for standalone builds can use screen.fullscreen = true .

c - Confused in understanding recursion -

i little bit confused following code to find height of tree , code find sum of n nos recursively, below this. lheight , rheight store, depending on number of recursions makes? int height(struct node* node) { if (node==null) return 0; else { lheight = height(node->left); rheight = height(node->right); if (lheight > rheight) return(lheight+1); else return(rheight+1); } } here 1 more clarification, prints sum of n nos : int findsum(int n){ int sum; if(n <= 0) return 0; else sum = n + findsum(n-1); return sum; } if change to: int findsum(int n){ int sum; if(n <= 0) return 0; else sum = findsum(n-1); // here return sum; } it prints output 0. why doesn't return number of recursions, if above tree code does? your second recursion equivalent to sum = findsum(n-1) = findsum(n-2) = findsum(n-3) = ..... = findsum(0) = 0; if want second recursion return number of...

java - Print logs on Android source code using Eclipse breakpoints? -

in debug effort understand system doing use java debugger conditional breakpoints mechanism print log messages on specific lines in android's source code. how it? don't know, that's question about. things know: eclipse java debugger has "conditional breakpoints" , i.e., set breakpoint in code , write condition. each time code reaches breakpoint line stop execution if condition wrote true , otherwise not stop. i though maybe mechanism can twisted print log message @ specific line in code instead of stopping execution. , if can done able track android's source code doing. you can use following expression in conditional breakpoint: android.util.log.v("myapp", "my message") == -1 this make breakpoints not break execution , in logcat view, filtering view using tag:myapp expression, desired logged messages. can use other log levels ( a , i , e , w ). see log documentation more info. to have breakpoint break, use: an...

jsf 2 - Primefaces Datatable recreate viewScoped bean -

i have data table 5 columns. first column contains: <p:column headertext="ordine" filterby="#{item.numeroordinelavoro}" sortby="#{item.numeroordinelavoro}"> <p:commandlink value="#{item.numeroordinelavoro}" process="@this" action="#{bean_ordinilavoro.cmdseleziona_ordine}"> <f:setpropertyactionlistener target="#{bean_ordinilavoro.sel_ordinelavoro}" value="#{item}" /> </p:commandlink> </p:column> bean_ordinilavoro viewscoped. bean_ordinilavoro.cmdseleziona_ordine redirects in new page. every times click on commandlink bean_ordinilavoro recreated. problem. <context-param> <param-name>javax.faces.state_saving_method</param-name> <param-value>server</param-value> </context-param> <context-param> <param-name>ja...

c# - WebAPI POST [FromBody] not binding -

i'm posting json webapi controller, properties on model not being bound. public void post([frombody] models.users.user model) { throw new exception(model.id.tostring()); } the raw request follows: post http://diva2.local/siteapi/user http/: diva2.local connection: keep-alive content-length:: application/json, text/plain, */* origin: http://diva2.local x-requested-with: xmlhttprequest user-agent: mozilla/5.0 (windows nt 6.2; wow64) applewebkit/537.31 (khtml, gecko) chrome/26.0.: application/json;charset=utf: http://diva2.local/users accept-encoding: gzip,deflate,sdch accept-language: en-us,en;q=: iso-8859-1,utf-8;q=0.7,*;q=: .aspxauth=4; __requestverificationtoken=rp_huysjwcjmsxw2 {"id":3,"firstname":"diva2","lastname":"user1","username":"diva1","isapproved":true,"isonlinenow":true,"ischecked":true} every example can find tells me should work, model.id == null . how...

jquery - TypeError: Cannot read property 'style' of null (Javascript/Wordpress) -

i trying plug-in called appointment calendar work wordpress website, calendar supposed appear doesn't. reported error is file: jquery.cycle.all.min.js uncaught typeerror: cannot read property 'style' of null [cycle] terminating; few slides: 1 here referred line: ``(function($){var ver="2.99";if($.support==undefined){$.support={opacity:!($.browser.msie)};}function debug(s){$.fn.cycle.debug&&log(s);}function log(){window.console&&console.log&&console.log("[cycle] "+array.prototype.join.call(arguments," "));}$.expr[":"].paused=function(el){return el.cyclepause;};$.fn.cycle=function(options,arg2){var o={s:this.selector,c:this.context};if(this.length===0&&options!="stop"){if(!$.isready&&o.s){log("dom not ready, queuing slideshow");$(function(){$(o.s,o.c).cycle(options,arg2);});return this;}log("terminating; 0 elements found selector"+($.isready?"...

python - how to give a name to downloaded file with async tornado client -

i have python tornado code use files async from tornado import ioloop , httpclient def get_file(url): http_client = httpclient.asynchttpclient() http_client.fetch(url,done) def done() print "done" url = "http://localhost/files/ldfhgdksgfjkdfadf/output.pdf" ioloop.ioloop.instance().start() what happens file gets saved in current dir "output.pdf", there way asynchttp client specify file name? if call file name , save in different directory other current directory. what reading response.body in specified callback , write appropriate file, e.g.: from tornado import ioloop, httpclient def get_file(url): http_client = httpclient.asynchttpclient() http_client.fetch(url, callback=done) def done(response): open("my_favorite_directory/my_favorite_filename.pdf", "w") f: f.write(response.body) print "done" get_file("http://samplepdf.com/sample.pdf") ioloop.ioloop.ins...

symfony - Symfony2 Twig custom filter in asset -

i'm new in symfony2 , have little question: i'm developing email template, has txt , html parts (no problem it) the 'problem' have absolute paths of assets in twig. inside email.html.twig file have this: <img src="{{ asset('images/my-image.png') }}" alt="my image" /> writes route relative path. i discovered little solution add absolute paths, this: {% set abs = app.request.scheme ~ '://' ~ app.request.host %} <img src="{{ abs ~ asset('images/my-image.png') }}" alt="my image" /> it works! want improve solution , learn create custom filters (i read documentation, got bit lost) i want create this: <img src="{{ asset('images/my-image.png' | absolute) }}" alt="my image" /> but don't know how override assetics extension. can me? thanks lot!! well, little hard copy paste solution can make short cookbook can go step step , yourse...

apache - Save the modified Property file inside WAR deployed on server -

we trying use apache propertiesconfiguration in our project using jsf , jboss. my property file located inside package demo.prop name of prop1.prop inside war file same present under /web-inf/classes/demo/prop/prop1.prop using facescontext.getcurrentinstance().getexternalcontext().getresource("/web-inf/classes/demo/prop/prop1.prop"); i able fetch property file. when try extract string property file using propertiesconfiguration pc1=new propertiesconfiguration(a); string s1=(string)pc1.getproperty("user_name"); i able proper string. using set property method able set property also. pc1.setproperty("user_name", "hardcodedstring"); but not able save file location. no matter not able save file using pc1.save . can please try tell me how can save file original location changes done in property file remain is. modifying war file bad idea (for example, web servers may notice file modification redeploy app...

android - Spinner with image and text -

Image
i want spinner only topmost header should have image , text. remaining drop down should have text only. can me in making this. i have tried this.. i xml file <spinner android:id="@+id/spinner1" android:layout_width="200dp" android:layout_height="50dp" android:layout_alignparentleft="true" android:layout_below="@id/view" android:layout_marginleft="35dp" android:layout_margintop="20dp" android:background="@drawable/grey_btn" android:popupbackground="@drawable/drop_down_background" android:spinnermode="dropdown" /> and arrayadapter<string> adapter1 = new arrayadapter<string>(mcontext, r.drawable.spinner_text,r.id.customtextview,arr1); adapter1.setdropdownviewresource(r.drawable.drop_down); s1.setadapter(adapter1); you should have both getview , getdropdownview in adapter. in way specify different looks on selected item , rest of list. i...

database - c# WinForm App setup wizard w/ network DB and multi Cient -

i have been searching couple days unlucky finding answer. building winform application . application installed multi pc's on same network , connect db on server in same network. first , unable find how develop/design multi client(sorry don't know call ) application , same app operating @ same time, different users, in different pc's , use single db on network. second , want create setup wizard ,where user choose ,when installing application , if server , or client side. when server selected create db app , , when client selected , user point server machine on network , client app installed pointing @ db on server. i don't know if clear enough or complicated while explaining. i resolved issue wcf. building wcf host on main server , terminals comunicate main server via wcf , host program sql queries.

java - How to parse XML element from SOAP response using Jsoup -

i'm having problem in parsing xml element returned soap because xml structure : <a:journey> <a:infantprice>0</a:infantprice> ... </a:journey> i have tried .select("journey") .select("a:journey") but still not getting xml value. possible select xml segment format using jsoup? thanks in advance i think, got answer question. i should use : .select("a|journey"); according documentation : ns|tag: find elements tag in namespace, e.g. fb|name finds elements source : http://jsoup.org/cookbook/extracting-data/selector-syntax thanks

Should casting from ``real`` to ``double precision`` in FORTRAN be affected by the compiler? -

i have fortran code need run on server. noticed results little different between 2 machines. looking it, learned difference rise function return real value double precision variable. on locale machine use old compiler (gnu f95 4.1.2) , on remote machine use ifort. you should expect small difference between same program compiled different compilers. finite precision arithmetic doesn't obey rules expect real numbers. if compilers change order of operations, results may differ slightly. that said, gfortran 4.1 old point of being obsolete. wouldn't use version of gfortran earlier 4.3. recommend upgrading.

javascript - Highcharts - update chart using ajax -

here sample chart random data http://jsfiddle.net/fw4pz/ $(function () { $(document).ready(function() { highcharts.setoptions({ global: { useutc: false } }); var chart; chart = new highcharts.chart({ chart: { renderto: 'container', type: 'area', marginright: 10, events: { load: function() { // set updating of chart each second var series = this.series[1]; setinterval(function() { var x = (new date()).gettime(), // current time y = math.random(); series.addpoint([x, y], true); }, 1000); } } }, title: { text: 'live random data' ...

internet explorer 8 - Kendo template fails to render properly in IE8 -

i have kendo ui template generates dynamic html similar data repeater. because kendo template engine supports javascript using "for, each" loop within template itself. the output looks fine in chrome, firefox, ie9 , above broken in ie8. you can view snippet reproducing issue here: http://jsbin.com/ajazuw/6 . i cannot see javascript error when content rendered in ie 8 assuming might caused ie8 specific issue in kendo ui. update: issue caused quote in template. see here: http://jsbin.com/ajazuw/11 updated working version of template. this issue due trailing commas - ie chokes on them (see topic more details - are trailing commas in arrays , objects part of spec? ). try - http://jsbin.com/iyiqib/1/edit

ms access - error with multiple dlookup criteria -

this code produces runtime error 3464 dlookup matchstr_t . can't understand why matchstr_v seems work fine. offers? @ moment i'm trying use dlookup flag duplicate start times appointments. dim i, j, clientid, therid integer dim origin_date, apptdate date dim slotday, apptype, venue, matchstr_v, matchstr_t string dim slottime date dim appt(25) date dim db database dim rst recordset dim test variant origin_date = date slotday = me.slot_day.value slottime = me.slot_time.value clientid = me.client_id.value therid = me.therapist_id.value venue = me.venue.value apptype = "continuation" slottime = format(slottime, "short time") = 1 7 apptdate = date + if weekday(apptdate, 2) = slotday 'set stuff j = 0 25 appt(j) = apptdate + (j * 7) set db = currentdb() set rst = db.openrecordset("dummy") debug.print "[therapist id] = " & therid matchstr_v = "[appt date]= #" ...

git - How to configure to use the trusted certificate from the windows certificate? -

currently have following entry in .gitconfig in user directory. ... [http] sslcainfo=c:\\users\\julian.lettner\\.ssh\\git-test.pem ... this sets certificate use when interacting git server (required company's git server). cannot clone other repositories (for example public repo on github) because client uses configured certificate gets rejected other servers. how can circumvent problem? or there way configure git use windows certification store authenticate. thanks time, julian use: git config --local ... to specify per-repository settings. local settings stored in .git directory. an overview of 3 locations git can store settings: --local : repository specific, <repo_dir>/.git/config --global : user-specific, ~/.gitconfig --system : system default, /etc/gitconfig more specific ones override more general settings, i.e. local overrides both global , system.

How to open a classical Notes document in a new client tab, triggered by a XPage -

i have implement following request, tries failed: if click on button/link in xpage (xpinc), classic notes-document shall created in notes database. new notes document has open in new client tab beside tab xpage. i’ve tried several ways with facescontext.getcurrentinstance().getexternalcontext().redirect("notes://server/anotherdb/newdocumentunid?opendocument") but none of them led desired result (there 3 tabs opened or xpage tab empty). edit: it possible execute csjs ssjs view.postscript() . <xp:button value="client" id="button3"> <xp:eventhandler event="onclick" submit="true" refreshmode="partial" disablevalidators="true"> <xp:this.action><![cdata[#{javascript:var url = myjavaclass.createnewdocumentandreturnnotesurl(); view.postscript("window.open('" + url + "')");}]]></xp:this.action> </xp:eventhandl...

asp.net mvc - MVC Model How to make byte[] nullable? -

i'm using asp.net mvc ef code first. in model have property can null: public byte[] avatar { get; set; } however, when run update-database get: cannot insert value null column 'avatar', table 'temp'; column not allow nulls. update fails. i don't have dataannotation specifying property required, nor property foreign key. any ideas? further updates: if delete database , force new 1 created 'update-database -verbose' can see table being created forces not null flag on field: create table [dbo].[userprofile] ( [userid] [int] not null identity, [username] [nvarchar](max), [firstname] [nvarchar](50) not null, [lastname] [nvarchar](50) not null, [emailaddress] [nvarchar](50) not null, [workphone] [nvarchar](20), [mobilephone] [nvarchar](20), [hiredate] [datetime], [avatar] [image] not null, [avatarmimetype] [nvarchar](max), constraint [pk_dbo.userprofile] primary key ([userid]) ) my f...

c# - ASP.NET application hangs after Page_Load - seems to be worker process specific? -

the problem i have asp.net web application connecting sql server database. occasionally, application hangs when specific users try log in. can replicate when try log in user on live site machine, problem doesn't appear in identical site (the same code, same machine, same database , user account - worker process , application pool different). the problem disappears (at least temporarily) on application pool recycle. when happens again tends same users. normally i'd assume problem in application-specific code or database, , i'm still looking way that's possible, fact doesn't happen in identical site running against same database makes me doubt it. more information from logging, hang seems happen after page_load of requested page, before page_load of user controls on page. the hanging requests can seen in current requests of site's worker process in iis, state shows executerequesthandler , module isapimodule. the sql server's activity monit...

jquery - how to access such a data from the database table in javascript? -

the problem facing peculiar.the values want visible,when message server-web console. but,when give in loop,it shows me error of 05-22 18:58:23.203: i/web console(29392): jscallback error: typeerror: cannot read property 'value' of undefined @ file:///android_asset/www/cordova-2.1.0.js:3727 . means query right.i have committed mistake in loop retrieving data. i new phone gap , using javascript code.i have doubt , problem while executing it.i using sqlite database in project. my table structure this id cid values 1 1 value1 2 1 value2 3 1 value3 4 1 value4 5 2 value1 6 2 value2 7 3 value1 8 3 value2 9 3 value3 so want values of same cid ,how should code it? my query: tx.executesql("select cid,value table cid="+cid_value, [], querysuccess, errorcb,cid_value); because,when tried following manner, var details = results.rows.length; console.log("db test value:"+results.rows.item(cid_value).value); (var i=...

c# - GZipStream with large files doesn't work well -

i want compress large gml files (1-10gb). wrote method this, not work well. if decompress using 7-zip windows (or else), file looks bad in end (it's not finished, xml not finished)... don't see i'm doing wrong... private void compressfile() { string outputpath = path.combine(path.changeextension(_gmlpath, ".gz")); var buffer = new byte[1024 * 64]; using (var compressing = new gzipstream(file.openwrite(outputpath), compressionmode.compress)) { using (var file = file.openread(_gmlpath)) { var bytesread = file.read(buffer, 0, buffer.length); while (bytesread != 0) { compressing.write(buffer, 0, buffer.length); bytesread = file.read(buffer, 0, buffer.length); } } } } [edit] additional question: how can specify/change name of file, compressed inside gz ? it's name same input's one, there no .gml extention:s (there in input)......

Implementing incremental search in emacs -

i improve emacs-eclim , add incremental search through java types in edited project (shift-ctrl-h in eclipse). i can call eclim-java-find variants results in *eclim: find buffer. but here comes question: how 1 implement behaviour lets user type minibuffer (with prompt) , calls other function on each minibuffer change (new/deleted character) current minibuffer content argument or other way of accessing current search string. you can add function post-command-hook , example. called after every command (typing character command: self-insert-command ). function can check minibuffer contents function minibuffer-contents . just don't forget remove function post-command-hook when search command finished. can use minibuffer-setup-hook , minibuffer-exit-hook control attaching function. just don't forget remove attaching function minibuffer-setup-hook / minibuffer-exit-hook either when search command finished. :)

web applications - Implementing web service security in Reporting Tools -

i have web reporting tool lets business objects, cognos, obiee, crystal reports. want display data report coming web service. copy paste web service url inside report cell , can access data. however leaves big security issue cannot authenticate requestor. 1 thing can think of checking http header request: referer property set reporting tool in web service. atleast ensures request has originated reporting application. besides cannot see how can authenticate specific user. appending username in web service url not option because 1 report used many users. somehow want access specific user session , associate web service request user session. lets both web reporting tool , web service running on same web application server. possible merge web service provider , reporting application session user name available in webservice ?

python - Twisted Conch Packet Integrity Error -

when connect using twisted conch packet integrity error (6 bytes remaining) @ serverloop.c:980 in /var/log/secure.log after connection gets dropped ("disconnecting: packet integrity error") the server vmware system, no firewalls or other security between systems. see authentication runs (accepted password port ssh2). my ssh.py same example: class sshcommandchannel(channel.sshchannel): name = "session" def __init__(self, eventparser, *args, **kwargs): channel.sshchannel.__init__(self, *args, **kwargs) def _cbsendrequest(self, data): print("%s" % data) self.conn.sendeof(self) def channelopen(self, data): d = self.conn.sendrequest(self, 'exec', common.ns(data), wantreply=true) d.addcallback(self._cbsendrequest) return none def extreceived(self, datatype, data): self.datarecieved(data) def datarecieved(self, data): print("w00t: %s" % data...

Parsing Json to handle and direct a user to view controller. Objective C -

i have login screen , post username , password login page. the webservice gives me 2 responses if login user details correct response of request. {"value":1} and if user details wrong request. {"value":0} i have been able parse json result give me log output of value: 1 or value:0 i battling handle parsed json e.g //parse out json data nsdictionary* json = [nsjsonserialization jsonobjectwithdata:urldata //1 options:kniloptions error:&error]; nsarray* definejsondata = [json objectforkey:@"value"]; //2 nslog(@"value: %@", definejsondata); //3 if ([[json objectforkey:@"value"] isequaltonumber:[nsnumber numberwithint:1]]) { hud.customview = [[uiimageview alloc] initwithimage:[uiimage imagenamed:@"37x-checkmark.png"]]; hud.mode = mbprogresshudmodecustomview; [hud hide:yes afterdelay:0...

c# - Regex starting with a string -

i want filter following string regular expressions: test^ab^^house-1234~str2255 i wanna string "house-1234" , i've test string beginning "test^ab^^" , ending "~" . can please me how regex should like? string input = "test^ab^^house-1234~str2255"; var matches = regex.matches(input, @"test\^ab\^\^(.+?)~").cast<match>() .select(m => m.groups[1].value) .tolist();

Why can't I connect to ElasticSearch through Java API? -

i'm having trouble connecting vanilla elasticsearch cluster via java api. to reproduce: #start elasticsearch elasticsearch -f #checking in new window $ curl -xput 'http://localhost:9200/twitter/tweet/1' -d '{\ "user" : "kimchy",\ "post_date" : "2009-11-15t14:12:12",\ "message" : "trying out elastic search"\ }' result: { "ok": true, "_index": "twitter", "_type": "tweet", "_id": "1", "_version": 3 } $ curl -xget 'http://localhost:9200/twitter/tweet/_search?q=user:kimchy' result: { "took": 2, "timed_out": false, "_shards": { "total": 5, "successful": 5, "failed": 0 }, "hits": { "total": 1, "max_score": 0.30685282, "hits": [ { "_ind...

c++ - Variadic template overload resolution -

suppose have list of template parameters can incremented. want increment head of list. here code template<int n> struct counter { static constexpr counter<n+1> increment(); }; template<int n> constexpr counter<n+1> counter<n>::increment() { return counter<n+1>(); } //list (will used list of counters) template <typename... tail> struct list {}; template <typename head, typename... tail> struct list<head,tail...> {}; template <typename head, typename... tail> auto incrfront() -> decltype(list<decltype(head::increment()),tail...>()) { return list<decltype(head::increment()),tail...>(); } it indeed working : auto l0 = incrfront<counter<0>>(); // ok, decltype(l0) == list<counter<1>> l0 = list<counter<1>>(); //ok, right type auto l1 = incrfront<counter<0>,counter<1>>(); // ok, decltype(l1) == list<counter<1>,counter<1>...