Posts

Showing posts from April, 2015

javascript - I have an svg element that i want to alter the color of with a button click. Involves, json, and csv -

what code create map projection using g.selectall("path)... assigns small circles perimeters of associated countries. want able create buttons in html file when pressed "select"/"deselect" or color/uncolor circles and/or associated countries. want able choose countries , circles colored. know how create buttons , reference them , such, calling functions them. hangup not sure how svg or g element redraw or reupdate canvas. if debug, shows call stack not going g.selectall more once method executes multiple times. first time writing js forgive inconsistencies or rough code outline.thanks! var svg = d3.select("#container").append("svg") .attr("width", width) .attr("height", height) .append("g"); //create secondary layer canvas svg var g = svg.append("g"); function buildmap() { d3.json("countries.geo.json", function(json) { d3.csv("map_of_the_gods...

tkinter - How to use .get() within a function. Python -

from tkinter import * import random def factorer(a,b,c): while true: random_a1=random.randint(-10,10) random_a2=random.randint(-10,10) random_c1=random.randint(-10,10) random_c2=random.randint(-10,10) if random_a1==0 or random_a2 == 0 or random_c1 == 0 or random_c2 == 0: pass elif (random_a1*random_c2) + (random_a2*random_c1) == b , random_a1/random_c1 != random_a2/random_c2 , random_a1*random_a2==a , random_c1*random_c2==c: break print "y=(%dx+(%d))(%dx+(%d))" % (random_a1,random_c1,random_a2,random_c2) root = tk() buttonsim1 = button(root, text="convert", command=lambda: factorer(entera.get(),enterb.get(),enterc.get())) buttonsim1.grid(row=2, column=3) entera = entry(root) entera.grid(row=1, column=1) enterb = entry(root) enterb.grid(row=1, column=2) enterc = entry(root) enterc.grid(row=1, column=3) root.mainloop() how can code run, every time click button crashes. works if re...

ruby on rails - How to include multiple resources in a tag? -

how can use tags when user clicks on tag takes him new page lists out posts tag in (in other words not 1 resource includes resources)? i played around creating tags scaffold, creates tags index, started getting error after error , i'm not sure if best route ;) routes.rb 'tags/:tag', to: 'tags#index' resources :habits resources :goals resources :valuations resources :quantifieds resources :results if route solving problem through creating tags_controller can offer me advice on can make work? or should work application controller , use partials did creating sidebar? i followed along episode start: http://railscasts.com/episodes/382-tagging thank time!

java - Parse.com whereDoesNotMatchKeyInQuery doesn't work -

i have relatively simple app shows quotes user. when user have seen quote, added "seenquote" relationship user table doesn't see again. when want retrieve new quotes user haven't seen still returns seenquotes. parseuser user = parseuser.getcurrentuser(); final parsequery<quote> newquotes = new parsequery<quote>(quote.class); final parserelation<parseobject> seenquotes = user.getrelation("seenquotes"); newquotes.wheredoesnotmatchkeyinquery("objectid", "objectid", seenquotes.getquery()); newquotes.findinbackground(new findcallback<quote>() { @override public void done(list<quote> quotes, parseexception e) { // still contains quotes have been seen } }); what doing wrong?

vb6 - eBay trading API run-time error when sending request -

i having problems sending getebaydetails request. use code (vb6, yes know) findpopularitems, getebaytime, etc, , works fine. private sub command1_click() dim httpcnct xmlhttp40 dim xmldoc freethreadeddomdocument40 dim ebayurl string dim devid string dim appid string dim certid string dim xmlstring string dim ebaytoken string dim title string dim itemid string dim price string ebayurl = "http://open.api.sandbox.ebay.com/shopping?" set httpcnct = createobject("msxml2.xmlhttp.4.0") httpcnct.open "post", ebayurl, false httpcnct.setrequestheader "x-ebay-api-app-id", appid httpcnct.setrequestheader "x-ebay-api-version", "857" httpcnct.setrequestheader "x-ebay-api-site-id", "3" httpcnct.setrequestheader "x-ebay-api-call-name", "findpopularitems" httpcnct.setrequestheader "x-ebay-api-request-encoding", "xml" xmlstring = "<?xml version=""1.0"...

javascript - Variable business hours in Fullcalendar -

i'm working fullcalendar , i'm using business has varying hours mon, tue, wed, fri 09:00 - 17:00. thu 09:00 - 19:00. businesshours: { start: '09:00', // start time (10am in example) end: '17:00', // end time (6pm in example) dow: [ 1, 2, 3, 5] // days of week. array of zero-based day of week integers (0=sunday) // (monday-thursday in example) } http://fullcalendar.io/docs/display/businesshours/ how can achieved? to use variable hours business hours, need use background events this: events: [ { id: 'available_hours', start: '2015-1-13t8:00:00', end: '2015-1-13t19:00:00', rendering: 'background' }, { id: 'available_hours', start: '2015-1-14t8:00:00', end: '2015-1-14t17:00:00', rendering: 'background' }, { id: 'work', start: ...

c++ - In MSVC there are such things as MFC custom controls (design time), is there a such thing as a win32 custom control? -

Image
in microsoft visual c++ (visual studio) 1 can create design time controls drag , drop on dialogs using mfc. for example http://www.codeproject.com/articles/521/creating-custom-controls my question is: can 1 develop win32 custom controls can drag , drop onto dialog @ design time, without using mfc? or win32 programming stuck controls win32 offers (i.e. edit, listbox, checkbox, etc.). does visual studio c++ ide allow create mfc custom controls @ design time, , win32 must create custom controls @ run time?

python - Text based game input -

i might being stupid, cant figure out. i'm making text based game , in order simulate character movement in different scenarios, have used following code: import random north = ("there path north. ") south = ("there path south. ") east = ("there path east. ") west = ("there path west. ") nsew = [north, south, east, west] print ("you find in woodland clearing. ") print (random.choice(nsew)) print (random.choice(nsew)) print (random.choice(nsew)) print (random.choice(nsew)) direction = input("which way go? ") this should print 4 random items list, does. want able like: if direction == ("north"): print ("you decide go north.") but if statement each one, if user types "east" program respond "you decide go east" thanks import random paths = [] tiaptt = "there path " nsew = ["north", "south", "east", ...

android-reverse geocoding-Google Map API (geocoding) -

i'm developing android app use google reverse geocoding api webservice in user side, user read address in text format. httpget httpget = new httpget( "http://maps.googleapis.com/maps/api/geocode/json?latlng=" + lat + "," + lng + "&sensor=true"); i have following 3 questions: 1-do have use map in app?, i'm displaying location in text user , don't want map in app? https://developers.google.com/maps/terms#section_10_1 "(h) no use of content without google map. must not use or display content without corresponding google map, unless explicitly permitted in maps apis documentation" 2-is must include api key @ app side part of calling webservice? 3-am expected establish enterprise agreement google, , client_id , include in request sent end user? https://developers.google.com/maps/terms#section_9_1 to answer questions: 1) think can use without using maps, for, in a...

floating point - How is this in Q10 format? -

i've read else's code , claimed answer in q10 format. can't figure out how in q10. here code: // convert x , y in such manner ratio of x y // produce value in q10 format cnt = 0; bitmask = 0x80000000; while((cnt < 10) && !(bitmask & x)) { x <<= 1; cnt++; } y >>= (10 - cnt); // calculate slope if (0 == x) slope = 0xffffffff; else slope = ((uint32)x)/(uint32)y; any appreciated i'll assume q10 mean value has 10 bits representing fractional portion of fixed point value. code in question produce q10 value if x , y inputs have same number of fractional bits (i.e., same "q" value). input x shifted left 10 bits, increases q value of x number of bits shifted. if x shifted less 10 bits (to avoid overflow) y shifted right remaining bits (decreasing q value of y ) difference between q values of x , y 10. slope calculated x/y . when divide fixed point values q value of result equal q value of numerator min...

html - Can anyone tell me how to make my these images have a hover? -

i building site in html & css , have section have images change when hovered over. problem can first 1 want, when try same method on images side side, gets moved or doesn't work. can see example of first hexagon changes in "core values" section of site. can either pull githib repo here or have added fiddle . thank you! .hex-image { padding-top: 70px; } .hexy-hex { position: relative; margin-top: 60px; height: 900px; } .hexy-hex-2 { position: relative; top: -45px; } .hexy-hex-3 { position: relative; top: -45px; } .hexy-hex-4 { position: relative; top: -45px; } .hexy-hex-5 { position: relative; top: -45px; } .lt-blue-hex { margin: 0px; } .drk-grey-hex { margin: 0px; } .lt-grey-hex { margin: 0px; } #spirituality { background-image: url('http://i.imgur.com/dptzosk.png'); height: 200px; width: 175px; } #spirituality:hover { background-image: url('http:...

search - Preserving some characters when using to_tsvector in PostgreSQL 9.3 -

i need process strings "hello world @mention #hashtag" , index them searching using postgresql. need treat @mention , #hashtag specially. the following produces tsvector: select to_tsvector('hello world @mention #hashtag') but output looks this: "'a':4 'hashtag':5 'hello':1 'mention':3 'world':2" what see "@" preserved in front of 'mention' , # in front of 'hashtag'. there way me using postgresql ? i'm not sure tsearch right solution use case. tsearch @ full-text search, sounds want relational data. can parse data in application , create tag/user relationships #hashtags , @mentions?

angularjs - Cannot read property $valid of undefined -

i have form - <form name="myform" novalidate> there fields in form validating , submitting form - <input type="button" ng-click="save(data)" value="save"> in controller, want check if form not valid save() should show error on page. that, setting watch - $scope.$watch('myform.$valid', function(validity) { if(validity == false) // show errors }); but getting error on running - cannot read property '$valid' of undefined can explain why? thanks you misspelled "myform" in controller code. in order remove error, write "myform" instead of "myform". however expect want this. $scope.save = function(data){ alert($scope.myform.$valid); } i setup jsfiddle .

Swift loop through array of dictionaries -

why getting error when looping through array of dictionaries ? import uikit let tableview = uitableview() func meh() { let product = buildcells() (identifier, nib) in product { tableview.registernib(nib, forcellreuseidentifier: identifier) } } func buildcells() -> [[string: uinib]] { var collector = [[string: uinib]]() let identifier = "identifier" let nib = uinib(nibname: "tableviewcell", bundle: nil) let asdf = [identifier: nib]; collector.append(asdf) return collector } the forin loop in meh() method produces following error: 'dictionary' not convertible '([[string : uinib]], [[string : uinib]])' we can't iterate through keys , values of array of dictionaries. can iterate through dictionaries though. , each dictionary, can iterate through keys , values: let product = buildcells() dict in product { (identifier, nib) in dict { tableview.registernib(nib, fo...

c# - How to check if user left register field empty -

i have registration form. in case contain username , password. when created table in sql server, put both columns on not null when try register without entering either username or password there no errors , forms 'registrates' new user example without password (if didn't enter password). here code if can me problem, , if other wrong/poorly written code because i'm new in of this. think did on sql injection problem never know. thank on reply. private void button1_click(object sender, eventargs e) { sqlconnection cn = new sqlconnection("data source=home-pc;initial catalog=testdb1;integrated security=true"); try { cn.open(); string query = "insert dbo.users (uusername, upassword) values (@uusername, @upassword)"; sqlcommand command = new sqlcommand(query, cn); command.parameters.addwithvalue("@uusername", textbox1.text); command.parameters.addwithvalue("@upassword...

Is it possible to use the "native" window.plugins.pushNotification from cordova in Monaca? -

has been able push notifications working in monaca app, not using monaca's backend service? it's worth, tried using backend service, couldn't work , if did, it's not enough according documentation. i'm trying use pushwoosh. below returns "undefined" . alert(window.plugins.pushnotification); it's simple importing pushplugin custom plugin, requires upgraded plan. don't offer "core" plugin.

build - Maven Enhancing / Exploding war file -

first of sorry if stupid question, quite new topic of maven. please correct me if doing wrong or not best practise like currently have following issue: have 3rd party application in several war-files extend (this 3rd party party allows extend software own individual implementation). therefore have created maven project added required war-files dependencies in pom.xml my assumption is: have somehow unpack war file , have add new implementation , have compile , have repack new war. is correct or not? how it? thanks lot help the maven war plugin supports overlays allow desire.

testing - CakePHP 3 integeration test without a model/entity -

i'm trying test controller function... want test couple of things: a) throws invalid request exception when argument used b) works correctly when correct argument made. i've written unit tests , seem cool. documentation can find on http://book.cakephp.org/3.0/en/development/testing.html integration testing, whilst interesting , potentially useful, can't seem how suppose implement without using fixtures (which don't want necessarily). namespace app\test\testcase\controller; use cake\orm\tableregistry; use cake\testsuite\integrationtestcase; class mustercontrollertest extends integrationtestcase { public function testin() { $this->in(); $this->setexpectedexception('invalid request'); } } class mustercontroller extends appcontroller { public $helpers = array('address'); public function beforefilter(event $event) { $this->auth->allow('in'); $this->layout = 'blank'; $this->autoren...

php - MySQL Select based on drop down value -

i have following code: <?php session_start(); include_once("config.php"); $query = "select category books"; $result = mysqli_query ($mysqli, $query); echo '<select name="dropdown" value=""><option value="">dropdown</option>'; while($row = mysqli_fetch_array($result)) { echo '<option value="' . $row['category'] . '">' . $row['category'] . '</option>'; } echo "</select>"; ?> the values of drop down box filled database. wondering if theres way have select statement run when user clicks on 1 of options in drop down menu , populate results in table? any information help! thanks ok, resontant81, want fill table depending on option selected, next code want, explanation comes after : <html> <head> <title>my list</title> <script type="text/javascr...

VBA Loop in Excel wont recognize time -

i creating spreadsheet allow users copy events during specific 15 minute interval specific sheet in workbook. time intervals run midnight 23:45. code works fine copying happened @ or before 6:45 after comes blank. have manually checked data , there events on primary sheet happen after 6:45 , should copied over. data being pulled same oracle table time formats should same. here piece of code works: 'core - orange 06:45 if activecell.address = "$ac$6" if range("ac6").value = 0 msgbox "no exceptions reported" else: sheets("exceptions").range("a4", "h50").clear sheets("core").select = 2 x = 4 while sheets("core").range("a" & i).value <> "" if range("j" & i).value <= timeserial(6, 45, 0) , range("k" ...

class - C++ program crashing (has something to do with with dynamic memory) -

i'm having weird crashing occurs everytime goes loop initialize each position undefined. can shine light on why happening? #include #include #include using namespace std; class myphonebook { public: myphonebook(int, string, string, string, string); myphonebook(); ~myphonebook(); void initialise(int, int, string, string, string, string); bool search(string&, int); bool find_free_pos(); void add(); void remove(); void display(int); friend istream& operator >> (istream& in, myphonebook& ph); friend ostream& operator << (ostream& out, myphonebook& ph); private: int *recordid; int *status; // -1 no longer @ number, 0 blocked, 1 not blocked, 2 free string *name, *areacode, *number, *group; }; int main(int argc, char** argv) { cout << "test 1" << endl; myphonebook *myphbk; // pointer point ...

Extract City Name in Talend -

Image
i have here sample data want put city on separate column. city can defined after comma sign. how can talend. component should use? here's sample data. on left side input , right should right output. you can use split function in tmap. use below code in city column change dwetl address field actual column name. !relational.isnull(row7.dwetl_address)?row7.dwetl_address.split(",")[1]:"default city"

Error when importing Grinder to Eclipse: No marketplace entries found to handle clojure-maven-plugin -

i want import grinder(java load testing tool)into eclipse new project. these environment: win7 64bit jdk 1.6 32bit eclipse-java-luna-sr2-win32 these steps: eclipse--import git uri ,i used git link provided official eclipse--file--import--maven--existing maven projects,i use directory contain source files downloaded git then eclipse started build , handle dependency,when process over,eclipse gave error info: ” no marketplace entries found handle clojure-maven-plugin:1.3.15” i don’t modify pom file ,and use default maven plugin of eclipse:m2e.i don’t install maven , other library. try delete “c:\users\g.m2\repository”,and redo these steps ,however,it doesn't work. plz me,thanks! not sure purpose. planning develop/enhance grinder tool. if yes, should connect developers in grinder site. and if planning use tool , trying configure eclipse scripting purpose, should try grinderstone. note outdated , works specific version of software. otherway, can use pydev in e...

Error when executing TwitterSearch in Python -

i attempting use twittersearch ( https://github.com/ckoepp/twittersearch ) import tweets csv analysis. however, getting following error message when executing python script: from .twittersearchexception import twittersearchexception valueerror: attempted relative import in non-package here code: from twittersearch import * twittersearchexception import * import csv def get_tweets(query, max_tweets): query = raw_input ("search for:") max_tweets = 2000 # takes search term (query) , max number of tweets find # gets content twitter , writes csv bearing name of query = 0 search = query open(search+'.csv', 'wb') outf: writer = csv.writer(outf) writer.writerow(['user','time','tweet','latitude','longitude']) try: tso = twittersearchorder() tso.set_keywords([search]) tso.set_language('en') # english tweets ts ...

ios - Page in Page View Controller has a sudden dropping down motion -

Image
i have 2 pages in app transitioned uipageviewcontroller. first page loads fine second page have 'dropping' motion similar .gif image below. this occur once when page loaded. not sure causes suspicions constraints. seems applying constraints when page loaded. i looking @ solution pre-load pages first , if works, expand solution pre-load previous , next page (if any). if there better solutions out there, share me. i've had similar issues caused navigation controller/navigation bar , automaticallyadjustsscrollviewinsets property in code, or "adjust scroll view insets" property in storyboard. looks first page not have set, , second page does.

mysql - Passing Variable to GoLang Query -

first off let me i'm beginner (started few days ago) golang , in process of learning how practically apply language. goal build web rest api queries database , provides data user. i've been able create simple api using martini ( https://github.com/go-martini/martini ) , connect mysql database using https://github.com/go-sql-driver/mysql . problem @ current moment how pass variable param api request query. here current code: package main import ( "github.com/go-martini/martini" _ "github.com/go-sql-driver/mysql" "database/sql" "fmt" ) func main() { db, err := sql.open("mysql", "root:root@tcp(localhost:8889)/test") m := martini.classic() var str string m.get("/hello/:user", func(params martini.params) string { var userid = params["user"] err = db.queryrow( "select name users id = userid").scan(&str) if err != nil && err !=...

python - Grabbing a users followers with Twython -

i have code grab specific users followers shown below. further not grab user's followers followers own followers. example grab carl icahns followers id's , followers own followers id's. if following carl icahn, able retrieve of followers well. also, reason grabbing same 5000 followers each call reason instead of getting different 5000 every time. can please me this? appreciate it. import logging import time import csv import twython import json app_key = "**********" app_secret = "**********" oauth_token = "***********" oauth_token_secret = "**************" twitter = twython.twython(app_key, app_secret, oauth_token, oauth_token_secret) followers = twitter.get_followers_ids(screen_name = "carl_c_icahn") follower_id in followers: print ("carl icahn followers:", followers) open('carlfollowers.txt', 'a') outfile: json.dump(followers, outfile, sort_keys = true, indent = 4) ...

java - Jackson ignores xml root element for abstract class -

i migrating application jersey spring mvc , i'm having problems make jackson work legacy xml's. receive abstract object on request body follow mycontroller.java @requestmapping(method = requestmethod.put, value = connectorconstants.subscribe_key) public callable<subscriberesult> subscribe( @pathvariable final string userkey, @requestbody(required = false) final subscriberequest subscriberequest) { return new callable<subscriberesult>() { @override public subscriberesult call() throws exception { return someservice.subscribe(userkey, subscriberequest); } }; } subscriberequest.java @xmlrootelement(name = "subscribe_request") @xmlseealso({ onerequest.class, anotherrequest.class, simpledomainrequest.class }) public abstract class subscriberequest implements request { /* (non-javadoc) * @see com.company.client.request.request#getbody() */ @override pu...

jboss - JMeter - load balancing -

in our application, have 6 instance of application server. when test manually, land on node randomly. when run our jmeter test (with 20 users), of load(70%) goes 1 specific node out of 6 nodes. 30% goes specific node rest 5. i see information via jsessionid set in request cookies. issue : i thinking load balanced on 6 nodes equally (more or less). application issue? or have jmeter? note: our app server jboss. cookie injection based load balancing. i not send request specific app server via cookie. cookie set automatically. first of make sure http cookie manager added test plan, should enough automatically resolve cookie-based load balancing problem. if have > 1 load balancer instance or load balancer resolves in > 1 ip address may have add dns cache manager well. see the dns cache manager: right way test load balanced apps guide better explanation , configuration details.

java - JAXB: Can we access and assign the inner node tags in the parent class using jaxb unmarshaller -

below xml have wanted convert object using jaxb unmarshaller: <start> <name>sss</name> <address> <street1>xxx</street1> <street2>yyy</street2> <zip>121212</zip> </address> </start> is there possibility access , set zip in start class? below root class above xml, readability not completing setters , getters: pacakge com.data //importing packages import javax.xml.bind.annotation.xmlelement; import javax.xml.bind.annotation.xmlrootelement; //root element class declaration @xmlrootelement(name="start") public class start { //elements in xml private string name; private address address; private int zip; @xmlelement(name="name") //setters , getters name tag @xmlelement(name="address") //setters , getters address tag @xmlelement(name="zip") //setters , getters zip tag public int...

javascript - How to pass value from ng-click (AngularJS) to Laravel? -

how value ng-click , send laravel query ? //.html <div ng-controller="recipientscontroller"> <div ng-repeat="recipient in recipients | orderby:'-created_at'" ng-click="select(recipient.id)"> <p class="recipientname">{{ recipient.name }}</p> </div> </div> //xxcontroller.js $scope.select = function() { comment.get() .success(function(data) { $scope.comments = data; $scope.loading = false; }); } //xxservice.js get:function(){ var comments = $http.get('api/comments'); return comments; }, //xxcontroller.php [laravel] public function index() { $comments = db::table('c') ->join('u', 'c.id', '=', 'u.id') ->select('u.id', 'u.name', 'c.comments', 'c.created_at') ->where('u.id...

javascript - dojo dom manipulation after page load -

i think question asked, surprised see dojo not behaving per docs. want div changed particular class. decided use dojo.ready(function(){ }); but running before page loaded. used addonload() function. gave same result. ended doing this require(["dojo/domready"], function(domready) { domready(function () { settimeout(function(){ setafrobeat(); },500); }); }); that working fine, times see blink there delay, , few times doesn't work. if increase timeout 1000 works always, user can see content modification. perfect way used in jquery's document.ready regards aadam the way loading domready typical module instead of dojo plugin "!" convention per dojo documentation http://dojotoolkit.org/documentation/tutorials/1.8/modules/ see using plugins. to use domready correctly should this.. require(["dojo/domready!"], function(){ // not run until dom finished loading }); http://dojotoolki...

How to build Ionic Framework in Android Platform? -

Image
i new in ionic framework followed in getting started page on page.. http://ionicframework.com/getting-started/ so start new project , want try build before try how make androids apps , followed tutorial (here: http://ccoenraets.github.io/ionic-tutorial/build-ionic-project.html ) sad got error when try build project? this error what mean , why getting error..i followed instruction.. installed android studio tutorial required. did wrong?

c# - Delegates with specific arguments -

i'll try keep simple can. have delegate del void() (no arguments). have function func(int) . have 2 variables , b. want able a() , run func(10) , , able b() , run func(43) . know can have delegate void(int) have function func2(int, int) . , variable c run func2(21,6) . need a, b , c same type of variable. it sounds have this public delegate void del(); public class myclass { public static void func(int value) { } public static void func2(int value1, int value2) { } } and need variables a , b , c declared , initialized delegate type such call func(10) , func(43) , func2(21, 6) respectively when invoked. the code a del = () => myclass.func(10); the code b del b = () => myclass.func(43); and, code c del c = () => myclass.func2(21, 6); a , b , c of type del you express as: del = new del(() => myclass.func(10)); or del = new del(callfuncwithvalue10); public static void callfuncwithvalue10() { myc...

c# - Passing List<int> with more then 10 lac records in function parameter? -

i have situation have more 10 lac record in database. , when user hit action method in mvc selected records want check whether these records present in database or not fetching record , comparing them record passed user. then want pass record function. safe pass many record in function parameter?? here demo :- //action method [httpget] public actionresult saverecords(list<int> selectedrecords) { list<int> allrecordsfromdb = _db.getallrecords(); if(allrecordsfromdb.contains(selectedrecords)) { _process(allrecordsfromdb); //here passing more 10 lac devices function parameter } } private void _process(list<int> allrecords) { //do process here } thanks :) yes safe. as phil said "as list passing reference list of items , not actual items themselves." another solution can put records in session or cache(according use-case) , can access anywhere ..no ne...

java - What is the difference between ivy's override tag and force=true attribute? -

here example. dealing ivy 2.1 , ant 1.8.3 . 1 of our project has direct dependency of 'math' version 5.1 , 'common' version 1.4.6 . 'common' has direct dependency of 'math' version 5.2 . <dependencies> <dependency org="home" name="math" revision="5.1" conf="runtime" /> <dependency org="home" name="common" revision="1.4.6" conf="runtime" /> </dependencies> it sure resolution gather 'math' version 5.2 owing ' common 's direct dependency. since causes compiler error want use 'math' 5.1 instead therefore tried put proper override tag ivy xml after dependency tags: <override org="home" module="math" rev="5.1" /> it should work , gather version 5.1. , turned out works in intellij idea 14 , in eclipse 4.3 , after respective ivy plugin's resolve can see 'math' versi...

wpf - Save Image which is inside a content control -

i'm having content control have image inside when im trying save image im getting black image. missing. rendertargetbitmap rtb = new rendertargetbitmap((int)content1.actualwidth, (int)content1.actualheight, 96, 96, pixelformats.pbgra32); rtb.render(content1); pngbitmapencoder pnge = new pngbitmapencoder(); pnge.frames.add(bitmapframe.create(rtb)); stream stream = file.create(drivename + ":/opencv/images/ui/leftedge.png"); pnge.save(stream); stream.close(); looks contentcontrol hasn't been layouted when try render it. try call updatelayout() on it. if doesn't trick try calling first measure(), arrange() - before rendering.

git commit --author does not require password? -

my situation following: there 2 people have access private repo , work on code. 1 guy has wrote code on other guy's computer , wants commit name not name of other guy. i have seen here how commit author repository. have done strange didn't require password of author name committing. not normal. people can commit myself code have not written , not responsible for? git not handle authorization. way works, can change identity using git config or --author argument make commits whoever want. these commits stay local computer until decide push them. remote servers opt in have sort of authentication. commonly done using ssh protocol. in addition, many add authorization layer restricts accessing repositories. example on github, may push repositories own or explicitely got write access. this access control apply act of pushing changes. if have access repository, can push whatever commits want, whatever author want. possible providers add check rejects pushes when ...

linux - Comparing multiple perf reports -

i using perf tool profiling. need compare multiple reports generated perf record command. couldn't find option in perf so, there way or manual interpretation way? you can use perf diff purpose: perf diff [oldfile] [newfile] link man page: https://linux.die.net/man/1/perf-diff

android studio - java.lang.SecurityException: Permission Denial -

i trying write data in mysql (wamp server) using android app. working perfectly. now shows follwoing error: java.lang.securityexception: permission denial: get/set setting user asks run user -2 calling user 0; requires android.permission.interact_across_users_full at com.android.server.am.activitymanagerservice.handleincominguser(activitymanagerservice.java:15168) @ android.app.activitymanager.handleincominguser(activitymanager.java:2498) @ com.android.providers.settings.settingsprovider.call(settingsprovider.java:688) @ android.content.contentprovider$transport.call(contentprovider.java:325) @ android.content.contentprovidernative.ontransact(contentprovidernative.java:275) @ android.os.binder.exectransact(binder.java:404) @ dalvik.system.nativestart.run(native method) i using android-studio, windows 7, 32 bit. can please me solve this.

sql server - Using Row_number() OVER(partition BY..) along with declaring local variables -

i have sql query, in sql query want select distinct columns irrespective of column first. other sql query use row_number() over(partition by..) , need use inner join. query in want use row_number , inner join - declare @columns nvarchar(max) declare @params nvarchar(max) = '@columns nvarchar(max) output' declare @sql nvarchar(max) = 'select @columns = stuff( ( select '',''+ [column_name] information_schema.columns (table_schema = ''dbo'' , table_name = ''main_mps_dqs_analog'') , (ordinal_position <= 73) xml path('''')),1,1,'''')' exec sp_executesql @sql, @params, @columns output set @sql = 'select '+ @columns + ' dbo.main_mps_dqs_analog logtime between ''2014-10-10 07:17:00'' , ''2014-10-10 08:47:00''' exec(@sql) i want apply inner join of table indus2_bds.dbo.ddtable , want beam_current , logtime...

php - Eloquent method all() undefined -

hi learning laravel. facing problem. seems eloquent method not inherited properly. when tried fetch data table in controller index method, shows "call undefined method category::all()" .. irritating never faced before did code earlier in similar way. pasted code below. experts need ur attention pls. model: <?php class category extends \eloquent { //protected $fillable = []; protected $table = 'categories'; public static function getcategory($category){ $category->category = $category['category']; $category->save(); } } controller: public function index() { // inputs $categories = category::all(); // load view , pass inputs return view::make('manage-category') ->with('categories', $categories); } views: <div class="col-md-4"> <select name='category' class="table-group-action-input form-control" name="product[sta...

java - ColdFusion not catching NoClassDefFoundError -

i using coldfusion 8. catch noclassdeffounderror exception in coldfusion can't... still fails , logs error in exception.log file. here tried. <cftry> <cfset myjavaobject.mymethod()> <cfcatch type="any"> <cfdump var="#cfcatch #"> </cfcatch> <cfcatch type="java.lang.throwable"> horrible exception. <cfdump var="#cfcatch #"> </cfcatch> </cftry> but not work. please show me how that? need catch error @ particular place , not in onerror function of application.cfc. now have had more coffee, not think cfcatch capable of catching noclassdeffounderror . according documentation, processes exceptions : exceptions events disrupt normal flow of instructions in coldfusion page, such failed database operations, missing include files, , developer-specified events. noclassdeffounderror error . an error indicates serious prob...

Prolog. If Prolog found first solution then it stops finding -

task is: determine numbers a,b,c divider of n. example: (a=2,b=3,c=4,n=2 answer a,c). so, wrote following code: predicates a(integer,integer) m(integer,integer,integer,integer) clauses a(x,n):- 0 = x mod n, write(x). m(a,b,c,n):- a(a,n). m(a,b,c,n):- a(b,n). m(a,b,c,n):- a(c,n). goal m(2,3,4,2). but if prolog found first solution (in case a=2) stops , displays it. but, in case answer a=2, c=4. question "how prolog can check predicates"? prolog begins backtracking when call fails. in situations, may necessary initialize performance of backtracking find other solutions. prolog has special predicate fail , calls unsuccessful finish, and, therefore, initializes refund. so, rewrote code: predicates a(integer,integer) m(integer,integer,integer,integer) clauses a(x,n):- 0 = x mod n, write(x),nl. m(a,b,c,n):- a(a,n),fail. m(a,b,c,n):- a(b,n)...

ruby - paperclip No handler found for "file.jpg" rails 4 -

i'm having problem setting paperclip gem in 1 of me apps. no handler found for error message when try save uploaded file things i've done migration: add_attachment :orders, :file model: has_attached_file :file validates_attachment_content_type :file, :content_type => /\aimage\/.*\z/ controller: def order_params params.require(:order).permit(:file) view: form_tag url, method: :post, html: {multipart: true} ... = file_field_tag 'order[file]', disabled: true, id: 'mtd_file',accept: 'image/png,image/gif,image/jpeg' when try execute in controller order.create params[order] error no handler found "file.jpg" when order[file] param see it's string file.jpg (name of uploaded file) can me ? i'm doing wrong ? try using below line of code, don't have pass mulitpart html hash `form_tag url, method: :post, multipart: true` for form_for have pass multipart in html hash form...

java - Replacing regex group results - is it possible? -

i want validate html link, plus @ same time extract "http/https", host , address part. possible change group 1 value, let's if "https" - output "true" value: string url = "https://www.youtube.com/watch?v=1m9tjpltcw8 "; pattern p = pattern.compile("^(?i)(https?)://(.{3,}?)/(.*?) *$");//(?i) - case insensitive matcher m = p.matcher(url); if (m.find()) { system.out.println("g1: " + m.group(1)); system.out.println("g2: " + m.group(2)); system.out.println("g3: " + m.group(3)); } the output is: g1: https//but want replace - when "http" - "false", "https" - "true" g2: www.youtube.com g3: watch?v=1m9tjpltcw8 what about g1 = "http".equals(m.group(1)) ? "false" : "true"

angularjs - Angular leaflet - How to handle markercuster click? -

i'm using angular leaflet , markers when click on cluster. can't find events or methods ? i'm using angular leaflet directive project. any ! thanks i went trough javascript markercluster code , changed behaviour during clusterclick in order trigger event. know isn't best way it, think quick patch in original library good, because there no easy way it. i trigger markerclusterclick event catch in controller , whatever want on cluster.

eclipse - Font color not changing when choosing different theme in aptana studio 3.6 for HTML -

Image
i found post font color not changing aptana studio 3.6 python , user able use color theme plugin working. have color theme plugin however, html dark red tags, light red attributes, blue properties, , black values. please advise.

vb.net - How to change value of /GrpPwd/ Cell in all Rows? -

i need perform sql query: update resurses set grppwd = @grppwd1 resurs = @resurs1 for rows in access database using vb.net how can it? i use code id doesn't work: password generator: dim charset string = nalf dim r new random() dim lenpass integer = r.next(minlength, maxlength) dim str string = string.empty integer = 0 lenpass - 1 str += charset(r.next(0, charset.length)) next return str end function update rows if datagridview1.currentrow.cells(3).value = "yes" nres = datagridview1.currentrow.cells(0).value nalf = datagridview1.currentrow.cells(6).value nsym = datagridview1.currentrow.cells(1).value dim parol1 string dim pwd string = pass99(nsym, nsym) ' parol1 = pwd dim cmd new oledbcommand() dim conn new oledb.oledbconnection("provider=microsoft.ace.oledb.12.0; data source=" + bpath) cmd.connection = conn conn.open() ...

php - Insert record if the id is not present in db -

i want ask inserting record db if give id in url throught $getn , check if data of id n present in table must update else must insert data ? how can in php plz me you like <?php $n = $_get["n"]; $query = "select count(*) numberofrecords table id = '$n'"; mysql_query($query); if ($numberofrecords == 0) mysql_query("insert [...]"); else mysql_query("update [...]");

sql - how to split one row to many based on a comma separate column -

here data in mysql table: name childid city 11,12,13 maintain 21,22,29 pool 33,39,100 i want data below format. can use join tables. 11 city 12 city 13 city 21 maintain 22 maintain 29 maintain 33 pool 39 pool 100 pool this bad format, no doubt comments , other answers tell you. want junction table -- , perhaps why want query. the simplest way if have table of valid child ids. can do: select c.id, d.name mydata d join children c on find_in_set(c.id, childid) > 0;

http - Send HttpRequest using post method with Ocaml Curl -

i'm using ocaml curl make http request server. try send using method post , found function ( https://gist.github.com/zbroyar/1432555 ) : let post ?(content_type = "text/html") url data = let r,c = init_conn url in curl.set_post c true; curl.set_httpheader c [ "content-type: " ^ content_type ]; curl.set_postfields c data; curl.set_postfieldsize c (string.length data); curl.perform c; let rc = curl.get_responsecode c in curl.cleanup c; rc, (buffer.contents r) i understand value data contains post values in form ? should "login=foo pass=bar" or "login=foo, pass=bar" ? has idea ? this post request, can send kind of data using form, that's why there content-type header tell server how decode data. default, function send html, if want use form encoding , replace "text/html" "application/x-www-form-urlencoded" .

c# - how to access controls in listview datatemplate in windows phone 8.1 -

i need access grid in list-view data-template, when using code program reaches foreach loop , don't execute it foreach (grid firstgrid in active_list.items) { var item = active_list.itemcontainergenerator.containerfromitem(firstgrid); var ch = allchildren(item); var tag = url; var control = (grid)ch.first(c => c.tag == tag); if (firstgrid.gettype() == typeof(grid)) { if ((string)firstgrid.tag == url) { foreach (progressbar prg in firstgrid.children) { if (prg.gettype() == typeof(progressbar)) { prg.isindeterminate = false; } } foreach (textblock txt in firstgrid.children) { if (txt.gettype() == typeof(textblock)) { txt.visibility = visibility.visible; } } } } } this code active_list.items won't give cont...

php - form_widget submit doesn't work -

i'm trying customize form created formbuilder. my form working when display {{ form(comment) }} doesn't work anymore {{ form_widget(comment.mymethod) }} i display form : <form class="commentform"> <ul> <li class="commentformarea">{{ form_widget(comment.commentaires) }} </li> <li class="commentformsubmit">{{ form_widget(comment.save) }}</li> </ul> </form> my controller public function postsaction(request $request) { $repository = $this ->getdoctrine() ->getmanager() ->getrepository('nastycodefrontbundle:publication') ; $posts = $repository->findby(array(), array(), 10); $commentaires = new commentaires(); $comment = $this->get('form.factory')->createbuilder('form', $commentaires) ->add('commentaires', 'textarea') ->add('save...