Posts

Showing posts from January, 2013

java - Eclipse product issue with Juno - Require-Bundle: org.eclipse.e4.core.services -

we using swt eclipse based app on eclipse indigo 3.x version. plan migrate eclipse juno whcih 4.x. followed instructions here - http://www.vogella.com/tutorials/eclipse4migrationguide/article.html after resolving few issues stuck @ following exc.: org.osgi.framework.bundleexception: bundle "org.eclipse.ui.workbench_3.103.0.v20120530-1824 [279]" not resolved. reason: missing constraint: require-bundle: org.eclipse.e4.core.services; bundle-version="1.0.0" @ org.eclipse.osgi.framework.internal.core.abstractbundle.getresolvererror(abstractbundle.java:1332) @ org.eclipse.osgi.framework.internal.core.abstractbundle.getresolutionfailureexception(abstractbundle.java:1316) ...... ...... org.eclipse.osgi.framework.eventmgr.eventmanager.dispatchevent(eventmanager.java:230) @ org.eclipse.osgi.framework.eventmgr.eventmanager$eventthread.run(eventmanager.java:340) !entry org.eclipse.ui.forms 4 0 2014-06-25 18:38:38.526 !message frameworkevent error !s

which open source projects used Mylyn plugin? -

i know using mylyn plug-in can track developer's interaction different parts of source code. in eclipse bug tracking system (bugzilla) of issues there attachment file called mylyn-context.zip includes interaction history collected mylyn specific bug. i'm wondering there other open source projects use mylyn , developers attached same file (mylyn-context.zip) project's issue tracking system? up till i've never seen attached mylyn-context.zip / issue. when @ projects @ github, can connect mylyn issues on github. when commiting in git , starting #issue-id (like #4 ) , additional message. easy see files relevant issue, appear comments under issue. most scm systems have support showing files effected issue, if issue-id part of commit message. (mostly 1 need start issue-id in commit message).

Regex not within <script> tags -

Image
this question has answer here: regular expression pattern not matching anywhere in string 8 answers need regex. i'd match within given string of html matches pattern \*[a-z0-9\_]+\* not fall in between <script> start , end tags. know has lookarounds, haven't clue how there. using regex lookaround. can use: (?!<script>)\*[a-z0-9\_]+\*(?!</script>) that match regex if not preceded , postceded script

jquery - Incrementing in JavaScript -

i'm trying create sliding sidebar , wondering if there better way doing already. <img id = "menuicon" src = "menuicon.png" alt = "menu icon" onclick = "slidesidebar()" /> at moment check if sideslidecount - if sidebar must not out, when function called slides out; if sideslidecount odd (i.e. % 2 != 0) sidebar should slide out of view. var sideslidecount = 0; // variable used side bar var bodyheight = $(window).height(); var bodywidth = $(window).width(); console.log(bodywidth); function slidesidebar() { if (sideslidecount % 2 == 0) { // if sideslidecount even, i.e. side bar hidden $("#sidebar").animate({width: bodywidth / 6}, 600); // slide bar out 300 width, 0.6 seconds $("#sidelinks").fadeto(1000, 0.8); // fade links view, 1 second, 100% opacity } else { // else, if side bar in view $("#sidebar").fadein(300).animate({width: 0}, 600); // slide bar out of v

=> in Google Python Example -

so i'm new python , trying work through google python online class [ https://developers.google.com/edu/python/regular-expressions] i running python 2.7.5 , when try example has issues =>. i've tried searching google explanations, have come empty. appreciated. error message below. sandbox$./re-test.py file "./re-test.py", line 8 match = re.search(r'iii', 'piiig') => found, match.group() == "iii" ^ code program : #!/usr/bin/python import re ## search pattern 'iii' in string 'piiig'. ## of pattern must match, may appear anywhere. ## on success, match.group() matched text. match = re.search(r'iii', 'piiig') => found, match.group() == "iii" match = re.search(r'igs', 'piiig') => not found, match == none ## . = char \n match = re.search(r'..g', 'piiig') => found, match.group() == "iig&qu

profiling - Is there a good line profiler for ruby? -

i need process time each line in ruby script, couldn't find suitable gem. i use line_profiler in python , it's useful. i try rblineprof , ruby-prof .

android - Using RunOnUI to pass data from a Service to an Activity -

need bit of here, trying create service uses microphone listen peaks in audio frequency. service should run in background , update ui frequency information when there peak. app launches , fc's due seems running out of memory. i've tried debugging , following threads new @ , can't seem decipher doing wrong. here activity: public class rtaactivity extends activity { private static final string tag = "rtatest"; private intent intent; @override public void oncreate(bundle savedinstancestate){ super.oncreate(savedinstancestate); setcontentview(r.layout.rta_view); intent = new intent(this, analyzeservice.class); } private broadcastreceiver broadcastreceiver = new broadcastreceiver() { @override public void onreceive(context context, intent intent) { android.os.debug.waitfordebugger(); // check logcat updateui(intent); } }; @override publ

java - How to cascade the update of @Version when you update its children? -

problem: i have parent class @version on attribute "lastupdate" concurrency checking. parent class has @onetomany relationship , when update children update field "lastupdate" such happens when update other fields. in jpa there @optmisticlocking(cascade = true) operation, couldn't find similar option ebean orm in play2. important : there no cascadetype between classes. code: @entity public class child extends model { @manytoone() @joincolumn(name="parent_id") public parent parent; } @entity public class parent extends model { @version public date lastupdate; @onetomany(mappedby = "parent") public list<child> children = new arraylist<child>(); } public class application extends controller { public void updatechild(parent p, child c) { ... c.save(); // or c.update() p.children.set(c); // imagine real code here updating, adding or removing child. p.update(); return; } }

jquery - Adding logic on the Cancel/Ok modal popup window click,Foundation 5 Modal -

i trying figure out silly thing work couple of hours,but doesnt seem working.i got foundation 5 modal alert window working javascript.i have prevent delete operation if user clicks on cancel button(on alert) , delete if click on ok or cross(x) icon right. here mark , javascript that <div class="reveal-modal small" id="firstmodal" data-reveal> <p>are sure?</p> <a href="#" class="close-reveal-modal" id="alert-close">&times;</a> <a href="#" class="button alert" id="alert-cancel">cancel</a> <a href="#" class="button alert" id="alert-ok">ok</a> </div> and javascript $('#firstmodal').foundation('reveal', 'open'); i tried adding callback after 'open' doesnt seem working.also tried catching cancel/ok buttons click event using jquery

How do you convert opengl texture back to bitmap in android? -

i wanted apply image-filter image , used android helloeffects sample it converts image data bitmap texture. after applying image filter effect, i'd image in jpeg format, don't know how that. i did in 1 way , i converted texture image bitmap using glreadpixles() method i saved bitmap sd card texture bitmap code public static bitmap savepixels(int x, int y, int w, int h){ int b[]=new int[w*(y+h)]; int bt[]=new int[w*h]; intbuffer ib = intbuffer.wrap(b); ib.position(0); gles20.glreadpixels(0, 0, w, h, gles20.gl_rgba, gles20.gl_unsigned_byte, ib); for(int i=0, k=0; i<h; i++, k++) {//remember, opengl bitmap incompatible android bitmap //and so, correction need. for(int j=0; j<w; j++) { int pix=b[i*w+j]; int pb=(pix>>16)&0xff; int pr=(pix<<16)&0x00ff0000; int pix1=(pix&0xff00ff00) | pr | pb; bt[(h-k-1)*w+j]=pix1;

objective c - javascript inject in uiwebview of iOS 8 -

i testing project in ios 8 preview 2. , faces 2 problems uiwebview use following code inject script nsstring *jsclose_window = @"function close_window(){ document.location ='myschema://function=close_window'; }"; [self.webview stringbyevaluatingjavascriptfromstring:jsclose_window]; in "-(void)webviewdidfinishload:(uiwebview *)webview" , response in - (bool)webview:(uiwebview *)webview shouldstartloadwithrequest:(nsurlrequest *)request navigationtype:(uiwebviewnavigationtype)navigationtype it works fine in ios 7.1 , earlier. in ios 8 preview 2 1.document.location = 'myschema://function=close_window'; seems not working anymore? can't response in "shouldstartloadwithrequest" 2.in ios 7.1 , earlier every time page redirect another (ex:page1.html -> page2.html -> page3.html) "webviewdidfinishload" triggered in every page. but, in ios 8 preview 2 triggered once in first page how fix these?, or new li

Splitting string by two conditions in vb.net 2014 -

i'm trying split string list of strings vb.net code, while adding dictionary of string: objevt.wbstr.add(b, objevt.metalbelowwidth.item(b).split({",","-"}).tolist) but error saying "value of '1-dimentitional arrary of string' cannot converted 'char' " if try implement splitting comma, works fine. following code works. objevt.wbstr.add(b, objevt.metalbelowwidth.item(b).split(",").tolist) but want split string 2 conditions. appreciated. thanks! one of overloads of split method takes string array needs have stringsplitoption parameter set. objevt.wbstr.add(b, objevt.metalbelowwidth.item(b).split(new string() {",", "-"}, stringsplitoptions.none).tolist) sub main() dim mystring string = "h,c,j-hello-world" dim mylist list(of string) = new list(of string) mylist = mystring.split(new string() {"-", ","}, stringsplitoptions.none).tolist

What does this debug log of Storm mean? -

i learned storm, , tested wordcount example code here . uses setdebug(true) enable debug logging. confused these debug information: 13867 [storm.starter.wordcounttopology.main()] info backtype.storm.daemon.nimbus - setting new assignment topology id word-count-1-1403745226: #backtype.storm.daemon.common.assignment{:master-code-dir "/tmp/4ef1358b-92ce-4051-a4ce- b33a25ace66d/nimbus/stormdist/word-count-1-1403745226", :node->host {"47fdd74b-65e0-4650- a000-f1f0418dd7c7" "ms-virtualbox"}, :executor->node+port {[2 2] ["47fdd74b-65e0-4650-a000- f1f0418dd7c7" 1027], [3 3] ["47fdd74b-65e0-4650-a000-f1f0418dd7c7" 1027], [4 4] ["47fdd74b- 65e0-4650-a000-f1f0418dd7c7" 1027], [5 5] ["47fdd74b-65e0-4650-a000-f1f0418dd7c7" 1027], [6 6] ["47fdd74b-65e0-4650-a000-f1f0418dd7c7" 1027], [7 7] ["47fdd74b-65e0-4650-a000- f1f0418dd7c7" 1027], [8 8] ["47fdd74b-65e0-4650-a000-f1f0418dd7c7" 102

java - How to display lat/long markers on google map v2 android -

i'm working on android app web services, using external database. app consists of several tasks , each task assigned each camera id. each camera have specific long/lat stored in database. right when select specific task, there guide button showing user current location marker in google map. want display long/lat of task marker on google map, there 2 marker. need android coding. appreciated! googlemapactivity.java public class googlemapactivity extends activity implements locationlistener { googlemap map; private string cameraid; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_google_map); locationmanager lm = (locationmanager) getsystemservice(context.location_service); lm.requestlocationupdates(locationmanager.network_provider, 0, 0, this); map = ((mapfragment) getfragmentmanager().findfragmentbyid(r.id.map)) .getmap(); } @override public void onlocationchan

Ruby on Rails Best Practices For Third Party Integration Code Placement -

i've looked @ other postings , blog postings on it's best place third party integration code naturally, there's plethora of opinions , answers hoping more definitive answer scenario. here's quick breakdown of user story: when user on profile page, have ability ask refresh of twitter , / or facebook info. models: class user < activerecord::base has_one :twitter_account has_one :facebook_account end class twitteraccount < activerecord::base belongs_to :user end class facebookaccount < activerecord::base belongs_to :user end what i'm looking for: when user wants update twitter account info, want able call method returns me fetched account info. somewhere handles auth, fetching, posting, , parsing of json response. want keep logic outside of model because it's going cluttered , methods behave little outside of norm mvc of app. the current implementation i've been going making separate classes in /lib each integration entitie

javascript - Onblur returns wrong data -

my form check not work. if leave alias field empty returns name field filled. var alias = document.getelementbyid("alias"); var name = document.getelementbyid("name"); var status = ''; function checkit() { if (alias.value != '') { document.getelementbyid("alias").style.bordercolor = "#3c763d"; return true; } else { document.getelementbyid("alias").style.bordercolor = "#a94442"; status = false; } if (name.value != '') { document.getelementbyid("name").style.bordercolor = "#3c763d"; return true; } else { document.getelementbyid("name").style.bordercolor = "#a94442"; status = false; } } name.onblur=checkit; alias.onblur=checkit; try this, should use current object this instead of global variable when eventing firing var alias = document.getelementbyid("ali

ruby on rails - Check if voted for scope - acts as votable -

the acts_as_votable gem allows check if user voted votable model. https://github.com/ryanto/acts_as_votable user.voted_on?(@votable) the gem allows cast votes using scope user.vote(@votable), vote_scope: 'funny' user.vote(@votable), vote_scope: 'useful' i wondering how check if user voted on object, in specific scope. i imagine code like user.voted_on? @votable, vote_scope: 'funny' is possible gem? yes, example syntax correct: user.voted_on? @votable, vote_scope: 'funny' the voted_on? , voted_for? methods accept :vote_scope option.

java - Minimal Hibernate 4 XML configuration with Spring 3 for annotation based transaction management and object mapping? -

assuming i've got working spring project minimal amount of configuration needed add in hibernate 4 spring 3 xml configuration? want use annotation based transaction management , have objects mapped using annotations. note: self-answer q&a style question intended give canonical answer common problem. intend expand question on time keep date hibernate. i find using hibernate spring's xml config intuitive, if you've never added project before, can pain working correctly. using spring's xml config preferred option hibernate 4. so you've set spring project , got working. want add hibernate. i configure hibernate in separate xml file called database-servlet.xml inside web-inf directory, name doesn't matter long on classpath. my new database-servlet.xml looks this: <?xml version="1.0" encoding="utf-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/xm

javascript - opencart contact page captcha is not comming -

i facing problem captcha not coming on contact page. please have look. http://www.lewevaaboutique.com/store/index.php?route=information/contact then set on local host , did modification according thread opencart, oc 1.5.1.3, captcha error , started working on local then did same thing on server captcha problem still there please me in issue "headers sent" means php script sent http headers, , such can't make modifications them now. check 2 things 1) check don't send content before calling session_start. 2) <?php first character not tab or space

javascript - Find Single Quote in Array (JS, jQuery or PHP) -

first, sorry bad english ;) i have array this: ["47'", "", "messi", "l."] (output .split(" ")) sometime its: ["messi", "l.", "", "47'"] now need find time (by '), name , lastname have no idea how time (once position of time know position of other). programming skills not best, use code snippets found , try understand , learn them. for better understanding: loop on this <tr class="score_row"> <td class="home">47' <span class="slball"></span>messi l.</td> <td class="away">ronaldo c.<span="yellowcard"></span> 68'</td> </tr> <tr class="score_row"> ... </tr> and want put in json array {"lastname":"messi","name":"l.","time":"47","type":"slball"

javascript - TimeEntry Js function not working for Dynamically added textboxes -

<td style='vertical-align: middle;'><input name='drivetimedayslots[" + index + "].starttime' class='smalltxtentry0 drivetimedayslot hastimeentry' id='drivetimedayslots_" + index + "_starttime' type='text' value='' onchange='drivetimedayslotvalueonchnge(this)' data-timeentry='show24hours: true, showseconds: true, defaulttime: 00:00:00'/></td>" + "<td style='vertical-align: middle;'><input name='drivetimedayslots[" + index + "].endtime' class='smalltxtentry0 drivetimedayslot hastimeentry' id='drivetimedayslots_" + index + "_endtime' type='text' value='' onchange='drivetimedayslotvalueonchnge(this)' data-timeentry='show24hours: true, showseconds: true, defaulttime:00:00:00'/></td>" + "<td style='vertical-align: middle;'&

javascript - KnockoutJs Visible doesn't work -

i want <td> visible or invisible depending on boolean value in javascript. my html is: <!-- ... --> <tbody data-bind="foreach: entries"> <tr> <td data-bind="visible: editable()"> <a href="#" data-bind="click: $root.removeentry">remove</a> </td> </tr> </tbody> <!-- ... --> and javascript this: //... function tableentryviewmodel(){ editable: ko.observable(false); //... } when loads data loads first entry , stops. here's error get. uncaught typeerror: unable process binding "visible: function (){return editable() }" message: string not function this isn't exact replica of programm, if make work i'm sure you'll me lot: http://jsfiddle.net/cupplekay/s6hwa/ ok, can see example you're trying do. i've posted modified version here: http://jsfiddle.net/s6hwa/2/ javascript: f

c# - String format to convert datetime causes an error -

i try convert persiandate standard date .so persian date has these formats (it means user can enter these formats : 1392/1/1 1392/01/01 1392/01/1 1392/1/01 so write function convert persian date standard date : public datetime convertpeersiantoenglish(string persiandate) { string[] formats = { "yyyy/mm/dd" }; datetime d1 = datetime.parseexact(persiandate, formats, cultureinfo.currentculture, datetimestyles.none); persiancalendar persian_date = new persiancalendar(); datetime dt = persian_date.todatetime(d1.year, d1.month, d1.day, 0, 0, 0, 0, 0); return dt; } but these function can handle formats 1392/01/01 , of users enter other formats got error: string not recognized valid datetime best regards you're specifying mm , dd in format, require 2 digits. specify "yyyy/m/d" format - should handle both 1 , 2-digit da

ios - Get Access to Embed tabBarController in App Delegate -

Image
i facing problem can access embed tabbarcontroller , set index2 i have tried following code won't work , goes first index: uistoryboard *secondstoryboard = [uistoryboard storyboardwithname:@"mainfunction" bundle:nil]; myviewcontroller *theinitialviewcontroller = [secondstoryboard instantiateinitialviewcontroller]; self.window = [[uiwindow alloc] initwithframe:[[uiscreen mainscreen] bounds]]; self.window.rootviewcontroller = theinitialviewcontroller; [self.window.rootviewcontroller.tabbarcontroller setselectedindex:2];/ [self.window.rootviewcontroller.navigationcontroller.tabbarcontroller setselectedindex:2]; [self.window makekeyandvisible]; it can't change second tab using above code. can give me advice? thank . the viewcontroller getting story board tab bar controller. uistoryboard *secondstoryboard = [uistoryboard storyboardwithname:@"mainfunction" bundle:nil]; uitabbarviewcontroller *theinitialviewc

jquery - Replacing Image Source Value With a PHP Variable Based on Device Width -

i'd able able swap img's src value variable created in php. i using javascript determine device width. happening within .php file containing wordpress loop. upon recognizing device width, change img's src value accordingly. i can retrieve php variables using js function when function written in loop, , know, duplicate function each post , resulting in error. i need able calculate these given php variables outside loop , inject them img src value inside loop. i recognize may have more errors in code looking resolve! have been working on time , particular issue has become quite troubling. in advance. current code in use: <?php query_posts( array ( 'home' => 'wordpress themes', 'orderby' => 'rand', 'posts_per_page' => -1 ) ); ?> <?php while ( have_posts() ) : the_post(); ?> <script> function getimagepath(){ if (window.matchmedia('(max-device-width: 1920px)').matches) {

neo4j - creating multiple labels with csv -

i trying load csv file create nodes , labels. there way add more 1 label @ same time? (i using neo4j 2.1.1) this csv: 1,test1,hardkey,button 2,test2,touch,button 3,test3,,screen i tried this: load csv 'file:/users/claudia/documents/nodes.csv' csvline foreach (n in (case when csvline[2]='hardkey' [1] else[] end) | merge (p:hardkey {name: csvline[1]}) ) foreach (n in (case when csvline[2]='touch' [1] else[] end) | merge (p:touch {name: csvline[1]}) ) this works, how other column ("button" , "screen") included? thanks lot. like this? see merge documentation. load csv 'file:/users/claudia/documents/nodes.csv' csvline foreach (n in (case when csvline[2]='hardkey' [1] else[] end) | merge (p:hardkey {name: csvline[1]}) on create set p.what = csvline[3] ) foreach (n in (case when csvline[2]='touch' [1] else[] end) | merge (p:touch {name: csvline[1]}) on create set p.what = csvline[

ng-resource in Rails. AngularJS + Rails tutorial -

i'm trying use ng-resource show index of book titles. ch.11 of angularails, far has been tough. i know problem has trying to use resource in coffeescript controller, because when $http "get" request specific url, things work fine. here parts of code this: 1.javscripts/application.js // manifest file that'll compiled application.js, include files // listed below. // // javascript/coffee file within directory, lib/assets/javascripts, vendor/assets/javascripts, // or vendor/assets/javascripts of plugins, if any, can referenced here using relative path. // // it's not advisable add code directly here, if do, it'll appear @ bottom of // compiled file. // // read sprockets readme (https://github.com/sstephenson/sprockets#sprockets-directives) details // supported directives. // //= require jquery //= require jquery_ujs //= require bootstrap.min //= require angular.min //= require angular-resource //= require angular-application 2 serializer: class b