Posts

Showing posts from May, 2010

Getting each image in custom WYSIWYG field - Advanced Custom Fields plugin - Wordpress -

i'm using custom post ui , advanced custom fields plugin, 1 of custom fields wysiwyg field uploading images (attached 'project' custom post type).i images uploaded wysiwyg field 1 one. using echo get_field ('name of field') doesnt work because returns images @ once.l tried using 'attachment', 'post_per_page' => '-1', 'post_mime_type' => 'image', 'post_parent' => $post-> id ); ?> id ); ?>" this doesnt work returns images attached post not in wysiwyg field i'm trying target although in thumbnail sizes. note, have other images attached same post want images specific wysiwyg field in post. i'm trying create image swap gallery thumbnails navigation created wysiwyg field user can upload thumbnail images.i'm trying use ultimate image swap gallery used here - http://bit.ly/10eyycx sorry long post.looking forward can get, i've been on weeks...

html - Difference between <link rel="icon" /> and <link rel="shortcut icon" /> -

this question has answer here: html5 `<link rel=“shortcut icon” />` 3 answers what difference between <link rel="icon" /> , <link rel="shortcut icon" /> . i understand first commonly used display favicon in web browser title bar. reading spec, can find fllowing explanation: where define "href": href = uri [ct] attribute specifies location of web resource, defining link between current element (the source anchor) , destination anchor defined attribute. it means: href says resource , when comes link perspective, stabilishes "conection" betwen page , resource. remember name: web. used reach resource , download in browser. now, going refinition of "rel" rel = link-types [ci] attribute describes relationship current document anchor specified href attribute. you're

meteor - Bootstrap dropdown not working with input-group -

i'm trying make dropdown input use search box. want work stack overflow tag box. search users, pops suggestions, click on one, populates choice , activates button can use cancel choice , start process on again. everything's working pretty okay, except when added button in bootstrap input group , dropdown box stopped dropping down. doesn't display now. here's html: <div class="row"> <div class="col-xs-6"> <div class="dropdown"> <div class="input-group"> <input class="entryinput form-control" id="query" name="query" type="text" data-toggle="dropdown" {{#if session "querypopulated"}}readonly{{/if}}/> <span class="input-group-btn"> <button id="cancelquery" class="btn btn-default" type="button"

sql - how do i cascade updates and deletions in oracle? -

i'm trying follow examples in book cascade updates , deletions problem syntax doesnt work in oracle db.. i understand cascade update mean update parent update child , same deletions.. cant figure out syntax oracle.. specific questions book are: 7.5 -- write create table statement employee table. email required , alternate key, , default value of department human resources. cascade updates not deletions department employee. 7.6 -- write create table statement project table. default value maxhours 100. cascade updates not deletions department employee. 7.7 -- write create table statement assignment table. cascade deletions project assignment; not cascade either deletions or updates employee assignment. i managed created these tables in isql *plus query: create table department ( departmentname char(35) not null, budgetcode char(30) not null, officenumber char(15) not null, phone char(12) not null, constraint departmentpk primary key(departme

(C#) YouTube API v3 - Copyright Strikes? -

i'm using google youtube api v3 automate checking copyright strikes on several youtube channels. channelauditdetails class provides copyrightstrikesgoodstanding boolean variable whether or not there copyright strikes, i'm hoping check total number of strikes (if any) should copyrightstrikesgoodstanding false (indicating there strikes). where can information found within api? there? working within c#.

javascript - Historical changes to same origin policy with XMLHttpRequest requests -

i wrote javascript 4 years ago xmlhttprequest request looked like: xmlhttp.open('get', 'http://www.example.com/script.php?arg=val&sid=' + math.random(),true) ; where example.com same domain. not work now, changed to: xmlhttp.open('get', 'script.php?arg=val&sid=' + math.random(),true) ; and works fine on major browsers, expected. my question this: did same origin policy chrome , firefox change in past 4 years in such way make xmlhttprequest need fixing? remember used work, can't go in time test it, , can't see documentation online indicates change of same origin policy. apologies if off topic, want understand how change of behaviour happened. simple "yes, changed" or "no, never changed, , should never have worked in first place." do. same origin must match domain exactly, protocol (e.g. http or https must match) , port (if specified). guess page either switched https or started using custom

php - not able to get results to paginate -

good day all, have been beating head against this, unless have missed how supposed work had better drawing board. went , got script working search database , 50,000 records have. searched internet there know , pagination or how work found coding it. since relative newbie on mysql , php, @ loss. <?php error_reporting(0); include("config.php"); ?> <!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>gt entertainment song database</title> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jq

html - Drop down menu goes below the web content -

i changed image slider in website: http://www.math.ubc.ca/~fluidlab/ however, see image slider on top of menu. how can fix it? thank you because elements position: absolute , have z-index larger dropdowns automatically. simply add z-index: -1 #slider1content .

memory leaks - using windbg to tune a asp.net app's performance find so many objects not be released -

i host asp.net(v4.0.30319) app on iis7, , using following windbg command find manay objects not released gc. !dumpheap -type xxxx 000000.... 671 246928 xxxx xxxx objects type's name , amount of objects increased 10+/m. can't find increase when use ants memoery prfiler 8. , can't find memory leaks when using windows performance monitor. i'm superised it's windbg's problem or .get latency gc mode applied? any body can give me advice? thanks lot. gary not answer, long comment the ants memory profiler garbage collection in order avoid false positives. windbg provides view on current situation on .net heap, garbage collector may not have run. how many windbg snapshots did compare? number increase or decrease sometimes? in garbage collection generation objects? find start address using !eeheap -gc and !dumpheap -stat -type xxxx <gc_generation_start_address> for different generations. if have many objects in generation 2, n

javascript - System JS load multiple dependencies in one call -

looking @ docs systemjs can not find example of loading multiple dependencies @ same time. expect api like... system.import(['jquery.js','underscore.js']).then(function($, _) { // ready go both jquery , underscore... }); i expect use promises load dependencies in parallel, , execute callback once complete. possible? if not, there reason why functionality not implemented? this possible promise.all: promise.all([ system.import('jquery'), system.import('underscore') ]).then(function(modules) { var jquery = modules[0]; var underscore = modules[1]; }); but ugly can see. there talk of considering allowing array example @ spec level, need in module spec since spec loader. the better alternative have 1 entry point application, app.js , have load dependencies.

python - PyQt application closes successfully, but process is not killed? -

Image
i noticed when run pyqt application , close it, application closes , process still alive. apparently process running not close after closing application. traceback (most recent call last): file "f:\projects\xyz\xyz\xyz.py", line 414, in <module> sys.exit(app.exec_()) systemexit: 0 when searched online , says if return value 0 , normal termination. see process keep on pilling run application. so how overcome problem? this looks problem specific idle. there several issues on python bug tracker closely related (e.g. 8093 , 12540 ), closed , resolved "fixed". since appears using old version of python (2.5), should able solve problem upgrading.

How to implement 'invite to download' feature in a Cordova/PhoneGap application on Android? -

i include menu item in android app (built using cordova/phonegap) provides users ability invite friends download app google play. does know of existing solution this? have not had luck finding one. on blackberry10, extremely easy (literally 1 line of code). leverages os , bbm share download url of app closest friends: blackberry.bbm.platform.users.invitetodownload(); link please tell me similar exists android (ios?) ? thank you. i use plugin , works perfectly: https://github.com/eddyverbruggen/socialsharing-phonegap-plugin it's sharing plugin allows lot of configuration options. configure users share link app on google play. documentation explains how set up.

java - What about new versions of third party libraries? -

i'm maintaining open source java library has dependencies third party libraries (e.g. commons-beanutils:commons-beanutils-1.8.3). during development added recent version of such libraries pom. did changes library , realized versions no more recent. i'm wondering strategy best practice such dependencies. my feeling says run mvn versions:use-latest-releases test . i recommend using mvn versions:display-dependency-updates , updating relevant libraries hand. it not necessary use latest version of library. usually, should update dependencies if: you need feature of new version (for major , minor releases) the update resolves known bug (that affects you) the update fixes security problem. resolves incompatibility dependency otherwise, consider staying on current version. you might, temporarily consider using version ranges commons-beanutils:commons-beanutils:[1.8.0,1.9.0) use latest bugfix version. note however, results in non-reproducable builds , m

.net - What is blocking AMQP TransportType when using Service Bus for Windows Server (Service Bus 1.1)? -

i have installed service bus windows server (service bus 1.1) on machine (windows 7 enterprise sp1 x64). i using sample c# code create simple message sender/receiver shown here: http://www.windowsazure.com/en-us/documentation/articles/service-bus-dotnet-advanced-message-queuing/ when use default transporttype.netmessaging console application runs fine , can send/receive messages queue. when change config file (or code) use transporttype.amqp console application starts , exception: an existing connection forcibly closed remote host (note: occurs when messagereceiver.receive() method called). it feels firewall/port blocked thing service bus install did add bunch of exceptions firewall include: sbhttpsport [inbound, local address=any, remote address=any, protocol=tcp,9355, 9002, 9359, 9002] service bus gateway [inbound, local address=any, remote address=any, protocol=tcp, 9354, 5672, 5671] sevice bus message broker [inbound, local address=any, remote address=any, prot

php - Returning array key when using array[] = -

what simple method return array key when using array[] add new values. for example: $array[] = 'hello world'; return $key_of_hello_world; the method i'm thinking of involves: $key = count($array)-1; is there different solution? conclusion a combination of end() , key() best in general allows associative if array uses numerical keys, count()-1 seems simplest , fast. added other linked question. $array[] = 'hello world'; end($array); // set internal pointer end of array $key = key($array); // key of element internal pointer pointing @ return $key;

android - Cant Save and Restore variable in fragment -

before post, tried read many topics restore app state , tried not solve problem. my class is: public class mainactivity extends actionbaractivity implements navigationdrawerfragment.navigationdrawercallbacks { private static boolean lv11 = true; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); mnavigationdrawerfragment = (navigationdrawerfragment) getsupportfragmentmanager().findfragmentbyid(r.id.navigation_drawer); mtitle = gettitle(); // set drawer. mnavigationdrawerfragment.setup( r.id.navigation_drawer, (drawerlayout) findviewbyid(r.id.drawer_layout)); } @override public void onnavigationdraweritemselected(int position) { // update main content replacing fragments fragmentmanager fragmentmanager = getsupportfragmentmanager(); if(position == 0) { fragmentmanager.begintransaction()

javascript prototype declaration -

there 2 pieces of codes. why first 1 correct second 1 incorrect? what's wrong this.prototype ? function person(name, age, job){ this.name = name; this.age = age; this.job = job; if (typeof this.sayname != "function"){ person.prototype.sayname = function(){ alert(this.name); }; } } function person(name, age, job){ this.name = name; this.age = age; this.job = job; if (typeof this.sayname != "function"){ this.prototype.sayname = function(){ alert(this.name); }; } } both of them incorrect. more on later. the second 1 incorrect because objects don't have prototype property. only functions have such property . in second example, this object, this.prototype undefined . in first example setting person.prototype , person function, "good". why first example still wrong? because don't have reason extend prototype ob

php - can I EXCLUDE rows in my complex query where criteria is met? (combining WHERE + multi AND) -

i need results table grouped ids exist in rows field1 = , field2 not null, not rows field1 = b , field2 null. getting syntax error, don't know quite how combine these criteria... here's i'm trying do: select a.post_title title, a.id, max(case when b.meta_key = 'endorser' b.meta_value end) endorser, max(case when b.meta_key = 'trail' b.meta_value end) trail, max(case when b.meta_key = 'townarea' b.meta_value end) townarea, max(case when b.meta_key = 'state' b.meta_value end) state, max(case when b.meta_key = 'start-date' b.meta_value end) startdate, max(case when b.meta_key = 'description' b.meta_value end) description, max(case when b.meta_key = 'organizer-name' b.meta_value end) organizer, max(case when b.meta_key = 'info-email' b.meta_value end) infoemail wp_posts left join wp_postmeta b on a.id = b.post_id b.post_id in (select post_id wp_pos

cakephp - how add more function in same view page? -

this 1 of controller app\controller\dashboardscontroller.php here patientslist controller <?php class dashboardscontroller extends appcontroller { public $components = array('session'); public function index() { $this-> loadmodel('patientslist'); $this->set('posts', $this->patientslist->find('all', array('conditions' => array('patientslist.user_id' => $this->auth->user('id'))))); } public function view($id) { $this-> loadmodel('patientslist'); if (!$id) { throw new notfoundexception(__('invalid post')); } $post = $this->patientslist->findbyid($id); if (!$post) { throw new notfoundexception(__('invalid post')); } $this->set('post', $post); } public function add() { $this-> loadmodel('pa

c - Integrating My Application with Powerpoint -

i have developed small basic gesture application using opencv. possible integrate gesture application ms powerpoint or other software vlc. thanks. it should possible creating kind of driver virtual device broadcast events according gestures, "mouse scroll wheel up" or sth. need dig in ms api this, , lot more work gesture recognition app. on other hand, might kind of software available already.

java - issue with spring bean configuration - Error processing XML Spring 4.0.2 -

Image
i using spring 4.0.2 eclipse kepler , facing following error while configuring component scan in bean configuration. please find spring configuration file well. <?xml version="1.0" encoding="utf-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:context="http://www.springframework.org/schema/context" xsi:schemalocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd"> <mvc:annotation-driven></mvc:annotation-driven> <bean id="jspviewresolver

javascript - Alternative Ways to change image color on hover (filters not working) -

i'm working on site http://66.147.244.95/~crossfy6/ , found open source code animated icons in circles , revised main menu icons. unfortunately, wasn't until after making in chrome (if view in chrome works perfectly) did test in browsers , found out greyscale filter used isn't supported in ie , safari. i'm wondering if there other ways can accomplish effect. thought of creating set of icon pictures grey , transitions them on hover, way rewrite bulk of menu since there set img's , not backgrounds divs can change css. other thoughts? or need start over? know basics of jquery , javascript not how implement them wordpress, i'm using. html <div class="gridcontainer clearfix"> <div class="grid_3"> <div class="fmcircle_out"> <a href="http://66.147.244.95/~crossfy6/about/"> <div class="fmcircle_border"> <div class="fmcircle_in fm

sql server - Fetching records from multiple tables -

i have 3 tables in database given below. have records these 3 tables such rf_date should between startdate , end date supplying query , page_id should equal pagetype supply query , 1 last assigned_to. suppose sent " 10/10/2003 12:00:00 am" start date , 10/10/2015 12:00:00 end date , pagetype=1 3 records table tblfrontusers each record have multiple entires in second table i.e "tblpatient", need latest "assigned_to" each user. eg: 115,latest there "5" , 116, latest "1" , 5 , 1 have it's names stored in last table i.e tblusers. trying following query finding difficult desired results. please help. select tblfrontusers .name, tblfrontusers .id, tblfrontusers.page_id, tblpatient.patient_id , tblusers.name tblpatient.assigned_to tblfrontusers left join tblpatient on tblpatient .id=tblfrontusers .id left join tblusers on tblusers.id = tblpatient .assigned_to tblfrontusers .rf_date >= '12/17/2003 12:

android - Join query in DataStore JPA java- App engine -

i want fetch data 2 different entites in jpa. using google datastore app engine store data on cloud storage. want fetch data 2 different entites making use of join query.as new app engine , datastore, don't know how that. referred this link , says datastore doesn't support joins properly. true? pleas eguide me solve problem. thank you. the ample places stated gae/datastore not "join queries". such https://developers.google.com/appengine/docs/java/datastore/jdo/overview-dn2 if instead using google-cloud-sql (why tag question sql?) suggest update question state that

osx - Can't ssh into my mac through local host or remote machine -

i've been researching days can find answer. can't ssh mac neither localhost or machine. here ssh user@localhost -vvv output: openssh_5.6p1, openssl 0.9.8y 5 feb 2013 debug1: reading configuration data /etc/ssh_config debug1: applying options * debug2: ssh_connect: needpriv 0 debug1: connecting 192.168.1.2 [192.168.1.2] port 22. debug1: connection established. debug3: not rsa1 key file /users/myusername/.ssh/id_rsa. debug2: key_type_from_name: unknown key type '-----begin' debug3: key_read: missing keytype debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3: key_read: missing whitespace debug3

computer science - Modeling VS Programming -

this might general computer science question benefit of question, what's difference between modelling , programming? how approached both separately , combined? moderators, instead of locking or closing general question, me out (commenting) broaden down question. difference follow modeling: modelling scientific activity aim of make particular part or feature of world easier understand programming: describes how struct/build model using real world objects or abstract concepts. of programming, simulation of model can construct , helps more understand modeling features

jquery - wizard accordion - how to set different heights for each part -

i'm new jquery , made wizard accordion jsfiddle html: <div id="accordion"> <h3><a href="#">step 1</a></h3> <div class="content"> <p> test </p> <button class='next'> next </button> </div> <h3><a href="#">step 2</a></h3> <div class="content"> <p> test </p> <button class='previous'> previous </button> <button class='next'> next </button> </div> <h3><a href="#">step 3</a></h3> <div class="content"> <p> test </p>

openoffice.org - Connect XPage with OpenOffice -

i have button on xpage want connect remote openoffice instance. openoffice started , listening socket connection. the onclick event of button runs following ssjs: oo = new com.test.openoffice(); oo.init("host=127.0.0.1,port=8107"); oo.openfile("c:\\temp\\test.odt"); the code raises excepction jva.lang.illeagalstateexception: notescontext not initialized thread the exception raised within method init of class openoffice . the relevant parts of class openoffice following code: public class dhopenoffice implements serializable { private static final long serialversionuid = -7443191805456329135l; private xcomponentcontext xremotecontext; private xmulticomponentfactory xmcf; private xtextdocument otextdocument; public dhopenoffice() { xremotecontext = null; xmcf = null; otextdocument = null; } public void init(string hostadr) throws java.lang.exception { xremotecontext = null;

java - Show alert when form submitted -

Ä° have form. when user click submit button, want show alert , submit form. here code sample. <form action="domakeapplication" method="post"> <td> <button class="btn type7 color1" type="submit" id="makeapplication" onclick="makeapp();return false" >baÅŸvur</button> </td> <input type="hidden" th:value="${jobadvert.company.companyname}" name="companyname" ></input> <input type="hidden" th:value="${jobadvert.company.id}" name="companyid" ></input> <input type="hidden" th:value="${jobadvert.id}" name="advertid" ></input> </form> this should trick: <form action="domakeapplication" method="post" onsu

mysql - cPanel user starting with Digital Ocean VPS -

i've been using cpanel whole life. switched digital ocean play around droplets. i'm having trouble creating mysql dbs digital ocean. i'm not unix shell. having trouble trying ssh account using mysql workbench gui. keeps giving me error login credentials invalid. i've changed default admin password mysql, can't seem login vps either new password or default password. i've tried installing phpmyadmin, prefer not use because not secure. cpanel there page can create dbs , setup privileges easily. i've read tutorials, know best 'workflow' vps setting mysql dbs. easy cpanel. i wouldn't install other soft , go ssh , learn way . i dont know how intalled mysql if installed using kind of images or preloaded images in do. when log ssh given mysql password . then here can start reading mysql tutorials add new database / users since pretty simple . most time use navicat manage db's .

Clojure: apply vs reduce for converting integers to chars and strings -

both of below functions return same output, first 1 uses reduce , pair of quote marks achieve same thing. played code , if delete "" marks, first character in sequence not converted it's integer value. second 1 seems clear me, feel first way superior, because packages of desired effects single function literal. unpack anonymous function me explain variables % , %2 referring , tell me why need "" first integer ( 115 ) in vector? (reduce #(str % (char %2)) "" [115 101 99 114 101 116 32 109 101 115 115 97 103 101 115]) (apply str (map #(char %) [115 101 99 114 101 116 32 109 101 115 115 97 103 101 115])) the first function taken clojure cookbook discussion on int str conversion, here . you can find anonymous function reader macro here anonymous function literal (#()) #(...) => (fn [args] (...)) where args determined presence of argument literals taking form %, %n or %&. % synonym %1, %n designates n

java - Search for items in the BST satisfy several conditions -

in java algorithm , data structure books found how realize search method, there explanation on how find element key entered. it's not need want search students in catalog satisfy several conditions, yeah, sounds easy, found little bit fiddly. here code method public node search() { node current = root; while (current != null || current.st.year != 2 && current.st.sex != "male" && current.st.result != 5) { if (current.st.id <= root.st.id) current = current.leftchild; else current = current.rightchild; if (current == null) return null; } return current; } have classes student , node , bst . st object of student class in node class access fields of student class. actually, method returns elements situated @ left side. wrong it?

sql - Oracle: query help for data conversion -

i have 2 tables containing same value. 1 table contains numeric values other contains character wise corresponding values. example if first table contains value '11', second table contains '3131'. if first table contains '123', second value contains '313233'. i need write sql statement joins these table (in other words need know function either converts '11' '3131' or vice versa.). i able solve using rawtohex function. applying rawtohex function on first table's column gave expected result. select rawtohex('11') dual; rawtohex('11') ----------------------------------- 3131 thanks.

c++ mysql connection failure -

i try connect mysql database c++ won't connect , cant figure out why. instance of mysql object initialised , tried connect database java , php , worked... the mysql server not hosted me, it's hosted german server provider suggest on server side ok. also libs , includes linked correct since initialisation of mysql instance works fine. mysql version use 5.0.x this line of code try connect database: mysql *connect = mysql_init(null); mysql_real_connect(connect, "xxxxx.db.1and1.com", "dboxxxxxx", "xxxxxx", "dbxxxxxx", 0, null, 0);

haskell - How can I quickly and easily configure GHC integration for Emacs? -

in past i've tried more ide experience while developing haskell in emacs, i've stumbled on not quite working integration. is there way basic ghc-powered features (e.g. type of identifier or instant compile using flymake) works*. works mean integrates rest of ecosystem (e.g. haskell-mode, cabal)? * works here means: requires basic configuration in init.el , perhaps installing package hackage. for inline error checking, hdevtools best i've found. it's background server running ghc in order speed analyzing programs. it's easy install: need 1 haskell package: cabal install hdevtools and 2 emacs packages, both through m-x list-packages : flycheck , flycheck-hdevtools . once it's installed, need enable m-x global-flycheck-mode (which can put in .emacs .) can go next error c-x ` . want change error , warning faces, can m-x customize-group flycheck-faces . unfortunately, emacs mode only errors , warnings (including hlint); not expose retri

javascript - Firefox reloads page even though I press "stay on this page" button -

i using window's onbeforeunload event prevent user leaving page. unfortunately, in firefox, if press f5 refresh page repeatedly, , press "stay on page" button every time, somehow firefox reloads page eventually. you can try reproduce bug on http://www.grooveshark.com the interesting thing is, after bug reproduced can see there no content loaded on site (example: grooveshark.com). , after refreshing page again , again content doesn't seem load @ all. please tell me if you've been able reproduce bug. want know if known issue in firefox , how fix issue. thanks in advance. this code: window.onbeforeunload = function (e) { var e = e || window.event; //ie & firefox if (e) { e.returnvalue = 'your information has not been saved yet. if leave now, information might lost.'; } // safari return 'your information has not been saved yet. if leave now, information might lost.'; }; p.s. video: http://1drv.m

python - socket.gaierror: [Errno 11004] getaddrinfo failed -

i trying install gsutil on windows 7 machine. following instructions here -> https://developers.google.com/storage/docs/gsutil_install but getting following error when run 4th step(python gsutil): socket.gaierror: [errno 11004] getaddrinfo failed maybe proxy issues? thanks in advance.

python - Event handling for matplotlib figure inside a WxPython panel -

how event handling on matplotlib figure inside notebook or example this? from numpy import arange, sin, pi import matplotlib matplotlib.use('wxagg') matplotlib.backends.backend_wxagg import figurecanvaswxagg figurecanvas matplotlib.backends.backend_wx import navigationtoolbar2wx matplotlib.figure import figure import wx class canvaspanel(wx.panel): def __init__(self, parent): wx.panel.__init__(self, parent) self.figure = figure() self.axes = self.figure.add_subplot(111) self.canvas = figurecanvas(self, -1, self.figure) self.sizer = wx.boxsizer(wx.vertical) self.sizer.add(self.canvas, 1, wx.left | wx.top | wx.grow) self.setsizer(self.sizer) self.fit() def draw(self): t = arange(0.0, 3.0, 0.01) s = sin(2 * pi * t) self.axes.plot(t, s) if __name__ == "__main__": app = wx.pysimpleapp() fr = wx.frame(none, title='test') panel = canvaspanel(fr) panel.draw(

jquery - can I use name tags as selectors -

i have form selects image customer customize, there should show set of options customizable particular product, e.g colours, trims etc first choose product , want show customization options once selected. not products can customized in same way need able remove options not applicable. can't use value because thats used change image shown choose product option link i have set name of each option numeric value, can this is correct way start it? if ($(this).name() == "1,2,3,4") then stuff any on appreciated, havent done while , brain drawing blank. you can use following alert($(this).attr('name')); and check if in array list using inarray

javascript - HTMLAnchor element download not working in Typescript -

i can't htmlanchor element's download property work under typescript. i'm using following code: var element = document.createelement('a'); element.href = 'data:attachment/csv,' + encodeuricomponent(csvcontent); element.target = '_blank'; element.mimetype = "attachment/csv"; element.download = 'report.csv'; /* #debug 030314 line fails */ document.body.appendchild(element); element.click(); it seems download property isn't supported in typescript. there work-around, adds .csv suffix file? - possible bypass typescript , call javascript code directly? you can add yourself: // tell typescript interface htmlanchorelement{ download:string; } var element = document.createelement('a'); element.href = 'data:attachment/csv,' + encodeuricomponent(csvcontent); element.target = '_blank'; element.mimetype = "attachment/csv"; element.downloa

Upload image to server and save the path in mysql database using php -

am new php. can provide me sample codes upload images server folder , save path in mysql db. know how upload image server using php have no idea how save images the server folder , save respective image path mysql db json response. in advance.

Semaphores in Java JVM processing and controlling of Thread -

my question regarding semaphores.. please can 1 explain me concept behind semaphores? have understood basic of it. still not able figure out why semaphore class implements serializable . http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/semaphore.html public class semaphore extends object implements serializable please try answer question in depth, using how jvm handles multimple threads , how semaphore controls it. use links semaphore example. http://www.javacodegeeks.com/2012/10/locking-with-semaphore-example.html http://javapapers.com/core-java/semaphores-using-java/

windows 7 - Please tell me how to create a SQL Server 2008 R2 Database Engine on my local Desktop computer -

Image
i have sql server 2008 r2 installed on local desktop computer. use connect remote sql server 2008 database engines in network. however, development purposes, create sql server 2008 r2 database engine on local desktop computer. please tell me how create sql server 2008 r2 database engine on local desktop computer 1. firstly connect server a. sever type: database engine b. sever name: your_pc _name/sqlexpress --> default server c. authentication: windows if have sql authentication please provide username , password given during time of installation 2. right click on databases , select new databases. 3. please enter desired database name , create database. 4. create user--> goto object explorer in left pane select security -->logins--> right click , click on create new login. please enter username , password , uncheck "user must change password @ next login". 5. need set administrative privileges database use

java - Log exceptions in separate files for each tenant in multi-tenancy architecture -

i having application multi-tenancy support, 1 server , multiple db, there separate db each tenant. exceptions thrown in application logged in 1 single log. tenantid printed along exception. i handle in separate file, i.e each tenant separate log file. helpful in identifying exception caused because of activity done user belonging particular tenant. there possibilities achieving using custom objectrenderer or other techniques. in advance. my suggestion create own appenders . in custom appenders can thing want separate log file etc.., reference : how create own appender in log4j? http://logging.apache.org/log4j/2.x/manual/extending.html

Get Latest Version of Folder from TFS, using Powershell -

i trying " get latest version " of particular folder tfs, using powershell. i have installed tfs snappin, , have been using tfs power tools cmdlets in powershell (such get-tfschilditem , select-tfsitem etc) [ how set tfs powershell snapin ], , have gone through documentation (which didn't find explanatory enough!). confused, on exact cmdlet use, when trying latest version of entire folder structure tfs, mapped local drive ( and not changeset or childitem ). example : tfs path - $/apd-repairsolutions/main/database mapped path - d:\tfs\apd-repairsolutions/main/database. i want code, iteratively latest version of entire folder database ,( has number of tables,stored procedures etc.) i using .. ps d:\tfs\apd-repairsolutions\main\database> $server=get-tfsserver -name http://tfs:8080/tfs ps d:\tfs\apd-repairsolutions\main\database> get-tfschangeset -recurse -server $server not helping case - returning latest changeset in current directory.

Create and "Save As" text file automatically using PHP -

so, trying export data database , have automatically prompt user save data has text file. here code: $datefile = rand(10000000, 99999999).".txt"; $datastring = "my data here blah blah blah"; $fwrite = fopen($datefile,"w"); $wrote = fwrite($fwrite, $datastring); fclose($fwrite); header('content-type: application/text'); header('content-disposition: attachment; filename="'.$datefile); this seems work in small ways - text file is, indeed, being created in same directory (as php page), , file seems open... no data in it. if navigate text file , open it, can see string there. doesn't open file automatically. doing wrong? edit: fwiw don't need file saved server per se , thought quick , easy way of getting "save as" text file created... if can think of way of doing without saving server, good, too. have tried sending content directly? header('content-type: application/text'); header('content-

java - @Indexed on nested property not working in Spring-data for mongo -

i have following object structure: @document(collection = "user") @typealias("user") public class user { @id private objectid id; private contact info = new contact(); } and here contact pojo: public class contact { @indexed(unique = true) private string mail; } but reasons not known me, don't see spring-data creating unique index property info.mail to summarize, have json structure of user object: {_id:xxxxx,info:{mail:"abc@xyz.shoes"}} and want create unique index on info.mail using spring data above pojo structure. please help. as far remember, annotating embedded fields @indexed not work. @compoundindex way go: @document(collection = "user") @typealias("user") @compoundindexes({ @compoundindex(name = "contact_email", def = "{ 'contact.mail': 1 }", unique = true) }) public class user { @id private objectid id; private contact info = new co

javascript - Validate that ALL radio buttons are selected or NOT on button Click -

i new javascript , have javascript function called on button click. want show alert if radio buttons have not been selected wether yes or no , if have been selected call function called addpoints() below. function validateform(){ var inputs = document.queryselectorall('input[type="radio"]'); var formvalid = false; for(var i=0;i<inputs.length;i++){ if(inputs[i].checked){ formvalid = true; } } if(!formvalid ){ alert("please answer questions!"); } else{ addpoints(); } } below how radio buttons presented <form name="form1" id="form1"> <input id="rdo1" type="radio" name="q1" value="10">yes<br> <input id="rdo2" type="radio" name="q1" value="0">no </form> <form name="form2" id="form2"> <input id=&qu