Posts

Showing posts from January, 2010

Using PHP to get Facebook friends statuses? -

that's first post here on so. i'm using php facebook friends statuses. in particular, i've tried retrieve public statuses 1 of facebook friends, happens first 100 statuses. need statuses , write them in text file. code i'm using, patched many answers read here on so. $i=0; $result = $facebook->api('/my_friend_id/statuses/', array('access_token' => $facebook->access_token,'limit'=>100,)); //'offset'=>50,used before limit, push limits forward 50, doesn't go beyond //'since'=>2010, read on there field, can't make work. foreach($result['data'] $post) { echo $i . '<br>'; echo $post['id'] . '<br>'; echo $post['from']['name'] . '<br>'; echo $post['from']['id'] . '<br>'; echo $post['name'] . '<br>'; echo $post['message'] . '<br>&

javascript - TypeError: name.toLowerCase is not a function -

i creating auto-complete code list countries json array. works fine, error in console. don't know when harmful. please can solve this? css .mainpart { width:100%; height:auto; } .first { width:150px; height:25px; float:left } .second { width:150px; height:25px; float:left } ul, li { list-style:none; } .li-autolist { background-color:#cbcacc; border:1px solid #fff; cursor:pointer; } html <div class="mainpart"> <div class="first"> <input type="text" id="county" onclick="autolist('#county','country')" /> </div> <div class="second"> <input type="text" id="county2" onclick="autolist('#county2','city')" /> </div> </div> js <script type="text/javascript"> function autosort(id,list){ if(list=='country&

java - Update database without opening browser from email link -

an email sent user, have email link. upon clicking link, database must updated, browser should not opened. there way using java? a link handled email client, it's not decide if browser opened or not. could, however, add image in email loaded url script on server can database update. wouldn't triggered click though. still, it's bit of grey area (privacy/hacking etc), , many (perhaps most) email clients disable loading of images reason, there's no 100% guaranteed solution (luckily!)

python - Why does re.findall() find more matches than re.sub()? -

consider following: >>> import re >>> = "first:second" >>> re.findall("[^:]*", a) ['first', '', 'second', ''] >>> re.sub("[^:]*", r"(\g<0>)", a) '(first):(second)' re.sub() 's behavior makes more sense initially, can understand re.findall() 's behavior. after all, can match empty string between first , : consists of non-colon characters (exactly 0 of them), why isn't re.sub() behaving same way? shouldn't result of last command (first)():(second)() ? you use * allows empty matches: 'first' -> matched ':' -> not in character class but, pattern can empty due *, empty string matched -->'' 'second' -> matched '$' -> can contain empty string before, empty string matched -->'' quoting documentation re.findall() : empty

alarmmanager - How to run an activity once in 3o mins forever android? -

this question has answer here: how run service once in 30 minutes? 2 answers how run background process in service method completely? 1 answer hi want code repeated forever, can body me pls trying lot not explanantion cant understand how repeate once half hour using alarm method or timer. can me? , dont need service this. code: public class gps extends activity implements locationlistener { locationmanager manager; string closeststation; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); { calendar cur_cal = calendar.getinstance(); cur_cal.settimeinmillis(system.currenttimemillis()); cur_cal.add(calendar.minute, 15);

android sdk on ubuntu Starting emulator for AVD PANIC: Could not open: -

i found tons of answers question windows, problem on linux (ubuntu). downloaded adt bundle, launched eclipse , tried start emulator virtual device manager, getting message starting emulator avd 'as' panic: not open: i tried run both root or not root without success. thanks dont use ./emulator -avd {avd name} super user...try using without root worked me..for more details see link

javascript - container is positioned from bottom all the time -

can suggest me please efficient way make 1 container stick out bottom of browser window , positioned :relative, scrollable can in pure css or there javascript/jquery that? unfortunately far know can using js. you can coordinates of element want stick, , position manually. can update "scroll" event using jquery

c++ - Algorithm to find min and max in a given set -

a large array array[n] of integers given input. 2 index values given - start,end . desired find quickly - min & max in set [start,end] (inclusive) , max in rest of array (excluding [start,end]). eg- array - 3 4 2 2 1 3 12 5 7 9 7 10 1 5 2 3 1 1 start,end - 2,7 min,max in [2,7] -- 1,12 max in rest - 10 i cannot think of better linear. not enough n of order 10^5 , number of such find operations of same order. any highly appreciated. you're asking data structure answer min , max queries intervals on array quickly. you want build 2 segment trees on input array; 1 answering interval minimum queries , 1 answering interval maximum queries. takes linear preprocessing, linear space, , allows queries take logarithmic time.

html - 2 Table but different width -

i want make table header , table data. facing problem width on 2 tables different. here example table : <table> <tr> <td>name</td> <td>class</td> <td>phone</td> </tr> </table> and data here : <table> <tr> <td>john reise</td> <td>math</td> <td>123456789</td> <tr> <td>michael sweirzgez</td> <td>information technology</td> <td>012345678910</td> <tr> so when try run code, : name | class | phone john reise | math | 123456789 if delete data, width fit table header. i make 2 table, 1 table header , 1 table data cause want marquee data. table header keep stay in top. maybe better use thead , tbody tags? <table> <thead> <tr> <td>name</td> <td>class</td> <td>phone</td> </tr> </thead>

php - Unreachable statement for PHPUnit achieving 100% Code Coverage -

i let phpunit generate code coverage , xdebug tell lines have not been reached: public static function execute() { static $hasrun = false; if (false == $hasrun) { // first run: init pat self::registerautoloader(); self::registerpatincludedir(); $hasrun = true; } return $hasrun; } this runs before can tested. inner block won't run again. there way reach block in if ? or way make 1 single test in phpunit run first?

build automation - Move a text file into target folder when compiling a Maven project -

i have slight different version of the question made recently. have maven project under netbeans 7.3 , doesn't have build.xml file configure building options, while there pom.xml use import other libraries. now, have text file (let's textfile.txt ) stored in project folder in netbeans 7.3 , e.g. project folder textfile.txt src package package.subpackage myclass.java when compile target folder jar file put in, e.g. project folder textfile.txt target classes generated-sources ....etc test-classes myproject.jar src package package.subpackage myclass.java how can make file textfile.txt being copied under target folder when compile maven project? a first way put files src/main/resources folder devoted store complied resources, i.e. resources included jar file (e.g. images icons). if need make config file distributed jar, separated it, must edit pom.xml file. possible answer add following plugin

Select all from a table hibernate -

so have following code: query query = session.createquery("from weather"); list<weathermodel> list = query.list(); weathermodel w = (weathermodel) list.get(0); i wan't items table weather, keep getting following error:(line 23 create query) java.lang.nullpointerexception @ action.weatheraction.validate(weatheraction.java:23) @ com.opensymphony.xwork2.validator.validationinterceptor.dobeforeinvocation(validationinterceptor.java:251) @ com.opensymphony.xwork2.validator.validationinterceptor.dointercept(validationinterceptor.java:263)............ what's problem? query query = session.createquery("from weather"); //you weayher object list<weathermodel> list = query.list(); //you accessing list<weathermodel> they both different entities query query = session.createquery("from weather"); list<weather> list = query.list(); weather w = (weather) list.get(0);

php - I want to make a sum from 5 tables that have one column named "UP" -

i have 5 tables (bepd , tirpd , elpd , frpd , kopd) same column named "up" , , want make sum of tables , show in php code . can me ? select sum(sumup) ( select sum(up) sumup table1 union select sum(up) table2 union select sum(up) table3 union ... ) subqueryalias

java - how to get selected row and column number after setgraphic of textbox in tableview in javafx? -

i have set textfield in column below in tableview setgraphic(textfield); have added changelistener updated text, want row , column number. setgraphic(textfield); textfield.textproperty().addlistener(new changelistener<string>() { public void changed(final observablevalue<? extends string> observablevalue, final string oldvalue,final string newvalue) { system.out.println("old "+oldvalue+" , new : "+newvalue); // here,how can particuler row number } }); assuming selecting 1 tableview cell, , want column , row index. get tableview tablecell : tableview table = this.gettableview(); then, tableposition first selectionmodel : tableposition firstcell = table.getselectionmodel().getselectedcells().get(0); finally, column , row index : firstcell.getcolumn() //int firstcell.getrow() //int

android.database.sqlite.SQLiteException: near "0": syntax error: ALTER TABLE data ADD COLUMN 0 INTEGER -

i new databases. i trying add columns table, need add columns named "0", "1", "2", etc.. until "94169". i following error: 05-04 10:12:50.656: e/an droidruntime(2022): fatal exception: main 05-04 10:12:50.656: e/androidruntime(2022): java.lang.runtimeexception: unable start activity componentinfo{com.example.koday/com.example.koday.mainactivity}: android.database.sqlite.sqliteexception: near "0": syntax error: alter table data add column 0 integer 05-04 10:12:50.656: e/androidruntime(2022): @ android.app.activitythread.performlaunchactivity(activitythread.java:1647) 05-04 10:12:50.656: e/androidruntime(2022): @ android.app.activitythread.handlelaunchactivity(activitythread.java:1663) 05-04 10:12:50.656: e/androidruntime(2022): @ android.app.activitythread.access$1500(activitythread.java:117) 05-04 10:12:50.656: e/androidruntime(2022): @ android.app.activitythread$h.handlemessage(activity

asp.net - Redirect to an .aspx page that is in another project from a MVC project -

i have 2 projects in solution. 1 mvc 4 project , other 1 web form application. have report.aspx page in web form application. question is: can redirect report.aspx mvc project's actions or views? yea, should not issue. responce.redirect("[your url here]"); you can use client side redirect using javascript (registerclientscript), following javascript command. window.location.replace('your url');

javascript - jQuery animate Background Color slideDown -

i trying animate background color when hovering element. for instance, have div when hover, want background change red, , slidedown, , fadeout on mouse leave. $('div.item').hover(function () { $(this).css('background-color', 'red').slidedown(400); }, function () { $(this).css('background-color', 'transparent').fadeout(400); }); there 2 issues this.. slidedown isnt working, color red comes in.. on mouse leave, element dissapearing (i assuming because fadeout working on element , not transition background-color). is there tutorial or can achieve please? you can achieve same effect making background image, using .animate change css , animation effects instead of keep chaining, code help: $('#nav a') .css( {backgroundposition: "0 0"} ) .mouseover(function(){ $(this).stop().animate( {backgroundposition:"(0 250px)"}, {duration:500}) }) .mouseout(function(){ $(this).st

linq to entities - Access entity array by index c# -

i have table represents matrix: custtype discountgroup1 discountgroup2 discountgroup3 wholesale 32 10 15 retail 10 15 0 all stock items have corresponding discount group code 1, 2 or 3. at time of invoicing want lookup discount customer type gets on item(s) being invoiced. the table needs able grow include new customer types , new discount groups nothing can hardcoded. i figured pull data array select column index getting stumped entities being intelligent... var disc = (from d in context.custdiscountgroups d.custtype == wholesale select d).toarray(); i can access columns name ie: disc[0].discountgroup1 if try disc[0,1] error saying wrong number of indices inside. what missing? feel ridiculously fundamental. other thought naming columns 1, 2, 3 etc , building sql select string can use variable denote column name. the database in design stages table(s) c

c# - Best way for sending advance email -

i'd send email asp.net . use code , work fine. mail.from = new mailaddress("mail@gmail.com", "sender", system.text.encoding.utf8); string = session["umail"].tostring(); mail.to.add(to); mail.isbodyhtml = true; mail.subjectencoding = encoding.utf8; mail.bodyencoding = encoding.getencoding("utf-8"); mail.subject = "subject"; mail.body = "body" ; smtpclient smtp = new smtpclient("smtp.gmail.com", 587); smtp.usedefaultcredentials = false; smtp.enablessl = true; smtp.credentials = new networkcredential("mail@gmail.com", "pass"); smtp.send(mail); but i'd custom , beautiful mail. emails send facebook, google team , etc. know can use html tag in mail.body way? best way ? this ready use code snippet use sending email contains both text content , content based on html template: // first create plain text version , set alternateview // create html version

ajax - jQuery and couchdb: is it possible to handle "created" and "already exist" in one handler? -

a typical pattern no use rest couchdb api "create if not exist". example, if want create database if it's not exist: $.ajax({ type: 'put', url: db + 'mydatabase', }); as programmer, both 201 created , 412 prerequisite failed success, since want database in place , it's fine me if it's created or here. jquery perspective, 201 success , 412 failure - need write lots of code make sure database in place: $.ajax({ type: 'put', url: db + 'mydatabase', }).fail( function( arg ) { if( 412 == arg.statuscode ) { // success. } else { // failure. } }).done( function( arg ) { // success. }); this makes code mess success in 2 places (even in 2 different callbacks!). possible somehow reduce error handling in less code, preferably processing success in 1 place? alternatively can use statuscode object bind shared event handler 200 , 412 . $.ajax({ type: 'put', url: db + 'myda

How do I write setters and getters for an array? (c++) -

im writing class within c++, not on how create setters , getters arrays (sorry being basic question!) getting following error: expected primary expression before ']' token here code: class planet: public body { private: string name[]; string star[]; public: void namesetter (string h_name[]) { name[] = h_name[]; } }; once again sorry such silly question, know not passing index through, however, when create index throws large amount of errors! string name[]; this not array, pointer. use vectors instead: #include <vector> class planet: public body { private: vector<string> name; vector<string> star; public: void namesetter (const vector<string> &h_name) { name = h_name; } };

php - SimpleXML: Selecting Elements Which Have A Certain Attribute Value -

in xml document, have elements share same name, value of attribute defines type of data is, , want select of elements have value document. need use xpath (and if so, suggest right syntax) or there more elegant solution? here's example xml: <object> <data type="me">myname</data> <data type="you">yourname</data> <data type="me">myothername</data> </object> and want select contents of <data> tags children of <object> who's type me . ps - i'm trying interface netflix api using php - shouldn't matter question, if want suggest good/better way so, i'm ears. try xpath: /object/data[@type="me"] so: $mydataobjects = $simplexml->xpath('/object/data[@type="me"]'); and if object not root of document, use //object/data[@type="me"] instead.

visual studio 2010 - Convert MVC 2 ASPX into MVC 4 Razor view engine -

i working on mvc 2 visual studio 2010 , view engine aspx kind of project. so have decided move visual studio 2012 mvc 4 , view engine razor . so achieve above task.if how ? i hear experience similar kind of situation. note : project large one. create new mvc4 project in visual studio 2012 , add source files old solution new solution 1 @ time. moving mvc3 mvc4 easier new solution, have imagine going 2 -> 4 more complex try upgrade in-place. conversion aspx razor should done manually. although there converters out there (like this one or code accepted answer in this question ), wouldn't trust application pure automation. also, convert 1 @ time. in other words, convert aspx -> razor or mvc2 -> mvc4 first , make sure works conversion. convert other 1 if run problems, don't have try figure out whether it's version upgrade or syntax upgrade caused problem.

GUI Programming in LISP? -

i did fair amount of lisp programming few years back, console-based things. did use cells-gtk (2), that's not maintained anymore , we're gtk3 now. does know of lisp library gui programming (i don't mind if dialect). for common lisp solutions listed in cliki usual. personally quite content ltk , it's not complex guis. capi should best such.

javascript - How to make an element's height increase with every child added to it -

i have <div> has children appended script. these children elements automatically appended php script , positioned using position:absolute . tried give parent <div> style min-height:400px allowing elements appended <div> increase parent's height. problem height not increase when this. know can fix this? edit: not able use position:relative positioning elements. there solutions allow position:absolute . yes can use position absolute (yeee♥!) live demo test case by doing: $(this).height( this.scrollheight ); or pure js: this.style.height = this.scrollheight ; and adding element's css: overflow:hidden; overflow-y:auto; edit: the demo tested fine in ie10, firefox, chrome, safari, , opera. the key point here setting overflow value x or y axis (whichever dimensions need size of) auto , rather default value of visible . scrollwidth or scrollheight property can used on html dom object full size of element, including abs

jsf - p:selectOneMenu does not work -

i developing application primefaces 3 , p:selectonemenu doesn't work. the first option selected , when press drop-down button right nothing happens. h:selectonemenu works fine, want style of primefaces component. <h:form> <!-- country--> <div class="control-group"> <label class="control-label">country</label> <div class="controls"> <p:selectonemenu value="#{userservice.sessionbean.currentuser.country}"> <f:selectitem itemlabel="austria" itemvalue="austria" /> <f:selectitem itemlabel="germany" itemvalue="germany" /> <f:selectitem itemlabel="italy" itemvalue="italy" /> </p:selectonemenu> </div> </div> <div class="form-actions"> <p:commandbutton type="submit" id="submitbutton" action="#{userservic

css - How do I create a box-shadow effect that looks like a curve? -

Image
i familiar creating basic box-shadows can't understand how create looks curve. better explain looking for, i've attached image. need similar that. how can create it? i've tried achieve somehow using absolute positioned elements, box shadow , radial gradient. overall use background image. but still have @ my fiddle unfortunately doesn't goal. might give starting point. html <div id="wrapper"> <ul id="nav"> </ul> <div id="first"></div> <div id="second"></div> </div> css body { background: #fefefe; } #wrapper { position: relative; display: block; width: 960px; height: 80px; overflow: hidden; } ul { height: 40px; width: 100%; background: #fff; box-shadow: 0px 3px 5px 0px #ccc; position: absolute; z-index: 300; display: block; padding: 0; margin: 0; border: solid 2px #eee;

Move vim function definition window to bottom -

Image
as can see, vim pops window definition of function completion on top (i don't know name is...), can move bottom? put following line in vimrc. ( relevant page ) set splitbelow this causes horizontal window splits put on bottom.

innodb - Foreign Key Input error in Link table (Error 1005) -

i trying input foreign keys link table @ once. created other tables first link table, added columns link table foreign keys (that worked). went insert foreign keys , doesn't work (by way none of other tables have foreign keys) it says #1005 - can't create table 'waget.#sql-798_842' (errno: 150) (details...) i clicked on details , comes innodb [ variables | buffer pool | innodb status ] click on variables has question mark next 3 things autoextend increment,buffer pool size,data home directory im lost want able create foreign keys please foreign key insert code use dbase; alter table link add foreign key (c_id) references c (c_id), add foreign key (d_id) references d (d_id), add foreign key (t_id) references t (t_id), add foreign key (b_id) references b (b_id), add foreign key (h_id) references h (h_id); make sure both collumns same: both int or varchar etc., both same length, both null or not.

mysql - NOT IN for multi field DQL Doctrine2 -

i want know how in doctrine2 select e \entity e e.field1, e.field2 not in (select e2.field1, e2.field2 \entity e2 condition ) when or surround 2 fields parenthesis got error like: queryexception: [syntax error] line 0, col 136: error: expected doctrine\orm\query\lexer::t_close_parenthesis, got ',' or: queryexception: [syntax error] line 0, col 135: error: expected =, <, <=, <>, >, >=, !=, got ',' php code: $query = $this->_em->createquery(' select r librairiebundle\entity\reseau r ( r.client1 = :me or r.client2 = :me ) , r.confirme = 1 , (r.client2, r.client1) not in ( select s.clientfrom, s.clientobject librairiebundle\entity\suggestclient s s.clientto = :cible ) '); separate clause. select e \entity e e.field1 not in (select e2.field1 \entity e2 condition ) , e.field2 not in (select e3.field2 \entity e3 condition )

java - Counting characters method exception error? -

this question has answer here: java: unresolved compilation problem 7 answers i have copied code answer on website (counting characters in string , returning count) , have amended suit own needs. however, seem getting exception error in method. i appreciate here. please forgive errors in code still learning java. here code: public class countthechars { public static void main(string[] args){ string s = "brother drinks brandy."; int countr = 0; system.out.println(count(s, countr)); } public static int count(string s, int countr){ char r = 0; for(int = 0; i<s.length(); i++){ if(s.charat(i) == r){ countr++; } return countr; } } } here exception: exception in thread "main" java.lang.error: unresolved compilation problem: method count(string) in type countthech

Solr API , how to access document? -

i developing custom request handler using solr api. reference taking "morelikethis" reference. i able access document using "getdoclist" api , taking object of "iterator" gives me document id . how can access each field of document ?? package org.apache.solr.handler.ext; import org.apache.solr.request.*; import org.apache.solr.response.*; import org.apache.solr.handler.*; import org.apache.solr.core.*; import org.apache.solr.schema.*; import org.apache.lucene.analysis.*; import org.apache.solr.common.params.*; import org.apache.solr.search.*; import org.apache.lucene.search.*; import org.apache.solr.search.solrindexsearcher.*; import org.apache.lucene.document.document; import org.apache.lucene.index.indexreader; import java.util.*; import java.io.*; public class myrequesthandler extends requesthandlerbase{ @override public void handlerequestbody(solrqueryrequest req, solrqueryresponse rsp) throws exception { system.out.println

java web start to spawn a process -

i have java webstart application should use on lan private network website not public usage. trying spawn command line window through webstart application calling api runtime.getruntime().exec("cmd.exe /c cd \""+strgenfolder+"\" & start cmd.exe /k \""+strcommandparas1+" \""); this works fine without webstart through jar file in webstart not give error nor crash doesn't work @ all. please correct me if there way spawn process in webstart though have given permission in jlnp file. <security> <all-permissions/> </security> i don't have experience in webstart bear me if talking silly. guidance can me better the cache in windows make problem in running correct version of jws, solve have delete cache folder. go in following directory c:\users\ssc1\appdata\locallow\sun\java\deployment , remove cache folder. refresh web page , run webstart, show updated version of jws app.

Apache configuration: automatic renaming of "file:///C:/xampp/htdocs/" to "localhost" in url when opening a local html file -

i'm new web development bear me. might missing despite searches. when open html file (of course directory served apache), opens in browser url is: file:///c:/xampp/htdocs/path/to/file.html this way not served apache, work have rename host-part of path host's name. if host-path is c:/xampp/htdocs/ then have rename part of url hostname, in case "file:///c:/xampp/htdocs/path/to/file.html" must renamed "localhost/path/to/file.html" if apache serve page. i've tried adding virtual host includes "file:///" in path crashes apache (and xampp). question: there way avoid manual renaming of urls when opening local html files served apache? i know it's been while since thread had activity, i've created chrome extension scenario. :) the name localhost automate, , redirects developer http://localhost according predefined folder. i hope find useful. :) https://chrome.google.com/webstore/detail/localhost-auto

javascript - Input box will not "forget" the first value it gets Firefox 20.0 -

the problem have input box not forgetting first input gets. feeds when content should have been on written new input. code using works fine ie8 problem seen firefox 20.0. i working entirely in javascript. there no html beyond body. i use set input box: addelementwithidbutnonode("input","manimp","div42"); // add input box addelementwithnodeandid("button","set","div42","setbutton"); //add "set" button document.getelementbyid("setbutton").onclick=showit; "manimp" id , below captures entered first time around "themainvar". function showit() { themainvar=manimp.value; themainvar=parsefloat(themainvar); alert(themainvar); } the problem if run again in firefox can enter value alert comes entered first time around. you can manually sent "manimp.value" else in javascript , change stays stuck @ changed value. i need "reset manimp can acce

Services in AngularJS -

i'm learning angularjs , i've little problem services. official tutorial gives example custom services rest : angular.module('phonecatservices', ['ngresource']). factory('phone', function($resource){ return $resource('phones/:phoneid.json', {}, { query: {method:'get', params:{phoneid:'phones'}, isarray:true} }); }); so made same code different names/url , works. i pass parameter service (an id in url). tried use $routeparams in didn't work. found other way declare several function in same service, made : factory('article', function($resource) { return { getlist: function(categoryid) { return $resource('http://...', { query: {method:'get', isarray:true} }); } } }) but doesn't work rest call (with return 'hello' example, it's ok). do know how ? thank

does elmah send errors to mail even if they got filtered ? -

i have web site mvc4 c# using elmah error logging. in web config declared email send on error elmah , error filtering in code in global.asax : void errorlog_filtering(object sender, exceptionfiltereventargs e) { if (e.exception.getbaseexception() invalidoperationexception) { if (e.exception.message.startswith("the connection id in incorrect format")) e.dismiss(); } } when go http://mydomain/elmah.axd see no more errors got filtered. them mail. i.e - if application has error ""the connection id in incorrect format" ,i notify on email elmah, , don't want notify ... there way filter in mail notifications ? i had same issue. have define second function filter out emails separately. signature of function is: void errormail_filtering(object sender, exceptionfiltereventargs e) { } calling e.dismiss() within method prevent exception being e-mailed. see https://code.google.com/p/elmah/wiki/errorfiltering

java - Is it required to use Clonable? -

i read everywhere if call clone() without implementing cloneable interface clonenotsupportedexception. if implement clone method in class not implement cloneable, can still call clone() w/o exception. mean implementing cloneable makes no difference. please elaborate........ implementing cloneable interface tells programmer object should have valid clone method. if looked @ cloneable interface find comment looks this note interface not contain clone method. therefore, not possible clone object merely virtue of fact implements interface. if clone method invoked reflectively, there no guarantee succeed. the cloneable interface programming practice programmer should follow if add implementation clone.

type conversion - Convert otf 2 woff with php -

for small type foundry website i´m looking way convert otf files woff dynamically php. (the goal use types css font-face , not images!) is there way php (script should work on shared host), if not there linux command lines tools can handle job? kind regards, tony the easiest way found this, using 1 of following 2 methods. use fontforge scripting , call php use rest font conversion apis like 1 found here . personally prefer later since works on environment , don't have mess compiling fontforge host , wrapping in php.

How do I git stash with Visual Studio Tools for Git v0.8.5.1 -

i comfortable command line, i'd know if it's possible (and if so, how) git stash using visual studio tools git . reading through q&a visual studio tools git responded not implemented. visual studio tools git q&a

.net - Performance issue when resizing Win32 containing WPF -

i in process of migrating existing legacy project. want use c++/cli bridge between business logic (native c++) , interface (wpf). followed msdn article on how host wpf content in win32 window starting point. however, cannot wrap head around problem: whenever resize host window... there serious delays , window repainting slowly. it causes desktop window manager (dwm.exe) increase dramatically in memory usage (2 gb in few seconds of resizing) i stripped down code bare minimum. simple, red wpf page , normal win32 project little changes: namespace managedcode { using namespace system; using namespace system::windows::interop; void create(hwnd parent) { hwndsource^ container = gcnew hwndsource(null, ws_child | ws_visible, null, 0, 0, 100, 100, "wpfcontent", intptr(parent)); managed::wpfpage^ page = gcnew managed::wpfpage(); container->rootvisual = page; } } lresult callback wndproc(hwnd hwnd, uint message, wpar

android - Update a Widget when user switches to sleep mode -

i have created little app widget, , want widget update when user switches sleep mode (or whatever mode called when short-push power button). i have searched around no avail. tried registering broadcastreceiver , not allowed in widget. if not possible, means widget has wait updateperiodmillis timeout, that's @ least 30 minutes , kind of breaks user experience.

MySQL behavior of ON DUPLICATE KEY UPDATE for multiple UNIQUE fields -

from mysql 4.1.0 onwards, possible add on duplicate key update statement specify behavior when values inserted (with insert or set or values ) in destination table w.r.t. primary key or unique field. if value primary key or unique field in table, insert replaced update . how on duplicate key update behave in case there multiple unique fields in table ? can have 1 update only, if either unique field matched ? can have update if both unique fields matched simultaneously ? consider insert table (a,b,c) values (1,2,3) -> on duplicate key update c=c+1; if , b unique fields, update occurs on a = 1 or b = 2 . when condition a = 1 or b = 2 met 2 or more entries, update done once. ex here table table id , name unique fields id name value 1 p 2 2 c 3 3 d 29 4 6 if query is insert table (id, name, value) values (1, c, 7) then get id name value 1 p 2 2 c

hierarchy - Make multiple dependent / cascading selectOneMenu dropdown lists in JSF -

i trying make 4 dependent menus. when user chooses item first menu, second menu show dependent data , when user chooses item second 1 , third 1 show dependent data , on. the user see items on first menu , other ones blank. if chooses item on first menu second 1 show data third , fourth remain blank, , on. user must choose entries 4 menus. <h:selectonemenu id="first" value="#{nodes.selectstate"}> <f:selectitems value="#{nodes.statelist}"/> <f:ajax render="second"> </h:selectonemenu> <h:selectonemenu id="second" value="#{nodes.selectcity"}> <f:selectitems value="#{nodes.citylist}"/> <f:ajax render="third"> </h:selectonemenu> <h:selectonemenu id="third" value="#{nodes.selectregion"}> <f:selectitems value="#{nodes.regionlist}"/> <f:ajax render="fourth"> </h:selectonemenu

math - Difference of Gaussian in Edge detection -

Image
can tell me how 2-d gaussian function given as- http://upload.wikimedia.org/math/f/7/3/f7352f2a6fea01707e869432d39bfc21.png where t standard deviation. how convoluted image(as in difference of gaussian)? what difference between gaussian function , gaussian filter? based on formula filter mask constructed in (aka discrete version of gaussian function): http://homepages.inf.ed.ac.uk/rbf/hipr2/gsmooth.htm this example gaussian filter mask: 1). this how convolution filter mask done: http://www.songho.ca/dsp/convolution/convolution2d_example.html basically filter flipped , filter moves on image. while moving on image, image pixel corresponds middle of mask gets value of weighted sum of mask , pixels. ( link explains better example) 2). gaussian function ==> continues gaussian filter ==> in case, discrete filter mask

php - jQuery ui autocomplete ipv4 -

i'm using jquery ui autocomplete helper in form. when try use search list of available ips never filter results, no matter number of characters (numbers) type returns complete list. how can correct it? using code http://jqueryui.com/autocomplete/#remote-with-cache json generated php file similiar (i have reduced number of results): ["192.168.3.2","192.168.3.3","192.168.3.4","192.168.3.5","192.168.3.6","192.168.3.7","192.168.3.8","192.168.3.9","192.168.3.10"] [edit] the form page code: <!doctype html> <html lang="en"> <head> <meta charset="utf-8" /> <title>jquery ui autocomplete - remote caching</title> <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" /> <script src="http://code.jquery.com/jquery-1.9.1.js"&g

javascript - How do I set an array of jQuery mobile flip toggle switches? -

i working jquery mobile , have set of 8 select flip switches on , off values. need set value each switch in localstorage when changed user. in turn, need values stored in localstorage , set each switch accordingly when page loads. here have far. it's far complete! $(document).bind('pageinit', function() { function setcats(){ var cats = $('#categories select'); var dealcats = localstorage.getitem("deal categories"); } function changecats (){ var cats = $('#categories select'); (var = 0; < cats.length; i++) { var obj = cats[i]; } $('#categories select').on('change', function(){ localstorage.setitem('deal categories', json.stringify(obj.id)); }); } $('#categories').on('pagebeforeshow', function(){ setcats(); }); $('#categories').on('pageshow', function(){ cha