Posts

Showing posts from July, 2012

c++11 - C++ font path Windows -

c++11 - C++ font path Windows - how may path specific font in windows. there specific way them windows versions? or different os's. example: .../path/fonts/truetype/arial.ttf option 1: get font filepath name , style in c++/windows (so; see link therein). option 2: there api this, csidl of csidl_fonts or (for vista , later) knownfolderid of folderid_fonts . c++11 true-type-fonts

Perl Range Operator with Letters and Numbers -

Perl Range Operator with Letters and Numbers - is there way utilize perl's range operator .. utilize letters , numbers? for example, have: for $i ('x'..'9') { print "$i "; } output x y z 1 2 3 4 5 6 7 8 9 not unless for $i ('x' .. 'z', 1 .. 9) counts. "z" never increment 1. perl

sql - How to concate multiple row using STUFF and for XML PATH in multiple table -

sql - How to concate multiple row using STUFF and for XML PATH in multiple table - i have 3 tables. dbo_users dbo_locations dbo_user_locations i want location name location table. multiple location has been assigned users. want location in 1 row against username here query ran select u.id, u.username, lo.location_id, loc.name dbo_users u inner bring together dbo_user_locations lo on u.id = lo.user_id inner bring together dbo_locations loc on loc.id = lo.location_id order 1, 2 and output id username location_id name ----------------------------------------------------- 5 admin 26 avis pharmacy thorpes 6 james 1 welches 12 khalliday 16 white park road (life) 12 khalliday 32 daewoods mall lower swan st 12 khalliday 19 cellular planet black stone 12 khalliday 18 cellular planet f street 12 khalliday 41 digicel centre manor lodge 12 khalliday 20 digicentre swan street 12 khalliday 21 cellular

ios - Handle App going background in middle of UILongPressgestureRecognizer -

ios - Handle App going background in middle of UILongPressgestureRecognizer - in app using uilongpressgesturerecognizer add together subview view on uigesturerecognizerstatebegan , removing view when gesture ends. my problem is, when app goes background before ending gesture (by clicking home button or powerfulness button lock screen ) subview added still there when user resumes app (back foreground). please suggest me way handle this. know - (void)applicationdidenterbackground:(uiapplication *)application delegate in appdelegate don't know how utilize delegate solve issue because functionality there in multiple uiviewcontroller . you can subscribe uiapplicationwillresignactivenotification notified when app come in background. each uiviewcontroller can subscribe notification on own. then can cancel gesture doing: recognizer.enabled = no recognizer.enabled = yes edit as user1963877 suggested should check whether app going background causes gesture

curl - urlread(), urlwrite() don't work for https pages in Octave for Windows -

curl - urlread(), urlwrite() don't work for https pages in Octave for Windows - when utilize octave 3.8.1 installed in cygwin, can download https pages this: urlwrite('https://www.google.com', 'downloaded.html') however, when utilize octave 3.6.4 installed in windows 7 sp1 pro 64bit, urlwrite() doesn't work: octave-3.6.4.exe:18> urlwrite('https://www.google.com', 'downloaded.html') error: urlwrite: curl: problem ssl ca cert (path? access rights?) urlread() has same problem. there way avoid error? update: following andy's advice, tried prepare curl-related problem. @ moment, curl.exe can work https, libcurl (i think embedded in octave) doesn't work https. allow me explain did. i downloaded curl.exe here. @ first, doesn't work https this: c:\somewhere\curl-7.33.0-win64-nossl>curl https://www.google.com/ curl: (1) protocol https not supported or disabled in libcurl after downloaded "cacert.pem&

Why is Turkish Lira symbol ₺ replaced with ? in SQL server 2008 database -

Why is Turkish Lira symbol ₺ replaced with ? in SQL server 2008 database - any thought why turkish lira symbol replaced question mark when insert in table in database. see image below this not font issue. unicode (ucs-2) vs ascii character set issue (i.e. nvarchar vs varchar). character trying utilize not exist in ascii character set (which varchar datatype can hold). not in standard range of 0 - 127, , while might perchance in particular code-pages's set--all of in range of 128 - 255--it not in current code-page's definition since seeing ? . can run next see yourself: select '₺'; print '₺'; it both prints , displays in results grid ? if want see character sql server thinks is, run following: select ascii('₺'); and return: 63 if want see character has ascii value of 63, run this: select char(63); and return: ? now run this: select n'₺'; print n'₺'; this both print , display in results grid

c# - Entity Frame work Unique field issue -

c# - Entity Frame work Unique field issue - i using ef model first create 2 entities public class brief { public int id { get; set; } public string title { get; set; } public string tid {get; set;} public int speakerid { get; set; } } public class speaker { public int id { get; set; } public string firstname { get; set; } public string lastname { get; set; } } what want in brief entity decorate tid field unique. sec when run entities is, creates database not create foreigh key relation between speakerid in briefs table , speakers please allow me know how 1. decorate tid unique 2. why not creating foreign key relation on speakerid , speakers table? for problem number 2 need add together navigational property entity: public class brief { public int id { get; set; } public string title { get; set; } public string tid {get; set;} public int speakerid { get; set; }

javascript - jquery ajax call with headers -

javascript - jquery ajax call with headers - i trying login @ tinder using ajax phone call per documentations : https://gist.github.com/rtt/10403467 here, there table : request headers and link login : > curl -x post https://api.gotinder.com/auth --data '{"facebook_token": fb_token, "facebook_id": fb_user_id} ' my wish here login successsfully using method : this have tried :- $("#btnsend").click(function () { var dataurl = "https://api.gotinder.com/auth"; var fbtoken = "[i wrote right fb token here]"; var fbid = "[i wrote right fb id here]"; var datavalue = '{"facebook_token": "' + fbtoken + '", "facebook_id": "' + fbid + '"}'; jquery.ajax({ async: false, type: "post", beforesend: fun

javascript - Sub match in javascrtip/apps script get's "null" result -

javascript - Sub match in javascrtip/apps script get's "null" result - hi have mails in gmail replied different answer-templates depending on keywords in subject. in illustration have 5 emails that's beingness scanned, , if have word "prodcution" in subject should logg "sucess!", there 1 mail service contains word production, logger writes out "sucess!" 5 times, want write out 1 time mail service contains word "production". doing wrong? function msmama() { var threads = gmailapp.getinboxthreads(0, 5); (var = 0; < threads.length; i++) { var message = threads[i].getmessages()[0]; var sub = message.getsubject(); var res = sub.match(/production/g); if (res = "production"){ logger.log("sucess!"); } } replace if (res = "production"){ with if (res === "production"){ also match returns array or null if there no re

cluster computing - Grid engine and shared libraries -

cluster computing - Grid engine and shared libraries - my question is: if have executable requires libs, have install these libs nodes of grid, or there way install libs on 1 node , share others? thank in advance. if nodes run same scheme (same architecture, version etc.), should able store libs on shared drive. note reading libs shared location might impact speed of executables. cluster-computing sungridengine

java - How to store weburl in a string of a website opened in webview on android? -

java - How to store weburl in a string of a website opened in webview on android? - how store weburl in string of website opened in webview on android ? basic requirement when open website in webview url of website should automatically stored in string every time move next website previous url should replaced bt previous one string weburl = webview.geturl(); java android string webview uri

javascript - Trying to get an ASP.NET search thingy to work on my site -

javascript - Trying to get an ASP.NET search thingy to work on my site - i'm working on project involves using header organization's website on website. there's search feature which, if possible, need work on site (although should trigger search on org's website. is, if type "blah blah" input , click enter, should open http://www.organization_website.org/home/search-results.aspx?search=blah+blah). since know nothing asp.net, can someone, first of all, tell me whether i'm trying possible? i'm trying backtrack see need include in code work. when hover house on search icon, shows javascript:__dopostback('dnn$dnnsearch$cmdsearch',''). searched function dopostback(...) , found it: var theform = document.forms['form']; if (!theform) { theform = document.form; } function __dopostback(eventtarget, eventargument) { if (!theform.onsubmit || (theform.onsubmit() != false)) { theform.__eventtarget.value = eventtarg

c# - BitmapFactory.DecodeByteArray causing Grow Heap (frag case) -

c# - BitmapFactory.DecodeByteArray causing Grow Heap (frag case) - i developing android app in xamarin. having problems generating image bytestream. bitmapfactory (which seems popular solution), causing huge allocation problems - grow heap. connecttodb connect = new connecttodb (); byte[] arr = connect.selectimgbyte(3,"thea"); bitmapfactory.options options=new bitmapfactory.options(); options.injustdecodebounds = true; bmp = bitmapfactory.decodebytearray (arr, 0, arr.length/*,options*/); _imageview.setimagebitmap (bmp); above method bitmapfactory.decodebytearray beingness called. works fine, image displayed. slow , causes these "warnings". thread started: <thread pool> #6 [dalvikvm-heap] grow heap (frag case) 22.596mb 1997584-byte allocation [choreographer] skipped 129 frames! application may doing much work on main thread. [dalvikvm-heap] grow heap (frag case) 20.755mb 1997584-byte allocation [d

Nested if-statement in MySQL -

Nested if-statement in MySQL - i making procedure inserts place ("sted") , check if inputs null. however, whenever seek add together if-statement @ start surround code (marked crash below), gives me error saying syntax not right @ "declare varstedskodeid int;" part after if-statement i'm trying add. to eyes syntax of if-statement same within code, soon-to-be-null-check if-statement crashes simple if(true) then. can give me hint of causes 1 if crash? drop procedure if exists insertsted; delimiter $$ create procedure insertsted( in inputstedsnavn varchar(255), in inputstedstype varchar(255), in inputkommunenavn varchar(255)) begin if(true) <<------ crash declare varstedskodeid int; declare varkommunenr int; if(select count(stedkodeid) stedstype kodenavn = inputstedstype limit 1) = 0 insert stedstype values(default, inputstedstype); end if; set varstedskodeid = (select stedko

java - How to make a Loaded Dice -

java - How to make a Loaded Dice - i creating subclass of dice class called loaded dice create dice roll loaded , percent, bit like; public loadeddice (int anumsides,int loadval, double loadpct) but don't know start, i've gotten ideas create arraylist , create have more of 1 number others , pick randomly there there's got cleaner way right? public class dice { // -------------------------------------------- // instance variables // -------------------------------------------- private arraylist<die> diearray; // ------------------------------------------------ // constructors // ----------------------------------------------- /** * default constructor creates 2 6 sided dice */ public dice () { diearray = new arraylist<die>(); diearray.add(new die()); diearray.add(new die()); } /** * takes arraylist of die objects utilize */ public dice (arraylist&

bsxfun - Matlab optimisation query, avoiding that repmat -

bsxfun - Matlab optimisation query, avoiding that repmat - this simple question, can't see improve reply , maybe else can! here code: example variables nsim = 3000; nrow = 10000; info = zeros(1, 5, nrow); info (:, 1:4, :) = rand(4, nrow)*0.5; % 4 columns of duration values info (:, 5, :) = 1000; % 1 column of actual value basis.increaserate = 1 + (rand(nsim, 4)*0.1); example calculation datawithsim = repmat(data(:, 1:4,:),nsim, 1, 1); increasefactors = bsxfun(@power, basis.increaserate, datawithsim); values = bsxfun(@times, data(:,5,:), prod(increasefactors,2)); the need repmat feels wrong, can't see way avoid it. effectively i'm doing increase^data , didn't want have loop through 2 dimensions ( sims or data rows). dummy info can ordered way choose, values output needs nsim nrow matrix. any ideas welcome. thanks. you don't need utilize repmat . can straight feed "submatrix" data - increasefactor

c++ - Call non-static method from base class in static create method -

c++ - Call non-static method from base class in static create method - i want write static create method, phone call non-static method base of operations class. <baseclass.h> class baseclass { public: void method(); } <myclass.h> class myclass : public baseclass { static myclass* createmyclass(); } <myclass.cpp> ... myclass* myclass::createmyclass() { myclass* myclass = new myclass(); method(); // error, illegal phone call of non-static fellow member function homecoming myclass; } ... so have phone call base of operations class method outside of createmyclass method, or there possible way phone call inside? non-static methods need invoked on instance, , compiler doesn't pretend smart plenty know instance want invoke on (unless in instance method). need explicitly invoke method on instance of myclass created: myclass->method(); (another way of thinking it: in non-static context, calling method

function - PHP - Using a global variable inside a class (Fatal Error) -

function - PHP - Using a global variable inside a class (Fatal Error) - i have class.php file, in include class file: class.php: include($_server['document_root'] . "/includes/user.php"); $user = new user; so, within /includes/user.php $user class defined. and in /includes/user.php there function named getsocialuser($username); : function getsocialuser ($username) { global $dbh; $stmt = $dbh->prepare("select * users username=:username"); $stmt->bindparam(':username', $username); $stmt->execute(); $udata = $stmt->fetch(); if(count($udata) == 0) homecoming false; homecoming $udata; } (the $dbh holds database value. i've tested it, , have connection database) however, want able utilize function above within class.php file: this doing now: class.php: include($_server['document_root'] . "/includes/user.php"); $user = new user; cl

elasticsearch - Elastic search data aggregation -

elasticsearch - Elastic search data aggregation - having next illustration type in index: { "_index": "aggs_20141028", "_type": "aggobj", "_id": "4anpd7zlr5etda7o2i898a", "_version": 1, "_score": 1, "_source": { "userid": 4, "created": "2014-10-28t09:40:22.0652362+02:00", "path": "path_0", "intprop1": 1, "intprop2": 87, "intprop3": 903, "boolprop1": false, "boolprop2": true, "boolprop3": false, "stringprop1": "stringprop_6", "stringprop2": "stringprop_6", "stringprop3": "stringprop_3" } } how aggregate info in next utilize cases? aggregate boolprop (count) grouping user, timeperiod (e.g. day, month), filter on startdate aggregate boolprop (count) grouping ti

php - Regex, ignore results with preceding character -

php - Regex, ignore results with preceding character - i have regex matching urls ((https?:\/\/)?[\w-]+(\.[\w-]+)+\.?(:\d+)?(\/\s*)?) , job, works want. match domain e-mail when don't want to. currently matchs: http://www.foo.bar foo.bar website: foo.bar (matches foo.bar part) info@foo.bar (matches foo.bar part) i don't want match lastly one, matches first three. tried adding (?!=@) front end didn't it. how can ignore results preceded @ symbol? add anchors regex ^((https?:\/\/)?[\w-]+(\.[\w-]+)+\.?(:\d+)?(\/\s*)?)$ see illustration http://regex101.com/r/li8kz6/1 explantion ^ asserts regex @ start of line $ asserts regex @ end of line edit if urls embedded within text utilize \s delemit regex match strings as (\s|^)((https?:\/\/)?[\w-]+(\.[\w-]+)+\.?(:\d+)?(\/\s*)?)\s see example http://regex101.com/r/li8kz6/3 php regex

webservice client - Implementation of Proxy Design Pattern -

webservice client - Implementation of Proxy Design Pattern - proxy pattern in wikipedia site : http://en.wikipedia.org/wiki/proxy_pattern understand programme in 1 computer. inquire me questions realization in 2 computers. in reality, in "real life", suppose : 1) interface subject duplicated same name, in client (computer a) , in server (computer b) => right ? 2) object of class proxy in client (computer a) 3) object of classe realsubject in server (computer b) 4) in constructor of class proxy, instance of realsubject created => right ? in point 4, if right, how possible instantiate in computer a, class located in computer b ? how do illustration if class b web service ? give thanks in advance. 1) interface subject duplicated same name, in client (computer a) , in server (computer b) => right ? yes, always. 2) object of class proxy in client (computer a) yes 3) object of class realsubject in server (computer b) yes 4) in constructor o

ios - AutoLayout labels getting cut off on right side of screen -

ios - AutoLayout labels getting cut off on right side of screen - i'm trying utilize auto layout custom table view cell in app. i can't seem constraints quite right. i layed labels out in custom table view cell, labels still getting cutting off. ideas? thanks! post else needed. tried show needed info in image below: debugging in xcode. somehow shows in simulator looks different in xcode debug. here's width of tableview shown: update: problem here related user matt said in accepted answer, wanted create q&a bit clearer have figured out else comes across this. in initial comment, mentioned xcode view debugging, great , able dig little bit more. called assistant editor: device preview, able see layout , layers of onscreen see if maybe have labels overlapping or going offscreen based on device running on. if want check multiple device sized, nail plus icon in lower left hand corner of picture. this helped me find overlapping layers , sizing issu

java - Query database AUTH metadata using JDBC -

java - Query database AUTH metadata using JDBC - when oracle db connection or connect request sent using jdbc, replies next info well. api access these values? auth_vfr_data auth_version_string auth_version_sql auth_xaction_traits auth_version_no auth_version_status auth_capability_table auth_dbname auth_session_id auth_serial_num auth_instance_no auth_failover_id auth_server_pid auth_sc_server_host auth_sc_dbunique_name auth_sc_instance_name auth_sc_service_name auth_sc_instance_id auth_sc_instance_start_time oops, forgot private class , accessed through instrumentation. nevertheless, i'll leave here others. they can retrieved properties collection through oracle.jdbc.driver.physicalconnection.getserversessioninfo() (non-static method). have cast connection object physicalconnection . java oracle jdbc metadata

How to improve regex? -

How to improve regex? - i need write regular look match characters: a-z a-z 0-9 .!$%&-_@# without whitespace , in possible order knowledge of regular look lets closer 0 expert. , there need @ to the lowest degree 1 digit, 1 special character , 1 letter. what able create on own: [\s\w\.!$%&-_@#][^ ]{6,} but i'm not sure it'll work assumed. question: how can create match entire word not part of it? edit: i've tested , it's not meet that: and there need @ to the lowest degree 1 digit, 1 special character , 1 letter. examples: not matching: as1@.&%~+ asd dfgf axf1345 1s4%z_-@#$ .!$%&-_@# correct: a1s#@%._ 1acf3%& abloct2$ @anubhava answer: ^(?=.*?[0-9])(?=.*?[a-za-z])(?=.*?[_.!$%&@#-])[\w.!$%&@#-]{6,}$ you can utilize lookahead based regex: ^(?=.*?[0-9])(?=.*?[a-za-z])(?=.*?[_.!$%&@#-])[\w.!$%&@#-]{6,}$ (?=.*?[0-9]) lookahead ensure there @ to the lowest degree 1 dig

javascript - Nav Bar - Script explain -

javascript - Nav Bar - Script explain - i know embarrassing... can 1 explain me script line line. $(document).delegate('.ui-navbar ul li > a', 'click', function () { $(this).closest('.ui-navbar').find('a').removeclass('ui-navbar-btn-active'); $(this).addclass('ui-navbar-btn-active'); $('#' + $(this).attr('data-href')).show().siblings('.content_div').hide(); $(document).delegate('.ui-navbar ul li > a', 'click', function () { when clicks anywhere on page, check if target anchor tag ( <a> ) straight below <li> within <ul> within element class ui-navbar . $(this).closest('.ui-navbar').find('a').removeclass('ui-navbar-btn-active'); $(this) anchor tag - script going find closest element class ui-navbar in dom tree , remove class ui-navbar-btn-active anchor tags beneath in dom tree. $(this).addclass('ui-nav

ms access - EASY: vba: Looking through a listbox and selecting the contents -

ms access - EASY: vba: Looking through a listbox and selecting the contents - i know simple , it's slipping mine right now. how loop though listbox , select contents? here's code i've made right now: dim allgrps integer dim integer allgrps = lstallgroups.listcount = 1 allgrps lstallgroups next keep in mind listbox zero-indexed you've got subtract 1 off i: for = 1 allgrps lstallgroups.selected(i - 1) = true next also, create sure you've got selectsheetslist.multiselect = fmmultiselectmulti in order able select multiple items in list. see the listbox documentation more info. vba ms-access access-vba

node.js - gulp is not calling the callback -- it just hangs at end of task -

node.js - gulp is not calling the callback -- it just hangs at end of task - callback firing, task hangs on finished 'hooks:pull' after 2.04 s gulp.task('hooks:pull', function(callback){ var files = [ { remote: '~/deploy/test.example.com/hooks/post-receive', local: './bin/post-receive.test' }, { remote: '~/deploy/staging.example.com/hooks/post-receive', local: './bin/post-receive.staging' }, { remote: '~/deploy/example.com/hooks/post-receive', local: './bin/post-receive.production' } ]; async.each(files, function(file, cb) { var opts = { host: 'example.com' }; opts.file = file.remote; opts.path = file.local; scp.get(opts, function(err) { if (err) { console.error(err); homecoming cb(err); } console.log('%s hook has been pulled!', file.local); cb(); }); }, function(err){ if ( err ) { console.error

Different types for zero length bit fields in c? -

Different types for zero length bit fields in c? - fount statement a zero-width bit field can cause next field aligned on next container boundary container same size underlying type of bit field to set practice assuming int 2 bytes (16 bits) , short 1 byte (8 bits) save typing. let's using gcc compiler (would nice explain differences clang). struct foo { unsigned int a:5; unsigned int :0; unsigned int b:3; } in memory looks struct address | | v aaaaa000 00000000 bbb00000 00000000 question 1: in understanding can not aaaaa000 00000000 0..00bbb00000... , bbb has align container directly next current container. true? moving on, if specify struct bar { unsigned short x:5; unsigned int :0; unsigned short y:7; } will so? struct address | short stops here short starts | | | v v | uint | v xxxxx000 00000000 00000000 yyyyyyy0 edit 1 pointed

c# - asp.net // why does this value get NULL? -

c# - asp.net // why does this value get NULL? - , have code when click button 4, want redirect link using variable querystring! utilize variable in of code when gets button class gets null!?!? next page results /..blabla?email=0. variable "pidprof"! help, im stuck! in advance! :) namespace displayingimages { public partial class pageview : system.web.ui.page { public string query, constr, query1, query2, query3, pidview; public int pidprof; public sqlconnection con; public void connection() { constr = configurationmanager.connectionstrings["myconnection"].tostring(); con = new sqlconnection(constr); con.open(); } protected void page_load(object sender, eventargs e) { if (!ispostback) { pidview = request.querystring["email"]; pidprof = convert.toint32(pidview); httpcontext context = httpcontext.current; searchedus

Set AutoFilter in Excel with VBA -

Set AutoFilter in Excel with VBA - can explain why first "autofilter" statement in code below continually gives "autofilter method of range class failed" in excel 2010? activesheet.autofiltermode = false shtusr.range("a1").select activesheet.range("a1").autofilter field:=1, visibledropdown:=true activesheet.range("b1").autofilter field:=2, visibledropdown:=true activesheet.autofiltermode = true i think have found it! apparently, autofilter fails if can't find info in range. seek adding values in cells a1 , b1 (and delete activesheet.autofiltermode = true line). 'general use' then, safe, need find or similar test info within range. +1 q though. excel excel-vba excel-2010

javascript - CSS minify default feature of Magento is not working -

javascript - CSS minify default feature of Magento is not working - i don't know why. it treating css files fine; combining & minifying. that's not case js's minification. have tried # of magento extensions accomplish result webo, js/css optimisation & minification diglin, fooman speedster, etc. none of them proved useful, instead produced errors. have ever experienced this? be sure clean css code. errors in css; load css files layouts; don't load same css more once; i experience many times , same solve problem. when goes fine in css, minify should works nice. it's not easy, seek "w3c friendly". javascript css magento minify

How to upgrade offline instance of sonarqube plugins -

How to upgrade offline instance of sonarqube plugins - i have instance of sonar on machine not connected internet. spent lots of time going through sonarqube doc not see addresses this. documented method utilize web server's update center seems net supported/available plugins. java , findbugs plugins @ 2.4 fresh install of sonar 4.5.1 , java plugin can downloaded (executable jar file) 2.5.1, i'd current can. follow these steps. check plugin version latest instance on plugin version matrix documentation page download plugin jars need (beware of dependencies) next download link on each plugin page put jar(s) in sonarqube_home/extensions/plugins directory stop sonarqube start sonarqube this should job. plugins upgrade offline sonarqube

Applying a custom groupby aggregate function to output a binary outcome in pandas python -

Applying a custom groupby aggregate function to output a binary outcome in pandas python - i have dataset of trader transactions variable of involvement buy/sell binary , takes on value of 1 f transaction purchase , 0 if sell. illustration looks follows: trader buy/sell 1 0 b 1 b 1 b 0 c 1 c 0 c 0 i calculate net buy/sell each trader such if trader had more 50% of trades buy, have buy/sell of 1, if had less 50% purchase have buy/sell of 0 , if 50% have na (and disregarded in future calculations). so trader a, purchase proportion (number of buys)/(total number of trader) = 1/2 = 0.5 gives na. for trader b 2/3 = 0.67 gives 1 for trader c 1/3 = 0.33 gives 0 the table should this: trader buy/sell na b 1 c 0 ultimately want compute total aggregated number of buys, in case 1, , aggregated total number of trades (disrega

hyperlink - How to add just one single link between two different breeds in Netlogo -

hyperlink - How to add just one single link between two different breeds in Netlogo - i'd love help creating links in netlogo. essentially want add together 1 single link between 2 different breeds in netlogo, defined length 'particle-length'. link needs joined other breed next it. @ moment code creates volume exclusive set of turtles, 3 breeds. 1 randomly scattered, , other 2 within box. think initial arrangement of 2 different breeds within box needs fixing every violet next every green. want 50 greens(big) , 50 purples(small) connected 1 link (green purple) link length of particle-length 1. note water-number, big-number , small-number defined on slider value 50. netlogo code: breed [bigs big] breed [smalls small] breed [ waters water ] setup clear-all set particle-length 1.0 set-default-shape turtles "square" ;;to set bigs , smalls within central box inquire patches [ abs (min-pxcor - pxcor) > 22 , abs (min-pxc

javascript - angularjs $watch not work in my item -

javascript - angularjs $watch not work in my item - <input ng-model="myinput" type="email" placeholder="recipient" /> controller : $scope.myinput = 3; $scope.$watch('myinput', function() { console.log(1); }); when input in console.log(1) ,not work! $watch execute if myinput has valid email value .if don't have valid email myinput seems undefined.that reason $watch not execute.so set valid email in field , check executing or not. javascript angularjs watch

objective c - Connecting to iMessage functionality with iOS8 -

objective c - Connecting to iMessage functionality with iOS8 - i making iphone app , need able minimally see when message comes in, when myself @ it, , when reply it. need see when happens on message app within iphone ios. have been looking around solution on , have not been able find one. is possible access info on iphone or closed off? there no messages sdk available (as of ios 8.1) allow developer interact (or receive) messages. the can share content through mfmessagecomposeviewcontroller. be aware other search results suggesting can utilize coretelephony - app will rejected apple because ct private framework. objective-c ios8

c# - How to Select New values in View in MVC4 -

c# - How to Select New values in View in MVC4 - here method public partialviewresult getallclassroom() { guid entityid = new guid(); var searchclassrooms = m in db.forms m.formtypeenumid == "classroom" && m.formtitle.toupper() == "add classroom".toupper() && m.entityid == entityid bring together fs in db.formsubmits on m.formid equals fs.formid select new { formid = m.formid, formsubmitsid = fs.formsubmitid, formtitle = fs.formtitle, createdon = fs.createdon }; homecoming partialview("_getclassroom", searchclassrooms.distinct().orderbydescending(s => s.createdon).tolist()); } i want pass these values in

ios - Interstitial ad on start of App -

ios - Interstitial ad on start of App - i'd know how add together interstitial advertisement on start of ios app, written in swift. have searched whole web found answers in objective c (which i'm not able utilize swift) , android. is there chance (i'd utilize iads) advertising opens in fullscreen when user starts app? why apple it's available ipad? i have code used before. written in swift. can utilize in wherever want. first checks iad, if fails show admit banner. may remove admit related parts if don't want. class adhelper: nsobject { private var iterationstillpresentad = 0 // can used show advertisement after fixed number of iterations private var admobkey = "ca-app-pub-3841570660522725/9161546495" // stores key provided google private var counter = 0 private var admobinterstitial: gadinterstitial! // initialize iad , admob interstitials ads init(presentingviewcontroller: uiviewcontroller, googleadmobkey: string, iterationsti

mysql - Application Instantiation Error -

mysql - Application Instantiation Error - i working on project using joomla+mysql. copied project computer. set config file. when run project gives me error: error displaying error page:application instantiation error: table 'esnew.eu3nr_session' doesn't exist sql=select 'session_id' 'eu3nr_session' 'session_id'='h0t2iivrekc9p57g9c9a8tssj1' limit 0,1 mysql joomla

gruntjs - npm install and node -v is not working though i have installed node.js -

gruntjs - npm install and node -v is not working though i have installed node.js - i have installed node.js none of command line commands working :( node -v npm install i getting error " node not recognized internal or external command. my os windows 8.1 it works fine after restart machine. node.js gruntjs npm

Test JSON response of a POST Rails -

Test JSON response of a POST Rails - i developing exercise in rails. have create users , allow them login. when user created, need send json respond (i know how that), don't know how test using rspec that response correct. attempt: describe "with right input" before { @user.save } specify { expect(user.count).to eq(1) } "should respond json" post '/signup.json', :user => {:name => 'ppppp', :login => '1234567890'} json = json.parse(response.body) expect(json["user_name"]).to eq('ppppp') expect(json["login_count"]).to eq('1234567890') end end when seek obtain error: nomethoderror:undefined method `post' thank you!! is controller spec? if yes, spec file placed under spec/controllers folder. by default rspec assumes controller specs under folder. if file isn't in controllers folder add together :type => :controller ill

css - Android application style -

css - Android application style - i set specific style whole application. i added style in androidmanifest.xml, , defined style follow: <style name="mystyle"> <item name="android:background">#000000</item> <item name="android:textcolor">#ffffff</item> </style> this style changes background , textcolor whole application, though alter text color of buttons: sentence works when defining button add together style of application thanks lot <style name="mystyle" parent="android:theme"> <item name="android:buttonstyle">@style/your button style</item> </style> source:how apply style buttons of android application android css button styles

javascript - jquery dynamically created checkbox not working properly with function -

javascript - jquery dynamically created checkbox not working properly with function - i wrote jquery dynamic generation of check box subtraction operation performed on text box value of checked check box. jquery working fine predefined checkbox not working dynamically created checkbox. tried solution "on" delegate still struck here code html <select class="select valid" id="destination" name="destination"> <option value="">select one</option> <option value="92">92(11)</option> <option value="923">923(12)</option> <option value="9230">9230(12)</option> <option value="9231">9231(12)</option> <option value="9232">9232(12)</option> <option value="9233">9233(12)</option> <option value="9234">9234(12)</option> <option value=&

c++ - Extended boost::lexical_cast for other class datatypes -

c++ - Extended boost::lexical_cast for other class datatypes - is possible extend boost::lexical_cast handle other datatypes, without modifying classes? in case, want extend handle things cv::point , cv::point3 , taking string-separated list of coordinates , loading them.. ability like: cv::point mypoint = boost::lexical_cast<cv::point>("2,4"); the cv::point class has stream operators, not compatible istream , wstream , fails. edit i inquire because i'm working in framework templated function get_parameter uses boost::lexical_cast convert string (read configuration file) desired datatype. works great ints & floats, right have phone call multiple times read 2d or 3d point (or worse, arrays of coefficients). nice able modify lexical_cast handle these cases. as such, isn't specific opencv, chose simplest datatype.. i'm more interested in general solution. edit 2 here's sample app i've been trying: #include <op

java - Is an instance created? -

java - Is an instance created? - suppose if condition: class="lang-java prettyprint-override"> (objecta) request.getparameter("something") != null will anonymous instance of objecta created? in request there instance of objecta if not null. no new instance creared. java if-statement instance anonymous

java - what happens in hibernate if i give a column tag for a transient variable? -

java - what happens in hibernate if i give a column tag for a transient variable? - what happens in hibernate if give column tag transient variable? @table(name="team") public class team extends baseobject implements serializable { @id @generatedvalue(strategy=generationtype.auto) private long id; @column(length=50) private string name; @column(length=10) private string code; @column(name = "agency_id") private long agencyid; @column(name = "agency_name") private transient string agencyname; } field not persistent. not field value database, changes not commited. jsr 220 specification if entity has field-based access, persistence provider runtime accesses instance variables directly. non-transient instance variables not annotated transient annotation persistent. java hibernate transient

CSS to style first and last word differently -

CSS to style first and last word differently - i have situation need impact styling on text , have access css. not have access of underlying code, can not wrap text in spans or of sort. the text "status: in stock". is there way css lone can create 'status:' 1 color , 'in stock' color? hoping :first-word/:last-word, apparently doesn't exist. another thought if there way "style word before ':' 1 way, , after ':' way" is of possible purely css? css

Get available memory (address space) before EOutOfMemory in a Delphi application -

Get available memory (address space) before EOutOfMemory in a Delphi application - i have 32-bit delphi application running /largeaddressaware flag on. allows allocate 4gb on 64-bit system. am using threads (in pool) process files each task loads file in memory. when multiple threads running (multiple files beingness loaded), @ point eoutofmemory hits me. what proper way available address space can check if have plenty memory before processing next file? something like: if totalmemoryused {from getmemorymanagerstate} + filesize < "availableuptomaxaddressspace" nooutofmemory i've tried using tmemorystatusex.ullavailvirtual availableuptomaxaddressspace but results not right (sometimes 0, > have). i don't think can reasonably , robustly expect able predict ahead of time whether or not memory allocations fail. @ to the lowest degree need write own memory allocator dedicated serving application, , have strong understanding of

php - Joomla ACL integration -

php - Joomla ACL integration - does know of way integrate joomla acl, create users , log users in programatically within custom component's controller , modules. i've scoured google either asking wrong questions, no 1 has documented how it, or it's not possible (which don't believe!) why may ask?! - developing single sign on application component must log user several api's when sign in. unfortuanetly client wants work acl such can show command content on front end end of website based on if user logged in or not. so need abole create own login view , when used, log user various systems using api's , log them (or create business relationship , log into) joomla acl. you clone installed mod_login login portion of it, , utilize form of below code creating user account: you can create user this: require_once('registration.php'); jimport('joomla.user.helper'); jimport('joomla.application.component.modeladmin'); $data

javascript - Threejs object selection issue -

javascript - Threejs object selection issue - im working on little web-application using threejs. ran next issue: i build prototype contains threejs content , works here (the canvas in prototype window.innerwidth , window.innerheight => has same size browser window. selecting works want utilize canvas on web page application , picking of 3d surfaces needs work there. i discovered alter margin or top via css of canvas doesn't work anymore. web-application based on scroll page , threejs canvas within div container can seen scrolling through page. for picking utilize next logic/code -> 1 works in "fullscreen prototype" not in web application page self.renderer.domelement.addeventlistener( 'click', function(event){ event.preventdefault(); //convert mouse position right vector var vector = new three.vector3( ( event.clientx / window.innerwidth ) * 2 - 1, - ( event.clienty / window.innerheight ) * 2 + 1, 0.5 ); //translates

performance - New relic custom instrumentation for Grape::Middleware::Formatter#call method in Rails app -

performance - New relic custom instrumentation for Grape::Middleware::Formatter#call method in Rails app - in rails app's new relic transaction section, can see particular method phone call (grape::middleware::formatter#call) time consuming 1 (taking 90% of time): middleware grape::middleware::formatter#call 89.2 % (time) 824 ms (avg time) but there not plenty info provided causing performance issue in new relic's transaction breakdown table. want add together ruby custom instrumentation method new relic can provide me more info problem showing events happening when grape::middleware::formatter#call method called. looking @ new relic's documentation adding custom instrumentation have created new file name config/initializers/rpm_instrumentation.rb , next content: require 'new_relic/agent/method_tracer' grape::middleware::formatter.class_eval include ::newrelic::agent::methodtracer add_method_tracer :call end but in development mod

haskell - Dependent Types: How is the dependent pair type analogous to a disjoint union? -

haskell - Dependent Types: How is the dependent pair type analogous to a disjoint union? - i've been studying dependent types , understand following: why universal quantification represented dependent function type. ∀(x:a).b(x) means “for x of type a there value of type b(x) ”. hence it's represented function when given any value x of type a returns value of type b(x) . why existential quantification represented dependent pair type. ∃(x:a).b(x) means “there exists x of type a there value of type b(x) ”. hence it's represented pair first element a particular value x of type a , sec element value of type b(x) . aside: it's interesting note universal quantification used material implication while existential quantification used logical conjunction. anyway, wikipedia article on dependent types states that: the opposite of dependent type dependent pair type, dependent sum type or sigma-type. analogous coproduct or disjoint union. how pair type

test suite - TestSuite JUnit -> Each TestCase has same @Before etc -

test suite - TestSuite JUnit -> Each TestCase has same @Before etc - i'm writing som selenium webdriver tests junit 4. test cases grouped junit testsuite. each test case (test class) has same @rule @beforetest @aftertest how can realize in junit testsuite, don't have same code @rule, @beforetest , @aftertest in each test case (class)? //edit: maybe define abstract testcase class, extend each test case? you merge code of @rule, @beforetest , @aftertest single rule. public class themergedrule implements testrule { private final testrule thecurrentrule = ... public statement apply(final statement base, final description description) { homecoming new statement() { thecodeofbefore(); thecurrentrule.apply(base, description); thecodeofafter(); } } public void thecodeofbefore() { ... } public void thecodeofafter() { ... } } junit test-suite

tfs2012 - TFS SDL 2010 & 2013 but what about 2012? -

tfs2012 - TFS SDL 2010 & 2013 but what about 2012? - i see there tfs template incorporating sdl (security development lifecycle) 2013 (http://www.microsoft.com/en-us/download/details.aspx?id=42517) not mention tfs2012. does know if compatible tfs2012 or if there sdl template 2012? (i don't want install 2013 version, break our tfs2012!) i downloaded msi , took quick orca. saw, installer checks explicitly tfs 2013 , and install additional web service, that, suppose interacts server-side and, therefore, version specific. so chance upgrade, which, experience not hard, if homework. sdl tfs2012 tfs2013

get created item details in webhook url of podio -

get created item details in webhook url of podio - i want item name, item created by, item assigned in webhook url. like in webhook https://api.domain.com/v1/message?appname={{app_name}}&itemname={{item_name}}&itemassignedto={{item_assigned_to}} is there anyway this? this not possible in way. when webhook invoked item_id post parameter. utilize create api request item webhook called on , exact same result. webhooks podio hipchat

gps - What kind of NoSQL storage should we use? -

gps - What kind of NoSQL storage should we use? - we iot company provide services transportation , logistics companies. infrastructure service provider offer gps tracking devices our client. although format of gps tracking info neat (gpsid, longitude, latitude, speed, direction, reporttime, etc), amount of big. every device study gps tracking info per 10 seconds, , have 100k devices, 60*60*24*100000/10 = 864m rows of new info generated every day. using info collected gps tracking device of particular vehicle, client can review traces of vehicle within given period of time (for example, lastly 10 days, need 60*60*24*10/10 = 86.4k rows of data). currently utilize mysql storage medium, , take advantage of sharding , table partitioning(based on gpsid) of it. since info big , query on frequent, wonder if can utilize nosql storage fit scenario better? historical info useful info analysis. appreciated. it sounds want time series database. these database

android - How to use adb with genymotion on mac? -

android - How to use adb with genymotion on mac? - i using cordova build apps android, on mac os x 10.9.4. i using genymotion create virtual devices. yesterday able 'cordova run android' apps run on genymotion virtual device. today, thought repeated steps took yesterday, can't work. i start adb server (with genymotion not running) with adb start-server adb server starts fine: * daemon not running. starting on port 5037 * * daemon started * i can see it's there lsof -i tcp:5037 adb 19131 bw 7u ipv4 0x3c0bc54e449e35f5 0t0 tcp localhost:5037 (listen) there's no devices attached adb devices so far good now when start genymotion, , start virtual device, adb seems have been killed , cannot start because virtual device has apparently killed , started own adb instance unknown-6c-40-08-9b-25-2c:todo bw$ adb devices adb server out of date. killing... cannot bind 'tcp:5037' adb server didn't ack * failed star

javascript - using variable outside of a function -

javascript - using variable outside of a function - i start saying trying larn node having difficulties. building super simple weather app calls api , want homecoming data. but not sure why wont homecoming info console? var request = require('request'); request('https://api.forecast.io/forecast/{api key}/42.47994,-83.13040', function (error, response, body) { if (!error && response.statuscode == 200) { //var info = json.parse(body); var jsonobject = json.parse(body); var summary = jsonobject.currently.summary; var temp = jsonobject.currently.temperature; var realfeel = jsonobject.currently.apparenttemperature; var summary2 = jsonobject.hourly.summary; var max = jsonobject.daily.data[0].temperaturemax; var min = jsonobject.daily.data[0].temperaturemin; } }) console.log('todays forecast ' + summary2 + ' current tempature of ' + temp + '. feels ' +realfeel + ' high o

arrays - Inverting image intensities in c -

arrays - Inverting image intensities in c - void invert( uint8_t array[], unsigned int cols, unsigned int rows ) { int y; uint8_t darkest = 255; uint8_t lightest = 0; uint8_t anygray = y; (int x = 0; x < (cols*rows); x++) { (y = 0; y < (cols*rows); y++) { if (array[x] == darkest && array[x] == anygray && array[x] == lightest) { array[x] = 255-y; } } } } i have function here inverts image intensities, black becomes white, , vice versa lite grays become dark grays. code here doesn't seem work , don't know went wrong. able help me out? i haven't prototyped check see @ to the lowest degree 2 things suspicious. 1) expected && in if ||. 2) expected array[x] = 255 - y array[x] = 255 - array[x]. c arrays colors invert

python - Easy_install issues -

python - Easy_install issues - trying install easy_install (ironic) , not wanting cooperate me. running next command in terminal python2.7 curl https://bootstrap.pypa.io/ez_setup.py -o - | python returns me --> -bash: https://bootstrap.pypa.io/ez_setup.py: no such file or directory is simple fix? this should work: curl https://bootstrap.pypa.io/ez_setup.py -s | python unless redirected otherwise, curl output received body stdout, not have pass -o - (which should not according docs). should pass -s in order suppress progress meter , errors. pipe straight python . given no other arguments, python determine stdin source of script execute. python osx easy-install