Posts

Showing posts from 2012

javascript - binding setTimeOut to some function with specific element -

javascript - binding setTimeOut to some function with specific element - i trying notification pop up, each pop dynamically generated after ajax fetched data. pop each have time limit of 10seconds before fade out. see on facebook's notifications on left bottom corner. each pop hidden according time added , timelimit. here's illustration code: function hidepop(obj){ $(obj).hide(); } function newpopup(data){ $('#notifications').prepend('<li class="new" style="display:none;">'+data+'</li>'); $('.new').fadein(200, function(){ var $this = $(this); $(this).removeclass('new'); settimeout(function(){ hidepop($this) }, 10000); }); } as can see above, ajax phone call call newpopup data. 1 time fades in settimeout function run. works, however, after few more li appended, new lis maintain hiding 1 time showed. note: remove class new 1 time done sin

javascript - How to change dropdown list label text on click? -

javascript - How to change dropdown list label text on click? - i have <select> element in html bound via ng-model object in scope. initially want dropdown read "group..." when user clicks on command want "group..." renamed "all" "group..." can never selected, in same sense sites utilize text boxes default text gives hint form , disappears when gets user focus (e.g. "search..." field). here jsfiddle illustration isn't working expected: http://jsfiddle.net/txpjz/561/ i figured ng-onclick="myoptions[0].label = 'all'" work, should alter value of info construction populates dropdown , alter dropdown options doesn't. how create work want? ng-click directive want, not ng-onclick. using seems work way want to: http://jsfiddle.net/txpjz/562/ javascript angularjs drop-down-menu

gitignore - Unignore files ignored with .git/info/exclude -

gitignore - Unignore files ignored with .git/info/exclude - i have ignored files editing .git/info/exclude . want unignore them. have edited .git/info/exclude rid of corresponding rules, files still seem ignored. should do? git check-ignore -v path/to/file will show rule matching pathname. git gitignore

AngularJS: add dependencies to my app before bootstrap it -

AngularJS: add dependencies to my app before bootstrap it - i working angularjs short amount of time still kind of lost it. sorry if question trivial or asked... have seen many different questions / posts / docs confused. this problem facing: dynamically add together dependencies app (i going refer rootapp), before bootstrap it. @ moment bootstrap happens manually: have read on web, should possible dynamically add together dependencies app before bootstrap (and why bootstrap happening manually). i have different templates (powered template toolkit) can load different modules dependency: example, template "mycomponent" needs load, dependency, angular module mycomponent; template "mytable" needs load, dependency, angular module ngtable, etc... define module rootapp as: // note: no dependencies argument! rootappmodule = angular.module('rootapp', []); and add together dependencies on demand, like: rootappmodule.pushdependency( mycomponentmodule

angularjs - Angular bootstrap tabs- refreshing a tab with a new html -

angularjs - Angular bootstrap tabs- refreshing a tab with a new html - i using tabs of angular bootstrap ui. have overriden tabs directive perform lazy loading of info plunkr link same : http://plnkr.co/edit/vabthzuwp50qps16gwuy?p=preview the lazy loading works fine.i have requirement in tab should reloaded different html on clicking of button. for ex, have tab renders tab1.htm. tab1.htm has button on click of button want render different html in same tab. i tried changing template-url of div tab1,however not able reload current tab new url your plunkr utilize outdated version of angular, doesn't back upwards new $sce service used ng-bind-html also, ha serious issues css i'm not gonna fix, point in right direction instead. in reply (how can create html model info display in <textarea> in browser?) can find how "inject" html page using modern angularjs version (1.2.0 or higher). working plunker: http://plnkr.co/edit/ld4nte2kkibgm

objective c - iOS redirect to new ViewCOntroller does not load all UI elements -

objective c - iOS redirect to new ViewCOntroller does not load all UI elements - i trying implement google map module set command parameters before adding marker the wayout initiate acquire result of new viewcontroller via nsbundles. want goal redirect sameviewcontroller expected result. but when comes implementation , loads actual result: expected result: actual result would please tell me other details instantiate new viewcontroller ui elements beingness set expected viewcontrollers? swear new viewcontroller has require elements beingness set on? the actual console message writes: 2014-06-18 17:50:37.766 marker[1469:60b] text=2014-06-18 17:50:36 2014-06-18 17:50:41.102 marker[1469:60b] *** terminating app due uncaught exception 'nsinvalidargumentexception', reason: 'storyboard (<uistoryboard: 0x17daf180>) doesn't contain view controller identifier 'sliderviewcontroller'' *** first throw phone call stack: (0x3102dfd3 0x3b7dcc

access vba - Ensure that all pages of a tab control are clicked before closing form -

access vba - Ensure that all pages of a tab control are clicked before closing form - i've got form 8 pages , i'd ensure pages clicked (ie. filled out) before user can close form. and i've got subform on 1 of pages tab command 2 pages. want create sure user has filled out (clicked on) both pages before main form can close. i don't know best way go this. what i've got far is: private sub tabcontrol_change() if (tabcontrol.value = 1) page2clicked = true end if end sub and records if sec page of subform clicked or not. don't know prevent main form closing. i utilize 8 pages on main form don't know if sufficient or not. maybe.... hide close button? i'm open ideas of best way go problem. thanks! edit: if not easy (i'm guessing not) there way create 2 tabs on subform tab command more visible user see? hide close buton in design view. closebutton=false add new button in lastly page. new button

java - Spring SimpleThreadScope in a web app : part of container pool? -

java - Spring SimpleThreadScope in a web app : part of container pool? - have service exposes crypto functions. don't need clean nor want objects created every time/ every session. need separate object per thread. in web app - scope web container's thread pool ? is same in spring 3 , 4 implementation? another place plan utilize cache simpledateformat objects. 1 time again don't need clean method. since version 3.0, spring has basic notion of thread scope : simplethreadscope . looks can feet ask, has limitations : it not registered default containers must explicitely be it performs no cleanup on beans. if can accomodate limitations, can register scope programatically : scope threadscope = new simplethreadscope(); appcontext.getbeanfactory().registerscope("thread", threadscope); or in xml config : <bean class="org.springframework.beans.factory.config.customscopeconfigurer"> <property name="scopes"&

javascript - Media Element js skipping on server (flash fallback issue) -

javascript - Media Element js skipping on server (flash fallback issue) - im using media element js. works great 1 problem when upload server , test on ie7 flash fallback mode in net explorer 9 video begins skip if playing on fast forawrd. illustration starts jumping 5 7 seconds every second. anyone know why doing , how prepare it. heres code. thanks in advanced //on successful load of media element $('audio,video').mediaelementplayer( { //ie7 pre-requisite plugins: ['flash'], enableautosize: true, success: function (player, node) { player.setvideosize(640, 480); //play film player.play(); //assign default skin $('#' + node.id + '-mode').html('mode: ' + player.plugintype); } }); javascript html5 flash element media

change color of some selected text in GWT TextArea -

change color of some selected text in GWT TextArea - i trying alter color of text in gwt text area. know start , end of text want alter color. now there way can alter color (apply css) text in location. example.. text in gwt text area "hello, example" now words 'an example' need in reddish color. thanks gwt implementation of textarea phone call dom creation of html textarea object. thus, gwt object has same limitations html object. try richtextarea allows complex styling , formatting. gwt

ios - UINavigation Bar not visible in animation of custom unwind segue -

ios - UINavigation Bar not visible in animation of custom unwind segue - i using custom unwind segue in navigation controller, in animation of segue navigation bar not visible during animation, when animation ends navigation bar 'pops'. ¿how can retain visibility of navigation bar during animation? more details: i have button in navigation bar calls modal view animation performs expected, new view has button trigger unwind segue animation view grow , disappear, while animation performing navigation bar in destination view controller not visible until animation finished. this code i'm using custom segue. - (void) perform { uiviewcontroller *sourceviewcontroller = self.sourceviewcontroller; uiviewcontroller *destinationviewcontroller = self.destinationviewcontroller; [sourceviewcontroller.view.superview insertsubview:destinationviewcontroller.view atindex:0]; [destinoviewcontroller beginappearancetransition:yes animated:yes]; [uiview anim

sql - How to check if the connection to the database was successful? -

sql - How to check if the connection to the database was successful? - i need check if database connections successful or not. using command sqlplus <username>/<password>@<sid> if connection successful command returns variable flagged y/n or whatever. should done multiple servers , flags stored in file. i not sure how conitnue? linux platform two_task=tns_alias sqlplus -s /nolog <<! whenever sqlerror exit 1; connect user/pass; select * dual; exit ! if [ $? = 0 ]; echo "success" else echo "failed" fi windows platform set local=tns_alias @( echo whenever sqlerror exit 1^; echo connect user/pass; echo select * dual^; echo exit^; ) > %temp%\run.sql sqlplus /nolog @%temp%\run.sql if "%errorlevel%"=="0" cls &echo success. if "%errorlevel%"=="1" cls &echo failed sql oracle bash shell

Array Property in VBA Class -

Array Property in VBA Class - i seek write array property , running code error cannot assign write-protected property. my code: private pq(9) string public property q() string() q() = pq() end property public property allow q(value() string()) pq() = value() end property i thought because of parentheses tried combinations didnt worked. can help me this, please? this error: for j = 0 9 .q(j) = thisworkbook.worksheets("xx").cells(3, j + 1) next j you cannot utilize arrays in property pairs. if could, illustration pass around new copies of backing array not efficient. you need pass around index , value utilize these read , write internal array: public property q(index integer) string q = pq(index) end property public property allow q(index integer, value string) pq(index) = value end property vba

javascript - Backbone Routing, CORS issue -

javascript - Backbone Routing, CORS issue - i trying create single page app using backbone.js on clicking 'home' tab should load page associated model div#content1. code works fine page in local folder lets if want load external page, 'https://www.google.com' instance, error "cross-origin request blocked: same origin policy disallows reading remote resource @ https://www.google.com/. can fixed moving resource same domain or enabling cors." how around issue or how can otherwise link external urls backbone routers? <!doctype html> <html><head> <title>demo</title> <script src="jquery-2.0.3.min.js" type="text/javascript" ></script> <script src="underscore-min.js" type="text/javascript" ></script> <script src="backbone-min.js" type="text/javascript" ></script> <script type="text/javascript">

java - hardware requirements for eclipse and tomcat -

java - hardware requirements for eclipse and tomcat - i'm sysad trade, i've been playing around java development, particularly web/servlets, can understand half of our developers maintain babbling on :d lacked foresight when bought dell inspiron 11z late lastly year --intel atom cpu, 2gb ram, remote access/troubleshooting. deploying simple "hello world" app using eclipse locally installed tomcat server wasn't pleasant experience. i'm planning ram upgrade, 4gb ram enough? i'm doing learning don't need bleeding border tech. or should resin, jboss, can live less ram? tia jboss need more ram tomcat. 4gb sufficient tasks when developing in eclipse , targeting tomcat, in general more ram merrier. java eclipse tomcat memory hardware

javascript - Get Attributes of enclosing Tag in HTML String -

javascript - Get Attributes of enclosing Tag in HTML String - i working on simple text screen / terminal emulator (similar jquery terminal plugin, without rpc stuff , window functionality). each line of screen table row (a html string) , print command can insert text attributes (e.g. foreground , background color). each printed text enclosed span style attributes, example: <span style="color:#000000;background-color:#111111">a</span><span style="color:#222222;background-color:#333333>bc</span> this works fine. want add together function gives me attributes of character @ given screen position, in above line character @ position 0 (a) has color #000000. have count characters don't belong span tag , lastly preceding styles. first rather error prone solution is: function getattr(line, position) { var result = {foreground:'', background:''}, ch = '', i, j = -1, tag = false; // count charac

PHP HTMLtoPDF is not working and returning only empty PDFs -

PHP HTMLtoPDF is not working and returning only empty PDFs - i have downloaded php htmltopdf converter here. when tried print single line output, not print in output pdf. empty. below code tried. $content1 = "<page><a>sample pdf file</a></page>"; // convert in pdf require_once('/home/www/apis/html2pdf_v4.03/html2pdf.class.php'); seek { $html2pdf = new html2pdf('p', 'a4', 'fr'); $html2pdf->setmodedebug(); $html2pdf->setdefaultfont('arial'); $html2pdf->writehtml($content1); $html2pdf->output('exemple00.pdf'); } catch(html2pdf_exception $e) { echo $e; exit; } whenever problem simplify. exterminate possibilities hinder workings of program. with in mind have looked @ website and, you, found sample piece. $html2pdf = new html2pdf('p','a4','fr'); $html2pdf->writehtm

definitive source as to what methods have been *added* to jquery 1.11 as opposed to older versions -

definitive source as to what methods have been *added* to jquery 1.11 as opposed to older versions - i'm creating bookmarklet uses jquery 1.11. because bookmarklet can/should potentially run on site, i'd utilize older versions of jquery when available. ideally, i'd want compatible jquery >= 1.8. however, want create sure i'm not using methods introduced 1.11 (as 1.10 or 1.9) aren't available in 1.8. note, compatibility guides discuss migrating higher version number , discusse deprecated methods. in case, need exact inverse of that. i.e.: added methods (or big changes in behavior of existing methods) weren't available earlier. pointers definitive source highly appreciated. edit: realize can merge changelogs 1.8, leaves me huge list of issues revolve around deprecated methods. i'd rather have succinct overview what's new in 1.11 opposed 1.8. jquery

Can ALL untagged docker.io images be safely removed? -

Can ALL untagged docker.io images be safely removed? - i can't find anywhere question on answer. when working docker.io there lot of untagged images created. question is: if remove them, risk break anything? mean possible tagged (!) image relies on them, , stops functioning when remove untagged child? is true in cases? thanks! why not try? ;) here's little list of untagged images on test system: # docker images -a repository tag image id created virtual size [...] <none> 3fe716bafb0d 36 hours ago 381.2 mb <none> 07bce059bd37 36 hours ago 380.3 mb <none> e1fef18f0eda 36 hours ago 380.3 mb <none> **a7e21150f14d** 36 hours ago 380.3 mb let's remove image on image depends: # docker rmi a7e21150f14d error: conflict, a7e21150f14d wasn't deleted 2014/06/19 18:21:45 error: failed remove 1 or

javascript - How to implement bootstrap tour on wordpress -

javascript - How to implement bootstrap tour on wordpress - i'm trying implement bootstrap tour wordpress site bootstrap theme far every time seek link stylesheets (css) , javascrit doesn't work. page wont load stylesheets or javascript. all setup works fine when work locally when seek implemented on wordpress nil works. is there specific way have setup stylesheets , javascript on wordpress? this header: <html <?php language_attributes(); ?>> <head> <meta charset="<?php bloginfo('charset'); ?>" /> <?php if (is_search()) { ?> <meta name="robots" content="noindex, nofollow" /> <?php } ?> <title> <?php wp_title('|', true, 'right'); ?> </title> <!-- bootstrap core css --> <link rel="stylesheet" type="text/css" href="<?php echo get_template_directory_uri();?>/c

java - Elasticsearch combining queries with Boolean query -

java - Elasticsearch combining queries with Boolean query - i'm trying combine mutiple queries in elasticsearch using boolean query result not i'm expecting. example: if have next documents (among others): doc 1: { "name":"iphone 5", "product_suggestions":{ "input":[ "iphone 5", "apple" ] }, "description":"iphone 5 - lastly version", "brand":"apple", "brand_facet":"apple", "state_id":"2", "user_state_description":"almost new", "product_type_id":"1", "current_price":350, "finish_date":"2014/06/20 14:12", "finish_date_ms":1403273520 } doc 2: { "name":"apple ii lisa", "product_suggestions":{ "input":[ "apple ii lisa",

javascript - Passing data between angularjs and express/node without ajax -

javascript - Passing data between angularjs and express/node without ajax - i have angularjs app running on node/express backend. i'm using passport user authentication. when user signs in or signs up, angular controllers communicate express via $http ajax/xhr calls. form info sent, node/express/passport process data, , homecoming json info user's info (i.e. username). angular uses user info update templates, i.e. {{user.username}} the problem if user refreshes entire page, angular loses user information. they're still logged in - req.user still contains info - angular doesn't know it. i'd avoid ajax phone call check if user logged in. that'll http phone call every new visit... i can pass user info jade template directly, can't updated angular later. i prefer ngstorage just check sample illustration given below, come in want text field , refresh browser , see working demo preview jsfiddle since angularjs module make

r - Plot vertices at the same position -

r - Plot vertices at the same position - is there method plot shared nodes of 2 graphs @ same position? e.g., 2 graphs g1 = graph.ring(5) v(g1)$name=c('node1','node2','node3','node4','node5') g1 = g1 - v(g1)[1] g2 = graph.ring(5) v(g2)$name=c('node1','node2','node3','node4','node5') g2 = g2 - v(g2)[2] there 3 nodes same g1 , g2. how can plot them same nodes having same position easy compare difference? par(mfrow=c(1,2)) plot(g1, vertex.label=v(g1)$name) plot(g2, vertex.label=v(g2)$name) using code question linked in comments can take positions 1 graph , utilize them on another. # graphs - tweaked node names g1 = graph.ring(5) v(g1)$name=letters[1:5] g1 = g1 - v(g1)[1] g2 = graph.ring(5) v(g2)$name=letters[2:6] g2 = g2 - v(g2)[2] # graph layouts # g1 set.seed(1) layg1 <- layout.fruchterman.reingold(g1) # g2 set.seed(2) layg2 <- layout.fruchterman.reingold(g2) # overwri

Using IPython Notebook (with rdflib?) to log SPARQL queries and results -

Using IPython Notebook (with rdflib?) to log SPARQL queries and results - i want utilize ipython notebook record sparql queries results of queries. since command-line tool can called ipython notebook "bang", can of course of study run: !arq --data dcterms.ttl --query test1.rq or roqet, can embed short query in command itself: !roqet -i sparql -e ’select * { ?s ?p ?o }’ -d dcterms.rdf neither arq or roqet take multi-line sparql queries arguments. query longer one-liner must stored in file (e.g., "test1.rq" above). far improve define sparql queries straight in ipython notebook cells, cloned , tweaked. next works: in [4]: myquery = """ prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> build {?s rdf:type ?o} """ in [5]: def turtleme(myquery): import rdflib g = rdflib.graph() g.parse('dcam.rdf')

breakout - How do I get the initBricks function to accept floats for better precision when placing bricks? -

breakout - How do I get the initBricks function to accept floats for better precision when placing bricks? - i'm trying precise positioning of bricks when using initbricks. not placing should 9out little fractions) , i'm pretty because code using ints i'm trying utilize floats. or perhaps prototype accepts ints, in case, how can bricks spaced given have have 10 rows , space between bricks? /** * initializes window grid of bricks. */ void initbricks(gwindow window) { float brickwidth = width / (cols + 1); float brickheight = height / (3*rows); float brickspace = width / (20*(rows + 1)); (int j = 0; j < rows; j++) { (int = 0; < cols; i++) { grect brick = newgrect(i*brickwidth + i*brickspace + brickspace, j*brickheight + j*brickspace + brickspace, brickwidth, brickheight); setcolor(brick, "red"); setfilled

Excel VBA - Combine and duplicate rows/columns -

Excel VBA - Combine and duplicate rows/columns - can help or guide me on how can create macro in excel create new rows columns while duplicating other surrounding values? for example, need turn this: a 1 2 3 4 b c 5 6 7 8 d into this: a 1 b 2 b 3 b 4 b c 5 d c 6 d c 7 d c 8 d i've found way combine columns using below macro: sub singlecolumn() dim cursh worksheet, newsh worksheet, rng range, col long set cursh = activesheet set newsh = sheets.add cursh.activate set rng = application.intersect(selection, cursh.usedrange) col = 1 selection.columns.count rng.range(cells(1, col), cells(rng.rows.count, col)).copy newsh.range("a65536").end(xlup).offset(1, 0) next col end sub modify code that: sub singlecolumn() dim cursh worksheet, newsh worksheet, rng range, col long, row long set cursh = activesheet set newsh = sheets.add cursh.activate set rng = application.intersect(selection, cursh.usedrange) row = 1 selectio

ruby - Rails CollectionProxy randomly inserts in wrong order -

ruby - Rails CollectionProxy randomly inserts in wrong order - i'm seeing weird behaviour in models, , hoping shed lite on issue. # user model class user < activerecord::base has_many :events has_and_belongs_to_many :attended_events def attend(event) self.attended_events << event end end # helper method in /spec-dir def attend_events(host, guest) host.events.each |event| guest.attend(event) end end this, reason inserts event id 2 before event id 1, so: #<activerecord::associations::collectionproxy [#<event id: 2, name: "dummy-event", user_id: 1>, #<event id: 1, name: "dummy-event", user_id: 1> but, when seemlingly random - instance alter attend_event method so: def attend_event(event) self.attended_events << event p self.attended_events # random puts statement end it gets inserted in right order. #<activerecord::associations::collectionproxy [#<event id: 1, name: "du

oracle - java.sql.SQLException: ORA-01157: cannot identify/lock data file -

oracle - java.sql.SQLException: ORA-01157: cannot identify/lock data file - i getting below given error, when run application: caused by: org.hibernate.exception.genericjdbcexception: not execute native mass manipulation query . . caused by: java.sql.sqlexception: ora-01157: cannot identify/lock info file - see dbwr trace file ora-01110: info file : '/fld1/fld2/mytemp_tablespace.dbf' i tried find out files , came know there no folders. have , created respective folders , new empty mytemptemp_tablespace.dbf file. still same error getting on there. any thought why error happening?if sql exception have happened @ right origin itself. have done is, have created new schema , exported db old new one. also how can see or dbwr trace file . this result of restored database , during restore rman not able create tempfiles because of missing directory. solution quite simple, 1 time directories created, add together 1 or more tempfiles: alter tablespace m

php - strotime with a difference of 20 months -

php - strotime with a difference of 20 months - i seek create new date strotime difference of 20 months, if set "+20 months" or "+1 year 10 months" first argument doesn't work. but if set "+2 years" work, guess m not far after reading documentation on php.net m not able create work. my code: $today = date("y-m-d"); $expire = $res['expire']; //$newdate = strtotime ( '+20 months' , strtotime ( $expire ) ) ; //not ok $newdate = strtotime ( '+2 years' , strtotime ( $expire ) ) ; //ok thanks help $expire = "2014-6-19"; $newdate=strtotime ( '+20 months' , strtotime ( $expire )); echo date("y-m-d",$newdate); //2016-02-19 that seems work fine. that's date after 20 months. what's format of date contained in $expire ? php strtotime

C++ function takes ints, but example shows text? -

C++ function takes ints, but example shows text? - this c++ question on confusing me. (i refreshing c++ after long time). reading illustration here. there 2 parts confuse me: the first part: in code line: void namedwindow(const string& winname, int flags=window_autosize ) window_autosize input, far can tell, not int. when code line , run, works fine. input function literally 'window_autosize'. confused why works. how window_autosize int? my sec question regarding lastly line, whereby say: by default, flags == cv_window_autosize | cv_window_keepratio | cv_gui_expanded i confused how/what means exactly... know | bitwise or, not clear means exactly... thank you. my input function literally 'window_autosize' yep, window_autosize in fact integer; simply @ fact it's default argument int function parameter. wouldn't compile if wasn't int // might have been defined #define window_autosize 23434 // number illust

objective c - Bodies connected by a joint must be added to the same CCPhysicsNode, however two bodies are under the same CCPhysicsNode but -

objective c - Bodies connected by a joint must be added to the same CCPhysicsNode, however two bodies are under the same CCPhysicsNode but - i making application tutorial. https://www.makegameswith.us/tutorials/getting-started-with-spritebuilder/spritebuilder-physics/ i made jointnode straight in code this _mousejoint = [ccphysicsjoint connectedspringjointwithbodya:_mousejointnode.physicsbody bodyb:_catapultarm.physicsbody anchora:ccp(0, 0) anchorb:ccp(34, 138) restlength:0.f stiffness:3000.f damping:150.f]; but though certainly 2 nodes under same ccphysicnode, it shows error bodies connected joint must added same ccphysicsnode, does have same issue this? i had same problem, turns out had not enabled physics on _mousenode. enabling physics on node solved problem. objective-c cocos2d-iphone spritebuilder

javascript - dynamically change the path of href angular JS -

javascript - dynamically change the path of href angular JS - i trying alter href value on click of it. this have tried. html: <a href="#page1">demo</a> js: angular.config(function ($routeprovider) { $routeprovider .when('/page1', { templateurl: 'main.html' controller: 'firstcontroller' }) .when('/page2', { templateurl: 'sub.html' controller: 'firstcontroller' }) .otherwise('main.html'); how alter path of anchor tag everytime when clicked on it. can please help me out. use different controllers each page. can utilize variable link , set in related controller. example: <a href="#/{{mylink}}">demo</a> or <a ng-href="#/{{mylink}}">demo</a> and in each related controller: $scope.mylink="page1"; or $scope.mylink="page2"

java - Issue with Design Patterns recognition -

java - Issue with Design Patterns recognition - i need help design patterns recognition. here java code public class extend b { public (string arg1){ super(arg1); } public c newinstance(string arg2){ homecoming new c(arg1, arg2); } } any ideas pattern it? upd public abstract class b { protected final string arg; public b(string arg) { this.arg = arg; } public string getarg() { homecoming arg; } } it mill pattern because newinstance() creates instance of other class. there tip of abstract factory. posted fragment of question. mean b base of operations mill class, a 1 of mill implementations, newinstance() method creates instances of concrete class c . edit yes, sure agree @sotirios delimanolis: mill belongs grouping of creational patterns. java design-patterns

android - Google Map API version 2 Failed to contact Google servers -

android - Google Map API version 2 Failed to contact Google servers - i have started create demo app uses google map api v2, followed google guide http://developer.android.com/google/play-services/maps.html & http://www.truiton.com/2013/05/android-mapfragment-example/. the map activity loading, actual google map not loading, error message: 06-18 10:19:23.717: i/google maps android api(29990): failed contact google servers. effort made when connectivity established. 06-18 10:19:38.903: e/google maps android api(29990): failed load map. error contacting google servers. authentication issue (but due network errors). could error caused due fact i'm on 3g/edge slower than 4g or wifi, in turn might causing connection timeout??? below activity: package com.example.theappdallas; import com.google.android.gms.maps.googlemap; import com.google.android.gms.maps.mapfragment; import android.support.v7.app.actionbaractivity; import android.support.v7.app.actionbar; impo

jquery - Mixpanel track event failing intermittently -

jquery - Mixpanel track event failing intermittently - i have few different mixpanel events beingness sent page. couple of them sent upon form submissions (two different forms, each in own modal). of events, 1 of form submission events fails intermittently , can't figure out why. both form submissions have jquery like: $(document).on 'submit', '#myform', (e) -> mixpanel.track('my form submitted') one form reliable, other not (it fails 3/4 of time). changed unreliable 1 to: $(document).on 'submit', '#myform', (e) -> window.mixpanel.track('my form submitted') and seems work of time, still not always. imagining difference, or changing mixpanel.track window.mixpanel.track have changed something. , oh missing here? i think caused mixpanels asynchronous behaviour. when phone call submit, track() instruction starts executing in non blocking way, allowing submit form when track() phone call mixpanel api

c# - How do I iterate through a Dynamic type array -

c# - How do I iterate through a Dynamic type array - this question has reply here: how cast system.object[*] system.object[] 2 answers i have com reads our vms scheme , returns array dynamic type. in visual studio when inspect type shows: dynamic {object[]} so tried following: var lines = myapp.getscreenlines(); foreach(var line in lines) { //do } but maintain getting exception: unable cast object of type ' system.object[*] ' type ' system.object[] '. however, if inspect lines , shows normal array , can expand see data. does know how can convert dynamic array info type string type? i have tried solutions in duplicate link yet dont seem work assume know info array. dynamic dont know until runtime, cant lower or upper bounds of array. ps have no command on myapp.getscreenlines() ; returns com api. edit: the solutions

actionscript 3 - AS3 : EventListener won't be removed in an [IF] -

actionscript 3 - AS3 : EventListener won't be removed in an [IF] - i have searched how pass arguments through eventlisteners, , used method without calling anonymous function remove eventlistener later. the issue eventlistener removed if out if function, not if in if function. how ? the code : function dragship(m:mouseevent):void { var func:function = dispositionship(m.target); if (isdragging == false) { stage.addeventlistener(keyboardevent.key_down, func); m.target.startdrag(true); isdragging = true; } else { stage.removeeventlistener(keyboardevent.key_down, func); isdragging = false; placeship(m.target , mousex , mousey , m.target.rotation); } // if eventlistener set here, gets removed, not if set in else } note : dispositionship() returns function. edit : here next part of code : function dispositionship(shiptarg):function { homecoming function(k:keyboardevent):void

mysql - Check whether lat/long combination reside within a polygon -

mysql - Check whether lat/long combination reside within a polygon - i've been breaking head while. need check whether lat/long position reside within polygon through mysql. according this post should this: select st_intersects(st_geometryfromtext('point(-33.7507, 151.1445)'), st_geometryfromtext('polygon (( -33.7508 151.1444, -33.7505 151.1447, -33.7507 151.1450, -33.7509 151.1454, -33.7514 151.1449, -33.7508 151.1443, -33.7508 151.1444))')) however returning me null. ideas? im using mysql 5.6.13 very cool. didn't know mysql had feature. build point, utilize no comma: 'point(-33.7507 151.1445)' fiddle mysql polygon

php - Which enviroment variable specifies current path? -

php - Which enviroment variable specifies current path? - i'm communicating debian computer via ssh2 php extension. (not well) documented function ssh2_exec states it's 4th argument is an associative array of name/value pairs set in target environment. i want operate upon different path ~ perform ls on other directories (as making communication more comfortable). should set? ssh2_exec($connection, "ls", null, array("???" => "/var/www/")); none of them. current path part of process state, not environment. shells utilize pwd environment variable indicate current path is, has no special meaning — setting won't anything. if want list contents of path isn't home directory, pass argument ls : ssh2_exec($connection, "ls $path"); if need run command care working directory, utilize cd : ssh2_exec($connection, "cd $path; command"); php ssh debian

c# - WeakReference vs. List objects -

c# - WeakReference vs. List<JSON> objects - i have question. i have json file 6000 complex objects. each object has few of different arrays. need serialize object insert each object database simple structure. after don't need anymore. more efficiency? using weakreference, import , gc.collect? or list, import , that's all. or should implement idisposable sec case? greets, greg you shouldn't have special in case, consume objects gc should take care of naturally. a weakreference used reference object not prevent referenced object beingness gc, don't see need weakreference here. c# json performance garbage-collection weak-references

c# - Multilingual ASP.NET Web Site doesn't work -

c# - Multilingual ASP.NET Web Site doesn't work - here link, author explains how build multilingual website when run code, such error mesage "an asp.net setting has been detected not apply in integrated managed pipeline mode." then found such workaround in web.config file: <configuration> . . . <system.webserver> <validation validateintegratedmodeconfiguration="false" /> </system.webserver> </configuration> now website works me, shown in russian, not in english language or greek. new asp.net, don't understand source's languagemodule class, should somehow modify it? there 2 types of pipeline modes in iis, integrated , classic. error getting symptomatic of having web.config arranged in classic configuration. integrated mode provides more flexibility both iis , asp.net functionality executed in same pipeline, instead of 1 after other. it might possible the project configured , hos

java - How to send app data securely to a recipient/server -

java - How to send app data securely to a recipient/server - i'm developing android app user has fill out , send info of few text fields recipient/server, enable feature. the big issue how in secure way protected against e.g. decompiling. concern not security during transport rather security of transport medium. what i've thought/read far: i send info via mail service java mail service api. first of all, don't want require user has come in mail service credentials , smtp server. mean have include credentials mail service business relationship in app, though. avoid situation decompiles app , takes on mail service account, thought of encrypting methods, if save aes encrypted version of password, attacker decompile app , add together syso output decrypted password. same applies oauth authentication because have store authentication token. in add-on mail service version, read getting password post request web service, doesn't seem safer @ all. i

C# Deserialize JSON to any type method -

C# Deserialize JSON to any type method - so have method (the sec block of code) convert json c sharp object works but what want able tell method type of object need cast to //not real code public static object jsontoobj(string i_json, typeof(home)) //will homecoming home object //not real code //real code public static object jsontoobj(string i_json) { serializer = new javascriptserializer(); object io_obj = serializer.deserialize<object>(i_json); homecoming io_obj; } //real code public static t jsontoobj<t>(string i_json) { var serializer = new javascriptserializer(); t io_obj = serializer.deserialize<t>(i_json); homecoming io_obj; } you can phone call this: home h = jsontoobj<home>(json); c# json javascriptserializer

r - Make a matrix of plots with row and column titles -

r - Make a matrix of plots with row and column titles - using par(mfrow = c(m,n)) command can create matrix of plots m rows , n columns. in special cases, there pattern in plots, such plots in each column share of import attribute, , plots in each row share different of import attribute. such info can included in title of each of m*n plots individually, repetitive. is there convenient way append column names (only above top row of plots) , row names (only left of left column of plots) in such grid? best solution far: utilize text() command place text outside of left-and-top plots. pretty unsatisfactory, requires many separate commands, , tweaking arguments such srt = 90 create text vertical on left margin, , using xpd = na within of par() . the lattice , ggplot2 packages have tools creating multiple plots in grid. may speed entire process if apply want do. library(lattice) splom( ~ iris[,1:4], data=iris, groups=species ) xyplot( mpg ~ wt | factor(

excel - can't get sumifs to work with a nested function -

excel - can't get sumifs to work with a nested function - i have set of info 1 column having product ids, , column having values. i'm looking take sum of column values, if ids have 7 or 9 3rd character. have formula believe insanely close... not there yet... =sumifs(e3:e821,a3:a821,mid(this,3,1)="7",a3:a821,mid(this,3,1)="9") my problem, i'm using mid function in criterias, don't know how give variable reference current cell beingness evaluated. if programming in javascript, i'd utilize "this" reference current object, doesn't work in excel. of examples i've been able find have simple criteria don't reference cell in comparison, leaves me @ loss. can help me figure 1 out? create helper column c: =or(mid(a2,3,1)="7",mid(a2,3,1)="9") sumifs function then: =sumifs(b:b,c:c,true) excel

ios - UITabBarControllerDelegate action not called -

ios - UITabBarControllerDelegate action not called - it looks lot of new ios developers have problems objective c class. i'm trying observe of 5 tab items tapped (home, products, cart, search, more). based on index tapped (0, 2, 4), want display root view, if there other views stacked on top of it. here's appdelegate.h code: @interface appdelegate : uiresponder <uiapplicationdelegate, uitabbarcontrollerdelegate> { uitabbarcontroller *tabbarcontroller; } @property (strong, nonatomic) uiwindow *window; @property (strong, nonatomic) uitabbarcontroller *tabbarcontroller; @end appdelegate.h code : @synthesize tabbarcontroller; - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { self.tabbarcontroller.delegate = self; homecoming yes; } - (void)tabbarcontroller:(uitabbarcontroller *)tabbarcontroller didselectviewcontroller:(uiviewcontroller *)viewcontroller{ nslog(@"action called.&

.net - resource '$this.icon' could not be instantiated in c# -

.net - resource '$this.icon' could not be instantiated in c# - i trying open old project , when open(form1.cs) give me error on particular forms designer view the parameter incorrect heres phone call stack at system.drawing.icon.initialize(int32 width, int32 height) @ system.drawing.icon..ctor(stream stream, int32 width, int32 height) @ system.drawing.icon..ctor(stream stream) @ system.drawing.iconconverter.convertfrom(itypedescriptorcontext context, cultureinfo culture, object value) @ system.componentmodel.typeconverter.convertfrom(object value) @ system.resources.resxdatanode.generateobjectfromdatanodeinfo(datanodeinfo datanodeinfo, ityperesolutionservice typeresolver) @ system.resources.resxdatanode.getvalue(ityperesolutionservice typeresolver) @ system.resources.resxresourcereader.parsedatanode(xmltextreader reader, boolean ismetadata) @ system.resources.resxresourcereader.parsexml(xmltextreader reader) when seek open form1.resx file gave me error:

multithreading - Synchronizing two methods in Java -

multithreading - Synchronizing two methods in Java - i have class one: public class iclass{ public void draw(){...}; //is called periodically rendering thread public void foo(){...}; //is called asynchronously thread(it ontouchevent() method example) } i want foo() method wait until draw method finished , vice versa. how can in java? regards make methods synchronized. public synchronized void draw() { system.out.println("draw"); } public synchronized void foo() { system.out.println("foo"); } or synchronize on same object. private static final object syncobj = new object(); public void draw() { synchronized (syncobj) { system.out.println("draw"); } } public void foo() { synchronized (syncobj) { system.out.println("foo"); } } java multithreading synchronization

c++ - SDL installation failure on windows with MinGW - dvec.h error -

c++ - SDL installation failure on windows with MinGW - dvec.h error - i trying set sdl on windows , struggling. i trying follow lazyfoo's tutorial on fresh install of windows 8 32bit. i install mingw via link mingw-get-setup.exe here: http://sourceforge.net/projects/mingw/files/, , install , update basic packages. i download developer libraries sdl2-2.0.0 (in order follow tutorial exactly, because current w.0.3 didn't work neither.) , extract main folder c:/, within includes folders named i686-w64-mingw32 , x86_64-w64-mingw32 (what difference between these exactly?), 2 other folders called 'include' , 'lib' (what difference between these lib&include folders ones within i686-w64-mingw32 , x86_64-w64-mingw32 folders?) i re-create source code file or create own simple test file includes main() 'return 0;' , '#include "sdl2/sdl.h" then run cmd line tutorial, below, , next failed result: c:\01_hello_sdl>g++ 01_hello_s

How does Swift implement ARC in property attributes? -

How does Swift implement ARC in property attributes? - how swift implement arc in property attributes? example, how create string variable utilize re-create instead of strong in swift? you can utilize @nscopying attribute when want copy behaviour objective-c. from swift book: apply attribute stored variable property of class. attribute causes property’s setter synthesized re-create of property’s value—returned copywithzone method—instead of value of property itself. type of property must conform nscopying protocol. the nscopying attribute behaves in way similar objective-c re-create property attribute. however, in specific case of string properties, it's not necessary so. strings value type in swift. such, when existing string assigned new variable, variable stores re-create of string, rather reference existing one. swift’s string type value type. if create new string value, string value copied when passed function or metho

javascript - Why is this eval failing? -

javascript - Why is this eval failing? - i'm getting desparate of bit of code not supposed do. after inserting lot of console.log , boiled downwards eval made variable undefined. the relevant segment of code is: console.log(str); console.log(typeof str); console.log(str.length); var ret = eval(str); console.log(ret); and output firebug-console is [[["index.php?page=int_jobmodule&methode=page_editjob&ro=1&id=20121218baasbw03","20121218baasbw03","dauervorgang plumperquatsch4711x"]]] string 135 undefined so, clearly, eval has done - can't figure out what's wrong there. javascript eval

php - Hide normal failure output from phpunit assert -

php - Hide normal failure output from phpunit assert - by default, when assert fails in phpunit print out error along values of variables in assert. usefull behavior, in case prints out big block of useless info (i'm asserting object has been destroyed) clutters error output. i tried passing error message optional 2nd parameter, output error above standard phpunit output. there method hide standard error output? here current assert: $this->assertfalse($json, 'json not removed'); although bad practice (precisely because hide actual values), in case can comparing yourself: $this->asserttrue(false === $json, 'json not removed'); another way assertempty. won't dump array , pass if $json false: $this->assertempty($json, 'json not removed'); php unit-testing phpunit

PHP capture word that contains special char from string using RegEx -

PHP capture word that contains special char from string using RegEx - i have special words in string capture based on prefix. example special words such ^to_this should caught . need word this because of special prefix ^to_ . here effort not working preg_match('/\b(\w*^to_\w*)\b/', $str, $specialwordarr); but returns empty array your code be, <?php $mystring = 'special words such ^to_this should caught'; $regex = '~[_^;]\w+[_^;](\w+)~'; if (preg_match($regex, $mystring, $m)) { $yourmatch = $m[1]; echo $yourmatch; } ?> //=> explanation: [_^;] add together special characters character class ensure begining of word special character. \w+ after special character, there must 1 or more word characters followed. [_^;] word characters must followed special character. (\w+) if these conditions satisfied, capture next 1 or more word characters group. php regex

.net - How to handle C++ Native Callback Class in managed wrapper -

.net - How to handle C++ Native Callback Class in managed wrapper - i've seen possible duplicate semantics different havent' been able working until now. i'm not sure comparable pure c-function pointer style, i've used in different projects. i have dll defines native c++ callback this: class="lang-or-tag-here prettyprint-override"> class nativeclass { // native callback handler class, internal definition class callback { public: // constructor callback() {} // destructor virtual ~callback() {} // callback functions virtual void handler() {} }; setcallback(callback* p) { ... } ... the dll consumes , fires callback function: setcallback(nativeclass::callback* p); so when i'm writing c++/cli wrapper, how can pass reference managed object exposing such callback handler. is not possible or how have handle correctly ? i've tried next according msdn documentation , other answers: typedef (__stdcall *native_call

html - Set selected option in dropdown using jQuery not working on IE -

html - Set selected option in dropdown using jQuery not working on IE - i have 2 dropdown lists created dynamically , i'm trying set default "selected" alternative using jquery. works in chrome, can't work in ie9. this i've tried far: js $("#dropdown").append($('<option>', { value: 'all', text: 'all' })).prepend($('<option>', { value: 'select financial year', text: 'select financial year', select: 'selected' })); $("#dropdownro").prepend($('<option>', { value: 'select ro', text: 'select ro' })).attr("selected", true).append($('<option>', { value: 'all', text: 'all' })); as can see tried different ways