Posts

Showing posts from January, 2011

eclipse - nodeclipse only allows debugging of 1 .js file at a time -

nodeclipse allows debugging of 1 .js file @ time. if set breakpoint in different .js file breakpoint never hit. error "source not available". nodeclipse not able load source of different files in debug stack. maybe because running current version: v0.12.0 of node.js because used work earlier version of node.js. running eclipse luna sr2 on windows 7. yes agree previous version of node.js worked , debugging stopped working new version of node.js however, forced upgrade new version v0.12.2 because version supports execsync call java classes in jar file synchronously instead of async. execsync works debugging not. any suggestions on how can debug eclipse node.js v0.12.2?

mediawiki - wikipedia page, how to display current date in yyyymmdd? -

i want display current date in yyyymmdd format in our company's internal wiki page. have looked through mediawiki page guidance, seems need link libraries or template. in general, it's little difficult navigate on mediawiki's page , learn necessary "programming language". please advise. {{currentyear}}{{currentmonth}}{{currentday2}} due mediawiki , browser caching, these variables show when page cached rather current time. source: http://www.mediawiki.org/wiki/help:magic_words

java - Calculate day of the week error -

i have wrote program , output isn't working. please me identify error is? have use code not other internet, have construct understood lesson. using jgrasp. ----jgrasp exec: javac -g samooras.java the error samooras.java:25: error: incompatible types: int cannot converted string[] -2*(year/100))%7+7)%7+1; ^ 1 error ----jgrasp wedge2: exit code process 1. code: import java.util.scanner; public class samooras { public static void main(string[] args) { scanner input = new scanner(system.in); string[] dayoftheweek = {"sat", "sun", "mon", "tues", "wed", "thur", "fri"}; int year = input.nextint(); int month = input.nextint(); int day = input.nextint(); dayoftheweek = ((day + (13 * ((month + 9) % 12 + 1) - 1) / 5 + year % 100 ...

java - How do I fix this bound mismatch error? -

by <item> it's saying : - bound mismatch: type item not valid substitute bounded parameter <t extends comparable<? super t>> of type expandablearraylist<t> expandablearraylist<item> items = new expandablearraylist<item> (); these headers: public interface listinterface <t extends comparable <? super t>> public class expandablearraylist<t extends comparable<?super t>> extends item { public class item implements comparable i can't figure out need change exactly. every time change in 1 header other errors pop up. use compareto(object obj) type. your item class implementing raw form of comparable interface. should have implement generic form, declaring type parameter on item itself. then, expandablearraylist can implement generic form of item . public class item<t extends comparable <? super t>> implements comparable<t> and public expandablearraylist<t extends co...

stack - Suggestions For Running Rails 2 App -

have old rails 2.0.1/ruby 1.8.7 app need run in production environment on ubuntu 14.04 until gets finished porting rails 4 , i'd advice on stack use. i've been trying going nginx 1.7.10 , passenger 5.0.4 rails app doesn't seem load , 404's. same thing happening me, though, when going passenger 3.0.19 , nginx 1.6.2 or combinations of above. tried passenger standalone , same problem. thing that's worked far webrick server comes standard in script/console. love suggestions. thanks well doesn't answer question problem cause, able copy gems, nginx version, passenger version, server running rails 2 application , worked. here list of versions of everything: nginx 1.6.2 passenger 4.0.53 gems: arel (6.0.0) builder (3.2.2) bundler (1.7.7) bundler-unload (1.0.2) chunky_png (1.3.3) crack (0.4.2) daemon_controller (1.2.0) drx (0.4.5) elif (0.1.0) erubis (2.7.0) executable-hooks (1.3.2) fastthread (1.0.7) gem-wrappers (1.2.7) hike (1.2.3) hpric...

HTML&CSS - Resize all my images -

i have folder full of thousands of image , want show images. i've done already, problem here wit hthe size of images. images in folder totally different format , size. i've succeeded resize them whenever that, when change browser size don't resize aswell, stay told them to. what want put maximum size if browser big enough size. if browser shrinks, react instantly , change size. i've tried 2 hours , can't find way that. ps: i'm using bootstrap thanks ! :) how this? images maximum size of 1000 pixels, 100% of browser width otherwise. img { width: 100%; max-width: 1000px; }

javascript - Jquery scroll, top offset for active class -

can me please 1 thing can't manage? i have used scrolling-nav.js top menu on website - interior, exterior etc. http://lukaszradwan.com/www_architect/services.php now set offset using code $(window).scroll(function() { if ($(".navbar").offset().top > 130) { $(".navbar-fixed-top").addclass("top-nav-collapse"); } else { $(".navbar-fixed-top").removeclass("top-nav-collapse"); } }); $(function() { $('a.page-scroll').bind('click', function(event) { var $anchor = $(this); $('html, body').stop().animate({ scrolltop: $($anchor.attr('href')).offset().top - 130 }, 1500, 'easeinoutexpo'); event.preventdefault(); }); }); but when click example exterior, active class not working @ position. i tried use method form topic, "js" knowledge poor. jquery scroll, change navigation active class page scrolling, relative sections thanks in advance. ...

angularjs - Using parsley js to validate form -

i must overthinking or something. i've read on parsley form validation site and, far can tell, passively responds attributes set in dom. needs component change attributes before 1 has working form. since i'm using angular, presumably, parsleyjs angular. i'm trying have save button disabled until form valid. think form validation 102. their super-simple demo doesn't have save button , doesn't bother showing css, frankly i'm not sure supposed demonstrating. if i've got write css , form validation, i'm not sure parsley doing me. http://parsleyjs.org/doc/examples/simple.html what i'd find plunkers showing parsley working end-to-end, don't seem believe in plunkers. don't seem find example form validating , setting value true or false can capture use in controller. (this sounds negative, i'm not down on parsley, i'm stumped , time running out.)

Should I use Intellij IDEA 14 Ultimate or Android Studio in that special case? -

as eclipse user, new intellij , android studio , start developing app comunicating jax-rs webservice. wanna know opinion, shoud start development using android studio or stick regular intellij idea ultimate? benefits of each case? missing? intellij idea ultimate has additional code insight support jax-rs not available in android studio, , include android development features android studio. if have intellij idea ultimate license, recommend keep using it.

node.js - body-parser - extended option (qs vs querystring) -

in current version of body-parser , extended option when using bodyparser.urlencoded() required. in readme, explains: the extended option allows choose between parsing url-encoded data querystring library (when false) or qs library (when true). [...] defaults true, using default has been deprecated. please research difference between qs , querystring , choose appropriate setting. i couldn't find helpful or specific information on this. found deprecated node-querystring . should option true? the reason message body-parser about change default value extended true false . extended protocol uses qs library parse x-www-form-urlencoded data. main advantage of qs uses powerful serialization/deserialization algorithm, capable of serializing json-like data structure. but web-browsers don't use protocol, because x-www-form-urlencoded designed serialize flat html forms. though, may come in handy if you're going send rich data structures...

sql - MySQL - how to find most commonly occuring "tag" in a list of rows -

some context goal "tag" occurs in set of rows returned table (entities). entity in case group of famous people , roles. not have flexibility chage database schema. e.g. (quick sql table struct) entityname (varchar) tag1 (varchar) tag2 (varchar) tag3 (varchar) tag4 (varchar) tag5 (varchar) example rows returned: entityname tag1 tag2 tag3 tag4 tag5 warren buffett ceo investor philathropist billionaire bill gates billionaire visionary ceo visionary steve jobs visionary ceo oprah celebrity entertainment what trying do? tag common among sql rows returned. above example, expecting "ceo" (since appears 3 times 4 record). assuming, sql query returns n rows above, how find occuring list of tags? please help, im not sure how best approach problem. not have flexibility chage database schema.. you can t...

javascript - In jsp, hiding a field based on other field that has datepicker -

i totally new jsp , situation, have 2 fields, f1 , f2. want hide f2 if there change done in f1. f1 looks like: <input type="text" class="form-control" id="f1-id" name="f1-id" data-date-format="yyyy-mm-dd"> i added code: $("#f1-id").on('change', hidef2); function hidef2() { $("#f2-id").hide } f2 hides if use keyboard change f1, f2 not hiding @ if change f1 using mouse. remember f1 has date picker. your code works me (just add parenthesis behind "hide"): $("#f1-id").on("change", hidef2); function hidef2() { $("#f2-id").hide(); // add parenthesis here! } <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> <div class="col-xs-6"> <label>f1-id</label> <input type="date" class="form-control" id="f1-id...

Java Do and While validation -

i created simple program there password, reason if input password program carry on executing though used , while. import java.util.scanner; public class passcheck { double password; int userinp; public void validation() { do{ system.out.println("please enter password"); scanner in = new scanner(system.in); int password = in.nextint(); } while (password == 1111); system.out.println("please select whether workout area or perimeter"); system.out.println("enter 1 area , enter 2 perimeter"); scanner in = new scanner(system.in); int userinp = in.nextint(); switch (userinp){ case 1: circlearea circleareaobject = new circlearea(); circleareaobject.area(); case 2: } } } your int password assign valid inside brackets of { ... } block. in while, referencing double password never 1111. do{ system.out.println("please ent...

meteor - pathFor returning empty href -

i've done quite bit of searching , testing on feel should pretty straightforward, since working on other routes: <a href="{{ pathfor 'categorylist' }}">{{post.category}}</a> here iron router route: router.route("/category/:category", function() { this.render("categorylist", { waiton: function() { return meteor.subscribe("posts"); }, data: function() { session.set("categoryname", this.params.category); return { posts: posts.find({category: this.params.category}) } } }); }, { name: 'categorylist' }); when load post html / spacebars, href empty. i've tried declaring name route, , comes empty. missing obvious? thanks, paul you need include parameter route in pathfor. <a href="{{ pathfor 'categorylist' category=post.category}}">{{post.category}}</a>

ms office - Word add-in producing 'Access Denied' error when run on server - fine locally -

we have word addin works excel having issues when being run on remote desktop that's running server 2012(multiple users access server) here's piece of trace exception details: system.componentmodel.win32exception (0x80004005): access denied @ system.diagnostics.processmanager.openprocess(int32 processid, int32 access, boolean throwifexited) @ system.diagnostics.process.getprocesshandle(int32 access, boolean throwifexited) @ system.diagnostics.process.kill() when add-in run locally, there no issues @ all. we've seen similar issues when working vmware, citrix, , rdp servers instance. my question needs modified @ server level make function properly? i've found running word , excel administrator allow them 'see' each other, normal click produce error above. tia!

neo4j - Drawing a graph with GraphViz in PHP -

good evening, i trying figure out way display simple node/edge graphs neo4j db in php. had @ three.js, sigma , alchemy tools seem way complex such simple tasks. found graphviz runs fine when use editor. not able find when wanted use php. there pear package seems not suitable anymore php >5.0 (tried , run lots of errors (e.g. non-static method system::mktemp() should not called statically - there thread here this: graphviz not working php 5.3.2 ) , found document http://www.graphviz.org/pdf/gv.3php.pdf - unfortunately seems cant deal this. anybody has example how draw e.g. this: <?php require_once 'image/graphviz.php'; $gv = new image_graphviz(); $gv->addedge(array('wake up' => 'visit bathroom')); $gv->addedge(array('visit bathroom' => 'make coffee')); $gv->image(); ?> (source: http://pear.php.net/manual/en/package.images.image-graphviz.example.php ) this code pear package example doesnt run -...

Android Development Eclipse Luna EE Errors -

i'm trying understand these errors. can ? [2015-03-20 17:04:07 - robshelloworld] /users/frederickdavidpina/documents/workspace/robshelloworld/res/values/styles.xml:7: error: error retrieving parent item: no resource found matches given name 'theme.appcompat.light'. [2015-03-20 17:04:07 - robshelloworld] [2015-03-20 17:04:07 - robshelloworld] /users/frederickdavidpina/documents/workspace/robshelloworld/res/values-v11/styles.xml:7: error: error retrieving parent item: no resource found matches given name 'theme.appcompat.light'. [2015-03-20 17:04:07 - robshelloworld] [2015-03-20 17:04:07 - robshelloworld] /users/frederickdavidpina/documents/workspace/robshelloworld/res/values-v14/styles.xml:8: error: error retrieving parent item: no resource found matches given name 'theme.appcompat.light.darkactionbar'. [2015-03-20 17:04:07 - robshelloworld] did downloaded android support library sdk manager? if not go sdk manager check android support libra...

Maven: ant-run plugin echo does not seem to execute -

i have maven project using ant-run plugin. added echo message not seem execute: <build> <plugins> <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-antrun-plugin</artifactid> <executions> <execution> <id>ast-application-deployment-kit</id> <phase>package</phase> <goals> <goal>run</goal> </goals> <configuration> <target> <echo message="starting ant-run target configuration."/> but when mvn clean package , see this [info] --- maven-antrun-plugin:1.3:run (my-app) @ my-app --- [info] executing tasks [info] executed tasks but not see echo. doing wrong?...

hadoop - The node /hbase-unsecure is not in ZooKeeper. Check the value configured in 'zookeeper.znode.parent'. -

i getting error while starting standalone hbase on ubuntu machine. please help. spent huge amount of time running. :( have checked far - /etc/hosts contains localhost 127.0.0.1 hbase : hbase-0.98.3-hadoop2-bin.tar.gz hadoop: hadoop-2.6.0.tar.gz i have node /hbase-unsecure in hbase-site.xml. when try run command - create 'usertable', 'resultfamily' it gives me following exception - error: node /hbase-unsecure not in zookeeper. should have been written master. check value configured in 'zookeeper.znode.parent'. there mismatch 1 configured in master. hbase-site.xml <?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="configuration.xsl"?> <configuration> <property> <name>hbase.rootdir</name> <value>hdfs://localhost:54310/hbase</value> </property> <property> <name>hbase.zookeeper.property....

vbscript - find string in text file from right -

how find character in string right? here try do, have following file path: \\abc\shows\t3rtf\ggh\episodes\111\yuo\character\goodday.jpg \\abc\shows\gt6yh\ggh\episodes\111\yuo\pop\5656h.jpg \\abc\shows\gh455g\ghj\episodes\111\yuo\character\bhy74f.jpg i need print/show file name only. (goodday.jpg, 5656h.jpg , bhy74f.jpg) i thinking finding "\" right, should able print out file name. i tried instrrev, not good. response.write instrrev(txt,"\") any ideas? solve own problem: mid(txt,instrrev(txt,"\")+1)

java - Reading a line with multiple line breaks as separate lines -

i have java program running on mainframe z/os , reading ebcdic file. few of lines in file have multiple records separated ebcdic 'lf' x'025'. using java readline , expected reading record till linefeed , discarding rest of records. besides parsing big line multiple records, there way make read methods split line multiple lines/records , return same? if needed, have option change new-line delimiter values. input: 10,ibm,erwin,black,123,abc(lf)10,ibm,jack,rose,456 expected output 10,ibm,erwin,black,123,abc 10,ibm,jack,rose,456 current code: public arraylist<string> readmainframefile() { //string ddname = zfile.allocdummyddname(); //system.out.println("the ddname " + ddname); //zfile convout = new zfile("//dd:convout", "wb,type=record,noseek"); //recordreader reader=null; try { zfile convin = new zfile("//dd:convin", "rb,type=record,noseek"); ...

exception - ConcurrentModificationException in spite of using Iterator -

i using following class: public class ticker implements runnable { private linkedlist<timeable> timeables = new linkedlist<>(); @override public void run() { listiterator<timeable> = timeables.listiterator(); while (it.hasnext()) { it.next().tick(); } } public void add(timeable timeable) { timeables.add(timeable); } public void remove(timeable timeable) { timeables.remove(timeable); } } i thought iterators prevent concurrentmodificationexception throws 1 @ "it.next().tick();". how can solve this? the java collection classes fail-fast, linkedlist throw concurrentmodificationexception if structure modified 1 thread while thread in process of iterating on elements. for multithreaded code should use thread safe collection such copyonwritearraylist (which provides fail safe iterator of collection @ point in time) or concurrentlinkeddeque (if need access first or last element).

How to call double echo or double variable in php -

i trying variable in php, existing text have issue this. when echo $address_number; list3 . so need variable $list3 , need echo $list3; after that. something <?php echo $(echo $address_number;); ?> but not possible. solutions? solution: $address_number = $address.$number; $iframe_url ="$address_number"; <?php echo $$iframe_url; ?> thanks everybody!

Android Studio rendering issues because of missing class -

http://i.gyazo.com/f8e34c7f62ba659a1d9cb7c6a82103f9.png rendering problem following classes not found: - adroid.support.v8.internal.widget.actionbaroverlaylayout i launched android studio , create new project using api 15 , blank activity, , instantly turns up. can load app fine on phone don't understand issue. http://i.gyazo.com/56c140be1acb170b2c1812b40e842592.png there copy of build path, i'm not sure if helpful. kind regards i had problem didnt seem affect project keep building , try changing api 21

Google analytics I'm a novice -

hi i've got doing seo me , no possible there manipulating visitors show higher page views i'm in uk , normaly google search alone 85% yesterday 9% , rest site32 , sclick deliberate ? yes, possible.. such huge difference in day quite impressive or duplicitous. have @ geographical distribution of visitors. more diverse distribution less there foul play. are using service of proven company or miracle worker met @ starbucks? did seo guy tell you have keep using services keep numbers , steady?

python - How do I upgrade my Marionette js app from 1.x to 2.x? -

it looks there pretty massive shift 1.x 2.x. app doesn't work anymore. no errors. doesn't work. i'm 1.8.3 trying 2.4.1 take advantage of new collection optimizations. i see there tool upgrade: marionette upgrade but requires python knowledge run it. know nothing python. instructions running pretty foreign me. did install latest version of python on windows 7 machine i'm not understanding instructions on running tool. is approach upgrading? the biggest "issue" "start" event. before, listen "initialize:after" event stuff when app starts, event has been renamed "start". also, make sure read through https://docs.google.com/document/d/1fuxb9n5lwmdpn-temwao3c8jtx6ifuowbqfy1nnsdp8/edit# : you'll recognize bits of code need updated.

c++ - Code compiles, however crashes after start(rot13) -

so, have been fiddling around code ctf competition. however, every time run actual console application, keeps crashing. please explain me why. thank in advance. #include <iostream> #include <fstream> #include <string> using namespace std; int lowerconvert(char x) { int y; if (x == 'a') y = 1; if (x == 'b') y = 2; if (x == 'c') y = 3; if (x == 'd') y = 4; if (x == 'e') y = 5; if (x == 'f') y = 6; if (x == 'g') y = 7; if (x == 'h') y = 8; if (x == 'i') y = 9; if (x == 'j') y = 10; if (x =='k') y = 11; if (x == 'l') y = 12; if (x == 'm') y = 13; if (x == 'n') y = 14; if (x == 'o') y = 15; if (x == 'p') y = 16; if (x == 'q') y...

emacs - Hierarchical GTAGS TAG file -

one liner: looking "hierarchical" tags file setup whereas if global cannot find tagsdb in gtagsdbpath directory climbs dir chain till finds another. long liners: i have project file structure /vob/project-name/src/ ==> root of project src directory under directory there subdirs like: ./utils , ./common , ./iplib , ./ipv6lib , ./subsystem1 , ./subsystem2 etc i work on subsystem1 the big tags file huge. i have.. setenv gtagsroot /vobs/project-name/src setenv gtagsdbpath /vobs/project-name/src these take 40mins build. i have tags file in ./subsystem1/sre currently have 2 shell files: toptags : setenv gtagsroot /vobs/project-name/src setenv gtagsdbpath /vobs/project-name/src bottomtags: setenv gtagsroot /vobs/project-name/src/subsystem1/src setenv gtagsdbpath /vobs/project-name/src/subsystem1/src in way, can build top project file , bottomtags every , there churn is. also, currently, when (setq ggtags-update-on-save nil) e...

c# - Isolate users in signalR hub by domain -

i have web application single iis installation (this isn't changing), has dynamic collection of subdomains. each subdomain has own user accounts. the problem running when run signalr on it, treats sub-domains same domain, users happen have same user name each others messages. this causing me security violation issue between domain accounts. so far best guess solutions have different levels of risks , problems. each user gets own group, build group name sub-domain name + user name. list item minimizes risk of collision doesn't remove it. using guid domain name, , reserving first n-characters guid reduces risk further, each user online have group formed. on owin start, spin new hub represents each domain. each time add subdomain, have restart application add new hub. right now, don't have add subdomains dns supporting wildcard, , host header in iis blank. works except lack of subdomain awareness in signalr. build custom hub class, makes client collection d...

winforms - Add items to combobox with multiple values C# -

currently have combobox 3 hard coded items. each item carries 2 values. i'm using switch case statement values each item depending on item selected. switch(combobox.selectedindex) { case 0: // item 1 in combobox = 100; b = 0.1; break; case 1: // item 2 in combobox = 300; b = 0.5; break; //and on.... } i'm trying add feature allow user add more items combobox inputted , b values. how able dynamically add case statements , define values under each case condition? i've had @ using datatable instead don't know how multiple valuemembers out of datatable when 1 item selected. also, save user added items , it's corresponding values .dat file. when program re-opened able load list of items added user file. considered using streamwriter , readline i'm unsure how done. you can use binding on combobox using datasource. combobox can bound other things primitive values (string/int/hardcoded values...

How to retrieve data from SQLite faster in python -

i have following info in database (example): longitude (real): 70.74 userid (int): 12 this how fetch it: import sqlite3 lite con = lite.connect(dbpath) con: cur = con.cursor() cur.execute('select latitude, userid message') con.commit() print "executed" while true: tmp = cur.fetchone() if tmp != none: info.append([tmp[0],tmp[1]]) else: break to same info on form [70.74, 12] else can speed process? @ 10,000,000 rows takes approx 50 seconds, i'm aiming 200,000,000 rows - never through this, possible memory leak or that? from sqlite3 documentation: a row instance serves highly optimized row_factory connection objects. tries mimic tuple in of features. since row closely mimics tuple, depending on needs may not need unpack results. however, since numerical types stored strings, need processing. @jon clements pointed out, cursor iterable, can use comprehension, obtai...

c# - LINQ to XML Replace Value Issue -

i having issue when trying replace value of xelement. not sure doing wrong. simplified xml follows <payload> <field name="slug_locator"> <value>orig value</value> </field> </payload> here query ienumerable<xelement> fields = el in doc.descendants("field") el.attribute("name").value == "slug_locator" select el; foreach (xelement el in fields) { e.value = "new value"; } if check el in each statement says value = orig value. assumed change , expect see this <payload> <field name="slug_locator"> <value>new value</value> </field> </payload> but , dont know why <payload> <field name="slug_locator">new value</field> </payload> any appreciated! currently, yo...

Removing \ from php/mysql insert -

i have insert statement using php/mysql in wordpress environment , when creates new entry has apostrophe in title (like mike's post) database adds \ name. looks mike\'s post in mysql. how can remove when sql insert performed inserts mike's post. i'm not sure if wordpress gets in way , complicate things not. note: stripslashes has done nothing far , on shared hosting cannot access php.ini, assume magic quotes on. echo "<td><a href=\"http://example.com?writing=$all[sid]\">$all2[name]</a></td>"; don’t care char. safe mysql_* function. please check magic_quotes_gpc option in php.ini. if(get_magic_quotes_gpc()){ //enabled //auto stripped without slashes when select row . } else { //disabld //please use stripslashes stripped slashes. $col = stripslashes($row['col']); } stripslashes() returns string backslashes before characters need escaped. these characters single quote ('), do...

wamp - Alias to localhost folder -

i'm trying setup wamp environment again. , forget have able go "test.dev" insteath of "localhost/testproject/index" what have make work? edit c:\windows\system32\drivers\etc\hosts administrator , add line 127.0.0.1 test.dev remove "#" in # include conf/extra/httpd-vhosts.conf , save , close httpd.conf file. add in c:\wamp\bin\apache\apache2.x.x\conf\extra\httpd-vhosts.conf (where x.x apache version) <virtualhost *:80> serveradmin webmaster@yourdamin.com documentroot "c:\wamp\www\yourfolder" servername test.dev </virtualhost> restart apache

javascript - Access Backbone fetch parameters -

i need able pass server info when calling fetch on backbone collection. on front-end have code, passing data:{} fetch function along success , error callbacks. looking @ docs backbone fetch: http://backbonejs.org/#collection-fetch perhaps not passing in parameters correctly fetch function? perhaps should in array []... var lineupcollection = new lineupcollection([]); var loadteamsonpageload = (function() { lineupcollection.url = '/api/lineups'; lineupcollection.fetch( { processdata: true, data: { team_id:$("#team_id").attr("value") } }, { success: function (result) { if(window.teamdashboardtableview === undefined){ window.teamdashboardtableview = new teamdashboardtableview({el: $("#team-dashboard-table-div")}); } window.teamdashboardtableview.render(); }, error...

regex - How do I replace every dash (-) with a random number in javascript? -

i have have codes abcde-----abcd----abc--, each (-) needs random number. i have no problem using replace function change single dash random number, have no clue how make each dash random number. note: each number doesn't need unique. here now, need numbers not same. http://jsfiddle.net/oqrstsdm/ var minnumber = 1; var maxnumber = 9; randomnumberfromrange(minnumber, maxnumber); function randomnumberfromrange(min, max) { var number = (math.floor(math.random() * (max - min + 1) + min)); var str = "abcde-----fgabc--"; var res = new regexp("-", "g"); var code = str.replace(res, number); document.getelementbyid("ccode").innerhtml = "code: " + code; } you use function second argument in string.prototype.replace() . var str = "abcde-----fgabc--"; var code = str.replace(/-/g, function() { return math.floor(math.random() * (max - min + 1)) + min; });

matlab - How to calculate 1D power spectrum from 2D noise power spectrum by radial averaging -

guys trying calculate 1d power spectrum 2d fft of image. did horizontal averaging looking @ graph it's not making me sense. can please suggest how radial averaging on 2d data set reach 1d representation of noise power spectrum. thank appreciate help. here code $ fid = fopen('c:\users\3772khobrap\desktop\project related\nps_cal_data_ub\100000006.raw','r'); img = fread(fid,[512 512],'uint16'); roi = zeros(64); avg = zeros(64); ux= 0.0075;% pixel size uy = 0.0075;% pixel size %% block of code subdividing imaage smaller roi , averaging purpose r = 1:8 r_shift = (r-1)*64; c = 1:8 c_shift = (c-1)*64; = 1:64 j = 1:64 p = img(i+r_shift,j+c_shift); roi(i,j) = p; end end avg = avg+roi; end end avg = avg./64; %%actual process of nps calculation scale = (ux*uy)./(64*64);%scaling fator per nps calculation formula f_x = 1/(2*ux);%nyquiest frequecy along x dire...

postgresql - perform select fails to compile postgres -

i have sql in want test whether record exists. tried perform select vote,file vote.file_id=file.file_id , vote.uid = userid , file.basename=abase[1]; with idea of testing whether item given uid , basename found. compiler complained error @ select . make compile had declare version , write: select file.basename version vote,file .... can explain why perform here failed? have other seemingly identical code works fine. thanks. from postgresql doc, see http://www.postgresql.org/docs/9.1/static/plpgsql-statements.html note: 1 might expect writing select directly accomplish result, @ present accepted way perform. sql command can return rows, such select, rejected error unless has clause.

xml - How to implement Tuner dial or horizontal wheel view in android -

how implement tuner dial or horizontal wheel view in android.. this: http://hmonitoring.comuf.com/screen568x568.jpeg for such purpose either need create custom view or can take @ here , might solve issue or can further search on horizontal wheel view android on google.

Flexible width and height of pre-rendered image using Shiny and renderImage() -

i calling bunch of pre-rendered images shiny app using renderimage(). these png images in sidebar , adjust in width , height depending on browser or device type (e.g., chrome, android). thus, want app mobile friendly. can't figure out how make flexible (e.g., max-width = 500px or width = 100% in other languages). a simple example: shinyui(fluidpage( titlepanel("title panel"), sidebarlayout( sidebarpanel( "sidebar panel", sliderinput("route", label = "route number:", min = 1, max = 5, value = 1), imageoutput("image")), mainpanel("main panel") ) )) and server.r: shinyserver(function(input, output) { output$image <- renderimage({ filename <- normalizepath(file.path('www/maps', paste(input$route, '.png', sep=''))) list(src = filename, alt = pas...

html - How to show only one element ande hide other element using javascript? -

how show 1 element ande hide other element using javascript ? when click on id="x_1" want show id="ele-1" element , hide other elements and when click on id="x_2" want show id="ele-2" element , hide other elements and when click on id="x_3" want show id="ele-3" element , hide other elements and when click on id="x_4" want show id="ele-4" element , hide other elements and when click on id="x_5" want show id="ele-5" element , hide other elements and when click on id="x_6" want show id="ele-6" element , hide other elements i don't know how ? thank you http://jsfiddle.net/a3mkg/63/ <script> function showdiv(data) { $("#ele-"+!data).hide(); $("#ele-"+data).toggle(); } </script> hi have created jsfiddle please have look. if need clarification please ping me. jsfiddle samp...

ios - Clear Banner Notification When Tapped -

i have noticed when select push notification app notification center, notification no longer appears in list of notifications. however, when receive notification , tap banner right away, app opens should, when pull down view notification center, notification still there. have following push handling code in delegate: - (void)application:(uiapplication *)application didreceiveremotenotification:(nsdictionary *)userinfo { [[uiapplication sharedapplication] cancelalllocalnotifications]; //presenting view controllers... } - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { // override point customization after application launch. // extract notification data nsdictionary *notificationpayload = launchoptions[uiapplicationlaunchoptionsremotenotificationkey]; if(notificationpayload) { [[uiapplication sharedapplication] cancelalllocalnotifications]; } return yes; } - (void)appl...

javascript - How to delete last white space in the array when concatenating? -

i need have javascript alert without space between last word , exclamation mark. the final alert should like: i own garden verymuchmuch verymuchmuch! here code have space before. var inittext, closetext, msg = ""; var i, j, k; var myarray = new array(3); myarray[0] = "my"; myarray[1] = "own"; myarray[2] = "garden"; inittext = "i "; closetext = "!"; (k=0; k < 3; k++) { inittext = inittext + myarray[k] + " "; } (j=0; j < 2; j++){ inittext = inittext + "very"; (i=0; < 2; i++){ inittext = inittext + "much"; } inittext = inittext +" "; } msg = inittext + closetext; alert(msg); you check not add white space in way: var inittext, closetext, msg = ""; var i, j, k; var myarray = new array(3); myarray[0] = "my"; myarray[1] = "own"; myarray[2] = "garden"...

ruby - Rails 4: Devise not populating users table with correct information -

Image
i have small rails 4 app has devise , simple form installed. my controller this: class usercontroller < applicationcontroller def create user.create(user_params) end private def user_params params.require(:user).permit(:first_name, :last_name, :profile_name, :email, :password, :password_confirmation]) end end my form sign follows: <h2>sign up</h2> <%= form_for(resource, as: resource_name, url: registration_path(resource_name)) |f| %> <%= devise_error_messages! %> <div class="field"> <%= f.label :first_name %><br /> <%= f.text_field :first_name, autofocus: true %> </div> <div class="field"> <%= f.label :last_name %><br /> <%= f.text_field :last_name, autofocus: true %> </div> <div class="field"> <%= f.label :profile_name %><br /> <%= f.text_field :profile_name, autofocus: ...

How can I create this linked list with stack in C? -

Image
i can create linked list. not managed create stack it. (stack cannot more 5, , can empty shown in link). how can it? (c language c++ functions new int allowed) the structure like: struct linkedstack { int elements[5]; int top; struct linkedstack *next; }; then manage stack top (equals 0 @ beginning)...

java ee - Does CDI @Transactional REQUIRES_NEW works in local methods -

does cdi @transactional(transactional.txtype.requires_new) works when called inside same bean: @transactional public void method1() { for(...) { method2(); } } @transactional(transactional.txtype.requires_new) public void method2() { ... } i suppose doesn't works because local calls can't intercepted proxy. in case recommeded usage pattern if want manage each call of method2 in new transaction. obvious 1 create bean, it's don't like. interception of local method calls not work cdi , cannot inject class directly (cyclic dependency). see cdi call interceptor annotated method within same instance the self injection issue still open, see https://issues.jboss.org/browse/cdi-414

algorithm - How to choose fitness function Heuristiclab for classification? -

i have classification problem. want use heuristiclab solve it. when tried see fitness function parameter, there 2 textboxes (start,end) don't know means? , how can choose best fitness problem? here link: http://dev.heuristiclab.com/ . i use labeled dataset uci. task use genetic optimization tool predication. thanks

vbscript - Find the count and position of a character- VB script -

how find count of character in string , index value in vb script. example "lion king of jungle" in example if n count 3 , position 3,10 , 18. use regexp - in: option explicit dim s : s = "lion king of jungle" dim c : c = "n" dim r : set r = new regexp r.global = true r.pattern = c dim ms : set ms = r.execute(s) wscript.echo "found", ms.count, "tokens of", c dim m each m in ms wscript.echo m.firstindex + 1 next output: cscript 29181557.vbs found 3 tokens of n 4 11 19 the + 1 adjusts vbscript's 1 based string indices.

css - html change color on youtube video -

Image
i need help. have seen on many different websites have changed color of youtube video menu. this 1 i dont know how change color. my code. <iframe width="760" height="428" src="https://www.youtube.com/embed/92hogzqvtow" frameborder="0" allowfullscreen></iframe> if know how change color please write comment have been searching everywhere , have not found asnwer. hope can 1 here :) thank you edit: answer deprecated since youtube has changed how player works. i'll try update answer when can. you can change specifying color when embed youtube video mentioned in documentation here . color (supported players: as3, html5) parameter specifies color used in player's video progress bar highlight amount of video viewer has seen. valid parameter values red , white , and, default, player use color red in video progress bar. unfortunately seems as3 , javascript deprecated have use youtube iframe e...

java - Performing more than one reduction in a single pass -

what idiom performing more 1 reduction in single pass of stream? have 1 big reducer class, if violates srp if more 1 type of reduction computation required? presumably want avoid making multiple passes, pipeline stages might expensive. or want avoid collecting intermediate values in order run them through multiple collectors, since cost of storing values might high. as brian goetz noted , collectors.summarizingint collect int values , perform multiple reductions on them, returning aggregate structure called intsummarystatistics . there similar collectors summarizing double , long values. unfortunately these perform fixed set of reductions, if want reductions different do, have write own collector. here's technique using multiple, unrelated collectors in single pass. can use peek() take crack @ every value going through stream, passing through undisturbed. peek() operation takes consumer , need way adapt collector consumer . consumer collector's accumu...

python - Finding every permutation of character-substitutions in a word -

while may seem already-answered question, it's not. i trying find way following: i have known string, e.g "i love dogs" i have bunch of possible characters, eg "@!470" i have bunch of characters should substitute in "known string", e.g s,e i want way substitute every interaction, in known string "i love dogs", 1 single character known in "possible characters", , let else unchanged. when finished, start substituting 2 characters @ time when finished, start substituting 3 characters @ time and on till have no more "possible characters" an example of output expected described below: i have known string "this string" i have list of possible characters "!$" i have characters substitute "is" first, program proceed changing every in !, having: "th!s !s str!ng" next, change s in $: "thi$ i$ $tring" now finished 1-character permutation , need start ...

jpa - EJB Session beans/methods transaction attributes -

i became in charge ejb 3.1/jpa part of our project running on glassfish 4.0. quite new ejb , not confident in session beans(and/or methods) transaction attributes. dealing stateless session beans. read not_supported, never, supports transaction attributes should used caution because behavior varies app server vendor. actually, not find statements in other sources. vendor specific? also, correct not annotating method or bean defaults required transaction attribute it? and here situation. let's have transaction t , 2 stateless beans , b methods ma , mb. ma calls mb. possible combinations transaction attributes of these methods transaction t go successfully? know if ma has required , mb has never exception throw. supports on mb kind incoming transaction - safe option make sure transaction go through method without error? thank you glassfish 4.0 reference implementation of java ee 7 , according release notes supports enterprise javabeans 3.2 ( jsr-345 ). i re...

ember.js - Ember.handlebars boundIf didn't call calculated property -

i try migrate project form ember cli 0.1.2 0.1.15. current problem next: i have can-helper. works fine @ older ember @ newer version can-blocks absent. can-helper use calculated property in model, try set debugger calculation function - work on 0.1.2 , didn't work @ 0.1.15 original ember - 1.7.0-beta.1 try migrate ember - 1.9.1 as found implementation of boundif helper changed. have ideas / experience such trouble? p.s. code of can-helper below var = ember.get, isglobalpath = ember.isglobalpath, normalizepath = ember.handlebars.normalizepath, is_binding = ember.is_binding; var getprop = function(context, property, options) { if (isglobalpath(property)) { return get(property); } else { var path = normalizepath(context, property, options.data); return get(path.root, path.path); } }; export default function(permissionname, property, options) { var attrs, context, key, path, permission; // property optional, if we've got 2 arguments property...

Spring framework jar file comparison -

can 1 explain me difference between spring-aop-4.0.3.release-javadoc.jar , spring-aop-4.0.3.release-sources.jar thanks in advance. -javadoc javadoc, api documentation spring-aop library. @ on website it's have local copy in case internet goes down , confirm you're looking @ documentation same version you're coding to. -sources source code of spring-aop library, .java files compile library itself. needed if want build spring-aop yourself.

java - Pattern.compile null Syntax Exception -

the pattern line keeps throwing null-pointers , have no idea why. tried pattern.quote , comes as: pattern p: \q.*(bread){1, 1}.{1, 1}(bread){1, 1}.*\e|java.util.regex.matcher[pattern=\q.*(bread){1, 1}.{1, 1}(bread){1, 1}.*\e region=0,13 lastmatch=] and totally not should be. want return string between 2 bread substrings. public string getsandwich(string str) { pattern p = pattern.compile(".*(bread){1, 1}(.{1, 1})(bread){1, 1}.*"); matcher m = p.matcher(str); if (m.find()) { return m.group(2); } else { return ""; } } any ideas? you have syntax error in pattern: .*(bread){1, 1}(.{1, 1})(bread){1, 1}.* no space ---^ here -^ , here ---^ btw, what's point of having quantifier expressed {1,1} ? test here: http://fiddle.re/y2mxd6

c++ - Which is the minimum Visual Studio version or edition to develop both for Win32 and Win64? -

our windows application (developed in delphi) shipped in 32-bit , 64-bit editions. users can write plugins it. if target 32-bit edition, need create 32-bit dll. if target 64-bit edition, need target 64-bit dll. i create sample application in visual studio c++ can used reference hacking it. i visual studio solution provided example able have in place compile sample dll both win32 , win64. which minimum (preferably free) visual studio c++ edition or version need able compile both win32 , win64. tried visual studio 2010 express not seem let add win64 target platform. vs2012 express includes 64 bit compiler. possible persuade earlier versions of express edition use 64 bit tools, it's quite tricky set up.