Posts

Showing posts from September, 2010

internet explorer - IE unable to download CSV files from SharePoint 2010 document library -

i developed web app in sp2010. entire app done in javascript spservices, since customer (the marine corp.) doesn't want allow .net development in environment. customer wanted able download of reports in excel spreadsheets can whatever them. since it's impossible generate excel spreadsheets in javascript, workaround came generate csv in javascript, , save document library, point browser csv file download. worked perfectly. though wasn't technically excel, customer didn't know better. provided asked for: open report in excel. other day, customer said export stopped working. i've spent day , half trying see what's wrong, find solution, jazz. here's i've noticed: the ".csv" extension being changed browser "_csv" when click "save" in download dialog, browser reports "[filename]_csv couldn't downloaded [retry] [cancel]" when looking @ response headers sp server using protocol analyzer, sp server giving brows

c# - Check for key in pre-existing dictionary in case insensitive manner -

i want check if dictionary given me contains particular string key. need make check in case insensitive manner. example if passes me http request object has dictionary of strings called headers. need able check if "content-type" or "content-type" or "content-type" key in request.headers dictionary. the usual containskey() not work since think checks key in case sensitive manner. i know there exist ways work on defining dictionary case insensitive. here not have control on kind of dictionary passed me. you have 2 options avaliable you, since don't have control on how dictionary constructed: iterate entire dictionary's pairs find given key: var match = dictionary.where(pair => string.equals(pair.key, "hello" , stringcomparison.invariantcultureignorecase)).firstordefault(); or create new dictionary own comparer: var casesensitivedictionary = new dictionary<string, string>(dictionary , stringcomparer

javascript - How to select only part of image on click -

i have star rating system website. i'd select 0 1/2 or full stars. for single star click, want achieve this, , i'm not sure if can done in javascript of jquery : if user clicks anywhere 1 left half, chooses 1/2 star; on right half, full star. of course, half's (ideally) divided right down middle - 50/50 of area space. is can done? the easier have 2 images per start , left , right image, , non-selected image serve background if nothing chosen. you can develop simple framework make reusable throughout website (and future projects) i wonder , want dozens of other open source projects do? as example , check rateit plugin examples: http://www.radioactivethinking.com/rateit/example/example.htm it includes need plus, nice ajax calls , several others settings makes easy use.

jQuery-Validation-Engine in Internet Explorer 10 -

i used jquery-validation-engine v2.6.1 web form , works great in firefox. tested in internet explorer 10 , validation not working @ all. noticed on index.html file included in package states supports (ie 6-8, chrome, firefox, safari, opera 10). is there update or make work in ie 9 & 10? thank you! you can add meta head section <!--[if gt ie 8]> <meta http-equiv="x-ua-compatible" content="ie=8"> <![endif]-->

sublimetext2 - Perform Search on Whole Directory in Sublime Text 2? -

is there directory-wide search functionality in sublime directory opened in editor? or optionally search opened files? (if exists files have opened in tab or visible on sidebar?) thanks yes there is. on windows ctrl + shift + f on macintosh cmd + shift + f the field in search panel determines search. can define scope of search in several ways. more: http://docs.sublimetext.info/en/latest/search_and_replace/search_and_replace_files.html

ios - Is chrome for iPad same as the desktop version? -

i use http://caniuse.com/ lists check browser compatibility. you have "chrome" , "chrome android" columns, no "chrome ios". so ios version identical desktop chrome? or android chrome? no. chrome on ios use uiwebview because of apple's restrictions.

SQL and oop in objective-c -

this stupid question, tried looking similar post couldn't find if there's some. i'm starting use sql, it's quite easy how can save entire object in it? i try explain better. if want save instance of "car" object should save primitive values or there way save entire object? also, sql software guys suggest use? tried mac embedded sqlite a couple of thoughts: if you're going sqlite programming in objective-c, should consider fmdb . makes sqlite programming easier. generally, though, core data preferred object persistence technology. but assuming wanted save object in sqlite table, can store object in database blob creating archive , saving in database: create archive (see archives , serializations programming guide ): car *car = [[car alloc] init]; car.make = @"honda"; car.model = @"accord"; car.year = 1998; nsdata *data = [nskeyedarchiver archiveddatawithrootobject:car]; but work, have implement initwithc

c++ command line arguments in ubuntu terminal -

this basic question beginning use command line arguments in programs. compile program in terminal g++ example.cpp type ./a.out , cout / cin , forth. my question is, after have compiled program, type in terminal let know input arguments? create output file of same program. entering in terminal: g++ example.cpp -o example when compiled, run program as: ./example arg1 arg2 even above method @petr budnik works.

c# - How do I get the element that the cursor is over during a keypress? -

this question has answer here: wpf element(s) under mouse 3 answers i'm writing wpf application, , i've come point need ui element mouse cursor on @ time of keypress. basically, have lists on screen, , if user enters ctrl+shift+f, able filter objects in list mouse over. i've done research on this, , related questions i've found have moving cursor element on keypress, not finding element cursor over. don't have code show since more of conceptual question, if need more detail me, please let me know. thanks! var elementundermouse = mouse.directlyover frameworkelement;

Is there a C# alternative to Java's vararg parameters? -

i have worked on java , new .net technology is possible declare function in c# accepts variable input parameters is there c# syntax similar following java syntax? void f1(string... a) yes, c# has equivalent of varargs parameters. they're called parameter arrays , , introduced params modifier: public void foo(int x, params string[] values) then call with: foo(10, "hello", "there"); just java, it's last parameter can vary this. note (as java) parameter of params object[] objects can cause confusion, need remember whether single argument of type object[] meant wrapped again or not. likewise nullable type, need remember whether single argument of null treated array reference or single array element. (i think compiler creates array if has to, tend write code avoids me having remember that.)

javascript - ReplaceAll Google script -

i've got problem, trying use replace function in javascript , cannot work. i'm using: var pagename = projectname.replace (" ", ""); but takes first space, wanted take spaces. example: "my first project 1" = "myfirstproject1", ie together. i'm developing script of google apps. thank you. you should try : var pagename = projectname.replace (/\s/g, ''); the g @ end of regular expression, flag indicating replace method shouldn't replace first occurrence of space character.

wpf - Background color for MenuItem not changed on MouseOver -

i have menu 3 items , i'm trying change background color when mouse hovers on of items. i've tried ismouseover & ishighlighted trigger property , neither works. in app.xaml: <style targettype="menuitem" x:key="menuitemstyle" > <style.triggers> <trigger property="menuitem.ishighlighted" value="true"> <setter property="background" value="black"/> </trigger> </style.triggers> </style> in main.xaml: <menu horizontalalignment="left" height="30" verticalalignment="top" width="975 " fontfamily="tempus sans itc" fontsize="16" > <menu.background> <lineargradientbrush endpoint="0.5,1" startpoint="0.5,0"> <gradientstop color="#ffc8c8c8" offset=&quo

android - Do Java Ellipsis Require Heap Allocation? -

is there kind soul out there somewhere knows whether or not java's ellipsis implementation involves heap allocation behind scene. seems reasonable me calling method necessaries on stack , avoid array/heap allocation altogether, when comes java i've been proven wrong more times can count. if knows sure, grateful answer. yes, creating array. it's possible in some cases jvm can clever stuff notice array can never "escape", , can created on stack - that's nothing varargs syntax, just syntactic sugar. in general, should treat other array creation. this: public void foo(int... args) // code foo(1, 2, 3); is equivalent to: public void foo(int[] args) // code foo(new int[] { 1, 2, 3 });

Is it possible to use google address search bar on the website -

Image
i want use google address search on website this: but after spending lot of hours couldn't figure out how it. tried use api returns geocoded value. want see 1 started typing first letters show me first results. know can use jquery autocomplete control target need know api method supposed use target. please help. google maps javascript api v3 places autocomplete documentation

c++ - What happens if you static_cast invalid value to enum class? -

consider c++11 code: enum class color : char { red = 0x1, yellow = 0x2 } // ... char *data = readfile(); color color = static_cast<color>(data[0]); suppose data[0] 100. color set according standard? in particular, if later do switch (color) { // ... red , yellow cases omitted default: // handle error break; } does standard guarantee default hit? if not, proper, efficient, elegant way check error here? edit: as bonus, standard make guarantees plain enum? what color set according standard? answering quote standard: [expr.static.cast]/10 a value of integral or enumeration type can explicitly converted enumeration type. value unchanged if original value within range of enumeration values (7.2). otherwise, resulting value unspecified (and might not in range). let's range of enumeration values : [dcl.enum]/7 for enumeration underlying type fixed, values of enumeration values of underlying type. before cwg 1766

python - Detecting regions in (x, y) data -

Image
i need able detect regions of list of (x, y) data based on features of data. example data shown in first image. right now, need able find region between black marks (sorry poor quality, imgur's editor isn't accurate). unfortunately, problem complicated being different lengths , shapes each time data collected, seen in second image. sharp drop ~98 ~85 consistent, , 2 dip/two peak feature between ~1e-9 , ~1.5e-9 should consistent. my question is, best approach detecting events in signal, based on features of signal? if can sliced 3 regions marked (beginning first mark, first second mark, second mark end), believe can extend method handle more complex situations. i've solved similar problems before, 1 unique in amount of variation occurs 1 set of data another. last time wrote hand-crafted algorithm find local extrema , use locate edge, feel it's rather ugly , inefficient solution can't reused. i'm using python 2.7.5, ideally should language agnosti

jquery - CodeIgniter won't pass $data when loading via AJAX? -

i working on database-driven site want uri segments of links load corresponding data database. site running on codeigniter 2.1.4 jquery mobile loading pages via ajax. here example of urls. site.com/browse (runs index function, loading list of artists) site.com/browse/artist/album (runs artist function, passing third uri segment album parameter data model, loading list of artist's albums) i understand how pass id url model load data , process data view. when calling index function of browse class, works should. able create list of artist. when calling artist function, uri segment being passed model , loading data, $data not seem passing view keep getting undefined variable error when trying display data. get_data.php: <?php if ( ! defined('basepath')) exit('no direct script access allowed'); class get_data extends ci_model { function getallartists() { $query = $this->db->query('select distinct artist data order artist'); if(

uitableview - iOS - NSNotifiction invalid selector -

i'm having trouble understanding why happening reason when nsnotification gets triggered second time happens: -[uitableviewcel lcontentview imagefound:]: unrecognized selector sent instance 0x1cd837e0 2013-08-12 16:32:24.340 poundtaxi[7483:907] *** terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[uitableviewcellcontentview imagefound:]: unrecognized selector sent instance 0x1cd837e0' * first throw call stack: (0x344d92a3 0x3c17e97f 0x344dce07 0x344db531 0x34432f68 0x3442a037 0x34d40599 0xd7d9f 0x33d64145 0x3c59611f 0x3c5954b7 0x3c596dcb 0x344acf3b 0x3441febd 0x3441fd49 0x37fe32eb 0x36335301 0xb963d 0x3c5b5b20) libc++abi.dylib: terminate called throwing exception here block of code gets executed: -(void)imagefound:(nsnotification *)anotification { nsdictionary* userinfo = [anotification userinfo]; picture *apicture = (picture *) [userinfo objectforkey:@"picture"]; uiimage *image = (uiimage *) [userinfo

java - HashMap and ArrayList adding while iterating/looping -

i have game every x seconds write changed values in memory db. these values stored in containers(hashmaps , arraylists) when data hold edited. for simplicity lets pretend have 1 container write db: public static hashmap<string, string> dbentitiesdeletesbacklog = new hashmap<string, string>(); my db writing loop: timer dbupdatejob = new timer(); dbupdatejob.schedule(new timertask() { public void run() { long starttime = system.nanotime(); boolean updateentitiestablesuccess = updateentitiestable(); if (!updateentitiestablesuccess){ try { conn.rollback(); } catch (sqlexception e) { e.printstacktrace(); logger.fatal(e.getmessage()); system.exit(1); } } else { //everything saved db - commit time try { conn.commit(); } catch (sqlexception e) { e.printstacktrace();

javascript - copy value from one field to another -

i have found fiddle (cannot remember source): http://jsfiddle.net/fpsdy/1/ want (copy contents field another) when copy php page, though, doesn't work: <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <script type="text/javascript" src="includes/jquery/jquery-1.10.2.min.js"></script> </head> <body> <script type="text/javascript"> $('input[type=submit]').click(function(){ $('#elm_14').val($('#elm_6').val()); $('#elm_16').val($('#elm_7').val()); }); </script> <input type="text" class="input-text " value="" size="32" name="user_data[firstname]" id="elm_6"> <input type="text" class="input-text " value=&q

Is it possible to find out when Android app returns from background? -

so, idea is: user launching application, , have perform task x. user work time , quit (app in background now). then open app again (from background) , have perform task x again. in first case, can use oncreate() of custom application class, not simple second 1 - there's no onresume() method or something. ideas? accroding activity lifecycle every time activity no more shown user same method called, no matter if went background pressing "home", or overlayed activity.

listview - Android: listview1.setAdapter null exception -

my app crashes @ line: listview1.setadapter(new arrayadapter(mainactivity.getappcontext(), android.r.layout.simple_list_item_1, listcontents)); my code: package de.nathan.android.droidschool; import android.content.context; import android.os.bundle; import android.support.v4.app.fragment; import android.support.v4.app.fragmentactivity; import android.support.v4.app.fragmentmanager; import android.support.v4.app.fragmentpageradapter; import android.support.v4.view.viewpager; import android.view.layoutinflater; import android.view.menu; import android.view.view; import android.view.viewgroup; import android.widget.arrayadapter; import android.widget.listview; import android.widget.textview; import java.util.arraylist; import java.util.list; import java.util.locale; public class mainactivity extends fragmentactivity { private static context context; /** * {@link android.support.v4.view.pageradapter} provide * fragments each of sections. use * {@link andro

Download file from google cloud storage using ruby client gets HTTP redirect -

i trying download file gcs using ruby client , service account authorization; here code: def build_client client = google::apiclient.new() key = google::apiclient::pkcs12.load_key(service_account_pkcs12_file_path, 'notasecret') service_account = google::apiclient::jwtasserter.new( service_account_email, 'https://www.googleapis.com/auth/devstorage.full_control', key) client.authorization = service_account.authorize client end client = build_client storage = client.discovered_api('storage', 'v1beta2') #get (download) specific object bucket bucket_get_result = client.execute( api_method: storage.objects.get, parameters: {bucket: bucket, object: params[:file_name], alt: 'media'} ) puts bucket_get_result.body the result body redirect detail follows: <html> <head> <title>temporary redirect</title> </head> <body bgcolor="#ffffff" text="#000000"> <h1>

angularjs - Why are my Angular, absolute path, URL's not compiling properly with Closure Compiler? -

take following example directive: .directive("mydirective", function() { return { restrict: "a", templateurl: "/my/absolute/path.tmplt.html", controller: ...do controller stuff... } }); this runs through closure compiler without error. however, when loading app greeted 404 tries load full /my/absolute/path.tmplt.html path. removing leading '/' resolves problem. problem ng-include(src="'/my/url'"), ng-controller="myctrl") located in html files , suspect anywhere reference url. so why absolute paths fail while relative ones work fine? you have invalid path specified. if current page asdf.com/boo/yourpage try going asdf.com/my/absolute/path.tmplt.html should see 404. this not related angular or google closure , related folder structure + server configuration.

javascript - Stop element from disappearing when clicked -

i'm writing simple jquery plugin dynamically place div under text box whenever has focus. i've been able position right in browsers. i have attach 2 event handlers on focus , blur events of textbox. , works okay, problem div has been placed under textbox closes when click on it. makes sense why happen, it's because textbox loses focus, there way can stop happening? i tried attaching blur event handler - if($(mainelem).is(":focus")) return; where mainelem div shown below textbox. here jsfiddle illustrate problem. you not going able use blur event if want place "clickable" elements in div shows. 1 way solve bind event listener more global element document , filter out targets. here code sample: $(document).on('click', function (e) { var targetel = e.target, parent = $(e.target).parents()[0]; if (relelem[0] === targetel || self[0] === targetel || self[0] === parent) { $(mainelem).show

php - w3 total cache not compressing js and css -

i using w3 total cache , have gzip compression set types. have looked @ header info js , css files , have accept-encoding gzip, deflate but when use google speed test , use http://www.webpagetest.org files not zipped. see there few complaints of on internet no real solution. the website www.treacyswestcounty.com. here .thaccess code w3 has added. can see issue in setting in it. not familiar .htaccess. thanks # begin w3tc browser cache <ifmodule mod_mime.c> addtype text/css .css addtype text/x-component .htc addtype application/x-javascript .js addtype application/javascript .js2 addtype text/javascript .js3 addtype text/x-js .js4 addtype text/html .html .htm addtype text/richtext .rtf .rtx addtype image/svg+xml .svg .svgz addtype text/plain .txt addtype text/xsd .xsd addtype text/xsl .xsl addtype text/xml .xml addtype video/asf .asf .asx .wax .wmv .wmx addtype video/avi .avi addtype image/bmp .bmp

dojox.grid.datagrid - creating two grids one besides other each grid having each grid with two columns using dojo. -

i want have 2 grids 1 besides other. each 1 of grid having each grid contains 2 columns. need complete source code using dojo. comparing data between 2 employees. can compare data between 2 employees. created 1 grid display 1 employee data failed create grid beside employee. need displaying 2 grids 1 besides other using dojo have tried setup 2 different grids 2 different nodes. example: <div id="emp1"> insert grid1</div> <div id="emp2">insert grid2</div> make 2 diffrent stores grids , startup both seperatly. regards

qt4 - How to open a PDF-file using default application on Windows with QProcess? -

i'm trying open pdf file in acrobat-reader using qprocess::startdetached("start c:\\temp\\mypdf.pdf") no success :-( if type same in console acrobat starts fine , loads pdf file. what missing? i'm using qt4.8.4 on windows 7 edit it works using: qprocess::startdetached( "cmd /q /c \"start c:\\temp\\report.pdf\"" ); but black console window appears short time - not nice. you might want qdesktopservices. qprocess starts program, has not understanding of underlying system. qdesktopservices does.

php - port check Error? -

Image
hey got port checker work dynamic image bad error occurs if server offline help? here says: image small: http://3nerds1site.com/test/finalimage.php?ip=blacknscape.no-ip.biz&port=80 this how should works when it's online? but anyways heres code not believe code problem maybe webhost hostgator? <?php $ip = $_get["ip"]; $port = $_get["port"]; $online = "online"; $offline = "offline"; $status = fsockopen($ip, $port) ? $online : $offline; // create blank image , add text $im = imagecreatetruecolor(215, 86); $text_color = imagecolorallocate($im, 233, 14, 91); // sets background light blue $lightblue = imagecolorallocate($im, 95, 172, 230); imagefill($im, 0, 0, $lightblue); //server information imagestring($im, 7, 5, 5, '3nerds1site.com', $text_color); imagestring($im, 2, 40, 30, $ip, $text_color); imagestring($im, 2, 40, 40, $port, $text_col

How to escape double quotes in JSON using Java -

what best way handle double quotes exist inside json string ? string external source. escaping double quotes escape double quotes, ones wrap around key , value. ideally want way escape quotes inside value. in example below, string "quotes" breaks json. best way handle ? appreciate input. thanks! @test public void isvalidjson() { string testjsonstring = "{\"messagetype\":\"typea\", \"subject\":\"here subject \"quotes\" in it\" }"; try { new jsonobject(testjsonstring); } catch (jsonexception e) { e.printstacktrace(); } } the error is: org.json.jsonexception: expected ',' or '}' @ 60 [character 61 line 1]

appsdk2 - Rally Request Entity Too Large -

due limitations of lbapi detailed here , queries lbapi have drastically increased in size (i passing array of "visible" projects lbapi return work items projects have view access to) point "request entity large" error. i know need break queries using of visible projectsat time. wanted programatically - every 100 visible projects, query, take records come , throw them array. however, gets kind of messy when trying determine when continue - have of queries come , populated array of totals? can think of clean way make happen? for (var = 0; < math.ceil(app.visibleteams.length / 100); i++) { console.log('i',i); var tempproj = []; (var j = * 100; j < math.min((i + 1) * 100, app.visibleteams.length); j++) { tempproj.push(app.visibleteams[j]); } console.log('tempproj.length',tempproj.length); // query app.completerecords = []; ext.create('rally.data.lookback.snapshotstore', { pagesize

javascript - Modernizr + Bootstrap 2/3 => browser's scrollbar disappears -

i use twitter bootstrap 3.0-rc1 combining modernizr 2.6.2. (the issue reproducible bootstrap 2.x.x) i struggled find why browser didn't show scrollbar, traditionally on right side. (of course tried minimize browser's window in order see it) i first found this post, potentially linked issue, since use navbar component of bootstrap. i find when remove second line of snippet: <link rel="stylesheet" media="screen" href="stylesheets/bootstrap.min.css"> <script src="javascripts/modernizr-2.6.2-respond-1.1.0.min.js" type="text/javascript"></script> the whole works meaning scrollbar appears. is normal behavior modernizr remove scrollbar regarding context?

Write XML Documents on Objective-c -

this question has answer here: converting nsdictionary xml 3 answers i have project need convert database entities (uml models) external file (xmi, xml file). looking xml parser or writer objective-c, have found nsxmlparser on apple's developer portal. can convert custom objects or nsdictionary xml ( nsstring / nsdata ) developed library (if knows one)? can influence on app submission? i know thats simple object manage xml content , can give me performance problems.. me thats motive dont have native library. this easy. need know xml schema needs be. data model determine how logic works. if old xml ok, @ results convenience methods provided nsarray , nsdictionary. can writetourl or writetofile property lists xml format. can @ property list serialization docs if need greater control. beyond that, it's pretty easy write own templating cod

php - how to calculate time left using string minus another string? -

i have lets $value = 5; , valnue means 5 minutes, , have file saved on server , getting modified lot called check.txt want code calculation of if timenow - timemodification of file <= 0 in h:i:s main $value of 5 minutes continue, else echo please wait minutes left time - filetimemodification of main value of 5 minutes = $timeleft in m:s format. i'm testing on current code keep getting value of -1376352747 my code know bad :) $filename = 'check.txt'; $time = date("h:i:s"); $time = str_replace("00", "24", $time); $filemodtime = filemtime($filename); $timeleft = $time - $filemodtime; $h = explode(':', $time); $h = $h[0]; $h = str_replace("00", "24", $h); $m = explode(':', $time); $m = $m[1]; $s = explode(':', $time); $s = $s[2]; $hms = ("$h:$m:$s"); if (count($filemodtime - $time) <= 0) { echo "you can continue"; } else { echo " please wait $timeleft";

jquery - removing Un-styled active/selected border -

there border on selected obj have not specified. appears when item active , selected. in case of tabs if click tab see gold ring around tab until click else. if start dialog default button gets same treatment. have individual css in fiddle minus images easy see. believe browser thing ie 10 has dashed white outline on dialog button , not tab chrome has gold ring on both in turn. can , how can stop behavior? // basic of tab calls: $(function() { $( "#tabs" ).tabs(); }); the fiddle here . can bee seen on theme roller pages well. put in css , set :) :focus{outline:none;} it problem if user navigating through tab key though, remove highlighting. doubt though.

php - How to get sum with different description in column -

id| name total 1 | meow 1 2 | meow 2 3 | raf 5 4 | meow 5 5 | raf 5 i want result this meow =8 raf =10 select name, sum(total) total_sum tablename group name

java - Send inputs from an Android App to Google Documents Spreadsheet -

my friend , making simple weather chance calculator android app summer project. app works asking user inputs using edittexts (formatted in decimal numbers) put simple formula , result spit out. what want take user inputs , transfer them public google docs spreadsheet, edittext1 goes cell a1, edittext2 goes cell a2, ect. can point me in right direction? thanks, found decent answer here, solution pretty explained: http://www.youtube.com/watch?v=gyuj2gtpzd0

javascript - Insert before the last occurrence of a specific character in a string -

how insert before last occurrence of specific character? if (statement) insert " again" string before last "<"; you can use lastindexof() substring() : var str="hello planet earth, great planet."; var n=str.lastindexof("planet"); var str2 = str.substring(0,n)+" again "+str.substring(n); console.log(str2); // hello planet earth, great again planet. as nice function: function insertbeforelastoccurrence(strtosearch, strtofind, strtoinsert) { var n = strtosearch.lastindexof(strtofind); if (n < 0) return strtosearch; return strtosearch.substring(0,n) + strtoinsert + strtosearch.substring(n); } var str ="this <br> <br> string <br> example."; var newstr = insertbeforelastoccurrence(str, "<", " again"); console.log(newstr); // <br> <br> string again<br> example. or string method: string.prototype.insertbeforelastoccurrence =

datagrid - Dojo treegrid runs fine locally, but not on remote server -

using dojo's treegrid (v. 1.9.0) served local machine (mvc.net) grid loads fine sample, hard-coded data. however, when served remote machine, un-debuggable "sorry, error occurred". breakpoints within formatters not hit, suggesting problem not lie unloaded dependencies within formatter. fails not on initial startup, if @ runtime try reload model using .setmodel(mynewmodel) after has loaded. have firebug flag set in dojo config object, , no informative warnings or errors showing in firefox...just annoying , useless message in grid itself. the sorry, error occurred message result of problem store , data putting store. the message shown in datagrid._onfetcherror , treegrid mixes in datagrid . you can put break point on query engine of ever store using, analyze data being passed store

php array file is empty when uploading file -

when upload file show array file empty, upload on in php.ini. please see code blow , let me know error. i have looked around web solution did not found, im using php version 5.3.25 on centos 5.4 kernel version 2.6.18-164.el5. thanks , regards hadi html page. <!doctype html> <head> <title>mysql file upload example</title> <meta http-equiv="content-type" content="text/html; charset=utf-8"> </head> <body> <form action="add_file.php" method="post" enctype="multipart/form-data"> <input type="file" name="uploaded_file"><br> <input type="submit" value="upload file"> </form> <p> <a href="list_files.php">see files</a> </p> </body> </html> add_file.php <?php // check if file has been uploaded if(isset($_files['uploaded_file'])) { // make sure f

How to set a server side request timeout in CXF/Spring Servlets? -

i have web service connecting database on backend provide information. database can slow, , i'll end client disconnects after 10 seconds, server continues process request , end broken pipe exception. i'm wondering if there way, on web service side, set request timeout, if spend more x seconds reply request made me, servlet throw error client, , servlet try kill thread processing request. is possible using cxf/spring provide servlet? it's possible using httpclientpolicy , setreceivetimeout method. here can find details information how configure on server side.