Posts

Showing posts from June, 2014

agile - Managing loads of small projects -

most of books project management (if not of them) describe management of 1 big project. describe how manage few projects in same time. have different situation. i manage small team (4 people) small projects. 1 engineer works on dedicated project. times 1 engineer work on few projects different priorities (projects quite switched "on hold" state several days). so specific is: small projects short lifetime (1 week 2 month in general) projects not shared between engineers number of projects can 2-3 times higher number of people (some projects go "on hold" quite often) there 2 longterm projects lowest priority can shared between engineers can share own experience how manage projects this, or if never had such experience have idea how organize i'll glad read it. of course if know book can me - i'll glad check well. may there ready methodology thas kind of projects never heard. thank you. i suggest looking @ kanban. here's links...

iphone - Persisting data between app launches -

i have small set of data persisted between different app launches... data versions of files checking on app launch. planning maintain dictionary key file name , value version of file. what best possible option persist data. think of using nsuserdefaults this. please guide. nsuserdefaults should work fine. if need reference see: http://www.tomwhitson.co.uk/blog/tag/persistent-data/ .

java - ImageJ jar file plugin shortcut creation -

i have been working on developmental biology project marking various nuclear markers along dapi stain determine percentage of marker expression. have found imagej plugin itcn ( http://rsbweb.nih.gov/ij/plugins/itcn.html ) works great each marker when using clahe program. problem have around 6000 images analyze , love able automate process. have recorded macro such following (which can looped individual image files) : open("image"); run("8-bit"); run("clahe"); run("itcn "); close(); but itcn icon wont start analyzing automatically, nor there programmed short cut job. ignorant java programming , love know if there anyway around easy problem. thanks in advance michael the itcn plugin implemented pluginframe , settings not recordable, have discovered. however, looking @ source, seems plugin uses class called itcn_runner once has gathered options, should able call programmatically. however, can't macro language. easiest a...

forms - jQuery: Executing functions in previously saved data and online? -

i've been working little time jquery , can't figure out how this... the thing in work i'm making lot of forms can reloaded different data , events width dependents controls. example (a simple example) have 3 radiobuttons select favorite food: meat, fish , another. when click radiobutton can specify other food in textbox (and other 2 disable textbox) they can save data , can reopen form data loaded , same input status (disabled/enabled). normally program in 2 parts, 1 executes when page loaded (this part enables/disables inputs according saved data - or lack of data 'if radiobutton selected enable specify textbox, else disable it') , 1 executes when click event triggered (if click radiobutton enable textbox, if click 1 disable - , onclick function every radiobutton) i've been thinking lot , think way jquery in 1 time, haven't found way it... ideas? i know think doing in 2 steps isn't lot of work, should know we're working forms more 200 ...

push notification - How to write android code in titanium -

i had been working on android since little long. wondering titanium. possible write android (java) code in titanium app since app build in titanium? if yes how? having problem dealing push notification android in titanium. got solution build complete app in titanium , if possible use android code in app deal push notification. how? please response possible. in advance. to answer question directly, need develop native android extension call java code via javascript in titanium application.

jQuery getAttribute -

i have "uid" attribute , it's value on "body" tag... $(document).ready(regfunct()); function regfunct(){ alert($("body").attr("uid")); } but says "undefined". wrong? try: $(document).ready(function(){ regfunct(); }); function regfunct(){ alert($("body").attr("uid")); }

How can I see the number of rollbacks in my STM in Clojure? -

how can see number of rollbacks in stm in clojure? you can't... unless willing cheat: (defmacro spy-dosync [& body] `(let [retries# (atom -1) result# (dosync (swap! retries# inc) ~@body)] (println "retries count:" @retries#) result#)) and replace dosync spy-dosync.

Redis on web server front-end or database server back-end -

i have 2 virtual private servers, first web server front-end , second database back-end. want use redis real-time stuff , questions is: should install redis? on web or database server? pros of installing redis on database server: the database size of redis can become large if have lot of data. if storing stats , storing lot of them, database can become memory hog. not want keep data in memory on web server, take away memory http server. its called database server reason cons of installing redis on database server there higher network response time when polling server data, not local if server goes down, out of data. i keep redis on own server, can feeding lot of data, depends on environment working in. if want speed top priority (an 50ms or unacceptable), should run on web server, request times 127.0.0.1 lot faster external network address, if inside local subnet. if not, should keep off web server.

How to import 'GDB' in Python -

i using python 2.7 , python 3.1.3. in python unable "import gdb". it giving me error as: >>> import gdb traceback (most recent call last): file "<interactive input>", line 1, in <module> importerror: no module named gdb >>> what's reason this? how should solve problem? import gdb works when python code running within gdb process. it's not supposed work regular system python interpreter. explanation gdb embeds python interpreter can use python extension language. you can't import gdb /usr/bin/python it's ordinary python library because gdb isn't structured library. what can source my-script.py within gdb (equivalent running gdb -x my-script.py ). example program here's self contained example. save file below t.py : import gdb gdb.execute('file /bin/cat') o = gdb.execute('disassemble exit', to_string=true) print(o) gdb.execute('quit') run: $ gdb -q...

How to do search & replace with ack in vim? -

i using ack plugin in vim, helps me search strings in project. however, want replace or occurrences of found strings. can kind of global search , replace using vim arglist ( source ) : :args app/views/*/* :argdo %s/, :expire.*)/)/ge | update but instead of using args , prefer search via ack , replace in files have been found. there way similar argdo command? i've decided use ack , perl solve problem outside of vim use more powerful perl regular expressions instead of gnu subset. map key stroke in vimrc. ack -l 'pattern' | xargs perl -pi -e 's/pattern/replacement/g' explanation ack ack awesome command line tool mix of grep , find , , full perl regular expressions (not gnu subset). written in pure perl, it's fast, has match highlighting, works on windows , it's friendlier programmers traditional command line tools. install on ubuntu sudo apt-get install ack-grep . xargs xargs old unix command line tool. reads items standard...

java - Android: SetUp API Key for Google Maps -

i'm trying api key on development mac pc. in terminal use following code: keytool -list -alias androiddebugkey -storepass android -keypass android -key store debug.keystore but unfortunately following error back: device-fdearf:~ mymac$ keytool -list -alias androiddebugkey -storepass android -keypass android -key illegal option: -key try keytool -help device-fdeur6f:~ mymac$ store debug.keystore how can fix this? this need: once hit enter key, you'll see (the actual md5 we're interested in last line): androiddebugkey, mar 10, 2009, privatekeyentry, certificate fingerprint (md5): d1:16:4a:bd:73:73:a4:56:9d:cd:9a:44:a2:6c:11:ac many thanks! see link .it provide step step simple. ----------what error ur code first glance not giving path of keystore.for more info see above link.

objective c - How to load SIMBL plug-in to the SystemUIServer -

i have experience in developing 2 simbl plug-in. those working on mac os x 10.6.6 @ moment. i'm planning make new simbl plug-in modifies behavior of menu extra. menu belonging systemuiserver. systemuiserver exists @ place: /system/library/coreservices/systemuiserver.app/contents/macos/systemuiserver bundle identifier of systemuiserver com.apple.systemuiserver. so add key simbltargetapplications info.plist follows: <?xml version="1.0" encoding="utf-8"?> <!doctype plist public "-//apple//dtd plist 1.0//en" "http://www.apple.com/dtds/propertylist-1.0.dtd"> <plist version="1.0"> <dict> <key>cfbundledevelopmentregion</key> <string>english</string> <key>cfbundleexecutable</key> <string>${executable_name}</string> <key>cfbundleiconfile</key> <string></string> <key>cfbundleidentifier</key> <string...

c - implementing globbing in a shell prototype -

i'm implementing linux shell weekend assignment , having problems implementing wilcard matching feature in shell. know, shells complete language themselves, e.g. bash, ksh, etc. don't need implement complete features control structures, jobs etc. how implement * ? a quick analysis gives following result: echo * lists files in current directory. logical manifestation of shell? mean, not considering language-specific features of bash, shell does, internally? replace * files in current directory matching pattern? also have heard perl compatible regular expression , seems complex use third party library. any suggestions, links, etc.? try @ source code well, bash. yes, that's shell does. replace '*' characters files , folder names in cwd . in fact basic regular expressions supporting '?' , '*' , matching file , folder names in cwd . remark backslashed \* , '*' enclosed between simple or double quotes ' or " ...

How to add a "confirm delete" option in ASP.Net Gridview? -

how add "confirm delete" option in asp.net gridview ? this should it. i found here: http://forums.asp.net/p/1331581/2678206.aspx <asp:templatefield showheader="false"> <itemtemplate> <asp:imagebutton id="deletebutton" runat="server" imageurl="~/site/img/icons/cross.png" commandname="delete" onclientclick="return confirm('are sure want delete event?');" alternatetext="delete" /> </itemtemplate> </asp:templatefield>

sql server - Error using prepared statements in C# -

the parameters aren't add sql string, i'm doing wrong? sqlcommand comando = conexao.createcommand(); comando.commandtimeout = 7200; foreach (sqlparameter parametro in parametros) { comando.parameters.add(new sqlparameter(parametro.parametername, parametro.value)); } comando.commandtext = cmdsql; comando.commandtype = commandtype.text; datatable dt = new datatable(); sqldataadapter adapter = new sqldataadapter(); adapter.selectcommand = comando; try { adapter.fill(dt); } catch (exception ex) { console.write(ex.message); } conexao.close(); return dt; the sql string, method call method above. string cmdsql = "select top @quantidade * representante"; sqlparametercollection sqlparameters = new sqlcommand().parameters; sqlparameters.addwithvalue("@quantidade", sqldbtype.int).value = quantidade; return persistencia.persistencia.consultacomando(cmdsql, sqlparameters); thanks helping solution use string cmdsql = "select top (@qu...

php - Deny script from client, but use locally -

i have .htaccess file - looks this: rewriteengine on <filesmatch ^.*\.php.*$> order allow,deny deny satisfy </filesmatch> rewriterule ^help$ scripts/help.php [l] #more rewrites here... what i'd able allow url such http://example.com/help rewritten (as per rule there) , handled help.php script in scripts directory, @ same time, deny people directly running script using http://example.com/scripts/help.php . problem is, when use these statements, both urls return 403 forbidden. i'm not sure if i'm trying possible... unfortunately, cannot place files outside/above of root web directory (which why i'm asking this), nor have access httpd.conf file. if /help requested, gets rewritten /scripts/help.php internally fulfills pattern of <filesmatch> . that’s why access /help forbidden. but can use mod_rewrite forbid access /scripts/help.php if requested directly checking request line : rewritecond %{the_request} ^[a-z]+\ /[^?\ ]*\....

Enabling Enable-PSRemoting on Powershell 1.0 -

this in relation http://www.computerperformance.co.uk/powershell/powershell_remote.htm . currently, of machines in test environment on powershell 1.0. under such scenario, there way can still manage make remote calls via powershell 1 machine another. ultimate motive start/stop/restart windows service remotely using powershell. you're not going able use powershell remoting in 1.0, can use wmi or .net servicecontroller task. $s = get-wmiobject -computer $server -class win32_service -filter "name='$servicename'" $s.stopservice() $s.startservice() in fact, if have 2.0 on client you're on, can skip couple of steps versus way it's written on either of posts using invoke-wmimethod: invoke-wmimethod -name stopservice -computer $server -class win32_service -filter "name='$servicename'" invoke-wmimethod -name startservice -computer $server -class win32_service -filter "name='$servicename'" note: gener...

javascript - jquery script doesnt work in ie -

when click on thumbnails, script change link , image path of big picture, works fine in browsers, except ) ie $('.image').click(function(event) { event.preventdefault(); var imagepath = $(this).attr("href"); var newimg = new image; newimg.src = imagepath; newimg.onload = function(){ $('#big_picture2').hide(); $('#big_picture2').attr('src', imagepath); $('.product_image_large').attr('href', imagepath); $('#big_picture2').fadein('slow'); }; }); the html looks this: <a href="/documents/product/#get_image_big.path#" id="thumb1" onclick="return hs.expand(this, { slideshowgroup: 1 } )" class="product_image_large"><img src="/documents/product/#path#" id="big_picture2" border="0" /></a> <a href="/documents/product/#get_product_images.path#" class=...

What's the "right" way to (temporarily) exclude sources from a maven build, and is there an easy way to do it from Eclipse? -

i'm new maven, , don't have whole lot of experience eclipse either. to exclude java files building in eclipse, right click files , choose build path -> exclude. works great "on-save" compilation in eclipse, not propagate maven project, when build project mvn install, tries compile excluded sources. i've done few searches , results point me compiler plugin , <excludes> functionality, editing maven project files in order temporarily exclude file build seems bit awkward. what's "right" way (temporarily) exclude sources maven build, , there easy way eclipse, via m2eclipse plugin or otherwise? you use < excludes > parameter in maven compiler plugin temporarily exclude files compilation. <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-compiler-plugin</artifactid> <version>2.3.2</version> <configura...

visual studio 2010 - How to set up a Graphic Designer to work on Asp.Net MVC 3 Razor Views? -

we have graphic designers work on "look & feel" of our web applications. typically work html, css & images. how can set designer's development environment work tfs, asp.net mvc 3 razor views? best workflow them? we want them able check out views / css tfs, edit them, view results , check tfs. how can see changes views & css if don't have full visual studio or iis or iis express? should periodically deploy web application web server them work on? i believe can download visual web developer express free. once that, can run project locally (assuming have access database if there one). i'm not sure if tfs plugin free, if can work source control.

javascript - Read Only asp drop down list -

i'm working on asp.net app i have drop down that, under conditions, should 'read only', is, user can't change but, on post selected value can read. now know readonly attribute not available drop downs i'm trying build method simulates this so wanted make javascript function doesnt let user 'open' drop down select item. possible? here's example function makedropdownreadonly(dropdownid, makereadonly){ var mydropdown = document.getelementbyid(dropdownid); if(makereadonly){ //block drop down } else{ //unblock drop down } } tks make disabled in form submit (using javascript) enable again value sent server. sample code enable upon submitting: document.getelementbyid("<%=dropdown1.clientid%>").disabled = false;

Recommended way to localize a WordPress blog -

i have wordpress blog in english (admin , content). need spanish version of same blog (admin english, content spanish). should replicate blog , translate content (images, posts, etc.)? or there plug-in use scenario? appreciate advice. cross-network duplicate? wordpress stackexchange discussion on subject.

objective c - NSURLCache bypasses HTML5 video tag -

i have nsurlcache descendent working uiwebview. load web page in webview , can intercept of http requests makes (and cache locally documents directory). works inline images, javascript references , css references , url calls within css. not pick call html5 video tag.... i left required files page except videos causes me issue when trying view webview offline (after caching). does know why nsurlcache doesn't work video tags , / or how can work!??!?!

c - Socket error:90:Message Too Long -

i have error following scenario igmp socket call; fd = socket(pf_inet, sock_raw, ipproto_igmp) ; setsockopt( fd, ipproto_ip, ip_hdrincl, nval, sizeof(nval) ); /** fill in ip header , ethernet header**/ /*** fill, create igmp packet structures***/ if(sendto( fd, &buf, sizeof(buf), 0,(struct sockaddr *) &addr, sizeof(addr)) < 0) { printf("socket sendto error %d : %s\n", errno, strerror(errno)); return 0; } the sendto call fails saying message long. using 8192 buffer size. tried using following call fix error; if(setsockopt(dlpifd, ipproto_ip, so_sndbuf, &val, sizeof(int)) < 0) { printf("can't set socket options:%d:%s\n", errno, strerror(errno)); return 0;` } setsockopt( ) call succeeds same error sendto(); so checked so_sndbuf size getsockopt( ) call , shows 1 byte ?! what wrong doing. does linux kernel need recompile igmp support ? or missing something? ethernet (the link layer working against) frame 15...

Converting a MySql trigger to a SQL Server 2008 R2 trigger -

so needed convert mysql database sql server 2008 r2 database. used microsoft's new ssma mysql tool. converted fine except triggers, kept crashing when converting them. first mysql trigger: create definer=`root`@`localhost` trigger `dbo`.`table_a_trig` before insert on `dbo`.`table_a` each row begin /* logic here */ end second mysql trigger: create definer=`root`@`localhost` trigger `dbo`.`table_a_trig_update` after update on `dbo`.`table_a` each row begin /* logic here */ end how should rewrite them able create them in sql server 2008? thanks guys! a couple of differences point out. sql server doesn't have "before" trigger, you'd have convert first instead of trigger , manually perform insert operation. sql server triggers use special inserted (equivalent new in mysql) , deleted (equivalent old in mysql) tables. so create trigger syntax like: create trigger dbo.table_a_trig on dbo.table_a instead of insert begin /* logi...

.net - How can I force the CredentialCache for a process to clear all entries? -

i have server process who's job monitor various web services. web services hosted on sharepoint farm, , end using ntlm authentication in underlying httpwebrequest methods. all of initial connections work fine, , can see typical challenge/response traffic in fiddler. after while, however, if sharepoint farm servers bounced (while monitoring service stays up) next time application tries connect same web services, http 401 unauthorized responses. this happens once, , if monitoring service connects again, works , connections go through fine. from can tell tracing through, initial connections getting challenged/authorized , ntlm tokens being cached in monitoring process each unique web service url. @ point sharepoint servers bounced, ntlm tokens no longer valid. however, process has hit 1 failure before tokens in cache thrown away, after challenge/response dance happens again , works. so, question this: there way me force ntlm tokens removed cache can avoid 401 unauthor...

c# - Dependency Injection Container -

i have data access layer library make "portable". reason portable because want work sql azure & azure file storage (eg, data + pdf reports) sql server 2008r2 , file system storage on concrete server. based on spec system supposed go live later implementation (sql + file system storage), while upon meeting scalability threshold plan on moving azure. the data access class use implements idataprovider interface (which built) , defines methods data access concrete implementation should have. consuming data access layer done via passing idataprovider interface , calling methods on eg: public interface idataprovider { public bool dosomething(); } public class azuredataprovider : idataprovider { private string connectionstring; public azuredataprovider(string connectionstring) { this.connectionstring = connectionstring; } public azuredataprovider():this( configurationmanager.connectionstring["conn"].connectionstring)...

wordpress - Social network platform or CMS -

i'm looking social network platform each user creating personal news feed following topics. don't know popular platforms such wordpress, livestreet, joomla etc. may allowed me such functionality. you try jomsocial joomla http://www.jomsocial.com/

android - onClickListener couses Crash with TextView -

im trying create simple application no luck want preform action if touches list view if i'm not adding onclicklistener ok java: listview mylistview = (listview)findviewbyid(r.id.listviewoptions); final arraylist<string> optionsarray = new arraylist<string>(); final arrayadapter<string> arrayadapter; arrayadapter = new arrayadapter<string>(this,android.r.layout.simple_list_item_1,optionsarray); for(int =1 ; < 3 ; i++) { optionsarray.add("1"); arrayadapter.notifydatasetchanged(); } mylistview.setadapter(arrayadapter); mylistview.setclickable(true); mylistview.setfocusable(true); onclicklistener onclicklistener = new onclicklistener() { public void onclick(view v) { // todo auto-generated method stub } }; mylistview.setonclicklistener(onclicklistener); xml: <listview android:layout_height="wrap_content" android:layout_width="fill_...

Test for cookies in PHP -

what best way tell if has cookies enabled in browser. tried: <?php setcookie('cookies','yes',time()+7200); if (!isset($_cookie['cookies'])) { echo '<div class="error" style="float:right;">you must enable cookies , javascript use site.</div>'; } else { echo ''; } ?> but displays alert if cookies enabled. want alert if cookies not enabled. the reason code doesn't work because cookies sent request. code you're trying work, setcookie has in different request isset call. try calling redirect in between calling 2 functions.

iphone - Objective-C multithreading, what happens when an object gets dealloc while its methods are being executed? (And how to prevent it?) -

i writing app iphone , arrived @ situation. i have view controller, myviewcontroller, dealloc whenever user taps "back" button on screen. there thread in background communicates remote server , may message method, updateui, method in myviewcontroller. what happen if background thread messages updateui in myviewcontroller, user happened tapped "back" button @ right time such causes myviewcontroller dealloc while updateui still executing? my guess dealloc method run , app might crash if updateui ends using null pointer. assuming case, current solution have is: [self retain]; // updateui code here [self release]; i unsure if best solution, feel common problem when dealing multiple threads. is assumption correct? if so, there better solution? what describing known "race condition." race conditions can difficult identify in testing, track down once reported, , reproduce because execution in debugger can modify how code being executed (...

iphone - MKMapView leaks when removing Annotations or just me? -

i'm getting leaks of annotations. code (stripped down bear minimum) in question is: - (void)updatelocations:(nsarray *)result { [mapview removeannotations:locations]; [locations removeallobjects]; [alllocations removeallobjects]; (nsdictionary *location in result) { locationannotation *annote = [[locationannotation alloc] initwithinfo:location]; [alllocations addobject:annote]; [annote release]; } [self updateannotations]; } - (void)filterlocations { (locationannotation *annote in alllocations) { if (annote.typeflag & filterflags) { [locations addobject:annote]; } } } - (void)updateannotations { [self filterlocations]; [mapview addannotations:locations]; } - (void)updatefilter { [mapview removeannotations:locations]; [locations removeallobjects]; [self updateannotations]; } alllocations array contains annotations (they not on map), , locations array holds locatio...

objective c - iphone: NSMutableURLRequest returns strange characters for MS Word style apostrophe -

we pulling content off our website using xml/nsmutableurlrequest , pulls through "curly" style apostrophe , quotes, ’ rather '. nsmutableurlrequest seems hate these , turns them strange \u00e2\u0080\u0099 string. is there can prevent this? using method, should somehow telling use utf-8? or, missing something? uiapplication* app = [uiapplication sharedapplication]; app.networkactivityindicatorvisible = yes; nsstring *urlstr = [nsstring stringwithformat:@"%@",url]; nsurl *serviceurl = [nsurl urlwithstring:urlstr]; nsmutableurlrequest *servicerequest = [nsmutableurlrequest requestwithurl:serviceurl]; [servicerequest sethttpmethod:@"get"]; nsurlresponse *serviceresponse; nserror *serviceerror; app.networkactivityindicatorvisible = no; return [nsurlconnection sendsynchronousrequest:servicerequest returningresponse:&serviceresponse error:&serviceerror]; nsurlconnection returns nsdata respo...

Determining whether VBA is necessary in Excel, or if a pivot chart/table can suffice -

Image
i wish had more precisely descriptive title question, not knowledgeable excel spreadsheets or vba (i'm java developer, , don't play in microsoft world). i'm trying use excel spreadsheet accomplish something. need determine whether can there pivottable, pivotchart, or other built-in functionality... or whether need go down path of writing custom vba code (or maybe using platform altogether). the purpose of spreadsheet create schedules organization (a toastmasters club). organization has roster of members, meets weekly, , various members assigned various roles in given meeting. my spreadsheet looks this: first tab one column... list of names representing membership roster. second tab each row represents past meeting date. there columns each role, , cells populated served role on date. use data validation have first tab's roster available inside each cell pulldown. third tab (maybe multiple tabs?) here's point of whole thing. each of possib...

sql - Determining what this Delete Statement does -

not sql programmer. looks me looking exch_date today , deleting it. correct? delete dbo.table dateadd(dd, datediff(dd,0,exch_date),0) = dateadd(dd, datediff(dd,0,getdate()),0) one way validate input select statement. identify rows affected. select * db.table dateadd(dd, datediff(dd,0,exch_date), 0) = dateadd(dd, datediff(dd,0,getdate()), 0)

need maven plugin configuration for building aggregate source jar -

i've been fighting while , reading lot of docs pages , other questions still can't work. in ormlite project, have ormlite-core project has core functionality , -jdbc , -android projects (with more planned). each of these sub-projects include core functionality add per-architecture implementations. want release single set of jars both -jdbc , -android versions -- i.e. want copy -core javadocs , sources resulting jars. for javadocs, cake includedependencysources config entry set true. however, i've been fighting while on how source jars released -android package include -core sources. i've tried maven-dependency-plugin copy , unpack dependency sources target/sources see no easy way them included in source jar -- appropriate paths. i've gone on maven-source-plugin , maven-assembly-plugin docs i'm still in dark. if has figured out magic maven fu done, can please share appropriate working pom.xml examples? much. i've reviewed fol...

php - Regex equals condition except for certain condition -

i have written following regex in php use within preg_replace(). /\b\s*(.com|.net|.us|.biz|.org|.info|.xxx|.mx|.ca|.fr|.in|.cn|.hk|.ng|.pr|.ph|.tv|.ru|.ly|.de|.my|.ir)\s*\b/i this regex removes urls string pretty far (though sure can write better one). need able add exclusion though specific domain. pseudo code this: if string contains: .com or .net or. biz etc... , not contain: foo.com execute condition. any idea on how this? just add negative lookahead assertion : /(?<=\s|^)(?!\s*foo\.com)\s*\.(com|net|us|biz|org|info|xxx|mx|ca|fr|in|cn|hk|ng|pr|ph|tv|ru|ly|de|my|ir)\s*\b/im also, remember need escape dot - , can move outside alternation since each of alternatives starts dot.

php mathematical addition of numerical values in 2 associative arrays -

probably simple 1 : i have 2 arrays $array1 = array( 'foo' => 5, 'bar' => 10, 'baz' => 6 ); $array2 = array( 'x' => 100, 'y' => 200, 'baz' => 30 ); i wish third array combining both above, should : $result_array = array( 'foo' => 5, 'bar' => 10, 'baz' => 36, 'x' => 100, 'y' => 200, ); is there built in 'array - way' this, or have write own function ? thanks $resultarray = $array1; foreach($array2 $key => $value) { if (isset($resultarray[$key])) { $resultarray[$key] += $value; } else { $resultarray[$key] = $value; } }

glsl - State-of-the-art GPU volume rendering -

what current technique implementing gpu based volume renderer in medical context, i.e. reasonable amounts of image data (512x512x1500 or more @ 16bit) , interactive/real-time performance optimal image quality? still raycasting approach introduced krüger , westermann (color cube etc.)? or have cuda/opencl changed traditional cg/glsl game? thanks hints, paper references etc.! matthias nothing has changed since then. there different versions of cuda/opencl/directcompute implementations floating around, same thing. here's nice siggraph 2010 course volumetric methods in visual effects summarize common techniques.

Register new file type in Android -

i want write simple stl (geometrical data file) viewer application on android, i'm not able make recognize format system. wrote in app manifest file is: <intent-filter> <action android:name="android.intent.action.view" /> <action android:name="android.intent.action.edit" /> <action android:name="android.intent.action.pick" /> <category android:name="android.intent.category.default" /> <data android:scheme="http" /> <data android:pathpattern=".*\\.stl" /> <data android:mimetype="application/sla" /> <data android:host="*" /> </intent-filter> but @ moment launch browser , go download sample stl file, download interrupted , i'm reported data file type unknown system. have no real android device, use emulator, , development use c# on monodroid (but don't think problem honestly) any ideas on subject? tha...

How to attach EXIF metadata to a serialized Bitmap in Android? -

in android, when decoding bitmap photo on phone, exif data in original gets lost. sending bitmap server via socket , re-attach missing exif data data being sent. i have code loads bitmap object mediastore , compresses byte array in preparation send on socket: bitmap bitmap = ... bytearrayoutputstream stream = new bytearrayoutputstream(bitmap); bitmap.compress(compressformat.jpeg, 70, stream); byte[] input = stream.tobytearray(); i want use exifinterface @ exif metadata in original jpeg on sd card , somehow add outgoing byte array in way i'd able extract jpeg correct exif on server side (hopefully without doing on server). far, managed use exifinterface read exif data: string path = ... //bitmap file path exifinterface exif = new exifinterface(path); ... = exif.getattribute(...) edit: optimally, i'd find solution uses no libraries. if indices of byte array of original jpeg contain exif , prepend/append these bytes byte array produced bitmap.compress(...) best. ...

Confirm jQuery sortable receive event -

i have 2 separate ul lists: list-a , list-b both of them sortable jquery ui plugin. users of project i'm working on wants confirm action when items moved 1 list other, not when moving within same list. when action triggered, page launch ajax request server update positions of list(s). what's troubling me order of events. experience far update event triggered before receive event before confirm dialog shown, request has been initiated. unfortunately forget of lists trigger request in case not matter: if item dragged onto list, nothing should sent server until user has confirmed action. i've used jquery quite bit think use on one. javascript: $('.sortable').sortable({ start: function (event, ui) { $(ui.helper).addclass("sortable-drag-clone"); }, stop: function (event, ui) { $(ui.helper).removeclass("sortable-drag-clone"); }, update: function (event, ui) { if ($(ui.sender).length == 0) ...

cpan - Googling within a Perl script? -

i have string in $var. using perl, how can pass string google , array of google search results? before proceeding, please aware of google terms of service . you agree not access (or attempt access) of services means other through interface provided google, unless have been allowed in separate agreement google. agree not access (or attempt access) of services through automated means (including use of scripts or web crawlers) , shall ensure comply instructions set out in robots.txt file present on services. that being said, there exists official api query web search programmatically. the json/atom custom search api lets develop websites , programs retrieve , display search results google custom search programmatically. api, can use restful requests search results in either json or atom format. you can use xml::atom::client or lwp + json::any or many other libraries perform rest calls. (you may still find references older google web search api it...

repository - Git push origin master ERROR following checklist on github.com new repo -

this first time using git, , not sure going on, , can't find answer resolving problem. i running: git commit -m 'first commit' git remote add origin git@github.com:oldwest/cakephp-tutorials.git git push origin master and everytime run: push origin master, error: permission denied (publickey). fatal: remote end hung unexpectedly. so ran: ssh-keygen -t rsa generate local key. did not resolve it. anyone know why not working? you have upload public key your account on github know it's , not random person. key located in .ssh folder of home directory. see "adding key github account" on this page .

c++ - Iterator for a container of a custom object -

if i've built class want contain inside, example set, how iterate through said set? say std::set<customobject>::iterator i thought that, i'm getting following series of errors... drawing.h:110: error: no match ‘operator=’ in ‘it = ((object*)this)->object::objects. std::vector<_tp, _alloc>::begin [with _tp = object, _alloc = std::allocator<object>]()’ /usr/include/c++/4.2.1/bits/stl_tree.h:225: note: candidates are: std::_rb_tree_const_iterator<object>& std::_rb_tree_const_iterator<object>::operator=(const std::_rb_tree_const_iterator<object>&) drawing.h:110: error: no match ‘operator!=’ in ‘it != ((object*)this)->object::objects. std::vector<_tp, _alloc>::end [with _tp = object, _alloc = std::allocator<object>]()’ /usr/include/c++/4.2.1/bits/stl_tree.h:292: note: candidates are: bool std::_rb_tree_const_iterator<_tp>::operator!=(const std::_rb_tree_const_iterator<_tp>&) const [with _tp = ob...

flex - How do you specify ApplicationDomain.currentDomain when loading via SWFLoader? -

i'm using flex builder 3 build large project. i'm suffering modules stepping on each other , conflict between application/module. structure looks following: main application |--application 2 |--application 3 |--application 3 (application 2 child of main application, while applications 2 , 3 siblings, children of application 2) in reality, it's more complicated that, problems start. in end, have tree 4 or possibly 5 levels deep... if can made work. main application file consists of little more canvas , series of buttons. second application contains vertical tab navigator canvases containers, list , tree view within 2 of tabs. application 3 complicated, event calendar in application 4. long no interaction takes place, loads , appears fine. when looking @ modules 2 , 3, both have comboboxes. first accessed works correctly, second throws errors, take sandbox violations. converted applications 2, 3 , 4 modules , used moduleloader bring them in , spec...

eclipse - How to pass a literal variable reference (${foo}) as program argument in a run configuration -

in eclipse, when specify arguments in run dialog, eclipse interprets ${foo} request use eclipse variable foo . pass string application contains ${foo} eclipse treats undefined variable , gives me error. -dfoo "bar" --pattern "regex magic ${foo}" eclipse not accept single quote (') quoting character, instead becomes part of input. know how can escape ${foo} in dialog interpreted text , not variable reference? you have define variable in eclipse: name = dollar, value = $ (this can done in "run configuration" dialog, when type arguments, click "variables...", , click "edit variables...", , add variable). then, in arguments text-box, type ${dollar}"{foo}"

php - Force SMS messages sent from static email address to use the same number (AT&T example) -

this specific example using at&t carrier of receiver. when sending sms messages clients via carrier email address (1234567890@txt.att.net) static email address, messages arrive on phone number in format of 1 (400) 000-244 . every time new sms message sent, number changes slightly. causes phones, such iphone, threading sms messages coming same source email address. basic research shows has how at&t's gateway handles turning emails sms messages. we've looked @ , decided common short codes (csc) not worth $1000 per month purchase, not option us. does know of way around limitation in possible force sms messages same source email appear way on phone threaded correctly? in our configuration, emails going out via smtp using php pear mail_mime package. we're looking way can on our end without purchase of shared or dedicated csc. for at&t issue they use cluster model send out sms using email gateway. on come problem there might couple of solutions...

Change Google map marker -

how change marker in google map.is possible add our custome image map? thanks, companion it simple - see http://code.google.com/intl/en-us/apis/maps/documentation/javascript/overlays.html#simpleicons example straight google docs var image = 'beachflag.png'; var mylatlng = new google.maps.latlng(-33.890542, 151.274856); var beachmarker = new google.maps.marker({ position: mylatlng, map: map, icon: image }); if want more complex stuff, can extend googles overlay classes , perform custom rendering ...

c# - Using reflection to select some properties -

how select properties of class. let's have class public class baseentity { protected string _createdby; protected datetime _createddate; protected string _updatedby; protected datetime _updateddate; //set } public class user : baseentity { private string _username; private string _password; private employee _employee; //set } i want select username, password, , employee, not createdby, createddate, updatedby, , updateddate. there way this? i've tried searching google, found nothing can hardcode it, this if (!propertyinfo.name.equals("createddate") || !propertyinfo.name.equals("createdby")) { } you should use bindingflags.declaredonly flag in type.getproperties() call, ignore inherited properties.

gcc - Why does make -j perform better when it is passed a number larger than the number of cores available? -

i have quad-core processor hyper-threading . when use make -j8 faster make -j4 (i read number of cores in java , called make -j<number of cores> ). i don't understand why make -j32 faster make -j8 when have (read in java) 8 cores (hyper-threading doubles number of physical cores). how possible? there's more compiling cpu speed , number of cores available: disk bandwidth , memory bandwith matter lot too. in case, imagine each cpu ht sibling getting 4 processes execute. starts one, blocks on disk io , moves onto next process. second 1 tries open second file, blocks on disk io, , sibling moves onto next process. starting 4 compilers before first disk io ready wouldn't surprise me. so when first 1 read in program source, compiler must start hunting through directories find #included files. each 1 requires open() calls followed read() calls, of can block, , of relinquish sibling other processes run. now multiply 8 siblings -- each ht core run unt...

php - How to get the total of a database column -

i have column of data returned database , i'd know how sum entire column. can tell me if there built in function this? 123.00 12.00 1.00 ----- 136.00 < need. please see accompanying post mysql portion of code. how total sum column in mysql can return values in sum() function, if important values , total amount if store in array in php u can use array_sum

c++ - do I need to close a std::fstream? -

possible duplicate: do need manually close ifstream? do need call fstream.close() or fstream proper raii object closes stream on destruction? i have local std::ofstream object inside method. can assume file closed after exiting method without calling close? not find documentation of destructor. i think previous answers misleading. fstream is proper raii object, does close automatically @ end of scope, , there absolutely no need whatsoever call close manually when closing @ end of scope sufficient. in particular, it’s not “best practice” , it’s not necessary flush output. and while drakosha right calling close gives possibility check fail bit of stream, nobody that, anyway. in ideal world, 1 call stream.exception(ios::failbit) beforehand , handle exception thrown in fstream ’s destructor. unfortunately exceptions in destructors broken concept in c++ that’s not idea. so if want check success of closing file, manually (but then).

oop - Is there a way to inherit this javascript pattern? -

i have javascript pattern , i'd inheritance. can tell me how it? var namespace = { app: {} }; namespace.app.main = (function($) { var main = function(options) { var _private; _private = function() { console.log('this private function'); }; return { public: function() { console.log('this public function'); } }; }; return function(options) { return new main(options); }; })(jquery); what i'd have inherits functions object like var obj = new namespace.app.newmain(); obj.public(); thanks advice {jim} you need use prototype of function object in order proper inheritance. function child(){ ... } child.prototype = new namespace.app.newmain(); var inst = new child(); inst.public();

email - How can I create a Outlook mail draft via MAPI from Delphi? -

is there code example available on web helps me getting started mail creation (including recipient list) delphi , outlook? use mailto: has limitation regarding url length, , need way put quite many users on recipient list. (no not spam mail application). can not use smtp because user needs display , edit draft before sending. i have found hints webdav, maybe option (using ms exchange 2008)? take at: http://www.rapware.nl/prod_easymapi_page1.asp?submenu=easymapi . its component, have been using long time great results. supports ms exchange well.

html - Determining what button was clicked on form submit -

i need mage decision im spring mvc3 controller based on button clicked on submit form. have idea how this, im not sure if best way. i use javascript save parameter hidden field , have posted controller on submit , have parameter in formbean. it seems me little cumbersome. there better way? can somehow figure out request button clicked? note dont want use ajax. only submit button used submit form successful control. so check submitted value associated name used submit buttons.

windows - Console-App to get all open files for processes -

i searching console-app (where can pipe output txt-file) gives me list of current processes , files each process has open. tool should work when user doesn't has administrativ-privilegues , should give file-path located on network (unc , absolute/mappings). is there can call tool , information? i on windows system. i have open filename , need whole path file if you're on unix-like system, lsof lists open files.

Identifying a JavaScript error on a list with 700 "entries" -

i'm modifying website don't coded boss ask me do. i see javascript error on firebug says: missing ] after element list in end of file processed php, there 2 lists 771 elements. 1 called list1 , other listaid . first contains names , second ids of list. you can see code: http://pastebin.com/ctji5qx9 how can evaluate error on list? can't see amount of elements , highlight don't shows error... thank in advance! editor highlighting showed strings in list1 aren't escaped. have "junta de compensaciÓ "adoberies-est"" , "junta de compensacion provisional del plan parcial del sector g "can oliveres"" . escape " s , should work.

c++ - Game NPC multi-action lua script design -

i need put scriptable npc in currect game project. project developed in c++ language. using luabind bind lua , c++. i need call npc function when npc clicked or timer activated. stuck between 2 npc script design. using kind of npcname_action differentiate every npc. kind of troublesome give name every different npc. i'm still thinking how implement in project. example: hotelbellboy12_click() { .. } hotelbellboy12_timeraction() { .. } using name of function. every npc have own lua file. i'm thinking load script memory , when needed loaded luastate using lual_loadbuffer example: onclick() { .. } ontimeraction() { .. } which 1 better , why? i've done before , used similar #2 option. when map loads load configuration lua file containing npc data; among name of script file used npc. when need load npc in game compile lua file. npc's can use 'model' npc type dictate of common behavior (for example merchant type or commoner type) ...

java - Advice on creating a screensaver updatable via a CMS -

i've been asked provide screensaver contains content pulled mysql database. having never developed screensaver before, i'm wondering how best go this. screensaver used in office of around 20 machines running windows - going use flash develop screensaver, export .scr format, need dynamic content making me wonder if can better python or java? have experience or advice type of thing? many thanks pyscreensaver (plus maybe turbogears or django managing database on server side, if don't have that, yet)

ec2 ami - If i Stop an Amazon EC2 instance, is this saved? -

if stop ec2 instance, rather terminate, image saved in account , available used @ later stage? ..as noticed terminated instances dissappear, stopped instance available boot , start when ever? also regarding charging, assume cost having stopped instance charged per gb similar custom ami? also possibly simple question, if shutdown machine on ssh or via script, initiate termination or stop instance (i assume terminates instance). thanks if terminate ebs backed instance, remove list of running instance, including it's allocated ebs volume. unless set instance attribute not delete volume. if stop, changed stopped status , can start again later. if shutdown machine, default's stop. read protect instance see: http://alestic.com/2010/01/ec2-instance-locking

javascript - Access a property of a css block from jquery -

i have site heavily based on javascript, still want let modified css. take example... there div has opacity modified when on hover through jquery, designer able choose value of opacity. thinking on creating block in css declare constants, example: .constants_someid{ opacity: 0.5; } and through jquery take opacity var opacity = jquery('css:constants_someid').attr('opacity'); i don't know if way these constants declaration, thats came mind right now. what guys think? thanks, joe define them in javascript file instead: var settings = { opacity: 0.5 }; that kind of syntax should easy enough designer modify. can use settings.opacity . you use $.extend merge settings defined designer default settings: var defaults = { opacity: 0.9, speed: 500 } settings = $.extend({}, defaults, settings); // returns { opacity: 0.5, speed: 500 }

xamarin.ios - Monotouch.Dialog: Backing Field Exclusion -

Image
using amazing monotouch.dialog tool set, how can ensure backing fields not show. when assign [entry] attribute get;set; property, following rendered: [caption("weight")] [entry(placeholder = "kilograms", keyboardtype = uikeyboardtype.phonepad)] public string weight { get; set; } this bug in monotouch.dialog, best option not use properties, , instead use fields directly or alter local copy of monotouch.dialog prevent creating elements if not public (currently uses public , private methods). change line: var members = o.gettype ().getmembers (bindingflags.declaredonly | bindingflags.public | bindingflags.nonpublic | bindingflags.instance); with: var members = o.gettype ().getmembers (bindingflags.declaredonly | bindingflags.public | bindingflags.instance);

java - how to get the object inside an object? -

i trying use thread can tell me wrong in following code. getting nullpointerexception in main. public class threadtest implements runnable { thread t; public threadtest(string name) { thread t = new thread(name); } public void run() { for(int = 0; <= 10; i++) { try { thread.sleep(1000); } catch(exception e) { system.out.println(e); } } } public static void main(string args[]) { threadtest ob = new threadtest("satheesh"); ob.t.start(); } } in constructor declare local variable called t uses same name field t . replace thread t this.t or simple t there: public threadtest(string name) { this.t=new thread(name); } btw1, it's highly recommended start class names capital letters, i.e. threadtest in case better name. btw2, decent ide spot mistake , drew attention this.

javamail - Postfix mail server and thousands of users? -

greetings have postfix mail server contains many domains , each domain contains many users (each user has mailbox) and want handle when email comes mailbox of user in domains java code. any ideas how done ? if users have 'real' system account, can put .forward home directory looks like "|/path/to/your/mail/handling/program" which automatically pipe email program when it's received. otherwise tweak local delivery agent you.

I cannot initialize class in python -

i have class flight, , i'm trying initialize it, have syntax error in print x=flight(flightfrominput='nebrasca') this content of example file class flight: flightfrom = none flightto = none departuredate = none arrivaldate=none airline=none serviceclass=none departureairport = none arrivalairport=none #---------------------------------------------------------------------- def __init__(self,flightfrominput): self.flightfrom = flightfrominput print x=flight(flightfrominput='nebrasca') what wrong code? you should write x = flight(flightfrominput='nebrasca') print x

c++ - which one faster concurrent_queue<> vs mutex-ed queue<> during iteration -

suppose want iterate item in queue implemented using concurrent_queue<> , std:queue<> . since on concurrent_queue<> there no iterator, can think need try_pop() , push() until pop-ed , re-push-ed items in concurrent_queue<> . which 1 more efficient in multithreaded condition?, doing that, or use iterator of queue<> , lock using critical section or other mutex. i know test , benchmark answer question, need know reason why 1 should faster other. if you're in multithreaded environment , push/pop queue check it, won't other threads see imprecise data if context-switch between pop , push operation? , thread might push object off, first thread miss it... etc. it's complicated, fraught race conditions. you'd have lock on queue iteration guarantee data accuracy. at point, question becomes: faster lock on queue , use iterator, or lock on queue , repeatedly pop/push? think can guess better option here :-)

sql server 2005 - A long stored procedure stops returning results after some execs, why? -

hi i've long stored procedure used populate gridview in asp.net(c#) application , console application(c#). every time run sp on management studio works fine. days sp stops returning values applications (but @ same time works fine when executed management studio). why or how can happen? (i'm using ms sql 2005 , win server 2003) thanks you haven't given detail guess getting timeout errors , have parameter sniffing issue (running fine in ssms not applications bit of give away this.) next time issue arises such doesn't work application works fine ssms use following query retrieve both plans , compare. use yourdatabase; select * sys.dm_exec_cached_plans cross apply sys.dm_exec_sql_text(plan_handle) cross apply sys.dm_exec_query_plan(plan_handle) cross apply sys.dm_exec_plan_attributes(plan_handle) epa sys.dm_exec_sql_text.objectid=object_id('yourprocname') , attribute='set_options'

c# - How to print Serial port incomming data to lable -

private void clibutton_click(object sender, eventargs e) { sp = new serialport(); sp.portname = "com14"; sp.baudrate = 19200; sp.parity = parity.none; sp.databits = 8; sp.stopbits = stopbits.one; sp.handshake = handshake.requesttosend; sp.dtrenable = true; sp.rtsenable = true; sp.open(); if (!sp.isopen) { messagebox.show("serial port not opened"); return; } sp.writeline("at" + environment.newline); sp.writeline("at+clip=1" + environment.newline); byte [] data= new byte [sp.bytestoread]; sp.read(data, 0, data.length); } here code. use communicate mobile phone through serial port. here im sending @ command (at+clip=1 command use take cli of incomming call) serialport. read data of serial port. problem how can print readed data in label. bytestoread going 0 when...

asp.net - How to Apply Databind For Instant Update -

how apply databind, recent updated value displyed instantly, press update button ? dim cmd new data.sqlclient.sqlcommand dim con new data.sqlclient.sqlconnection(constr) try dim strsql string = "update a1_admins set imageurl = '" _ & "~/admin/image/" & filename & "' employeeid =" _ & label1.text '------------" con.open() cmd.connection = con cmd.commandtext = strsql cmd.executenonquery() catch ex exception response.write(ex.message) cmd.dispose() con.dispose() end try just re-databind control. if post databinding code can provide better answer.