Posts

Showing posts from February, 2010

cronexpression - Cron Expression that includes from and to time -

i have difficulty writing cron expression schedule events mon-saturday every 15 minutes 4:30 8:30 am. thanks. it take 3 separate quartz cron expressions define times want them. 0 30 4,5,6,7,8 ? * mon,tue,wed,thu,fri,sat * 0 45 4,5,6,7 ? * mon,tue,wed,thu,fri,sat * 0 0,15 5,6,7,8 ? * mon,tue,wed,thu,fri,sat * edited add: quartz cron expression gets 4 8:45 am, fvu's answer does. 0 0/15 4-8 ? * mon,tue,wed,thu,fri,sat *

c# - Add a method to a custom control that I can access from the client with javascript -

i have asp.net custom control extends dropdownlist. want add method can call javascript client clears user selection , resets list default. far have been unable right. code below returns , exception, 0x800a01b6 - javascript runtime error: object doesn't support property or method 'clearselection' . in asp.net control have: public void clearselection() { //... code reset list } and in aspx page have javascript attempts invoke method. var control = $("body").find('<%=uxbillto.clientid %>'); if (control != null) { control.clearselection(); }

python - Re.match does not restrict urls -

i school urls in table on wiki page lead page information. bad urls colored red contain phrase 'page not exist' in side 'title' attr. trying use re.match() filter urls such return not contain aforementioned string. why isn't re.match() working? url: districts_page = 'https://en.wikipedia.org/wiki/list_of_school_districts_in_alabama' function: def url_check(url): all_urls = [] r = requests.get(url, proxies = proxies) html_source = r.text soup = beautifulsoup(html_source) link in soup.find_all('a'): if type(link.get('title')) == str: if re.match(link.get('title'), '(page not exist)') == none: all_urls.append(link.get('href')) else: pass return this not address fixing problem re.match , may valid approach without using regex: link in soup.find_all('a'): title = link.get('title') if title:

Adding variables in Stata and then dividing by a number is giving unexpected results -

i trying calculate z-scores creating variable d 3 other variables, namely a, b, , c. trying generate d : d= (a-b)/c reason when it, produces large numbers. when did (a-b) did not should have when calculated hand, instead of -2, -105.66. variable 'long' , variable b 'float', not sure if reason? stata syntax is: gen zscore= (height-avheight)/meansd did not work. you confusing scalars , variables. here's solution (chop off first 4 lines , replace x height fit calculation code): // example data clear set obs 50 gen x = runiform() // summarize qui su x // store scalars sca de mu = r(mean) sca de sd = r(sd) // z-score gen zx = (x - mu) / sd su zx x , z-score zx variables take many values, whereas mu , sd constants. might code constants in stata using scalars or macros.

Android image displaying differently despite same pixel density -

i have 2 different png's both 48px x 48px. however, when assign both imageview, 1 of images displays larger other. code have follows: switch (id) { case 0: iconid = r.drawable.ic_launcher; break; case 1: iconid = r.drawable.gmail; break; } the above image displayed in following imageview: <imageview android:id="@+id/statusicon" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentleft="true"/> the launcher icon 1.5x bigger gmail in listview though exact same pixel size. going on? sometimes android try scale pictures on fly. try putting them in raw res folder , if system trying scale things should fix it.

Value is not passed on javascript code in django -

i new django , javascript both. , using highcharts displaying charts. problem @ template file. visualise.html contains <script type="text/javascript"> var yname_agewise_total_call_duration = {{ yname.agewise_total_call_duration|safe }}; var yname_agewise_weekly_total_call_duration = {{ yname.agewise_weekly_total_call_duration|safe }}; </script> i tested value of yname.agewise_total_call_duration , yname.agewise_weekly_total_call_duration in html file shows well. when want use value yname_agewise_total_call_duration , yname_agewise_weekly_total_call_duration in javascript file charts.js cannot show values. tried in charts.js as alert(yname_agewise_total_call_duration); the popup displays undefined. what problem here ? how solve ? in javascript, undefined means variable has been declared has not yet been assigned value. check on browser console whether yname_agewise_total_call_duration holds data or not

scripting - PHP Singleton or static cross-scripts -

so have classes need initialized once fill them data. want access them seperately ajax without having them initialized again. read singleton in php, wonder if it's possible have same instance of class in multiple scripts, can called seperatedly. example: <?php class example { private $instance; private $a; public function __construct() {} public function __clone() {} public function singleton() { if (self::$instance === null) { self::$instance = new example; return self::$instance; } public function seta($val) { $this->a = $val; } public function geta() { return $this->a; } } ?> script_a.php: <?php include_once('example.class.php'); example::singleton()->seta(10); ?> script_b.php: <?php include_once('example.class.php'); echo example::singleton()->geta(); // output 10? ?> i read static functions deleted memory @ end of script execution,

javascript - What's a good way to circumvent the mobile web's broken video implementation? -

i'm wondering if there solutions circumventing problems mobile browsers hi-jacking native video implementations on web. specifically, i'm looking able autoplay , loop video. i've looked @ multiple javascript video decoders which, essentially, decode video, on fly, , push frames canvas element. these solutions, unfortunately, aren't performant on mobile (but work on desktop quite well). animated gifs not viable solutions image quality poor , i'd maintain relatively small file size . i'm exporting videos webm , use (or video format), if possible, open javascript apng or animated webp decoder, if 1 out there. again, solution needs performant on mobile web browsers , have ability autoplay , loop. appreciate ideas, thoughts, libraries or resources may know of. cheers!

jquery - Animate addClass + removeClass transitions? -

say have 2 boxes, 1 positioned in top left hand corner of screen using class: .position1 { position: fixed; top: 100px; left: 100px; } and positioned in bottom right using class: .position2 { position: fixed; bottom: 100px; right: 100px; } is there simple way, using jquery or otherwise, to: slide (animate) box in upper left position of bottom right one slide (animate) box in bottom right position of top left one i can achieve without using animation simple doing .addclass() , .removeclass() ... need animations imitate boxes "switching places" each other rather instantaneously swapping sides. i've looked @ jquery animate feature doesn't appear, unless i'm mistaken, can apply pre-defined class (and remove pre-defined class) option of animate function. look here: jquery.animate() css class only, without explicit styles or here: http://api.jqueryui.com/switchclass/

php - Joomla form variable handling -

i have situation need create shortcut specific filter in joomla component. the problem cannot unset it, not know if joomla sets form fields own session handler, request handler or kind of custom handler. there not appear documentation on specific case. the full situation have link auto filter in same view link (in components sidebar). 1 view specific filter , other standard. need when click filtered view reset current filters make sure displays should, , vice-versa clicking again reset filters. i have tried number of approaches this, , although can consistently force filter not reset form when re-enter last page technique have tried far , of course want avoid bypassing joomla's default functions. if(jrequest::getvar('filter_group_id',false)==10){ jrequest::setvar('last_filter',true); ethicstoolhelper::addsubmenu('supervisors'); }else{ if(jrequest::getvar('last_filter',false)===true){ jrequest::setvar('last_filter&#

c# - StructureMap Could not load file or assembly -

i'm using structuremap mvc on webapi project. when run unit tests or integration tests, xunit , resharper i'm getting: system.io.filenotfoundexception not load file or assembly 'myapi.myservices, version=1.0.0.0, culture=neutral, publickeytoken=null' or 1 of dependencies. system cannot find path specified. this occurs randomly on tests. when try run again don't error. here error occurs: objectfactory.initialize(x => { x.for<iprovider>().lifecycleis(lifecycles.getlifecycle(instancescope.perrequest)).use<sqliteprovider>(); x.for<ilog>().lifecycleis(lifecycles.getlifecycle(instancescope.singleton)).use(logger.object); x.for<isession>().lifecycleis(lifecycles.getlifecycle(instancescope.perrequest)).use(() => session); }); the stacktrace isn't helpful: @ structuremap.objectfactory.initialize(action`1 action) in c:\buildagent\work\767273992e840853\src\structuremap\objectfactory.cs: line 61 are us

php - codeigniter join changing id from one table's id to another -

i have code active record query in codeigniter: $this->db->join('user', 'user.id = purchase_req.owner_id', 'inner'); $this->db->where('user.employer_id', $user->employer_id); $purchase_req = $this->purchase_req->find(); in view without join statement, $purchase_req->id return actual purchase request id. in view join, $purchase_req->id returns user id. how can join tables together, , still purchase request id, instead of changing user.id? the id want achieve ambiguous mysql because both tables have id columns therefore when tries access $purchase_req->id return last id column purchase_req table need assingn unique aliases same columns in joined table like $this->db->select('`user`.*,`purchase_req`.*,`user`.id user_id') $this->db->join('user', 'user.id = purchase_req.owner_id', 'inner'); $this->db->where('user.employer_id', $user->employer_id);

asp.net mvc - How to remove Roles -

i added these roles in code. if (!roles.roleexists("administrators")) roles.createrole("administrators"); //create intern roles if don't exist if (!roles.roleexists("intern")) roles.createrole("intern"); everything works fine app in iis. however, want remove both of these roles. there way remove them? i tried recycle web app in iis, didn't seem work. where roles stored when first created? curious. please advise. thanks this has been answered here roles.removeuserfromroles

sql - Sorting an Oracle table inside a stored procedure -

i have stored procedure running .sql file takes in inputs users , runs procedure. procedure runs many queries , inserts row of values table. in .sql file have order table column after finish running queries. have: declare nameparam varchar2(200); versionparam varchar2(200); startdate date; enddate date; begin nameparam := '&1'; versionparam := '&2'; startdate := '&3'; enddate := '&4'; procedure(nameparam, versionparam, startdate, enddate); commit; select * table_name order column_name asc; exception when others raise_application_error(-20101,sqlerrm); end; / however throws error: pls-00428: clause expected in select statement i dont know why needs clause. help? edit: clarify don't want see output of sorted table table updated , sorted column in ascending order. if put select statement in pl/sql block, need results. if you're expecting 1 row, you'd select into local variable.

javascript - Trying to turn fluid width div into 100% wide modal -

you can see example of i've got here . i'm trying div that's 'full' expand middle out, pushing others out of way in process. i've got push them left edge , expand them. know because i've got position:absolute . ideas on how can acheive effect? here working example of think describing: http://codepen.io/anon/pen/pkfaw i removed display: table div , set .min, .min p width 0px overflow hidden , removed height 0%. the issue why jumping because set min 0 full floating left. automatically pushed left , expanded out. divs animating 0 while .full animating 100%.

html - Vertically align middle without knowing the height -

<div class="grid-960"> <div class="row content"> <div class="col col-6-12"> <img src="imgs/image.jpg" alt="img"/> </div> <div class="col col-6-12 last"> <h2>title1</h2> <p>my content</p> </div> </div> </div> my problem: yes know how vertically align content. i've used many techniques, example setting parent table , child table-cell. techniques requires me either know height of parent/child - or assume working block element. i working floated element, , don't know height of it(dynamic content). .col{float:left} basically need elements on right col vertically align image on left. because columns float left, 100% height have no effect. any ideas? *by way, not sure why code never display's correctly here. can't seem indents work. you can

writer - Reading from binary file into several labels on a form in C# -

i'm writing trivia game app in c# writes data binary file, reads data file 6 labels. 6 labels follows: lblquestion // question text goes. lblpoints // question points goes. lblanswera // multiple choice answer goes. lblanswerb // multiple choice answer b goes. lblanswerc // multiple choice answer c goes. lblanswerd // multiple choice answer d goes. here code writing binary file: { bw.write(question); bw.write(points); bw.write(answera); bw.write(answerb); bw.write(answerc); bw.write(answerd); } now code read data file corresponding labels: { filestream fs = file.openread(ofd.filename); binaryreader br = new binaryreader(fs); lblquestion.text = br.readstring(); lblpoints.text = br.readint32() + " points"; lblanswera.text = br.readstring(); lblanswerb.text = br.readstring();

service - Qt QDesktopServices::openUrl() error 2 -

i have problem open file using qdesktopservices::openurl() function. i have code generates absolute address of file when try run i´m getting shellexecute error 2. this code i´m using: void openfilemainwindow::runsong() { qaction *act = qobject_cast<qaction *>(sender()); qstring addr = "file:///"; addr.append(qstring(act->data().tostring())); qbytearray temparray = addr.toutf8(); const char * addrw = temparray.data(); qmessagebox::warning(this, tr("info"), tr("you trying open file:\n%1").arg(addrw), qmessagebox::ok); qdesktopservices::openurl(qurl(addrw, qurl::tolerantmode)); } when tried write path manualy "file:///.../file.mp3" working good, why generated address not? tried qstring addr only, same result. for sure encoding problem. qurl takes qstring first parameter. no idea remained initial qstring addr after squeezed qbytearray , take const char * address , let qurl convert qstring. any particular rea

javascript - Set time out still runs when i clear the div -

i have settimeout have assigned div this: function update(div,data){ div._mytimer = settimeout(function() { update(data);},1); } but reason when remove div page time out still runs. for example lets clear parent of div doing: parent.innerhtml = ''; shouldn't cancel time out because div no longer appears in dom? or have misunderstood something. the timeout once set not need div exist. should remember reference timeout , clear manually before clear div. when remove div setting innerhtml of parent, can every div going removed , check if has _mytimer property set , in case clear timer. for (var i=0, ilen=parent.childnodes.length; i<ilen; i++) { if (parent.childnodes[i]._mytimer) { cleartimeout(parent.childnodes[i]._mytimer); } } or if delete div way, can acces reference directly: cleartimeout(div._mytimer); div.parentnode.removechild(div); not innerhtml = '', way have more control on elements removed

wordpress - What would be faster - plugin, html or shortcode? -

i'm curious if has experience refining wordpress site make fast page loading possible , approaches work better others. for example, lets take adding social media buttons footer. fastest? biggest drag? plugin - there plugins, including genesis, allow user enter social media url , icon , link generate in widget. i'm wondering if big load in case css , files icons sets loaded instead of being used, plus additional plugin code being run. html in widget - simple thought code created , added text widget, images being stored in theme folders. can little risky because i've seen html code in widget blown out , clients can accidently edit wrong piece. html in theme - try avoid hardcoding elements client might want update, seems efficient, unless it's in widgetized area default, in case un-widgetize it? shortcode - hardcoded elements need used in couple of different places, thought creating shotcode option. know if shortcodes tend drag on site? of elements within s

ruby - Rails, including relationships in json render -

i have following code returns json data includes @admin_user.companies: @admin_user = user.find_by_email(email) render :json=>{:status=>{:code=>200,:token=>@admin_user.authentication_token, :user=> @admin_user, :companies => @admin_user.companies }} each company have many "locations". how include locations every single company in @admin_user.companies in json? the conventional way use render json: @admin_user.companies, include: :locations (please refer #as_json more options.) you don't need include status code in json, since it's in http headers. thus, following might close need. render :json => @admin_user, :include => { :companies => { :include => :locations }, }, :methods => :authentication_token side note this example. have configure :include , :methods want. more fine-grained control, jbuilder or rabl .

file - Java filename with bracket -

i'm getting error when try read files flashdrive. of files contain left parenthesis not right one. have many files change each file seperately. thats code: string src; src = "c:\\users\\marc\\desktop\\musik\\02 uncrushables (feat. ill bill.mp3" file tempmp3 = new file(src); and error message i'm getting: exception in thread "main" org.farng.mp3.tagexception: unable create filenametag @ org.farng.mp3.mp3file.<init>(unknown source) @ org.farng.mp3.mp3file.<init>(unknown source) @ org.farng.mp3.mp3file.<init>(unknown source) @ newid3.main(newid3.java:55) caused by: org.farng.mp3.tagexception: unmatched parenthesis in "02 uncrushables (feat. ill bill" @ position : 20 @ org.farng.mp3.filename.filenametagbuilder.parseparenthesis(unknown source) @ org.farng.mp3.filename.filenametagbuilder.createcompositefromtoken(unknown source) @ org.farng.mp3.filename.filenametagbuilder.createfilenametagfrommp3file(unknown sourc

security - Collecting user information for debugging and support -

i have java application need support. i'd collect user information, such system information: os , hardware easier diagnostics , support. there security & privacy regulations need follow? need consent user this? i not know country , local regulations, better accepted have privacy policy if collect sensitive data. might inform user upon first start, example. can explicitly ask user consent , collect if user agrees it. informed consent nice policy both informs user , asks permission. can stack results , release them (if , e.g. include in policy) stating users provided consent.

C++ Handling My own Exception class -

i'm having problems display strings have in subclasses. i'm trying function i'm not sure why don't content of these strings. class employee{ string fn, ln, jt; double income; public: char const *getters(){ return fn.data(), ln.data(), jt.data(); //=========>getting content of strings } virtual char const *getaccess()=0; employee(char const *fn, char const *ln, char const *jt, double inc){ if(fn==0) throw exception(1, "sorry, first name null"); if(ln==0) throw exception(2, "sorry, last name null"); if(jt==0) throw exception(3, "sorry job title null"); if(inc<=0) throw exception(4, "sorry, income null"); fn=fn; ln=ln; jt=jt; income=inc; } }; class programmer: public employee{ public: programmer(char const *fn, char const *ln, double inc): employee(fn,ln,"programmer", inc) {} char const *ge

php - Modify selector to only target a specific tag [wordpress] -

code below target anchor link in wordpress navigation menu have new attribute 'data-foo' value 'bar'. how can modified target menu specific class? add_filter( 'walker_nav_menu_start_el', function( $item ) { $parts = explode( '>', $item ); $out = array (); foreach ( $parts $i => $part ) { if ( 0 === strpos( $part, '<a ' ) ) // start $out[ $i ] = $part . ' data-foo="bar"'; else $out[ $i ] = $part; } return join( '>', $out ); }); in code "walker_nav_menu_start_el" pre-defined "filter". can use $get_body_class(classname) apply filter elements class. $class = $get_body_class('yourclassnamehere'); add_filter( $class, function( $item ) { $parts = explode( '>', $item ); $out = array (); foreach ( $parts $i => $part ) { if ( 0 === strpos( $part, '<a ' ) ) // start

javascript - How can I create a graphic canvas with 2D objects animated in 3D space? -

i came across this site , fell in love background animation, particularly points connected each other, animating in 3d space. (the element in question is: <canvas id="bg" width="1920" height="995"></canvas> ) new canvas animation, , research i've done far, not know path should start down achieve similar background animation project. far, have looked paper.js , plain canvas , js api. here specifications have: ability make 'canvas' (not literally <canvas> , graphic canvas. not opposed particular graphic wrapper). ability make 'canvas' responsive round points (2d circles) navigating in 3d space (ability spin objects on axis plus, animating in helix plus.) instantiable modules of these round point sets ability animate these modules on specific events (click, hover, etc) nice haves: vector graphics something similar want achieve can viewed here . i know of trying require pieces whole (js graphics l

android - ActionBarCompat and windowContentOverlay -

i've updated project migrating actionbarsherlock new google's actionbarcompat. i've found tedious issue. if create brand new project actionbarcompat (use theme.appcompat.light) you'll notice shadow under action bar present @ top of window. can see default theme of theme.appcompat define property windowcontentoverlay follows: <item name="android:windowcontentoverlay">@drawable/actionbarcompat_shadow</item> i worked on hours not resolve problem, shadow duplicated on top of actionbar. did found same issue? there workaround posted here... what happened windowcontentoverlay in android api 18? it noted on thread "official" bug , has been fixed in api 19

linux - how to find unique rows in a large file? -

i have large file (4 billion rows) each row contains 1 word. want find list of unique words , corresponding counts. i tried: sort largefile |uniq -c >outfile but still running , no output. then tried: awk '!arr[$1]++' largefile >outfile but not not print counts. how can use awk print counts well? or other alternative approach can handle large files. edit: there 17 million unique words in file. how large files? how many unique words expecting? in cases sort | uniq solution start, if files big it's not good. perl script saves each word in hash might work you. this untested , memory, may have bunch of errors... my %words = (); open(in, "<", "yourfile") or die "arrgghh file didn't open: $!"; while(<in>) { chomp; $words{$_}++; } close(in); $k in (keys %words) { print "$k $words{$k}\n"; }

java - SAXParser Android, ArrayList repeating elements -

i trying process elements within item nodes. focusing on title @ point simplicity, finding when parses, getting same element 3 times. http://open.live.bbc.co.uk/weather/feeds/en/2643123/3dayforecast.rss import java.io.inputstream; import java.net.url; import java.util.arraylist; import javax.xml.parsers.saxparser; import javax.xml.parsers.saxparserfactory; import org.xml.sax.attributes; import org.xml.sax.inputsource; import org.xml.sax.saxexception; import org.xml.sax.xmlreader; import org.xml.sax.helpers.defaulthandler; import android.util.log; public class xmlhelper extends defaulthandler { private string url_main="http://open.live.bbc.co.uk/weather/feeds/en/2643123/3dayforecast.rss"; string tag = "xmlhelper"; boolean currtag = false; string currtagval = ""; public itemdata item = null; public arraylist<itemdata> items = new arraylist<itemdata>(); public void get() { try {

rebol - REBOL3 - How to set the initial size of a layout? -

i need set initial size of layout viewed. how do that? in r2, was: view layout/size [button] 1000x1000 there no longer size refinement on layout , trying set facet not work view layout [button] options [facets: [size: 1000x1000]] right now, view/maximize workaround bug me, prefer not use maximized windows you can create face before , set init-size manually in b: layout [button] b/facets/init-size: 300x80 view b

android - Can not scroll and click item on gridview inside scrollview -

okay guys, have layout this <scrollview android:id="@+id/scrollviewtree" android:layout_width="match_parent" android:layout_height="wrap_content" > <include android:id="@+id/layoutgallery" android:layout_width="wrap_content" android:layout_height="wrap_content" layout="@layout/layout_gallery_obstruction" > </include> </scrollview> and *layout_gallery_obstruction* ?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" > <textview android:id="@+id/textviewgalleryobs" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignbaseline="@+id/buttongalleryobs" android:layo

html - How Do I Use CSS to Set the Color of An ALink? -

i’m trying use css set color of alink i’m not succeeding. obviously i’m doing wrong after having screwed around seemingly trivial problem still have no clue i’m doing wrong. here’s html /css … <html> <head> <title>alink test</title> <style type="text/css"> a.home:link{ text-decoration:none; color:rgb (240, 180, 50); } </style> </head> <body> <a class="home" href="http://www.subudnewyork.org/">home</a> </body> </html> if explain me i’m doing wrong and, more importantly, how fix immensely appreciate … simply have remove space rgb (240, 180, 50) rgb(240, 180, 50) . see demo .

Python 2.6.6 doesn't work properly -

i working redhat linux 5.6 (in case matters). my team working python 2.6.6. installed source (configure, make, make install) official python site. seems not work properly: when type python in terminal enter python cli, reason can't delete type (backspace prints character marks screen) modules psutils missing (this should standard part of python, no?) python 2.4, installed, works fine. any ideas? psutil not standard module. have to: easy_install psutil or pip install psutil in terminal. about symbol when pressing backspace. '^?' symbol appear on pressing backspace, if insert option on. switch off insert (by pressing insert button on keyboard) try backspace.

javascript - Highcharts: limit number of markers -

i'm using highcharts show data series quite large number of points in small space, here's demo . when datapoint marker shown on every point graph cluttered , difficult read. can remove markers changing plotoptions: { line: { marker: { enabled: true } } } to plotoptions: { line: { marker: { enabled: false } } } but i'd in between these 2 extremes. there way specify maximum number of markers should displayed, e.g. 20. don't particularly care 20 points marked, marked points should chosen such markers evenly spaced. afaik can disable markers per point have supply data objects, can problematic large quantities of points: series: [{ data: [ { y: 29.9 }, { y: 71.5, marker: { enabled: false } }, { y: 106.4, marker: { enabled: false } }, { y: 129.2 }] }] documentation here (see third

compilation - How to compile go program in 1.1.2 with dependencies compiled in 1.1.1? -

every time try compile program after (this morning) upgrading go 1.1.1 1.1.2 (on windows 7 64 bits), error message like: c:\users\vonc\prog\go\src\github.com\spf13\hugo>go build -o hugo.exe main.go # github.com/spf13/hugo/hugolib hugolib\page.go:23: import c:\users\vonc\prog\go\pkg\windows_amd64/github.com/emicklei/hopwatch.a: object [windows amd64 go1.1.1 x:none] expected [windows amd64 go1.1.2 x:none] i tried go clean -r , error message persists? what right clean command use? actual solution: i reproduced issue with: calling 1.1.2 go.exe directly (i didn't have %goroot%\bin in path) with goroot pointing previous 1.1.1 installation folder (i kept go 1.1.1 , 1.1.2 installed in separated folders). if sticking default go setup (ie: one c:\go installation directory, , %goroot%\bin in path ), won't see error. but if see error: make sure %goroot% consistent go.exe calling go install -a explained below. go clean mentioned below wo

Getting jQuery and AngularJS content assist / auto-complete in eclipse for standalone HTML "file" -

Image
i have followed steps described here adding autocomplete functionality eclipse. in after installing jsdt plugin, have create project, add plugin js resource. have found 2 weird things: i can autocomplete have included no jquery library in html i cannot autocomplete html file created explicitly in notepad , opened in eclipse. example in screenshot above in tempq.html can autocomplete in angularjsexp.html open in tab , not part of project cannot autocomplete jquery when enter $(). also how can similar autocomplete angularjs in eclipse. read somewhere using jsdt can autocomplete functionality angularjs too. possible? angularjs eclipse gives completion angularjs (directive name (ng-app, ...), modules, controllers, expression on $scope model). based on tern.java provides jquery plugin benefit jquery (after configuring angularjs nature in project, can select jquery tern module on project properties tern -> modules).

html5 - html 5 web app cache download complete javascript alert? -

i'm creating basic offline web app using cache.manifest but have under 5mb of cache downloading do. , wondering if there way of having popup alert runs once when cache download complete? thanks i found debugger helps me debug wether have missed on manifest, don't know whether can in anyway? <script> var cachestatusvalues = []; cachestatusvalues[0] = 'uncached'; cachestatusvalues[1] = 'idle'; cachestatusvalues[2] = 'checking'; cachestatusvalues[3] = 'downloading'; cachestatusvalues[4] = 'updateready'; cachestatusvalues[5] = 'obsolete'; var cache = window.applicationcache; cache.addeventlistener('cached', logevent, false); cache.addeventlistener('checking', logevent, false); cache.addeventlistener('downloading', logevent, false); cache.addeventlistener('error', logevent, false); cache.addeventlistener('noupdate', logeven

sql server 2008 - Microsoft dynamics CRM 2011 : error 404 after moving my database -

i moved database development server deployement server. used tutorial microsoft : http://msdn.microsoft.com/en-us/library/hh699772.aspx#move_databases_to_another_sql however when try launch application, have 404 error. tried everything, reinstalling crm sql server configuration. when try retrieve configuration made during development, still have 404 error. my development database on sql server 2008 r2 10.50.2550 installed on windows server 2008. deployement database (the new one) on sql server 2008 r2 10.50.1600 installed on windows server 2008 (another server on same domain) crm crm 2011 on rollup 14 ( version of organization : 5.0.9690.3557 ) hope me ! thanks in advance first of try iis reset , make sure crm services running. edit re-installing rollup 14 helped user fix issue.

objective c - Property with redefined accessor still accessible -

i wondering usefulness of redefining getter of property. documentation states can redefine getter of property using getter : @property (getter=isfinished) bool finished; from understand, callers should use: myobj *obj = ...; obj.isfinished; but nothing prevents do: myobj *obj = ...; obj.finished; since property can still freely accessed, what's point of redefining getter? wouldn't more concise , readable do: @property bool isfinished; by @property (getter=isfinished) bool finished; declare explicit getter, implicit setter, and implicit ivar. (in former versions of objc, have needed `@synthesize in addition). however, there no need getter/setter use automatic ivar, not ivar @ all. thus, can have private ivar, or set number of ivars, or other 'magic'. the dot syntax syntactic sugar avoid []. edit till here, answered question "what's point of redefining getter?". to answer name/privacy part: if want bool , first alter

angular ui - Does AngularUI/Bootstrap support twitter-bootstrap 3? -

dropdown menu not working in angular-ui-bootstrap? using bootstrap-3 css the following code. link click me dropdown shows up. not toggle on click. wrong? <!doctype html> <html> <head> <link rel="stylesheet" href="css/bootstrap.min.css"> <script>function dropdownctrl($scope) { $scope.items = [ "the first choice!", "and choice you.", "but wait! third!" ]; } </script> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.1/angular.min.js"></script><script type="text/javascript" src="js/ui-bootstrap-tpls-0.5.0.min.js"></script><script type="text/javascript" src="js/dropdowntoggle.js"></script> </head> <body> <li ng-controller="dropdownctrl" class="dropdown"> <a href='#' class="dropdown-

c# - Tooltip style. Can't bind to datacontext -

i have 1 problem tooltip. want add templated tooltip button information inside. here button tooltip, datacontext bounded viewmodel: <fluent:button datacontext="{binding newconnections, source={staticresource locator}}" command="{binding addcloudstorageaccount}" header="add account"> <fluent:button.largeicon> <image source="pack://application:,,,/icons;component/ui/v1/add_account.png" width="48"/> </fluent:button.largeicon> <fluent:button.tooltip> <tooltip datacontext="{binding userinput.addaccountsbuttoninfo, source={staticresource locator}}" style="{staticresource buttontooltip}"></tooltip> </fluent:button.tooltip> </fluent:button> style: <style targettype="tooltip" x

Google Analytics Event tracking with _trackEvent when a form is submitted -

i trying track event when user clicks submit button on signup form. i have following code in page: google analytics - before closing </head> tag: <script type="text/javascript"> var _gaq = _gaq || []; _gaq.push(['_setaccount', 'ua-xxxxxxxx-xx']); _gaq.push(['_trackpageview']); (function() { var ga = document.createelement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; var s = document.getelementsbytagname('script')[0]; s.parentnode.insertbefore(ga, s); })(); </script> form event tracking: <input onclick="_gaq.push(['_trackevent', 'forms', 'submit', 'mylist', , false]);" name="submit" id="af-submit-image-873297158" type="image" class="image

javascript - How to add loop multiple HTML5 videos using jquery? -

my requirement have place n number of videos in same place , if 1 video ended next video has start wise.... here have tried 4 videos not starting second video. could please me <script> video_count =1; videoplayer = document.getelementbyid("ss"); function run(){ video_count++; if (video_count == 4) video_count = 1; var nextvideo = "video"+video_count+".mp4"; videoplayer.src = nextvideo; videoplayer.play(); }; </script> <video id="homevideo" width="100%" autoplay onended="run()"> <source id="ss" src="video1.mp4" type='video/mp4'/> </video> try remove onended-tag , add javascript event. help? videoplayer.onended(function(e) { run(); };

linux - How to test system reboot time more than a year? -

i want test code against linux system not rebooted since year. didn't find system not rebooted since last 2 months. there way simulate it? i tried weird way change system time year , rebooted system , change date current time. won't solve problem. i want test against big integer counters. there multiple ways check latest boot time, instance: % last reboot | head -n 1 reboot ~ tue aug 13 09:56 % sysctl kern.boottime kern.boottime: { sec = 1376377004, usec = 264281 } tue aug 13 09:56:44 2013

c - How can I break out of a function -

i need check condition. if true, operation performed , need break out of function. if condition not satisfied proceeding normal operations in function continue. the return keyword used exit function. if function has non- void return type, expression of appropriate type must used return provide return value: /* returns 2 * abs(a), abs(a) denotes absolute value of a. */ int twice_positive(int a) { if(a < 0) return -2 * a; return 2 * a; } some people consider "early return" long(er) functions evil stylistically , avoided; don't agree thought should mention it.

ios - How to add a badge on UIButton and manage orientation -

this question has answer here: how can add badge standard uibutton? [closed] 6 answers i trying create shopping cart application , on adding product want add badge on uibutton increase or decrease accordingly . i searched google end solution " mknumberbadgeview " ( https://www.cocoacontrols.com/controls/mknumberbadgeview ) i creating application supports iphone4/5 afraid add sub view in view controller , manage on iphone 4 & 5 . can 1 suggest better solution can badge on uibutton along also supports orientation . or solution handle subview both devices 4 & 5. thanks in advance . managing whether iphone 4 or 5 not ton of work, makes difference when initialize button , it. you can getting screen size using following code cgrect screenbounds = [[uiscreen mainscreen] bounds]; if (screenbounds.height == 568) { // iphone 5 }

matplotlib - using interactive and non-interactive backends within one program -

i running code written pyqt4 uses matplotlib's qt4agg backend showing live plots in windows. @ same time, use matplotlib in background thread produce (different) figures saved file, not shown on screen. i can use qt4agg in background thread, getting bunch of qpixmap: not safe use pixmaps outside gui thread warnings, , crashes in cases. as far see, matplotlib supports using 1 backend @ given time (which can changed via switch_backend , closes existing figures). there way work around limitation, , assign per-figure backend? to knowledge, if don't use pyplot interface. for instance, using full oo interface simple plot: from matplotlib.backends.backend_agg import figurecanvasagg figurecanvas matplotlib.figure import figure fig = figure() canvas = figurecanvas(fig) ax = fig.add_subplot(1,1,1) ax.plot([1,2,3]) canvas.print_figure('test.png') hth

How to select without using CTL key in multiselect in extjs -

xtype:"multiselectfield", fieldlabel:combodata.label, allowblank:false, labelalign:"left", autoscroll:false, scroll:false, width:280, height:80, store:combostore, value:combodata.selectvalue ? combodata.selectvalue : combodata.items[0].value, displayfield:"name", valuefield:"value", you can using combobox , setting multiselect true. { xtype: 'combobox', multiselect: true, . . . } the value of combobox array of valuefields of items selected.

php - Modify regex in a script that highlights certain words in a text by adding span classes to them -

i working on code highlights words, using regex. here is: function addregex($word){ return "/\b(\w+)?".$word."(\w+)?\b/i"; } function highlight($word){ return "<span class=\"highlighted\">".$word[0]."</span>"; } function customhighlights($searchstring,$tohighlight){ $searchfor = array_map('addregex',$tohighlight); $result = preg_replace_callback($searchfor,'highlight',$searchstring); return $result; } lets use function customhighlights searc word "car" in text: using boundary - \b - method, script searches word car in text. in regex, have added (\w+)? in front , after word, script match words contain "car" - cars, sportcars, etc... the problem is, messes inner html, example: this great car. click here <a href="http://cars.com">more</a> the script match word car in url of link above, ad

ASP.NET MVC 4, List Course and Language on same View -

i have simple view, without model in it, want display course on course table , language list languages table. both table not connected each other, in webform using usercontrol result, in mvc not able result want. any tutorial great. regards you should query database retrieve 2 collections. create view model object 2 properties hold 2 collections. then pass object view. in view create html table each collections a viewmodel class have need in view. in case: public class myviewmodel{ public list<course> mycourses { get; set;} public list<language> mylanguages { get; set;} } in controller action, can call database logic have retrieve collections, instanciate viewmodel, , pass view.

notepad++ - How to read Text File of about 2 GB? -

this question has answer here: text editor open big (giant, huge, large) text files [closed] 2 answers i have .txt file memory more 2gb. problem cannot open notepad, notepad++ or other editor programs. any solutions ? instead of loading / reading complete file, use tool split text file in smaller chunks . if you're using linux, use split command (see this stackoverflow thread ). windows, there several tools available hjsplit (see this superuser thread ).

java - forward from spring jsp to spring jsp -

in catalog webapp/web-inf/views located jsp pages want forward 1.jsp 2.jsp in 1.jsp write <a href="2.jsp?id=${candidate.id}">${candidate.name}</a> but doesn't work. how fix it? use <c:url , value attribute of <c:url set href link other jsp. example, be: <a href="<c:url value="2.jsp?id=${candidate.id}" />">${candidate.name}</a> i had used in following manner in webapps (where circuits folder under /web-inf/views ): <a href="<c:url value="/circuits/${circuit.circuitid}/edit" />">edit circuit</a>

winforms - c#: adding new item to comboBox -

i want list of clients ip address added combobox in winforms list doesn't appear in combobox. here code server // list of sockets each client connected server list<socket> astr = new list<socket>(); public form1() { initializecomponent(); addfg(); combobox1.selectedindexchanged += combobox1_selectedindexchanged; } public void addfg() { foreach (socket s in astr) { string str = string.format("client : " + s.remoteendpoint); combobox1.items.add(new object[] {str}) } } private void combobox1_selectedindexchanged(object sender, eventargs e) { messagebox.show(combobox1.items[0]); } but getting error "argumentexception unhandled" or in detail "items collection cannot modified when datasource property set". try this: foreach (socket s in astr) { string str = string.format("client : " + s.remoteendpoint); combobox1.items.add(str); } in version, looks tryi

sql server - Sql Query to find reporting user details -

i have table follow fields userid username reportinguserid 1 vinoth null 2 kumar 1 3 raja 1 4 ragu 2 5 vignesh 2 6 yoga 3 7 yogesh 2 8 eswar 4 9 esakki 3 . ... . . .... . if gave userid 1 query display users reporting him displayed if gave userid 1 then result be userid username reportinguserid 2 kumar 1 3 raja 1 4 ragu 2 5 vignesh 2 6 yoga 3 7 yogesh 2 8 eswar 4 9 esakki 3 . ... . . .... . have @ using recursive cte . a common table expression (cte) can thought of temporary result set defined within execution scope of single select, insert, update, delete, or create view statement. cte similar derived table in

PopupMenu in older android API -

can use popupmenu in older api without using support library v7 ? i using support library v4, it's not enough this and alternative, if don't use ? popupmenu available in api 11 or higher. far can tell documentation not included in support library , cannot used on lower api version. should use alternative dialog or contextmenu in situations. it's not same thing kind of close.

c++ - Organise output data according to an order -

i organise output of following code. please advise on how can procede. stringstream ss; (i = 0; < vecdb.size(); i++) { (j = 0; j < vecuser.size(); j++) { if (vecdb[i].accesslevel == vecuser[j].accesslevel) { ss << vecuser[j].accesslevel << endl; } else if (vecdb[i].accesslevel < vecuser[j].accesslevel) { ss << vecuser[j].accesslevel << endl; } else if (vecuser[j].accesslevel < vecdbi].accesslevel) { ss << vecuser[j].accesslevel << endl; } } } cout << ss.str(); current output level0 level3 level2 level4 level0 level0 level1 level4 level2 level3 desired output level0 level0 level0 level1 level2 level2 level3 level3 level4 level4 first of all, logic messed up: if vecuser[j] == vecdbi[i] output vecuser[j].accesslevel if vecuser[j] < vecdbi[i] output vecuser[j].accesslevel if vecuser[j] > vecdbi[i] output vecuser[j].acces

Can we have split view control in iphone same that is in iPad? -

Image
as can see in youtube , facebook app. there splits when select 1 cell . split hidden then. want have type of structure in app. if posible in ios7 add template split view iphone . worked fine in ipad. can please me, need develop app type of structure in iphone when create project master template have type of split view... can have same thing in iphone too. if there default control of it. no there isn't default controller applying slide effect inside iphone. yes, can achieve adding custom classes. checkout mfsidemenucontainerviewcontroller enjoy programming!

java - using ajax send large json data to controller -

this jsonexample.jsp file, <!doctype html> <html> <title>jquery function demo - jquery4u.com</title> <head> <script src="http://www.jquery4u.com/function-demos/js/jquery-1.6.4.min.js"></script> <script src="http://www.jquery4u.com/scripts/function-demos-script.js"></script> <script> function call() { //var url = 'http://192.168.10.82:8081/formulator-service/tracks?callback_track=processjson'; var url = "http://api.flickr.com/services/feeds/photos_public.gne?jsoncallback=processjson&tags=monkey&tagmode=any&format=json"; $.ajax({ type : "get", url : url, async : false, jsonpcallback : "processjson", contenttype : "applicati

asp.net - VS 2010 produces Validation error -

i crate new webapplication project, , site.master code <%@ master language="vb" autoeventwireup="false" codebehind="site.master.vb" inherits="webtestapp.site" %> <!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head runat="server"> <title></title> <link href="~/styles/site.css" rel="stylesheet" type="text/css" /> <asp:contentplaceholder id="headcontent" runat="server"> </asp:contentplaceholder> </head> <body> <form runat="server"> <div class="page"> <div class="header"> <div class="title"> <h1> asp.net appli

c# - ListBox transition when visibility is changed -

in application have listbox stackpanel s in it, , within these stackpanel s, header, , listbox it's visibility set collapsed when listbox has collapsed visability set visible enter animation, technique use these sorts of things doesn't seem work. listboxofsongs.visibility = system.windows.visibility.visible; slidetransition slidetransition = new slidetransition(); slidetransition.mode = slidetransitionmode.slidedownfadein; itransition transition = slidetransition.gettransition(listboxofsongs); transition.completed += delegate { transition.stop(); }; i have tried fiddeling around , trying research different techniques, either couldn't find anything, or found them complicated. so grateful if tell me i'm doing wrong, or different technique follow. thanks help.

csv - Latitude/Longitude Generation to be used as sample data -

i writing demo web application tracks multiple devices through companies platform. have app working, need csv file simulate devices moving on map if tracker attached car. simulator works reading 1 row of data every second (1 lat/lng point). here example of first few lines of file work if points weren't scattered across (the sclid device name). sclid latitude longitude hat-0 44.968046 -94.420307 hat-1 44.33328 -89.132008 hat-2 33.755787 -116.359998 hat-3 33.844843 -116.54911 hat-4 44.92057 -93.44786 hat-5 44.240309 -91.493619 hat-0 44.968041 -94.419696 hat-1 44.333304 -89.132027 hat-2 33.755783 -116.360066 hat-3 33.844847 -116.549069 hat-4 44.920474 -93.447851 hat-5 44.240304 -91.493768 if had create simulation data mouse clicks save me lot of time creating program requiring me drive around device , record data csv. help/recommendations appreciated. if don't understand question please ask clarification!

osx - How to install and run gaia astronomical software from starlink-hikianalia -

i trying install gaia, image software astronomy. running snow leopard 10.6.8 , have xcode tools 3.2.6 developer tools installed. believe have correct gfortran compiler necessary. how install gaia now? commands need run. when download it, unzips , there bunch of folders. any appreciated. thanks, max steps installing starlink gaia download latest starlink distribution (hikianalia, of writing): http://starlink.jach.hawaii.edu/starlink/hikianaliadownload uncompress .tar.gz. new star directory created. can move other place (for instance, /users/shared/star , or /star ) as installer 0.7gb, might want delete after installation has been successful. depending on default shell: for c ( csh , tcsh ) shells: create starlink_dir environment variable pointing star directory left (i.e., /users/shared/star ): setenv starlink_dir /users/shared/star source chsrc files source $starlink_dir/etc/login source $starlink_dir/etc/cshrc you can combine steps above cr