Posts

Showing posts from March, 2015

javascript - Dynamically generated navbar and AngularJS -

i not find easy way explain following, apologize if not clear enough. i have navigation bar each item category of articles. navigation item read database , can modified back-office. i categories via angularjs controller : app.controller('apicontroller', ['$scope', '$http', function($scope, $http) { $http.get('/categories') .success(function(categories) { $scope.categories = categories; }); }]); <div class="collapse navbar-collapse" id="target-navbar-main"> <ul class="nav navbar-nav"> <li ng-repeat="category in categories"> <a href="/<% category.slug %>" title="<% category.name %>"><% category.name %></a> </li> </ul> </div> in body of page, using controller articles of given category can't find way make navbar communicate arti

User-Defined Table Types Documentation in SQL Server 2012 -

i tried find documentation user-defined table types in sql server 2012 find 2008 r2 documentation here . i know can used in sql server 2012 should considered them bad practise or obsolete if there no documentation sql server 2012? user defined table types in 2012 , 2014. in ssms under programmability/types , see tab user defined table types.

interpolation - Algorithm to iteratively discover points on an arc described by three points -

Image
i writing graphics application needs calculate , display list of points along curve arc described 3 points. lets have points (1,1), (2,4) , (5,2). need algorithm can give me values of y each x 1 5 fall on interpolated arc. i'm sure simple task math whizes out there, me it's bit beyond mathematical payscale. thanks in advance! so problem how compute center c = (c1, c2) , radius r of circumference given 3 points p = (p1, p2) , q = (q1, q2) , s = (s1, s2). the idea simple. consists in realizing that, definition, center has same distance 3 points p , q , s. now, set of points equidistant p and q perpendicular segment pq incident @ mid point (p+q)/2 . similarly, set of points equidistant q , s perpendicular qs passing thru (q+s)/2. so, center c must intersection of these 2 lines. let's compute parametric equations of these 2 straight lines. for need 2 additional functions call dist(a,b) computes distance between points a , b , perp(a,

c# - MonoTorrent magnet link download does not start -

Image
i believe monotorrent library can this, due lack of documentation haven't been able working. to start with, monotorrent seems able download original torrents using following code: https://smuxi.im/wiki/monotorrent/managing_torrents but due increase of magnet links popularity, would magnet links working well . "trick" of getting .torrent out of them (like using ones µtorrent generates) doesn't work me either when using same code above. stays stuck this, founding 1-3 peers per second making no progress : stackoverflow best question / answer @ topic monotorrent - magnet link torrent file unfortunately answer didn't match monotorrent constructors following: public torrentmanager(torrent torrent, string savepath, torrentsettings settings); public torrentmanager(magnetlink magnetlink, string savepath, torrentsettings settings, string torrentsave); public torrentmanager(torrent torrent, string savepath, torrentsettings settings, string basedirectory); publ

C++ Pointer addition being multiplied -

this question has answer here: c++ pointer arithmetic weirdness 5 answers i working on packet code, , need move pointer x bytes. when tell pointer pointer = pointer + x; proceed print pointer via to_string or cout, x*2 has been added pointer. have tried multiple values, both constant , variable. have verified pointer's value before operation. thing can think when happens 3 being bit-shifted somewhere. ideas? sample code: cout << "before: " << pointer << "\n"; pointer = pointer + 3; cout << "after: " << pointer << "\n"; output: before: 0x7ffff4604e93 after: 0x7ffff4604e99 my includes: #include <cstring> #include <cstdlib> #include <cstdarg> thank you, mike pointer = pointer + x; not move pointer x bytes, moves x * sizeof(*pointer) bytes. in ca

sql - Can I create a MYSQL select statement with a column which consists on another select statement? -

i'm trying export data old drupal site. hoping mysql query this: select users.uid, name, pass, mail, created, (select rid users_roles users_roles.uid = users.uid) all_rids users so row of output might like: "1000", "frank smith", "123456", "frank@example.com", "12/15/2012", "3,7,12" the point last column array consisting of values select statement ...sorry, forget proper terminology type of query, pretty sure possible in sql server. is possible in mysql? if so, syntax? there may multiple matches. think want use group_concat() in subquery: select users.uid, name, pass, mail, created, (select group_concat(rid) users_roles users_roles.uid = users.uid ) all_rids users;

php - Selenium PHPUnit_Extensions_Selenium2TestCase_Element::fromResponseValue() -

i'm following examples book phpunit essentials zdenek machek , i'm on section functional tests using selenium. i downloaded server, webdrivers , firefox ide. the test class exported firefox ide: class seleniumfirsttest extends phpunit_extensions_selenium2testcase { protected function setup() { $this->setbrowser('firefox'); $this->sethost('127.0.0.1'); $this->setport(4444); $this->setbrowserurl('https://www.google.com.br/'); } public function testcasephp() { $this->url("/?gws_rd=ssl"); $this->byid("lst-ib")->value("phpunit"); $this->bylinktext("documentation")->click(); $this->bylinktext("13. phpunit , selenium")->click(); $result = $this->bycssselector("h1.title")->text(); $this->assertequals("chapter 13. phpunit , selenium", $result);

ios - Xib fatal error -

i have .xib called contentview.xib , set custom class subview of uiview. error when try , run app: fatal error: init(coder:) has not been implemented: here code: class contentview: uiview { override init() { super.init(frame: cgrect( x: 0, y: 0, width: screen.width, height: screen.height)) nsbundle.mainbundle().loadnibnamed("contentview", owner: self, options: nil) } required init(coder adecoder: nscoder) { super.init(coder: adecoder) fatalerror("init(coder:) has not been implemented:") } i have looked nscoder , couldn't find fix it. it because of code: fatalerror("init(coder:) has not been implemented:") you raising assertion , crashing app yourself, remove code, work well.

angularjs - angualrjs: escape slashes from parameter value passed to $http.get -

i using simple http call in angularjs , passing query string parameters. one of param date. let's "update" , value passed 03/20/2015. when make $http.get call passing "update" query string parameter, the request sent as http://myservice.com/services/products?update=03%2f20%2f2015 i send as http://myservice.com/services/products?update=03/20/2015 any appreciated. i suggest replace slashes dashes in date: 03-20-2015 here can find more informations

xcode - Parse - Query and send push notification to custom class -

i trying send push notification users when data in submission class created changes in status column keep getting error in xcode in "let pushquery = pfsubmission.query()" have "use of unresolved identifier 'pfsubmission'." //install push function func application(application: uiapplication, didregisterforremotenotificationswithdevicetoken devicetoken: nsdata) { let installation = pfinstallation.currentinstallation() installation.adduniqueobject("status", forkey: "channels") installation.setdevicetokenfromdata(devicetoken) installation.saveinbackground() let pushquery = pfsubmission.query() pushquery.wherekey("status", equalto: "1") // send push notification query let push = pfpush() push.setquery(pushquery) // set our installation query push.setmessage("test 1 message here") push.sendpushinbackground() i not using framework, cannot noticing

javascript - How to return value from an asynchronous callback function? -

this question has answer here: how return response asynchronous call? 24 answers this question asked many times in so. still can't stuff. i want value callback. @ script below clarification. function foo(address){ // google map stuff geocoder.geocode( { 'address': address}, function(results, status) { results[0].geometry.location; // want return value }) } foo(); //result should results[0].geometry.location; value if try return value getting "undefined". followed ideas so, still fails. those are: function foo(address){ var returnvalue; geocoder.geocode( { 'address': address}, function(results, status) { returnvalue = results[0].geometry.location; }) return returnvalue; } foo(); //still undefined this impossible cannot return asynchronous call inside s

java - Random Coin Flipper output number of times run -

i attempting write program in java flips imaginary coin , outputs flips , when side has been flipped 3 times, stops , tells number of times flipped. program doesn't seem working my code below: import java.util.*; public class flipperthree { public static void main(string[] args) { boolean fin = false; while(!fin){ system.out.println("welcome flipper!"); int h = 0; int hcount = 0; int tcount = 0; int ocount = 0; string random; string[] ht; boolean done = false; while(!done){ for(hcount<3||tcount<3){ht = new string[] {"heads","tails"}; random r =new random(); random = ht[r.nextint(ht.length)]; system.out.println(random); } if (hcount!=3||tcount!=3){ if(random == ht[h]){ hcou

android - activity in running app list after alarm -

i started developing android , ran problem. i made basic application in wich can set timer between 5 , 60 seconds. after button press intent starts pendingintent wich register alarm in android alarmmanager. i can set alarm 30 seconds, close application, remove running application list , wait. eventhough application totally shut down, after 30 seconds custom made activity simple view pops-up , can stop alarm. the problem: though removed application running app list after did set alarm, after goes of , pressed stop alarm button activity closed see activity in running app list..... can click on , basic custom made acticity pops-up again. in stop button onclick() call finish() in onstop() call super.onstop().... how show custom alarm activity stop alarm button , after stopping or snoozing not show in running app list? thanks! you can use android:excludefromrecents="true" attribute activity <activity /> tag in manifest file.

swift - Custom Tab Bar button Not hiiding on push -

i have 5 tabs , center button custom, created uitabbarcontroller class customize center button. happening when hidesbottombarwhenpushed tab bar becomes hidden except center custom button still visible & not disabled , when tab class tabbar: uitabbarcontroller { @iboutlet weak var centerbutton:uibutton! override func viewdidload() { super.viewdidload() let nimage = uiimage(named: "infobutton") let bimage = uiimageview(image: nimage!) bimage.frame.size = cgsize(width: 50, height: 50) let cbutton: uibutton = uibutton.buttonwithtype(uibuttontype.custom) uibutton cbutton.autoresizingmask = uiviewautoresizing.flexiblerightmargin | uiviewautoresizing.flexibleleftmargin | uiviewautoresizing.flexibletopmargin | uiviewautoresizing.flexiblebottommargin cbutton.frame = cgrectmake(0,0, 50, 50) cbutton.setbackgroundimage(nimage, forstate: uicontrolstate.normal) cbutton.setbackgroundimage(nimage,

ember.js - Ember data - Multiple namespaces for single model -

i have ember data model named activity . depending on current route, need call services populate store activities different api namespaces. while current activityadapter looks this: app.activityadapter = ds.restadapter.extend({ namespace: 'services/activities' }); i want this: app.activityadapter = ds.restadapter.extend({ if (this.get('currentroute') === "user") { namespace: 'services/users/activities' } else { namespace: 'services/activities' } }); i can't seem find solution this, , best can think of right hack involves creating separate useractivity model has same properties activity model, , specifying separate useractivityadapter . has else run issue? input appreciated! do control api on server? if so, change /services/activities endpoint accept optional userid query param. so target same namespace: get /services/activities => returns activities get /services/activi

ruby on rails 4 - heroku run rake db:migrate Error connecting to dyno -

i new on ruby on rails. , trying deploy application local system heroku, when run heroku run rake db:migrate , error msg: running rake db:migrate attached terminal... up, run.7855 ! ! error connecting dyno, see https://devcenter.heroku.com/articles/one-off-dynos#timeout-awaiting-process i've followed link site didn't understand said there. please how deploy appreciated. thank you seems have no access rendezvous.runtime.heroku.com:5000 ask system administrators or internet service provider allow address , port you this problem solution described @ https://devcenter.heroku.com/articles/one-off-dynos#timeout-awaiting-process , didn't understand @ once :) you can check access necessary resource telnet rendezvous.runtime.heroku.com 5000 command update: encountered problem when rendezvous.runtime.heroku.com:5000 accessible heroku run ... command doesn't work. in case command must modified heroku run:detached ... it helped me, interactive ut

How to move a gradle function from build.gradle into a plugin? -

currently, have few utility functions defined in top level build.gradle in multi-project setup, example this: def utilitymethod() { dosomethingwith(project) // project magically defined } i move code plugin, make utilitymethod available within project applies plugin. how do that? project.extension? plugins not meant provide common methods tasks . when comes extensions should used gather input applied plugins: most plugins need obtain configuration build script. 1 method doing use extension objects. more details here . have @ peter's answer , using closures carried via ext might looking for.

javascript - recursion functional programming dilemma -

below code in javascript. loop answer down @ bottom correct answer. my recursion version incorrect , illogical when index 3 , array length 3 computer still enter if statment... why? if 3 not less 3, computer should not enter if statement. me fix recursion answer. loop correct , fine , should left alone. var data = [ { name: "jamestown", population: 2047, temperatures: [-34, 67, 101, 87] }, { name: "awesome town", population: 3568, temperatures: [-3, 4, 9, 12] }, { name: "funky town", population: 1000000, temperatures: [75, 75, 75, 75, 75] } ]; recursion answer function john( arr, i, j, total, coord) { var total = total || 0; var coord = coord || []; if(i < arr.length) { if(j < arr[i].temperatures.length) { total = arr[i].temperatures[j] + total; john(arr, i, j + 1, total, coord) } ave = total / arr[i].temperatures.length; total = 0; coord.push([av

progress bar - WPF ProgressBar tick marks -

Image
how style progressbar use old fashioned tick marks? there question , winforms. i hope following style starting point. leave style green ticks (the background of first rectangle of visualbrush). <style targettype="{x:type progressbar}"> <setter property="template"> <setter.value> <controltemplate targettype="{x:type progressbar}"> <grid> <visualstatemanager.visualstategroups> <visualstategroup x:name="commonstates"> <visualstate x:name="determinate" /> <visualstate x:name="indeterminate"> <storyboard> <objectanimationusingkeyframes duration="00:00:00"

Avoiding Android ListView from recycling until after animation -

i have animation going on items in listview, , don't want listview item recycled until after animation finished. there way apis lower 16? if have case needs keep view recycle, @ video: https://www.youtube.com/watch?v=8mifsxgshis use view property animator (keep view recycle until animation done): view.animate().setduration(1000).alpha(0).withendaction(new runnable() { @override public void run() { … view.setalpha(1); } }); or 2. set view transient state, not recycled until clear transient state: view.sethastransientstat(true); view.sethastransientstat(false);

Java newbie needing friendly helpful advise with reading in a textfield to make a button appear/change -

firstly, have started coding in java evening apologizes if seem total newb , code atrocious, im novice. want image change colour when number entered text field on separate j frame. car appears blue when loaded , if press 1 car moves , changes color. issues cant seem access text variable manipulate it. appreciated, thank x public class imagebackground extends jframe { public static void main(string[] args) throws exception { jframe f = new jframe("crossroads simulation"); textdemo textdemo = new textdemo(); try { f.setcontentpane(new jlabel(new imageicon(imageio.read(new file("c:/users/stacy/workspace/test/crossroadsbackground.png"))))); } catch(ioexception e) { system.out.println("image doesnt exist"); } f.setresizable(false); f.pack(); f.setvisible(true); jbutton button = new jbutton(new imageicon("c:/users/stacy/workspace /test/carblueone.png")); button.setsiz

html - 3 Column setup CSS problems -

hello trying setup 3 three columns using code below <div class="col1"></div> <div class="col2"></div> <div class="col3"></div> **css** .col1 { background-color: #ddf; float: left; } .col2 { background-color: #dfd; float: none; } .col3 { background-color: #fdd; float: right; } but cannot working if take http://paycoinfaucet.cf/test/ see last column doesn't align other two thanks help setting every div inline-block 33% of width, divs resize page. .col1 { display: inline-block; width: 33%; background-color: #ddf; } .col2 { display: inline-block; width: 33%; background-color: #dfd; } .col3 { display: inline-block; width: 33%; background-color: #fdd; } i suggest take @ bootstrap rows <row> <div class="col1 col-md-4"></div> <div class="col2 col-md-4"></div> <

javascript - Errors in Ajax Control Toolkit's JS files after upgrade? -

i upgraded ajax control toolkit v15.x , have been working on cleaning code after doing so. i'm running across exceptions being thrown, , vs breaks @ points in toolkit's js files. i'm not sure why or how. i've double-checked scripts not referenced multiple times, leading suggestion on google, still haven't figured out. i need this, have 2 months invested in project. way, i'm using vs2013 , project in asp/vb. here couple of errors (to next, i've hit continue): unhandled exception @ line 1647, column 38 in http://localhost:50236/scriptresource.axd?d=d9drwtsj4hba6o8uht6cqmpvfriilrnrich93dvwgtp67e1h_mwkzofwldgs9bmtlj8olqcr6zhxtnsvz0umliymkk0gfdoqtlznle2yqi2elwox58_2mzeceflkjdg6fbv26oe3vanxwpdhskxpgciaybdvlsawwdxpe-98sv01&t=ffffffffb53e74b8 and unhandled exception @ line 785, column 42 in http://localhost:50236/scriptresource.axd?d=d9drwtsj4hba6o8uht6cqmpvfriilrnrich93dvwgtp67e1h_mwkzofwldgs9bmtlj8olqcr6zhxtnsvz0umliymkk0gfdoqtlzn

javascript - Testing CSS ':hover' pseudo-class -

i'm having real trouble testing behaviour of css :hover pseudoclass. i've tried following approach, wrapping test.assertequals in event listener casper.on('mouse.move', function(){test.assertequals(...);}) no avail. i've tried multiple combinations of casper.mouse.move , casper.mouseevent('mouseover', rightarrowid); no result either. the relevant part of tests following. i'm testing webpage running on localhost , other tests run fine. ... var rightarrowid = "#right"; casper.test.begin("on hover, navigation widgets change opacity", function(test) { casper.then(function() { casper.capture("abouttomove.png"); casper.mouse.move(rightarrowid); test.assertequals(customasserts.isopaque(rightarrowid), true, "on hover, 'right' widget becomes opaque"); }); casper.then(function() { casper.capture("aftermove.png"); }); casper.run(function() { test.done(); }); ... var

In an Android app, can I direct menu item to a Google Maps page? -

my android app works simply. works this. my app has list of places menu. , when hit place button on list, directs google maps page, using cell phone's default browser. in kind of simple usage, still need api? is legal / ok use google maps in app this? yes, can direct google maps in browser application another way can use mapfragment in application, initialise google maps work in application. so, using way not directing outside application. i assume know using google maps, need use google maps api : check this

Is there a faster way go compare two, unequal ranges in excel vba? -

this take forever execute. there faster way? function add_column_binary(sheet_name_from string, col_from integer, sheet_to string, col_to integer) ' set range - range looped through find key searching second range dim first_range range ' set ragen - range in teh second sheet repeatedly searched dim second_range range set second_range = set_range(sheet_to, col_to) ' find last column dim last_col integer last_col = worksheets(sheet_to).cells(1, columns.count).end(xltoleft).column ' label last column worksheets(sheet_to).cells(1, last_col + 1).value = "invited = 1" dim rows1 long rows1 = first_range.cells(rows.count, col_from).end(xlup).row + 1 ' grab length of range on first sheet dim n long dim constructed_id string dim find_result range n = 2 rows1 constructed_id = "objectid(" & first_range.cells(n, 1) & ")" ' format object id set find_re

c# - Correct way to transfer SelectedItemViewModel to another page in Windows Phone 8.1 -

i'm building universal app i'm concentrating on wp8.1 part of right now. i'm using mvvmlight project. for simplicity sake, we'll assume have 2 pages in project. page1.xaml contains list has various items. page1.xaml binded own viewmodel i.e. page1viewmodel. each item in list represents viewmodel i.e. itemviewmodel. when tap on item, call following code: public relaycommand<itemviewmodel> itemtapcommand { { return this._itemtapcommand ?? (this._itemtapcommand = new relaycommand<itemviewmodel>((msg) => executeitemptapcommand(msg))); } } when item in list tapped, call following code: private object executeitemptapcommand(itemviewmodel selecteditemviewmodel) { page2viewmodel page2viewmodel = simpleioc.default.getinstance<itemviewmodel>(); page2viewmodel.selecteditem = selecteditemviewmodel; _navigationservice.navigate(typeof(page2), selecteditemviewmodel);

c# - MonoDevelop: IDE does not auto-format braces -

i trying write c# code in monodevelop ubuntu linux, editor not format braces. used format them nicely, so: void method() { if (condition) { //... } } then 1 time reopened monodevelop, editor started leaving left brace hanging: void method() { //cursor left here after pressing enter, no right brace after went edit > preferences > text editor > behavior > checked "insert matching brace", editor started appending } end of block. however, problem code formatted eclipse/java-style, don't want. see below: void method() { if (condition) { //... } } for reason, going edit > preferences > source code > code formatting > c# > setting policy "microsoft visual studio" doesn't this. "enable on fly code formatting" checked off, too. edit > format > document works though, don't know what's wrong. edit > preferences > source code > code formatting ide

vbscript - Copy File Over, then rename VBS -

so, had user me out in getting file renamed, fantastic! here code: set fso = wscript.createobject("scripting.filesystemobject") set fol = fso.getfolder("f:\downloads") each fil in fol.files 'may need specify comparison if instr(1, fil.name, "tv show bob - 13", vbtextcompare) <> 0 ext = fso.getextensionname(fil) if len(ext) > 0 ext = "." & ext sname = "tv show bob s03e13" & ext fil.name = sname end if next wscript.echo "completed!" but issue come across file being used torrent program. right now, standard files use line of code: if (objfso.fileexists("d:\tv shows\tv\tv show s01e02.mkv")) else objfso.copyfile "d:\downloads\tv show - 02 [1080p].mkv", "d:\tv shows\tv\tv show s01e02.mkv" end if i wondering if possible have copy file, paste renamed version using first section of code. :d

objective c - Correct method to present a different NSViewController in NSWindow -

i developing app single nswindow , clicking button inside window present nsviewcontroller , , button exists in controller present different nsviewcontroller . know how swap out views in window, ran issue trying multiple view controllers. have resolved issue, don't believe accomplishing behavior in appropriate way. i defined method in appdelegate : - (void)displayviewcontroller:(nsviewcontroller *)viewcontroller { bool ended = [self.window makefirstresponder:self.window]; if (!ended) { nsbeep(); return; } [self.box setcontentview:viewcontroller.view]; } i set target/action nsbutton appdelegate, , here's call method show new view controller: - (ibaction)didtapcontinue:(nsbutton *)sender { newviewcontroller *newvc = [[newviewcontroller alloc] init]; [self displayviewcontroller:newvc]; } this work - presents new view controller's view. if click button in view has target/action set resides within view controller class, app

clojure - How can I parse string into Hiccup? -

how can parse string of hiccup hiccup node? for example, "[:b 'hello world']" [:b "hello world"] use reader convert string data structures: user=> (clojure.edn/read-string "[:b 'hello world']") [:b 'hello world'] you should use " denote string: user=> (clojure.edn/read-string "[:b \"hello world\"]") [:b "hello world"]

c# - Visual Studio 2013 IWizard ProjectFinishedGenerating How To Add A Reference Programmatically -

i'm working on small project of mine requires using iwizard interface microsoft.visualstudio.templatewizard. want add c# .net reference project after it's generated based on input form. project that's being generated c# library custom code. need in figuring out how access references project class. i've tried casting vsproject no avial, , documentation in remarks portion vague it. this says in documentation i'm having trouble with: "reference object using dte.solution.item or using specific language's objects, such dte.vbprojects.item, or dte.vcprojects.item." from: https://msdn.microsoft.com/en-us/library/envdte.project.aspx here's code: public void projectfinishedgenerating(project project) { vsproject vsproj = (vsproject)project; vsproj.references.add(form.referencedllpath); } i've tried using dte described, (vsproject)project.dte.solution.items(0), i've gotten errors. above last resort. appreciated

c# - Lazy or not to use the new keyword without assigning the result? -

i enjoy learning new approaches , coding methods. question relates use of "new" keyword. 1 consider using new keyword without assignment fair practice? var example1 = new item(); example.add(testobject); //ok //using initializer ... var example2 = new item { title= "this title", summary = "this summary" }; //fine again .. //but question relates using new keyword ... new item().add(testobject); i not keen on last approach, me seems little lazy , messy haha, there drawbacks or issues associated using new keyword in manner? don't think there garbage collector clean little advice here? as quick example, when such approach used: new databaseconnection().executesinglequeryandforgetaboutdb(...); so, if small utility oneliner work

input - Solving a task in cosmology using Python 2.7.5 -

i looking piece of code takes list of redshifts (i.e. numbers) input user, separated spaces , in 1 go, , automatically assigns them variables a,b,c,d.....m,n,o. for example, if user gives "0.32 0.53 0.77 0.91 1.1 1.4" input, program should assign 0.32 variable a, 0.53 variable b, 0.77 variable c, , on. not expect user input more 10 numbers. i have been trying best of knowledge use raw_input function this, no success far. following planning use simple formula a=3800/(1+a) find shortest rest-frame wavelength body @ redshift "a" seen emit in optical range, , repeat process other bodies redshifts have been given user. part should present no problem however. real stumbling block described above. let's got string user using raw_input() : astr = raw_input('input: ') then, there many ways can handle this. easiest might split string list: alist = astr.split(' ') # returns ['0.32', '0.53', '0.77', '0.91

javascript - Google Map API - Infowindow display google place API information -

i not sure how go this. what want: want display information might find if go https://www.google.com/maps , search farmers' market. i want info window provides address, hours of operation, , possibly additional information google maps provides business. what have now: have angular js code block populates array looks following: var locations = [ ['findlay market', 39.115398, -84.518481, 5], ['hyde park farmers' market', 39.139601, -84.442496, 4], ['lettuce eat farmers' market', 39.166134, -84.611613, 3], ['college hill farm market', 39.195641, -84.545453, 2], ['anderson farmers' market', 39.078364, -84.350539, 1] ]; then use infowindow display name of farmers market. i know add new table database hours , additional information , use create angular js card display in infowindow... hoping there way use google map api google places api information instead of storing in database. thanks uksz able use below c

javascript - AngularJS: How to access input[date] min attribute within custom directive? -

i'm trying write access of <input type="date" min attribute within custom directive value. know input[date] element directive to. https://docs.angularjs.org/api/ng/input/input%5bdate%5d access $(elem).attr('min') not right way. how can access input[date] min attribute within directive? jsfiddle here: http://jsfiddle.net/musuk/lbbtyjod/ demo as per directive: use attrs.mydirective access minvalue inside directive link function. access min date: attrs.min , set min date attrs.$set('min', '2015-03-02') .directive("mydirective", function(){ return { require: 'ngmodel', scope: { minvalue: "=mydirective" }, link: function(scope, element, attrs) { scope.$watch('minvalue', function(){ console.log(attrs.mydirective); // set min here attrs.$set('min', '2015-03-02');

ruby - How to display all posts in a blog application using Rails 3? -

i trying implement blog application in app.but getting following error after saving posts. error: nomethoderror in homes#blog showing c:/site/library_management1/app/views/homes/blog.html.erb line #19 raised: undefined method `name' #<array:0x21896a0> actually blog implementation story this.when logged in user add name , comment in required place , clicked on submit button blogs saved display.all comments should visible logged in users belongs app.suppose 1 user wants reply/edit he/she can this. my codes follows. views/homes/blog.html.erb: <% if current_user %> <div class="totaldiv"> <div class="navdiv"><span>student information</span><span>logged in <%= current_user.email %></span></div> <div class="wrapper"> <div id="leftsidebtn"> <ul> <li><a href="/homes/issuebooks">book issue</a></li> <li><

javascript - AngularJs : Multiple clicks on same button is not working -

i have created web page in angular js. whenever navigate other page home page , click on home button page navigates home page expected , working fine. when again click on home button i'm expecting page refresh (because home page) not happening. the following untested, alternative solution came with. in routes configuration object home page (which assuming has url of /home ), specify following parameters: { // ... reloadonsearch: true, redirectto: function (routeparams, path, search) { if (search.redirected) { // don't redirect, return same path + search return '/home?redirected=true'; } else { return '/home'; }, // ... } the thinking when link /home , redirectto() function fire , redirect /home?redirected=true . change search parameter, route should reload correctly due specifying reloadonsearch: true . since home page links pointing /home , page should reload.

codenameone - How can I apply shadowing effects to components in codename one -

i want apply shadowing effects label , button component. there method available in codenameone ? how can achieve ? there many ways simplest 1 incorporate shadow 9-piece border representing component. can use things layered layouts or painters generate such effects, depends on need.

python - How Do I Setup SublimeREPL with Anaconda's interpreter? -

i love python in sublimetext, need interactive mode data exploration. however, life of me cannot sublimerepl use anaconda's interpreter. ideas appreciated. i have added following sublimerepl.settings.user file, doesn't have effect: { "default_extend_env": {"path": "users/anton/anaconda/envs/py3k/bin/python3:{path}"} } in packages/user folder, create sublimerepl/config/python/main.sublime-menu following contents: [ { "id": "tools", "children": [{ "caption": "sublimerepl", "mnemonic": "r", "id": "sublimerepl", "children": [ { "caption": "python", "id": "python", "children":[ {

excel - Need macro to take the parameter in the url to be taken from the cell -

i macro take sc_id parameter in url taken cell '[data download.xlsx]data'!$b$1. please me modify code?? private const number_of_pages byte = 8 sub datadownload() dim url_template string url_template = "url;http://www.moneycontrol.com/stocks/hist_stock_result.php?sc_id=" _ & ws.range("b1").value2 & "&pno={0}&hdn=daily&fdt=2000-01-01&todt=2015-12-31" dim page byte dim querytableobject querytable dim url string dim ws worksheet set ws = thisworkbook.sheets("data") page = 1 number_of_pages url = vba.strings.replace(url_template, "{0}", page) set querytableobject = ws.querytables.add(connection:=url, _ destination:=ws.range("a:a").find("*", , , , , xlprevious).offset(1, 0)) querytableobject.fieldnames = true querytableobject.rownumbers = false querytableobject.filladjacentformulas = false qu

python - Changing default django admin widget site wide -

i want modify widget used models.urlfield include dropdown internal links in site (similar any-urlfield detected sitemap). i want have every external app uses models.urlfield use custom widget , not have redefine each individual app formfield_overrides . i looked django/contrib/admin/options.py , found formfield_for_dbfield_defaults = { ... models.textfield: {'widget': widgets.admintextareawidget}, models.urlfield: {'widget': widgets.adminurlfieldwidget}, models.integerfield: {'widget': widgets.adminintegerfieldwidget}, models.bigintegerfield: {'widget': widgets.adminbigintegerfieldwidget}, ... } essentially change default if possible. how go changing default widget field in django admin site wide. why not update dictionary? place code admin.py file. from django.contrib.admin import options django.db import models django.forms import widgets options.formfield_for_dbfield_defaults[models.urlfield] = {

android - How to pass data from one swipe tab to another? -

i need pass 2 string first tab second tab. although wrote code: map map = new map(); bundle bundle = new bundle(); bundle.putstring("position", intent.getstringextra("position")); map.setarguments(bundle); toast.maketext(context,"visualizzare la posizione sulla mappa",toast.length_short).show(); in first class, , code: bundle args = getarguments(); if(args != null) { toast.maketext(getactivity().getbasecontext(),"non è null",toast.length_short).show(); string pos=args.getstring("position"); string id=args.getstring("id"); } in second class, app crashed. don't understand why. searched lot found reason don't understand how can do. tell me how pass 2 strings first fragment second fragment? lot for communicating between fragments must follow process : - must define interface communicator between fragment , parent activity ,

php - "Undefined" is display with discount price in magento -

Image
i using magento 1.8.1 , trying display discount percent sell price on frontend. with of site discount i putting these code: <?php // discount percents output start ?> <?php if($_finalprice < $_price): ?> <?php $_savepercent = 100 - round(($_finalprice / $_price)*100); ?> <p class="special-price yousave"> <span class="label"><?php echo $this->__('you save:') ?></span> <span class="price"> <?php echo $_savepercent; ?>% </span> </p> <?php endif; ?> in page: app/design/frontend/yourpackage/yourtheme/template/catalog/product/price.phtml but after result showing this: now not able find why "undefined" showing here , how remove this. please tell me how remove this. i seen in question image need effect on product detail page have edit media.phtml app\design\frontend\your_package\your_theme\def

database - Aerospike: Something like relatation -

i should make site price comparisons in pure aerospike, then: products, combination products (a cpu related motherboards) , stores. ù products should relate stores, example product related 3 stores , each store has different price. aerospike can me in this? i thought might make relationship bins, not know if idea suggestions solve problem? you can model many-to-one relationships otherwise spread on 2 tables in single aerospike set using complex types list , map. combination product can have 'components' bin list of map objects, each of them product. or can have 'components' list of product ids batch-read products based on ids in list. however, can model many-to-many relationships in similar way rdbms, intersection table. not have join, can perform separate queries , rely on fact aerospike key-value , batch operations far faster rdbms. so example can have store_products intersection table can keep id of store , of product. build secondary index on bo

MS Access Stored Procedure and Sql from VB.NET -

i have built system in vb.net sql automatically generated , executed commandtype.text (default). in addition have created stored procedure in access database wish use "view". i wish execute sql query utilizes stored procedure. kind of action possible? i'm guessing isn't since commandtype can text, table, or storedprocedure. public function gettable(byval query string) dataset dim connectionstring string = string.empty connectionstring = "provider=microsoft.jet.oledb.4.0;data source=" + globalsettings.databases(globalsettings.databasetypes.submission) + ";" dim connection oledbconnection = new oledbconnection(connectionstring) dim command oledbcommand = new oledbcommand(query, connection) dim dataadpter new oledbdataadapter(command) dim dataset new dataset try connection.open() dataadpter.fill(dataset) catch loexception oledbexception

javascript - Images does not load properly on phonegap -

i having trouble image.onload . doing take list of paths , want convert them base64 var img = new image(); img.setattribute('crossorigin', 'anonymous'); img.onload = function() { console.log("image done loading"); var canvas = document.createelement('canvas'), width = img.width, height = img.height; if (width > height) { if (width > maxsize) { height *= maxsize / width; width = maxsize; } } else { if (height > maxsize) { width *= maxsize / height; height = maxsize; } } canvas.width = width; canvas.height = height; canvas.getcontext('2d').drawimage(img, 0, 0, width, height); var dataurl = canvas.todataurl("image/jpg", 0.8); callback(imageobj, dataurl.replace(/^data:image\/(png|jpg);base64,/, "")); }; img.src = url; now working fine on computer, on phone galaxy2 (android 4.1

No documentation available in Qt Creator -

when hit f1 while cursor marks classname in source code, message on right side of ide: "no documentation available." how can fix this? i run qt on linux mint 17.1 , i'm getting familiar linux :-) thank you. i had strange problem (freeze after start qtcreator) , got fixed after remove diretory ~/.config/qtproject may problem too: ~/.local/share/qtproject you can reload files qtcreator options.