Posts

Showing posts from February, 2014

vb.net - BindingSource - can't navigate after deleting record unless I commit -

i using bindingsource navigate through datatable in dataset. have custom back, forward, delete, , new buttons. have working except delete button. after delete row, row stays in bindingsource (marked "deleted") until commit changes. understand this, problem not want commit changes right after user deletes record. have opportunity add , delete multiple records , click "save" or "cancel" button commit changes @ once. so after delete row using delete button, can't navigate through records anymore because row has been marked deletion still "exists", error " deleted row information cannot accessed through row " when navigate through records , forward because record marked deletion still able navigate through in bindingsource. it's want have bindingsource bound non-deleted records only. way, when user deletes record, no longer seen in bindingsource gets deleted when commit datatable changes. also, proper way remove ro

c# - Persisting variable after AsyncFileUpload call to OnUploadedComplete -

this strange one. have ajax toolkit file uploader called asyncfileupload located in update panel. asyncfileupload control, put file there, begins upload , calls server. store file blob , obtain row id database table using select @@identity. far good, have row id , wish store it. placed inside hidden field when asyncfileupload calls onclientuploadcomplete, hidden field blank! thought "okay, i'll store in viewstate". surprise, same thing happened; viewstate gets cleared. had success using session variable. question is, why session variable work , viewstate or hiddenfield not? front: <script type="text/javascript"> function uploadcomplete(sender, args) { var filesize = args.get_length(); if (filesize > 2000000) { alert("logo size must smaller 2mb"); } $("[id*=hfuploadsuccessful]").val("1"); //calls postback , lvmembers_prerender gets executed results

javascript - Jcrop failing under IE8 on specific server, works on another -

having problem jcrop failing on our staging server working fine in production. both environments running on same hardware, apache virtual hosts set up. can tell, environments identical. following code in modal box loads after selecting picture upload. <?php $jsincludes = array( "jquery-file-upload-and-crop-plugin/js/vendor/jquery.ui.widget", "jquery-file-upload-and-crop-plugin/js/jquery.iframe-transport", "jquery-file-upload-and-crop-plugin/js/jquery.jcrop", "jquery-file-upload-and-crop-plugin/js/canvas-to-blob.min", "jquery-file-upload-and-crop-plugin/js/load-image.min", "jquery-file-upload-and-crop-plugin/js/main" ); echo $this->html->script($jsincludes); ?> <link rel="stylesheet" href="/js/jquery-file-upload-and-crop-plugin/css/jquery.jcrop.css" type="text/css" /> <!-- css make adjusments layouts of jq furac --> <link rel="

AngularJS templates can't use JSON that contains hyphen -

angularjs templates can't use json contains hyphen in key. e.g. my json looks { ... link: { xx-test:{ href: '/test/xx' } } now, in angularjs template if refer href not working <a ng-href="/app/edit?item={{item.link.xx-test.href}}"></a> it unable resolve value href rendered /app/edit?item= it tried <a ng-href="/app/edit?item={{'item.link.xx-test.href'}}"></a> <a ng-href="/app/edit?item={{item.link.xx\-test.href}}"></a> <a ng-href="/app/edit?item={{item.['link.xx-test'].href}}"></a> the object key needs quoted with: $scope.bar = {'xx-test':'foo'}; bracket notation should used in angular expression. <p>{{bar['xx-test']}}</p> you can optionally escape hyphen \- in angular expression.

asp.net - Unable to render Grid View -

i have grid view in user control, , getting below error: registerforeventvalidation can called during render(); i using gv.rendercontrol(htw); my code below: private void exporttoexcel(string strfilename, gridview gv) { response.clearcontent(); response.addheader("content-disposition", "attachment; filename=" + strfilename); response.contenttype = "application/excel"; system.io.stringwriter sw = new system.io.stringwriter(); htmltextwriter htw = new htmltextwriter(sw); gv.rendercontrol(htw); response.write(sw.tostring()); response.end(); } and avoid server control created outside form control exception using below code: public override void verifyrenderinginserverform(control control) { /* verifies control rendered */ } but i'm using code in usercontrol, there isn't method in base class. should do, placed above in page in place user control, still getti

java - Retrieve an image from my database sqlite -

i store images type text contains url of image in sqlite database, want in application in android these images , display on buttons want know how can it, suggestion please since fist need download images, suggest google "android load images" or "android download images". find many tutorials , libraries.

iphone - How to avoid auto-playing Youtube videos in UIWebView -

i want implement play , stop button same sd youtube when webview loaded youtube url. used below code when loads in webview starts playing (auto-play). want load in webview , not auto-play it. how can this? this code: uiwebview *videoview = [[uiwebview alloc] initwithframe:cgrectmake(10,80,275.0,150)]; nsurl *nsurl=[nsurl urlwithstring:strpreview]; nsurlrequest *nsrequest=[nsurlrequest requestwithurl:nsurl]; [videoview loadrequest:nsrequest]; [self addsubview:videoview]; thanks in advance here code create load embedded video in iphone using iframe nsstring *yoururl = @"http://www.cloudstringers.com:14556/ingcloud/users/400010003/mp4_320p/efda2f8a618be8e4a36b81d31251752820130710115909.mp4"; nsstring *embedhtml =[nsstring stringwithformat:@"\ <html><head>\ <style type=\"text/css\">\ body {\

datetime - Date Diff Human Format Output in PHP -

ok have found many threads on topic, can't find 1 seems working me. i've got script working, if input date today, have date example that's sunday 7th of july @ 10:51am , , it's coming thursday @ 12:33 pm , , older week coming january 1 @ 12:33 pm . this script far (the input date $timestamp in format y-m-d h:i:s ) function datediff($timestamp) { if(empty($timestamp)) { return "no date provided"; } // time difference , setup arrays $unix_date = strtotime($timestamp); if(empty($unix_date)) { return "bad date"; } $difference = time() - $unix_date; $periods = array("second", "minute", "hour", "day", "week", "month", "years"); $lengths = array("60","60","24","7","4.35","12"); // past or present if ($difference >= 0) { $ending = "ago"; } else { $difference = -$difference; $ending

javascript - Escape HTML tags. Any isue possible with charset encoding? -

i have function escape html tags, able insert text html. similar : can escape html special chars in javascript? i know javascript use unicode internally, html pages may encoded in different charsets utf-8 or iso8859-1, etc.. my question is: there issue simple conversion? or should take consideration page charset? if yes, idea of way handle that? ps: example, equivalente php function ( http://php.net/manual/en/function.htmlspecialchars.php ) has parameter select charset. no, javascript lives in unicode world encoding issues invisible it. escapehtml in linked question fine. the place can think of javascript gets see bytes data: urls (typically hidden beneath base64). this: var markup = '<p>hello, '+escapehtml(user_supplied_data); var url = 'data:text/html;base64,'+btoa(markup); iframe.src = url; is in principle bad thing. although don't know of browsers guess utf-7 in situation, charset=... parameter should supplied ensure browse

android - use custom title bar while have the normal theme -

Image
if use 1 of many tutorials on creating custom titlebars seems change rest of theme. how can change titlebar out changing rest of theme eg menu menu , edittext boxes etc //mainactivity.java requestwindowfeature(window.feature_custom_title); setcontentview(r.layout.activity_main); getwindow().setfeatureint(window.feature_custom_title, r.layout.customtitlebar); //manifest. <application android:allowbackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/apptheme"> <activity android:name="com.mediocrefireworks.cheapchug.mainactivity" android:label="@string/app_name" android:theme="@style/customtheme"> <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.l

multithreading - How to use different global variable for different browser sessions in Django website -

i trying count in django website. use global variable testc count (i know caused problem, don't know how counting without global variable). if 2 browser open website (threadtest.html) in same time, both increase same testc (of course). there way count individually in each browser session? need use multi-thread? thanks. here view: testc=0 def threadtest(request): global testc if request.method == 'post': testc=testc+1 print testc return render(request,'threadtest.html',{'count':testc,}) here template: base.html {% load staticfiles %} {% load static %} {% load extra_tags %} <html> <head> <title>{% block title %}{% endblock %}</title> {%block myscripts %}{% endblock %} </head> <body> <div id="content"> {% block content %}{% endblock %} </div> </body> </html> threadtest.html {% extends 'base.html' %} <html> <head><title

Working with iframes with the moovweb sdk -

i've created project moovweb sdk , have trouble editing content within iframe on 1 of pages. instance, moving div around inside iframe doesn't seem work tritium i'm writing. can tritium make work? domains different fyi. unfortunately, tritium allows edit attributes of iframe itself, not content within. this because request content in iframe made after browser constructs dom of main page. tritium can intercept first request main page, not second request content different domain. i know of 2 workarounds: add second website moovweb project , able use tritium manipulate content. can point iframe of original page new content. use javascript/ajax modify iframe's content. however there implications production domains... i'm afraid may have rushed answer , update after more research.

DOJO Movable Editor is not resizing until dragged -

i have dojo editor movable <div id="dnd" dojotype="dojo.dnd.moveable"> <div data-dojo-type="dijit/editor" height="120px" width="250px" id="editor3" data-dojo-props="plugins:['bold','italic']"> <p>this instance created customized toolbar/ plugins</p> </div> </div> i know : 1- why changing width attribute not make difference in editor's width 2- why editor resizes when dragged first time(to appropiate height) i use dojo 1.9.1 use style attribute on div , not height , width , dojo honor that. <div id="editor3" data-dojo-type="dijit/editor" style="width:250px;" data-dojo-props="plugins:['bold','italic'], height: '120px'"> <p>this instance created customized toolbar/ plugins</p> </div>

java - Multiple Field Collection Sort -

i have class arraylist contains value string word, string expandedword, double confidence, double support i want sort arraylist based on confidence, , based on support. i have succeed sort arraylist based on confidence, failed make new method sort arraylist based on support this code sort based on confidence public class expandedterm implements comparable<expandedterm> { string word; string expandedword; double support; double confidence; public expandedterm (string word,string expandedword, double confidence,double support){ this.word = word; this.expandedword = expandedword; this.support = support; this.confidence = confidence; } public string getword(){ return word; } public string expandedword(){ return expandedword; } public double getsupport(){ return support; } public double getconfidence(){ return confidence; } @override public int compareto(expandedterm conf) { return new double(this.confidence).compareto(new double(

java - Calculating execution time of an algorithm -

i have developed image processing algorithm in core java (without using third party api), have calculate execution time of algorithm, have used system.currenttimemillis() that, public class myalgo { public myalgo(string imagepath){ long sttime = system.currenttimemillis(); // .......................... // algorithm // .......................... long endtime = system.currenttimemillis(); system.out.println("time ==> " + (endtime - sttime)); } public static void main(string args[]){ new myalgo("d:\\myimage.bmp"); } } but problem each time running program getting different execution time. can please suggest me how can this? if don't want use external profiling libraries wrap algorithm in for() loop executes 1000 times , divide total time 1000. result more accurate since other tasks/processes out. note: overall measure time reflect expected time of algorithm finish , not total time algorithms co

asp.net - SignalR connection issues -

i'm getting issues signalr (1.1.2) trying create basic realtime chat setup , after spending week on (including trawling through signalr source) i'm sort of @ end of can try... i have (i think) rather complicated signalr setup consisting of: load balanced servers redis message bus two sites on each server (asp.net webforms vb.net desktop site , mvc3 c# mobile site) each of sites includes hub of , other site, each page can send messages each site. looking chrome inspector (in example on mobile site), hubs both loaded, negotiate step mobile successful connect attempt fails after 3 seconds error: eventsource's response has mime type ("text/html") not "text/event-stream". aborting connection. which of course our custom 500 error page after microsoft.owin.host.systemweb has thrown: the connection id in incorrect format. once happens, of time sort of weird loop continue throw hundreds of these errors , send off lots of pings followed lon

web testing - Example page for trying out web automation tools -

does know of web page can try out automation tools on. we evaluation test automation tool , looking page can write test cases automat beyond avarage "google search" test case. so looking page bit more advanced, example login, search. , should built trying out test automation, , nobody should care if fill crazy data. an exampel page, http://www.ranorex.com/web-testing-examples/vip/ more advance stuff, multiple pages , login. you create few dummy google accounts: give ability test multiple simultaneous logins , access myriad of different activities (gmail, google+) have pretty advanced capabilities.

java - Rotating wheel in Swing -

i have searched here did not answer (though feel should here). i want perform activity(but don't know how time take complete) , while task being run, want show rotating wheel user message "processing...please wait". once activity gets completed,rotating wheel should disappear. how implement feature? as seem recall, glasspane in swing can used to: intercept user input. display image/animation someone implemented this: http://www.curious-creature.org/2005/02/15/wait-with-style-in-swing/ there download link source code @ top of page. also at: http://docs.oracle.com/javase/tutorial/uiswing/components/rootpane.html it explains glasspane in more detail.

linux - Having HAProxy check back-end server status? -

haproxy able load balance mysql/tomcat/cassandra/ldap/web server etc....perfectly. main issue how make sure backend mysql/tomcat/cassandra etc server forward request , running (i mean not establish connection port 3306 mysql,8080 tomcat,389 ldap etc. mean more “ complete ”, performs little operation against back-end servers). my use case : ============= there numerous back-end tomcat working behind haproxy , tomcat serving through haproxy , 1 of tomcat gone outofmemory . apparently haproxy , tomcat server , request routed tomcat failing tomcat running oom. is possible make haproxy check status of back-end server using small shell script? what script performs basic operation against tomcat returns http status 200 if operation successful or http status 500 if there error (i.e. tomcat not available). are there other ways configure haproxy check status "complete" rather connection check on server-ip : port ? the solution i'm using available @ l

android - Contextual ActionBar for ListView With checkbox -

i'm working listactivity checkbox, want initiate contextual action bar listview whenever list item checked , show number items selected. have gone through cab http://developer.android.com/guide/topics/ui/menus.html#cab . still have difficulty understanding should invoke cab?

How to resolve java.lang.OutOfMemoryError error by "java.lang.String", loaded by "<system class loader>" Eclipse Memory Analyzer -

Image
i reading large xml files , storing them database. arond 800 mb. it stores many records , terminates , gives exception : exception in thread "main" java.lang.outofmemoryerror: java heap space @ java.util.identityhashmap.resize(unknown source) @ java.util.identityhashmap.put(unknown source) using memory analyzer have created .hprof files says: 76,581 instances of "java.lang.string", loaded "<system class loader>" occupy 1,04,34,45,504 (98.76%) bytes. keywords java.lang.string i have setters , getters retrieving values.how resolve issue. appreaciated. i have done increasing memory through jre . ini . problem doesn't solved edit : using scireumopen read xml files. example code have used: public void readd() throws exception { xmlreader reader = new xmlreader(); reader.addhandler("node", new nodehandler() { @override public void process(structurednode node) {

html - php page hosted through MAMP using old website code -

so i'm having problem php page, hosted locally through mamp, not updating properly. whether change html, php code, page source/webpage still manages same before. problem be, , how can fix this? i've tried stopping server , starting again, , double checked file locations & file names.

mysql SUM Group after max of Date -

i have 2 tables, servis table client_id date , type (0 or 1) sales tables client_id date , product i need crate table groups client id, calculates sum of product, data after last date on servis table, type 1 client | sum -------+------ 1 | 32 4 | 2

How do I get the index in a VBA For Each Loop (programming with Excel)? -

Image
i working excel vba process data , here want make: in sheet, want create function "getdebutdate" can automatically calculate first date row has value. for example, in row of "mark", first time value aug-05 number of "4". i know few vba , after searching around found can use for ... each loop in range. how index of "v" in each loop? after index, how value of date in head row? function get_board_count(range range) each v in range .... next get_board_count = .... end function you can alternatively use excel-only solution, doesn't need vba programming. have formula: =indirect(address(1,match(true,index(a2:e2>0,0),0))) match(true,index(a2:e2>0,0),0) looks first value greater 0 , not null , returns current column index of value. rest of formula refers row, dates, wanted date per reference. in case first row...

iphone - Set Uibutton Random Position on UIView -

i want set 5 buttons on uiview @ random position. buttons need maintain spacing each other. mean buttons should not overlap each other. buttons set on uiview come corners rotation animation. btn1.transform = cgaffinetransformmakerotation(40); btn2.transform = cgaffinetransformmakerotation(60); btn3.transform = cgaffinetransformmakerotation(90); btn4.transform = cgaffinetransformmakerotation(30); btn5.transform = cgaffinetransformmakerotation(20); i can rotate buttons using above code can pls. me set buttons on random position out overlapping each other. if points fix can set buttons animation code want random position of buttons. [animationview movebubble:cgpointmake(18, 142) duration:1 : btn1]; [animationview movebubble:cgpointmake(118, 142) duration:1 : btn2]; [animationview movebubble:cgpointmake(193, 142) duration:1 : btn3]; [animationview movebubble:cgpointmake(18, 216) duration:1 : btn4]; thanks in advance.

jquery - How to make your div stick to the page even when resolution of the window changes -

i want div scroll down scroll window,its happening when change resolution of window position shifts this code $(document).ready(function() { var stickynavtop = $('#sticker').offset().top; var stickynav = function() { var scrolltop = $(window).scrolltop(); if (scrolltop > stickynavtop) { $('#sticker').addclass('effect'); } else { $('#sticker').removeclass('effect'); } }; }); // in css file .effect { position: fixed; width: 100%; left: 783px; top: 0px; } basically screen resolution independent thing position fixed if have <div class="asd"></div> and want fix div css : .asd{position:fixed; top:0;} in case may have forgotten . in css. "." defines class .effect { position: fixed; width: 100%; left: 783px; top: 0px; }

AngularJS format array values in textarea -

i have angularjs application, in have array. $scope.data[0] = x1; $scope.data[1] = x2; and text area <textarea ng-model="data"> </textarea> i can see textarea contains values x1, x2 (separated comma). want show values on separate lines. meaning array values should separated new line character not comma. need write filter this? you can write directive modifies how ng-model converts variables input values , back. i'm writing off top of head, have no idea if it's right, might it: app.directive('splitarray', function() { return { restrict: 'a', require: 'ngmodel', link: function(scope, element, attr, ngmodel) { function fromuser(text) { return text.split("\n"); } function touser(array) { return array.join("\n"); } ngmodel.$parsers.push(fromu

c# - Regular Expression For JSON -

i have string - xyz":abc,"lmn i want extract abc. regular expression ? i trying - /xyz\":(.*?),\"lmn/ but not fetching result. in c# use var regex = new regex(@"(?<=xyz\"":).*?(?=,\""lmn)"); var value = regex.match(@"xyz"":abc,""lmn").value; note makes use of c# verbatim string prefix @ means \ not treated escape character. need use double " single " included in string. this regex makes use of prefix , suffix matching rules can match without having select specific group result. alternatively can use group matching var regex=new regex(@"xyz\"":(.*?),\""lmn"); var value = regex.match(@"xyz"":abc,""lmn").groups[1].value; you can check existence of match doing following var match = regex.match(@"xyz"":abc,""lmn"); var ismatch = match.success; and follow either match

sql server 2008 - Import unique combination of rows -

i working huge database updated every day new entries. in order find duplicates use either checksum using hashbytes function , custom remove duplicates function, or import unique entries using merge function. encounter difficulties when set of entries considered unique business information. e.g.: date name adress 2013-07-01 peter ad1 2013-07-01 peter ad2 2013-07-01 peter ad3 2013-07-02 peter ad1 2013-07-02 peter ad2 2013-07-02 peter ad3 2013-07-04 peter ad1 2013-07-04 peter ad3 2013-07-05 peter ad1 2013-07-05 peter ad2 2013-07-05 peter ad3 the desired result be date name adress 2013-07-01 peter ad1 2013-07-01 peter ad2 2013-07-01 peter ad3 2013-07-04 peter ad1 2013-07-04 peter ad3 2013-07-05 peter ad1 2013-07-05 peter ad2 2013-07-05 peter ad3 it simplified case, in general import function s

php - Is there any array function by which I can get the expected result? -

this question has answer here: convert array simple 1 level array in php 4 answers is there array function can expected result? my array $a = array( [0] => array( 'id' => 6 ), [1] => array( 'id' => 5 ), [2] => array( 'id' => 8 ), [3] => array( 'id' => 4 ), ); result expected $a = array( [0] => 6, [1] => 5 , [2] => 8 , [3] => 4, ); i can using foreach loop. searching array function .. strictly, yes, there function array_walk() : array_walk($a, function (&$value) { $value = $value['id']; }); but foreach loop more efficient in case: foreach ($a &$value) { $value = $value['id']; } a foreach loop has little overheads compared array_walk, has create , destroy function call stack on each invokation of callback function. note in each case, $value p

iphone - How to fetch LinkedIn connections/Friends/Contacts in iOS SDK? -

i want fetch friends linkedin profile. please suggest me tutorial. my code : nsurl *url = [nsurl urlwithstring:@"http://api.linkedin.com/v1/people/~/connections:(id,first-name,last-name,email-address,picture-url,positions)"]; oamutableurlrequest *request = [[oamutableurlrequest alloc] initwithurl:url consumer:self.oauthloginview.consumer token:self.oauthloginview.accesstoken callback:nil signatureprovider:nil]; [request setvalue:@"json" forhttpheaderfield:@"x-li-format"]; oadatafetcher *fetcher = [[oadatafetcher alloc] init]; [fetcher fetchdatawithrequest:request delegate:self didfinishselector:@selector(profileapicallresult:didfinish:) didfailselector:@selec

javascript - Grunt task dependencies -

i have grunt task installed via npm taska (not actual name) taska has dependency: grunt-contrib-stylus , specified in taska's package.json , installed. reason when running grunt default main gruntfile.js gives error. warning: task "stylus" not found. use --force continue. and fix require grunt-contrib-stylus in main project. want avoid this. reason task not using grunt-contrib-stylus in node_modules/ ? taska module.exports = function(grunt) { 'use strict'; grunt.loadnpmtasks('grunt-contrib-stylus'); ... main gruntfile.js ... grunt.loadnpmtasks('taska'); ... grunt.loadnpmtasks loads [cwd]/node_modules/[modulename]/tasks/ . can load task dependenies changing cwd : taska module.exports = function(grunt) { var parentcwd = process.cwd(); process.chdir(__dirname); grunt.loadnpmtasks('grunt-contrib-stylus'); process.chdir(parentcwd); }; just sure set cwd parent @ end.

javascript - In php, find which array element is shown and provide a link to the next and the previous -

i stuck following problem. dealing html/php/js situation have image thumbnails specific link class, when clicked, javascript function takes image src , loads image in specific place. is there way know each time image shown since javascript function dows not load page again, replaces image, ajax . if knew in php image shown, make links prev($array) , next($array) . code follows: <ul id="<?php echo $gal_id; ?>" class="<?php echo $extrawrapperclass; ?>" style="list-style-type: none;" > <?php foreach($gallery $count=>$photo): ?> <li class="thumb"> <span class="linkouterwrapper"> <span class="linkwrapper"> <a href="<?php echo $photo->sourceimagefilepath; ?>" class="gallerialink link<?php if($count==0) echo ' linkselected'; ?>" style="width:<?php echo $photo->width; ?>px;he

datetimepicker - Show date and time together Jquery mobile Datebox -

i using jquerymobile datebox implement calendar time. http://dev.jtsage.com/jqm-datebox2/ i able set calendar , select dates. want select time. demos shows how set date picker , time picker separately. , want both together. i.e in 1 click should able select both date , time. appreciated. thanks it not possible in current version 1.1.0. welcome vote on this issue .

sql - Get the last result from the mysql resultset in mysql stored procedure -

i have table data follows. name age alex 23 tom 24 now how last row ie. row containing "tom" in mysql stored procedure using select statement , without considering name , age. thanks. without considering name , age that's not possible. there's no "first" or "last" row in result set long don't add order a_column query. result see kind of random. might see same result on , on again, when execute query 1000 times, might change when index gets rewritten or more rows added table , therefore execution plan query changes. it's random!

SQL Server : could not be bound? -

i have table want update view in sql server 2008 when write update sql code : update [dorsadbfitupdetail].[dbo].[tbl_wl_joint] set [jntlinenointernaluse] = dbo.ipmilineinternal.lnno (dbo.tbl_wl_joint.jntlinenointernaluse null) go sql server throws error: msg 4104, level 16, state 1, line 3 multi-part identifier "dbo.ipmilineinternal.lnno" not bound. what can resolve it? try 1 - update j set jntlinenointernaluse = i.lnno dbo.tbl_wl_joint j join dbo.ipmilineinternal on j.id = i.id /* simple change id columns */ j.jntlinenointernaluse null

javascript - display row tooltip on condtion base on row mouse hover -

Image
i using code in grid render event display tpl on row mouse hover grid.tip = new ext.tooltip({ view: grid.getview(), target: grid.getview().mainbody, delegate: '.x-grid3-row', trackmouse: true, renderto: ext.getbody(), showdelay: 1000, listeners: { beforeshow: function updatetipbody(tip) { var = grid.getview().findrowindex(tip.triggerelement); var viewobj = grid.getstore().getat(i); var namevar, addressvar, salesorgvar; if (viewobj.get('error_message') != null && (viewobj.get('error_message')).length > 1) { console.log("done.."); namevar = (viewobj.get('error_message') != null && viewobj.get('error_message') != "") ? (ext.bundle.getmsg('posfileswidget.errorfoldergrid.errorfolder.label') + " : " + viewobj.get('error_message')) : ""; tip.u

asp.net mvc 4 - Calling post method on link click jQuery -

i wan use anchor tag post page on page in mvc . problem when click on hyperlink takes controller. not hit post method. hit method. can create method on acnhor in jquery post page page. suppose have anchor on page1 <a href="/home/action">click here</a> <input type="hidden" value="2"/> and should hit post method on home action. use tag. <form method='post' name='frmpost' id='frmpost' action='/home/action'> <a id='clickme'>click here</a> <input type="hidden" name='hiddenvalue' value="2"/> </form> $('#clickme').click(function(){ $('#frmpost').submit(); }); hey, may

ASP.NET Web API removing HttpError from responses -

i'm building restful service using microsoft asp.net web api. my problem concerns httperrors web api throws user when go wrong (e.g. 400 bad request or 404 not found). the problem is, don't want serialized httperror in response content, provides information, therefore violates owasp security rules, example: request: http://localhost/service/api/something/555555555555555555555555555555555555555555555555555555555555555555555 as response, 400 of course, following content information: { "$id": "1", "message": "the request invalid.", "messagedetail": "the parameters dictionary contains null entry parameter 'id' of non-nullable type 'system.int32' method 'mynamespaceandmethodhere(int32)' in 'service.controllers.mycontroller'. optional parameter must reference type, nullable type, or declared optional parameter." } something not indicates webservice based on asp.net webapi

regex - pcregrep for finding all files with extra space before php opening tag -

i have working command line code using pcregrep finding php space after closing tag: pcregrep -rml '\?>[\s\n]+\z' * i here: find space / new line after closing ?> (php tag) now want know equivalent command above finding spaces before php opening tag @ beginning of php file: [space here]<?php if know how this, please share thanks. you can try pattern: ([\s\n]+)(?=\<\?php) you should try escaping < , ? since have specific meaning in regex. prefer around here since no need consume upcoming stuff , grouped results comes before php tag. you can skip \n above pattern. live demo

java - Android Install apk from url -

i have android app check there updates available. if have new version number, program should open link , install apk: this link: http://sample.com/sample.apk how can this?

jsp - Values not getting stored in array -

hie, trying insert values array getting each value previous page (dynamic). problem these values not getting stored in array. null values being shown.the code follows. string ins[][] = new string[numb][2]; for(int i=0;i<numb;i++) { string frwd = "frwd"+string.valueof(i); string posn = "posn"+string.valueof(i); ins[i][0] = request.getparameter("frwd"); ins[i][1] = request.getparameter("posn"); } numb being number or rows in previous page , [2] represents number of dynamic columns .. please guide me .. remove quotes in request.getparameter calls: ins[i][0] = request.getparameter(frwd); ins[i][1] = request.getparameter(posn);

spreadsheet - Make a Copy of a Google Spreadhseet retaining all formats but copy only values -

i need create monthly archive of scorecard spreadsheet. archived file must retain formatting (borders, colours, col width etc) have values. in other words, no formulas must copy across, results. i able make copy of spreadsheet , append date name formulas copied across well. use following code called ui: function archivesc(e){ var archiveextension = " "+e.parameter.archiveext; var root = docslist.getrootfolder() var archivefolder = docslist.getfolder('scorecard archives'); var archivefile = docslist.getfilebyid(spreadsheetapp.getactivespreadsheet().getid()).makecopy(spreadsheetapp.getactivespreadsheet().getname() + archiveextension); archivefile.addtofolder(archivefolder); archivefile.removefromfolder(root); var archiveapp = uiapp.getactiveapplication(); archiveapp.close() return archiveapp; is there function or code can add ensure formats copied , values.

How to deal the circumstance of ASIDs are used up in Linux kernel? -

asid(the address space identifier) in arm architecture occupy 8 bits in register. means 256 asids can allocated. in linux kernel there maor 1024 tasks can run @ same time. how deal circumstance of asids used in linux kernel? had checked kernel source code, when asids used up, kernel allocate asid new task start again. considering 1 circumstance, newest task own first asid(0b1000 0000 0000 0001), there 1 task must own same asid. if 2 tasks need cantext switch? had not found related kernel source code. related codes in linux kernel in ~/kernel/core.c context_switch() .any reply appreciated much, in advance best regards. heron i had found instructions that, follow(cortex -a9 programmer guide p8-20): asids dynamically allocated , not guaranteed constant during lifetime of process. asid register provides ei ght bits of asid space , can have more 256 processes, linux has scheme allo cating asids. new process, increment last asid value used. when last value reached, have ta

coldfusion - Oracle CLOB slow running report -

we have report pulls data oracle 10g database. using coldfusion 9 display report. report contains 3 clob columns killing report processing time. tested removing 3 clob columns , report displays in 2 - 3 seconds. is there can done increase processing time of report? understand why running slow due how large clob fields are. looking improve processing time. just give idea of rows typical report returns 200-300 row small amount of rows. many thanks matthew update - have tried using dbms_lob.substr() , return max 4000 character not improve processing time. here's query: select r.nc_request_id request_id, r.tc_request_name request_name, r.tc_request_name_2 request_name_2, r.tc_initiator initiator, r.nc_expense expense, s.nc_form_step_id form_step_id, s.nc_form_id form_id, s.nc_step_id step_id,

How to put the contents of a file to a String of array in java -

i have string array contains records ,now have put records in file , have read values , have check records string array values.here string array.. public final static string fields[] = { "fileid", "filename", "eventtype", "recordtype", "accesspointnameni", "apnselectionmode", "causeforrecclosing", "chchselectionmode", "chargingcharacteristics", "chargingid", "duration", "dynamicaddressflag", "ipbinv4addressggsn", "datavolumefbcdownlink", "datavolumefbcuplink", "qosinformationneg"}; i have put these records in map using these,, static linkedhashmap<string, string> getmetadata1() { linkedhashmap<string, string> md = new linkedhashmap<>(); (string fieldname : fields) md.put(fieldname, ""); return md; } now file fileid

visual studio 2012 - How to add list items in windows phone app using c#? -

i beginner c# , windows phone programming , have code load json data message box able want display data in message box list items in page , unable understand api in msdn,help me this programm xaml code <grid x:name="layoutroot" background="transparent"> <grid.rowdefinitions> <rowdefinition height="auto"/> <rowdefinition height="*"/> </grid.rowdefinitions> <!--titlepanel contains name of application , page title--> <stackpanel x:name="titlepanel" grid.row="0" margin="12,17,0,28"> <textblock x:name="pagetitle" text="page name" margin="9,-7,12,0" style="{staticresource phonetexttitle1style}"/> </stackpanel> <!--contentpanel - place additional content here--> <grid x:name="contentpanel" grid.row="1" margin="12,0,12,0">

javascript - CustomEvent() to an XUL tab - Firefox addon -

for many reasons, have open xul in tab, instead of using standard window. wish send custom events tab, , here's how code looks : myextension.js : .. var ptab = window.gbrowser.loadonetab("chrome://myextension/path/options.xul", {inbackground: false}); var pwin = window; var event = new pwin.customevent("prefwindow-event"); pwin.dispatchevent(event); .. options.xul code: window.addeventlistener("load", init, false); window.addeventlistener("prefwindow-event", myevent, false, true); .. myevent: function(e) { dump("my event : " + e.details ); }, .. however, don't event. have tried possible options. enabled/disabled usecapture , wantsuntrusted of addeventlistener(). after realizing there restrictions in sending custom events between windows, tried dispatching event tab element, : ptab.dispatchevent(event); that wouldn't work either. 1) event dispatch work perfe

c# - Find out which module registered type -

Image
i'm debugging autofac issues in application quite lot of modules. there way find out module registered registration? i'm looking @ componentregistry of container, can't find information there. edit: clarification. have lot of modules in solution: public class mymodule : autofac.module { public override void load(containerbuilder builder) { builder.registertype<myconcretetype>().as<imyinterface>(); } } i register in container scanning assemblies: var builder = new containerbuilder(); builder.registerassemblymodules(/* assemblies in base dir */); var container = builder.build(); now, have lot of registrations. question "what module registered myconcretetype ?". container.componentregistry.registrations.select(reg => new { reg.service, reg.registeredby }) , registeredby magic property. ok, not 100% sure mean, i'll give go: for debugging, implemented type displayed in registrations collection of componen