Posts

Showing posts from February, 2010

android - How to startForeground() without showing notification? -

i want create service , make run in foreground. most example codes have notifications on it. don't want show notification. possible? can give me examples? there alternatives? my app service doing mediaplayer. how make system not kill service except app kill itself (like pausing or stopping music button). as security feature of android platform, cannot , under any circumstance, have foregrounded service without having notification. because foregrounded service consumes heavier amount of resources , subject different scheduling constraints (i.e., doesn't killed quickly) background services, , user needs know what's possibly eating battery. so, don't this. however, is possible have "fake" notification, i.e., can make transparent notification icon (iirc). extremely disingenuous users, , have no reason it, other killing battery , creating malware.

SQL Server : how to group values by month interval with offset -

i have query groups aggregated sum values month. this query: declare @isbystatus bit set @isbystatus = 0 select cast((datediff(month, '2012-01-01t06:00:00', dattimestamp)) int) [index] , min(dattimestamp) [from], max(dattimestamp) [to], sum(case cast(intio_id nvarchar(100)) when n'284' value else null end) [286] [iovaluesfn](@isbystatus) iovalues dattimestamp >= '2012-01-01t06:00:00' , dattimestamp < '2013-01-01t05:59:59' , intio_id in (284) group cast ((datediff(month,'2012-01-01t06:00:00', dattimestamp)) int) order [from] and result: index 286 0 2012-01-07 07:00:00.000 2012-01-31 23:00:00.000 142579.898864746 1 2012-02-01 00:00:00.000 2012-02-29 23:00:00.000 139486.498001099 2 2012-03-01 00:00:00.000 2012-03-31 23:00:00.000 99516.3022232056 3 2012-04-01 00:00:00.000 2012-04-30 23:00:00.000 84597.599899292 4 2012-05-01 00:00:00.000 2012-05-31 23:00:00.00

jquery - Create floor heat map with DWG file for website -

i create floor map show foot print of user or heat map based on user movement on floor. i'm not sure how create heat map using .dwg file. need show live map on website give real time data on map , show users more (currently have .dwg file auto cad file have complete drawing of floor plan). i'm open use technology supports on website , can used javascript, php etc. there tool can create heat map me , generate web based format host on website? if problem's getting dwg canvas, can convert dwg svg first. here discussion on that if want draw heatmap in realtime, check this instead

ruby on rails - Dynamically add created images to asset pipeline -

i have rails app creates images in controller phantomjs using system("/usr/bin/phantomjs ./app/assets/javascripts/phantom_snapshot.js http://urltopagewhereimgcomesfrom/ ./app/assets/images/newimage.png '#divid'&") now want integrate image in view, think because of assets:precompile image not yet available. correct location put images anyway? or there way dynamically add created image assets? any appreciated. static assets not precompiled go in ./public folder. just make sure have static asset serving turned on in environment config.serve_static_assets = true

Python cannot work as dbus server and client in the multi-thread enviroment -

i created dbus server following code, named server1.py #!/usr/bin/python2.7 import dbus.service import dbus.glib import glib import gobject dbus.mainloop.glib import dbusgmainloop class app_server(dbus.service.object): def __init__(self): bus = dbus.sessionbus(private = true, mainloop = dbusgmainloop()) bus_name = dbus.service.busname('de.test.app1', bus) dbus.service.object.__init__(self, bus_name, '/de/test/app1_obj_path') @dbus.service.method("test.app1.interface",) def is_ready(self): return true def publish_dbus(): loop = glib.mainloop() app_server() loop.run() if __name__ == '__main__': gobject.threads_init() dbus.glib.init_threads() publish_dbus() and want access dbus service in server1.py following code, named server2.py work dbus server. #!/usr/bin/python2.7 import dbus.service import dbus.glib import glib import dbus.mainloop import gobject dbus.mai

Search for text contained in a text file and remove them from another text file in java -

i have text file output java program finds frequency of people's names mentioned in multiple documents , writes them file (peoplenames.txt) this: article1location\article1 name1:countofname1# name2:countofname2# name3:countofname3# ... article2location\article2 name1:countofname1# name2:countofname2# name3:countofname3# ... article3location\article3 name1:countofname1# name2:countofname2# name3:countofname3# ... the names correspond people names identified in each article along frequency appear in article, there 90,000 articles. have text file (titles.lst) contains list of 40 different titles , abbreviations (such mr., mrs., president, sir etc.) use list in file search , remove these titles peoplenames.txt. not sure how go in java new java , need modify original code in java produced peoplenames.txt accommodate title removal. my program identifying person such mr john smith different john smith, removing titles give me more accurate count of names mentioned in articles.

How to install jdk 1.7 on CentOS 6.4 -

this problem makes me crazy. i downloaded jdk 1.6 , 1.7 oracle website, , extract in /usr/java. and add path information in /etc/profile. export java_home="/usr/java/jdk1.7" path="$java_home/bin:$path" and source command. source /etc/profile finally when java -version send below message back. bash: /usr/bin/java: /lib/ld-linux.so.2: bad elf interpreter: no such file or directory i've been tried 1.6 also, same. (of course, dod chmod thing , others..) thanks lot reading, , advices in advance. i solved problem. omg, downloaded file wrongos.t^t

php - can't retrieve all rows from a table -

i've tried past hour figure way server recognize if user owns similar row in mysql db can of guys me... here code ive done now $nummer = $_get['a']; $klasse = strtoupper ( $_get['b'] ); $kid = $nummer . '.' . $klasse; $result = $db->query("select kid kcode sid='".$_session['id']."'"); $resa = $result->fetch(); $b = strtoupper ( $resa['kid'] ); $a = $kid $c = $_session['id']; if ($a !== $b){ echo "insert"; } else { echo "already exists"; } ok explain deeper different commands is: $_get['a'] =a letter retrieved previous page $_get['b'] =a number retrieved previous page "kid" wich wanna select row in kcode table, problem there several kid's want compare $a ... when try way retrieve last created. thx time edit: said in comment want compare $kid mysql rows called kid when sid=$_session['id'] . if want retrieve

java - JavaFX WebView / WebEngine Cache external JavaScript -

situation : have simple html page have normal script tag this <script src="main.js"></script> after load html , update main.js , , make reload (throught ui button). the problem new js not taken , must close application , open again. what did try: -not using webengine.reload() , webengine.load() -making new broswer every time reload occurs. -making new stage new broswer -setting nodes caching off -in html following code <meta http-equiv="cache-control" content="no-cache, no-store, must-revalidate" /> <meta http-equiv="pragma" content="no-cache" /> <meta http-equiv="expires" content="0" /> -inetaddresscachepolicy: inetaddresscachepolicy.setnegativeifnotset(inetaddresscachepolicy.never); -vm options: -dnetworkaddress.cache.ttl=0. the question there way delete cache or enforce webview reload resources other appending number js filename every time update it? note:i u

java - UIMA for parsing emails -

i new uima. i want develop app using uima , uimafit can parse email related air tickets, such confirmation email, cancellation email etc. , extract valuable information ticket number, flight number, departure time, arrival time, passenger name etc. how can achieve using uimafit. tried use uimafit read string , regular expression tried extract information, seems complicated email not structured. suggestions of how connect emails , perform parsing without using regex. any suggestions. is set of types of emails (confirmation email, cancellation email etc) small enough? if yes, in first step, try simple classification types of email. in next steps, can apply different tools based on type of email. for rest, think it's best use regexes, if tedious. might want @ uima textmarker implement regexes/rules. ticket number: regex flight number: regex departure time, arrival time: regex passenger name: person ner ( here uima example) (or match email to: field?)

web services - Glassfish 3.1.2.2: @WebServiceProvider deployment fails: DPL5041 : Unknown port-component-name -

i having problems @webserviceprovider web service deployed in glassfish 3.1.2. i configured glassfish-ejb-jar.xml following way service. <ejb> <ejb-name>testwebservice</ejb-name> <webservice-endpoint> <port-component-name>testwebservice</port-component-name> <endpoint-address-uri>head/testwebservice</endpoint-address-uri> <transport-guarantee>none</transport-guarantee> </webservice-endpoint> </ejb> the web service implemented follows. package test.ws.services; import [...left out brevity...] @webserviceprovider( targetnamespace = "http://ws.test.com" , servicename = "head/testwebservice" , portname = "testserviceport") @servicemode(value = service.mode.payload) @stateless @handlerchain(file = "test_handlers.xml") @interceptors({ testinterceptor.class }) public class testwebservice implements provider<source> { @webmethod public

iphone - Detect country of iTunes Store in iOS -

this question has answer here: how detect active itunes store on iphone/ipod touch/ipad? 5 answers in iphone app detect country of itunes store iphone user logged into, e.g. user usa direct him/her to: https://itunes.apple.com/us/album/21/id420075073 , user logged polish itunes store redirect him to: https://itunes.apple.com/us/album/21/id403037872 i know check locale (e.g. language),but might not work. any ideas how achieve this? nsstring *countrycode = [[nslocale currentlocale] objectforkey: nslocalecountrycode]; will identifier e.g. "us" (united states), "es" (spain) , etc. because find country means no problem. hope itunes store must device country.

html - How to get rid of a table border in wordpress? -

i'm building simple website friend of mine using wordpress. in page want make simple rectangle , put info in it. since learned html in 90's still use table (with 1 td) this. since want table border disappear created table so: <table border="0"> <tr><td>some content</td></tr> </table> unfortunately, border still appears (see here page work on). does know how can rid of table border? you having rule in stylesheet style.css line 1071 needs removed th, td, table { border: 1px solid #dddddd; } note: element selector, apply tables in website. you've table inside div class post-entry better can override styles using below selector .post-entry * { /* '*' select element inside .post-entry cautious */ border: 0 !important; } and if having post-entry other elements too, explicitly specify elements instead of using * .post-entry table, .post-entry th, .post-entry td { border: 0; } tip

rebulid href tag from text with jquery -

i have dynamic html: <div class="msg_body"> <p> text... |uri=http://www.somesite.co.il/|some link|euri| text |uri=http://www.somesite.co.il/|some link|euri| , text... </p> i need extract uri string , replace: 1. |uri= [<a href"] 2. | [>] 3. |euri| [</a>] so... need bee this: <p>some text... <a href="http://www.somesite.co.il/" target="_blank"></a>some link</a> text <a href="http://www.somesite.co.il/" target="_blank">some link</a> , text...</p> i stack @ point: $('.msg_body').find('p').text().replace('|uri=','<a href="'); how can in jquery? you can use regex in following way: $('div.msg_body').html($('div.msg_body').html().replace(/\|uri=([^\|]+)\|/g, '<a href="$1" _target="blank">')); $('div.msg_body').html($('div.msg_body'

Need to convert this SQL to linq -

i've got sql, need convert linq query. having difficulty trying use partition/rownum , patition/count together. select top 1 vals.c3, (vals.rank * vals.[occurances]) rnk ( select row_number() over(order c1 asc) rank, count(*) over(partition c3) [occurances], c3 dbo.ranks c2 in ('adams', 'chip', 'shop') group c3,c2,c1 ) vals --group vals.c3 order rnk desc this ranks list like: c1 c2 c3 26774 chip chipshop 26054 shop shops 10054 shop chipshop 23037 medical doctors 21434 centre doctors 12803 dental dentists 11847 office post offices c2 word, c3 category i'm looking for. c1 how word occurs per category. when enter search 'adams chip shop', it'll go , find category match based on name. any appreciated :) try tool. want. linqer

PHP - get specific element form each sub array without looping -

in php there way element each sub array without having loop - thinking in terms of efficiency. say following array: $array = array( array( 'element1' => a, 'element2' => b ), array( 'element1' => c, 'element2' => d ) ); i of 'element1' values $array there number of different functions can operate on arrays you, depending on output desired... $array = array( array( 'element1' => 'a', 'element2' => 'b' ), array( 'element1' => 'c', 'element2' => 'd' ) ); // array of element1s : array('a', 'c') $element1a = array_map(function($item) { return $item['element1']; }, $array); // string of element1s : 'ac' $element1s = array_reduce($array, function($value, $item) { return $value . $item['element1']; }, ''); //

java - Command Line Server?? Client Server Architecture? -

hope doing great. here want know command line server, how can access remotely command line server via iphone. any thought advise appreciated. thanks. peter lawrey guided me in right direction above in comments. others if looking answer question asked here on stackoverflow.com " if start program command line , close it, sends hup signal of it's child processes. way avoid killing process use nohup @ start of command line. blocks signal , prevents process being killed when exit. true of unix programs , not specific java @ all. "

javascript - Knockout not behaving correctly in Pyramid -

i'm building webapp using pyramid, knockout behaving differently. have form: <div data-bind="with: $root.itemtoadd" style="display: none;"> <form data-bind="submit: $root.additem"> <fieldset style="border: none;"> <legend >submit item</legend> <label> url <span>{</span> </label> <input type="text" placeholder="url" data-bind="value: url, valueupdate: 'afterkeydown'" /> <br /> <br /> <label> kwip <span>{</span> </label> <input type="text" placeholder="your description please!" data-bind="value: description, va

class - Python: 'NoneType' object has no attribute 'get_username' -

i'm working on hangman program has user accounts objects. player can log in, create new account, or view account details, of work fine before playing game. after game has completed, user's wins , losses updated. before exiting program, if try view account (the viewacc function) error: 'nonetype' object has no attribute 'get_username'. when run the program again, can log in account, when view account info wins , losses haven't been updated. appreciated, have turn in class in 8 hours. heres class code: class account: def __init__(self, username, password, name, email, win, loss): self.__username = username self.__password = password self.__name = name self.__email = email self.__win = int(win) self.__loss = int(loss) def set_username (self, username): self.__username = username def set_password (self, password): self.__password = password def set_name (self, name):

mysql - error getting while start a value from 0 in auto increment -

hi have field uid in mysql db when created table used add uid int primary key auto_increment value started 1.so deleted field , created time out using primary key or auto_increment.then inserted 0 , when want make primary , auto increment not working.please tell me how do alter table patient add primary key(uid); error 1062 (23000): duplicate entry '0' key 'primary' you cannot make field primary key (or unique) if holds duplicated values. check records , there no repeated uid values.

javascript - merge / join regular expression results for highlighting -

i want join/merge result of regular expression. for example, string hello foo bar the regex result pattern /el/ => el regex result pattern /llo\sfo => llo fo if use pipe, result 1 match. pattern /el|llo\sfo/ result el my desired result should ello fo use case highlighting multiple pattern in text. the regex engine processes string once. after character has been consumed, cannot processed again (lookarounds don't count matter because "just look"). since patterns need "overlap" on example string, never match (in 1 regex). however, global flag g , following input: "helllo foo bar".match(/el|llo\sfo/g) so solution use 2 separate regexes purpose.

ruby - what is "oh" method in rails 2.3? -

the code below comments controller. "oh" doing in line 3? @offer = offer.find(params[:offer_id]) @offer_comment = @offer.offer_comments.build(params[:offer_comment]) @offer_comment.commenter oh = current_user @offer_comment.save! notify::offer_comment_create(@offer_comment) @offer.update_attribute(:read, false) if @offer.read? , current_user == @offer.offerer ruby see line as: @offer_comment.commenter(oh = current_user) so it'll assign current_user oh , commenter receive current_user it's argument.

php - clearing/refreshing all the fields using onchange event in JQuery -

i have set of code, in have drop down list, , have 6-8 text fields below it. whenever change option, want fields refreshed, mean fields must made empty.... what have tried:- $(document).ready(function(){ $('#typed').change(function() { $('#fieldid1').val(""); $('#fieldid2').val(""); .... }) }); but question can done using single line of code such textboxes present cleared ???? try this: $('#typed').change(function () { $('input:text').val(""); }); also, can put class input fields want clear , follows: $('#typed').change(function () { $('input.someclass').val(""); });

php - Logs for an API in symfony 1.4 -

i working on rest api in symfony 1.4 i log comes in , out of "api" application. in log/api folder, keep track of api calls in various files. call mymodule/myaction, have 3 files: mymodule_myaction_rq.log requests mymodule_myaction_rs.log responses mymodule_myaction_error.log error responses i know how manually, adding code @ beginning , @ end of each action. here how go: class myactions extends sfactions { /** * log function */ private static function customlog($message, $seed, $url, $content, $type) { $file = sprintf('%s/%s_%s.log', sfconfig::get('sf_log_dir', "no_log_dir")."/api", $message, $type); $logger = new sffilelogger( new sfeventdispatcher(), array('file'=> $file) ); $logger->log( sprintf("#%s# (%s) %s ", $seed, $url, $content), 0, "info" ); } /** * executes index action

cygwin - cygbin: hostname nor servname provided, or not known -

Image
installing hadoop1.0.3 successfully. run hbase service(start-hbase.sh command) having changes in hbaseenv.sh , hbasesite.xml but problem arises: please suggest how resolve problem , aslo cygpath: can't convert empty path

foreign keys - SQL Query - If discriminator in table equals something, change column content in another table to equal PK -

say have 2 tables(tablea , tableb) tablea has id (primary key) , discriminator value (eg. "stuff") tableb has id column foreign key of tablea id ("stuffid") what make sql query tableb checks discriminator value "stuff" (for example) in tablea , if value "stuff", take id (primary key) of tablea , link value tableb in column "stuffid" is doable? thank you yes there existing rows. tablea might have id discriminator -------------------- 1 stuff 2 notstuff 3 stuff tableb might have stuffid name ----------------- 43 ffr 87 fd i stuffid column same column in tablea if discriminator in tablea "stuff" ok, reposting comment answer: insert tableb (stuffid) select id tablea discriminator='stuff' should accomplish want stated in original post. note new rows added in tableb have null or default value in name field isn't specified in qu

php - Close an area of just me -

it such need convert website new version folder named "/public_html/opdaterning" such not want others me access folder out of myself . try helps nothing .. :( errordocument 403 /specific_page.html order allow,deny allow 111.222.333.444 deny all, allow 1 ip through htaccess order deny,allow deny allow 111.222.333.444 for multiple either allow lines or seperated spaces order deny,allow deny allow 111.222.333.444 allow 111.111.111.111 111.111.111.112 and critics, know ip can not contain 333 or 444 ;)

jquery - MVC custom DataAnnotation (RequiredAttribute) not applied on select elements -

i created new requiredattribute extention called "requredwhen". it works on textboxes not on select elements. reason validate on postback instead on client side. "required" drop downs validate client side why aren't "requiredwhen" attributes failing validate? when add attribute [required] you markup <select class="customselect input-validation-error" data-val="true" data-val-number="the field x must number." data-val-range="please select correct range" data-val-range-max="5" data-val-range-min="0" data-val-required="the x field required." id="x" name="x"></select> this doesn't happen add custom attribute. in markup validation related attributes missing select element (like data-val, etc) applied on input fields. is there additional need force validation work on select elements? getclientvalidationrules not include elements when

Get each post id with all comments using facebook FQL -

i want each post id comments page using fql query.if use - select text,post_id comment post_id in(select post_id stream source_id=page_id_here) this returns - { "data": [ { "text": "would nice if website let me update. says have current version 2.5.9 :(", "post_id": "2211155996_10151336546425997" }, { "text": "all of mine started showing update message in last hour , got emails admin tools.", "post_id": "2211155996_10151336546425997" }, ........continues as see returns text , post_id in 1 object.what want there post_id , comments in 1 object.hope answer struggling hour.it's multi queries join

is it possible to run windows service / app (c#) on heroku platform? -

i checking possibility run c# service on heroku platform does have experience such solution? thanks there heroku buildpacks use mono run .net , c#. here's 1 built: https://github.com/friism/heroku-buildpack-mono

android - How to start on current activity when user presses Home button -

on main activity added following intent-filter <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.home" /> <category android:name="android.intent.category.default" /> <category android:name="android.intent.category.launcher" /> </intent-filter> so when press home button main activity showed. last seen activity show, not main one. how can achieved? store each activity in sharedpreference through onpause , can rectify it. @override protected void onpause() { super.onpause(); sharedpreferences prefs = getsharedpreferences("x", mode_private); editor editor = prefs.edit(); editor.putstring("lastactivity", getclass().getname()); editor.commit(); } in mainactivity: public class mainactivity extends activity { @override protected void oncreate(bundle savedinstancesta

c# - Nested transaction scope .net -

i'm using sql server 2008 r2 , trying use transactions. first question transactions in .net , sql server. if have this try { var transactionoption = new transactionoptions(); transactionoption.isolationlevel = isolationlevel.readcommitted; transactionoption.timeout = transactionmanager.maximumtimeout; using (var scope = new transactionscope(transactionscopeoption.requiresnew, transactionoption)) { //create question creates new question in database helpers.createquestionbankitem(ref mappedoldnewquestionitemguid, missingquestionbankitems); //question created //query database code of newly inserted question, database give me code since complete has not been called yet? scope.complete(); } } catch (exception ex) { throw; } //query database code of newly inserted question, database give me code since complete has been called now? at point should call database ask code of newly inserted question. sec

'sed' : How to add new line after string match + 2 lines -

i add new line after string match + 2 lines. here file : allow-hotplug eth0 auto eth0 iface eth0 inet static address 172.16.2.245 netmask 255.255.254.0 gateway 192.168.1.1 allow-hotplug eth1 #auto eth1 iface eth1 inet static address 192.168.0.240 netmask 255.255.255.0 iface eth2 inet static address 192.168.2.240 netmask 255.255.255.0 i want add 'gateway 192.168.1.1' after found 'iface eth1' + 2 lines. example: need after execute sed command allow-hotplug eth0 auto eth0 iface eth0 inet static address 172.16.2.245 netmask 255.255.254.0 gateway 172.16.2.254 allow-hotplug eth1 #auto eth1 iface eth1 inet static address 192.168.0.240 netmask 255.255.255.0 gateway 192.168.1.1 iface eth2 inet static address 192.168.2.240 netmask 255.255.255.0 i know how find , move 2 lines after, append line after specific string, etc. not combine 2 operation. steph this seems work: sed '/^iface eth1/{n;n;s/$/\ngateway 192.168.1.1/}' input.txt add -i op

How to avoid a for-loop in MATLAB, when performing a operation on each row in a very large matrix? -

i using matlab . have very large sparse matrices , , want perform logical or bsxfun on each column of matrix. there single for loop in single operation of logical fill sparse matrix. here include sample function fake small data see trying do; function maskmat() graph_temp = round(rand(10,10)); tic; com_mat = round(rand(10,10)); com = round(rand(10,1)); ii=1:length(graph_temp) com_mat(:,ii) = logical(com ~= com(ii)); %bsxfun works slower %com_mat(:,ii) = bsxfun(@ne,com,com(ii)); end toc; com_mat = graph_temp .* com_mat; graph_temp , com_mat bigger around 1m rows , columns , code horribly slow for loop. there relevant question here on so , have not understood theory behind see if can apply solutions problem well. i thinking either write mex c++ function or try sort of nested arrayfun each logical / bsxfun operation called subroutine of greater function avoid loop bottle neck. i'm not sure followed code way. so, make sure, com_mat(ii,j

c# - How to order a list with a method in a collection class -

i having problem searching method. want make function inside collection class can find products (objects) in list specific name , there after sort list price. but because generic can't "reach" fields in objects in list. can please me? here have tried: public class productlist<t> : icollection<t>, icomparer<t> { public list<t> _productlist = new list<t>(); // other methods // 1. try: public void funcsearch_name(string search_name, productlist<product> listin, out productlist<product> listout) { listout = listin.where(x => x.name.equals(search_name)).tolist(); // here complaining cant not implicity convert generic list productlist (i dont understand that) } // have tried this: public void funcsearch_name(string search_name, ref list<t> listin, out list<t> listout) { listout = listin.where(x => x.name.equals(search_name)).tolist(); listout.or

.htaccess redirect all files in this directory -

i've moved email cache directory in wordpress plugin , want leave .htaccess file in old directory redirect new one i've googled , cannot find answer works redirect files in current directory new one. simplicity htaccess must in old directory siteurl/wp-content/plugins/church-admin-cache/ siteurl/wp-content/uploads/church-admin-cache/ redirectpermanent should job. redirectpermanent /wp-content/plugins/church-admin-cache/ /wp-content/uploads/church-admin-cache/

html - Allowing a background to overflow? -

Image
i have background such below: trouble want set width of containing box cover end of white areas & hence shadow should "overflow". don't want use out container or padding trying avoid width; if background overflows browser isn't going create horizontal; scrollbars , that's want. is there way can accomplish or forced use full width? backgrounds on <body> don't affect scrollbars, depending on need shadow might able similar this; body { background: url(http://i.stack.imgur.com/ftw5z.png) no-repeat center top; margin: 0; } .container { width: 1014px; /* inner space of shadow image */ margin: 35px auto; /* 35px matches size of top shadow */ } demo @ http://jsfiddle.net/gjsxn/2/ you can achieve same effect container , use of min-width , overflow hidden.

html5 - Inner curved box with css3, is this possible? -

i wondering possible make in css3 or needs done .png ? if possible make inner circle maybe add width example 400% , slight curve of circle ? !!!! screenshot: http://oi34.tinypic.com/xya89.jpg

c# - How can I get the IndexOf() method to return the correct values? -

i have been working googlemaps , looking format coordinates. i coordinates in following format: address(coordinates)zoomlevel. i use indexof method start of "(" +1 first number of coordinate , store value in variable call "start". i them same thing time index of ")" -2 last number of last coordinate , store value in variable call "end". i following error: "index , length must refer location within string.parameter name: length" i following string imparameter: "loddvägen 155, 840 80 lillhärdal, sverige (61.9593214318303,14.0585965625)5" by calculations should value 36 in start variable , value 65 in end variable but reason values 41 in start , 71 in end. why? public string removeparantheses(string coord) { int start = coord.indexof("(")+1; int end = coord.indexof(")")-2; string formated = coord.substring(start,end); return fo

monodevelop - Debugging F# in Xamarin Studio 4.0.3 throws an error -

i have installed xamarin studio 4.0.1 on windows 8 x64 http://monodevelop.com/download . when ran xamarin, got updated 4.0.3. have installed f# bindings. have created new f# console project. when run it, works fine. when set break-point , run it, following error. idea, why happens? system.runtime.interopservices.comexception (0x80070032): request not supported. (exception hresult: 0x80070032) @ microsoft.samples.debugging.cordebug.nativeapi.icordebug.createprocess(string lpapplicationname, string lpcommandline, security_attributes lpprocessattributes, security_attributes lpthreadattributes, int32 binherithandles, uint32 dwcreationflags, intptr lpenvironment, string lpcurrentdirectory, startupinfo lpstartupinfo, process_information lpprocessinformation, cordebugcreateprocessflags debuggingflags, icordebugprocess& ppprocess) @ microsoft.samples.debugging.cordebug.cordebugger.createprocess(string applicationname, string commandline, security_attributes processattri

html - GWT event that should be fired whenever textbox.setText() is called -

i using gwt textbox. whenever textbox.settext() method called, want perform action in other class. valuechangeevent not fired whenever settext() called. is there event fired or ways achieve this? please help you try use setvalue(string value, boolean fireevent) method

html - JavaScript save text to file with spaces -

javascript function savetextasfile() { var texttowrite = document.getelementbyid('out').innerhtml; var textfileasblob = new blob([texttowrite], {type:'text/plain'}); var filenametosaveas = document.getelementbyid("maze").value; var downloadlink = document.createelement("a"); downloadlink.href = window.webkiturl.createobjecturl(textfileasblob); downloadlink.download = filenametosaveas; downloadlink.click(); } i'm trying here save text <pre id="out"></pre> .txt file, function doesn't save spaces , line-spaces <pre> tag, can see 1 long line in new .txt file. i'm missing here? <pre> contains '\r\n'

java - Register MBean Everytime before using it -

i registering mbean in common class while booting tomcat application. trying access bean in other class record statistics. jmx bean values not getting updated in jconsole. to instantiate mbean tried mbeanimplclass = new mbeanimplclass(); mbeaninterface= new mbeaninterface(); do have register mbean, everytime use it? no, but, need make sure bean registered, , bean being updated new statistics same instance. 1 way implement bean singleton .

jquery - editRow not working after setCell in jqGrid -

Image
i'm using setcell set value of cell , , after enabling cell editing grid.jqgrid('setcell','1','valid','5'); grid.jqgrid('editrow','1', false); but result ist cant click longer on cell ? after calling sercell cell cant longer editable. how can make cell again editable ? thanks from comment find solution instead set column value grid.jqgrid('setcell','1','valid','5'); you need set : $('#1_valid').val('5');

mysql - Error while inserting value in datetime column -

i'm trying insert record (from java code) in table i'm getting "error 1292 (22007)". timestamp column of type "datetime" following query insert alert(name,timestamp,location,message) values ("aaa", "2013-04-25 5:47:3pm","xyz", "bla bla bla"); error error 1292 (22007): incorrect datetime value: "2013-04-25 5:47:3pm" column 'timestamp' @ row 1 change timestamp value in query 2013-04-24 17:47:03 . format datetime column must yyyy-mm-dd hh:mm:ss .

sql - get first letter of string, disregarding "the" -

i trying list of book titles begin letter. however, need disregard "the" @ beginning of title. instance, when i'm looking titles begin "a", query should return both "the alamo" , "american history". how can this? use where case when substr(title, 1, 4) = 'the ' substr(title, 5) else title end '...' in query, or use patterns.

javascript - Phonegap app to send data via wifi -

i have idea app. app send data ipad iphone via wifi. question is possible make app sends data through wifi using phonegap ? assuming devices on same wifi network, achievable. if there no wifi ap available, you're looking @ more difficulty because ios devices cannot create ad-hoc networks. take @ this plugin , uses bonjour discover ip address of other devices running app, , can establish tcp connection between devices.

javascript - Faulty Logic in this image color equalization algorithm -

somewhere in code, seem doing wrong , cannot tell part going awry. i've printed console values i'm getting various arrays , seems match up. when run equalization function (a la wikipedia-histogram equalization ) output image close total black. trying interpret this guy's php javascript test stuff out , figured did decent job. i'm not expert. the pertinent parts: function imageloaded(ev) { element = document.getelementbyid("canvas1"); c = element.getcontext("2d"); im = ev.target; // image // read width , height of canvas width = element.width; height = element.height; // stamp image on left of canvas: c.drawimage(im, 0, 0); // canvas pixel data imagedata = c.getimagedata(0, 0, width, height); w2 = width / 2; var reds = new array(); var greens = new array(); var

.net - How to generate nosetter.camelcase-underscore access strategy with NHibernate mapping by code? -

cant find appropriate accessor. should nosetter or field? thanks if have (read-only) property, should use accessor.nosetter the specific naming convention determined automatically nhibernate (of course, try not have both _myprop , _myprop , myprop fields, nh pick first 1 iirc)

javascript - Dynamic regular expression -

trying make expression dynamic. can split string in equal chunks. var keyparts = key.match(/.{1,4}/g); var keyparts = key.match(/.{rangea,rangeb}/g); so want make range, trying put in new regexp() w/o positive results. try this: var re = new regexp(".{" + rangea + "," + rangeb + "}", "g"); var keyparts = key.match(re); demo: http://jsfiddle.net/bzkaq/ in demo, notice how when change length of key between ranges, match string. reference: https://developer.mozilla.org/en-us/docs/javascript/reference/global_objects/regexp

ruby - Why prefix a method with "self" -

i'm doing following ruby tutorial http://rubymonk.com/learning/books/4-ruby-primer-ascent/chapters/48-advanced-modules/lessons/118-wrapping-up-modules one of exercises asks me to ...define static method square in module math. should return square of number passed it... why work when prefix method definition "self"? e.g. following works: module math def self.square(x) x ** 2 end end but following not work: module math def square(x) x ** 2 end end why this? reference, method being called puts math.square(6) within context of module, declaring method self prefix makes module method, 1 can called without having include or extend module. if you'd have mix-in methods, default, , module methods, requires self prefix, can this: module math # define mix-in method def square(x) x ** 2 end # make mix-in methods available directly extend self end that should have effect of making these methods usable calling

spring - HTTP Status 503 on Sun Java System Application Server 9.1_02 (build b04-fcs) -

we replicating our production application our dr machine. our application web app using hibernate spring , struts2 framework running on sun java system application server 9.1_02 (build b04-fcs). application stable on production environment. made run during our first replications. encountered http status 503. tried redeployment application server (servlet container) restart. tried rebuilding application source code , redeploying resolve http status 503. causing http status 503? in advance guys. here dependencies/jar files antlr-2.7.6.jar arpeggio-1.1.jar cglib-2.2.jar commons-collections-3.1.jar commons-dbcp-1.2.2.jar commons-fileupload-1.2.2.jar commons-io-2.0.1.jar commons-lang-2.4.jar commons-logging-1.1.1.jar commons-pool-1.4.jar dom4j-1.6.1.jar freemarker-2.3.16.jar ganymed-ssh2-build210.jar hibernate-jpa-2.0-api-1.0.1.final.jar hibernate3.jar javassist-3.12.0.ga.jar jettison-1.3.2.jar jta-1.1.jar ldap.jar log4j-1.2.14.jar mime-util-2.1.3.jar og

java - servlet-api.jar - jar not loaded on localhost -

this jar in not loading in tomcat 7 environment locally. worked fine yesterday when shut down day. nothing has changed, when start morning presented with. nothing has changed - really. opened eclipse start working , testing web app - cannot found , returns 404. what cause jar not load? have no errors in project , have cleaned it. the offending jar located: c:\users\me\documents\dev\eclipse\j2ee_wdt\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps\app.cloud.services\web-inf\lib the console output after cleaning: apr 25, 2013 9:38:31 org.apache.catalina.core.standardcontext reload info: reloading context name [/mydomain.com] has started apr 25, 2013 9:38:35 org.apache.catalina.startup.tagliburirule body info: tld skipped. uri: urn:com:sun:jersey:api:view defined apr 25, 2013 9:38:35 com.sun.jersey.api.core.packagesresourceconfig init info: scanning root resource , provider classes in packages: com.mydomain.webservices apr 25, 2013 9:38:35 com.sun.jersey