Posts

Showing posts from January, 2015

c++ - Assigning parameter value in function declaration? -

i don't understand why in constructor declaration, input parameter assigned 2. what mean? mean default (unless else passed), size 2? graph(int size = 2); i've never seen syntax this, don't know how google :/ thanks in advance! you're right, parameter value 2 default. so can call normally: graph g(5); in case size equal 5, or can call without providing value: graph g; in case size equal 2. note: graph g(); function declaration, not construction/initialization. c , c++ allow declare functions inside other functions. graph g(); declaration of function g takes no arguments , returns graph object value.

xcode - Step By Step Process for creating and distributing Mac App for beta testing -

can provide step step guide building , distributing mac app beta testing. mac app using icloud. can't find useful guide works me here have figured out far: sign developer program (dev center) create developer certificate (dev center) create app id (dev center) create development devices (dev center) create application development provisioning profile app , selected test devices (dev center) install developer certificate on development mac (keychain) install development provisioning profile on mac (keychain) install provisioning profiles xcode (drag , drop or import organiser) create archive of app (using xcode) export developer signed application (xcode organiser) create test user (itunes connect) copy signed application test device run signed application - here error in console saying following: application killed because 31/07/13 2:34:40.177 pm taskgated[21510]: killed xx.xxx.xxx.appname[pid 22396] because use of com.apple.developer.ubiquity-container-iden...

sorting - Print the permutations of integer array in non increasing order -

given array of intergers. how program print permutations of numbers in array. output should sorted in non-increasing order. example array { 12, 4, 66, 8, 9}, output should be: 9866412 9866124 9846612 .... .... 1246689 #include<algorithm> #include<iostream> #include<stdio.h> #include<math.h> using namespace std; int totaldigits=0; int x[10000000]; int countx=0; int finddigits(int num) { int counter=0; while(num!=0) { num=num/10; counter++; } return counter; } int arrdigits(int *a,int size) { int count=0; for(int i=0;i<=size;i++) { count+=finddigits(a[i]); } return count; } int findval(int n) { totaldigits-=finddigits(n); return(pow(10,totaldigits)*n); } void findnum(int *a,int size) { x[countx]=0; int n=0; for(int i=0;i<=size;i++) { n+=findval(a[i]); } x[countx]=n; countx++; } void swap(int *a,int *b) { int *temp; *temp=*a; *a=*b; *b=*temp; } voi...

visual studio 2010 - how to grab a OpenCV frame without showing it or without creating cvNamedWindow? -

i not understand why opencv doesn't work when not need create opencv window using cvnamedwindow. actually, not want use opencv gui window, want use third party gui in order display grabbed frame, this, not need create opencv window. when not create opencv window, application gets stuck, nothing works, , when create opencv window using cvnamedwindow, works fine. any suggestion, whats reason? how can grab opencv frame without creating gui window? i using opencv 2.4.3 (cvqueryframe), vs2010 c++, windowsxp thanks. you need skip waitkey() call, ;) (also, favour, , skip c-api. it's real pita , go away soon)

android - androidmanifest.xml file resolves attribute entries -

i new android , started hello world app. i going through androidmanifest.xml <application android:allowbackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" </application> i trying figure out ic_launcher file located or has variable mapped. i have folder res/drawable-hdpi res/drawable-ldpi i can see folder has ic_launcher.png file, question folder pick image. also, saw there 1 entry in r.java file name as, public static final class drawable { public static final int ic_launcher=0x7f020000; } what relation between entry in r.java , androidmanifest.xml. also, second line android:label="@string/app_name" can see in strings.xml file, there 1 entry these, <string name="app_name">mymaplocation</string> now, written in androidmanifest.xml file(or other place) go , check app_name variable entry in strings.xml file? i sorry ask b...

javascript - why onclick not working as expected? -

i confused why onclick not wokring code1: onclick="return clicked('35','http://www.google.com');" code2: onclick='return clicked('35','http://www.google.com');' if used code1 onclick works fine not code2 thnx because you're breaking out of onclick soon, since use single quotes multiple things. first 1 doesn't break since can have single quotes in double quotes. if use second approach, escape single quotes in function call.

javascript - click event handler for span or td inside a table cell does not work -

i populating table when page loaded. rows created below: $.each(datax, function() { $.each(this, function(kx , vx) { tbl_row += '<td><p id="' +'^'+$key1+':'+$keyval1 +'^'+$key2+':'+$keyval2 +'^'+$key3+':'+$keyval3 +'^'+$key4+':'+$keyval4 +'^'+$key5+':'+$keyval5+ '$$'+kx+':'+vx+ '">'+vx+'</p></td>'; tbl_labels += "<th>"+kx+"</th>"; }) tbl_body += "<tr>"+tbl_row+"</tr>"; tbl_head = "<tr>"+tbl_labels+"</tr>"; }) $("#table_results thead").html(tbl_head); $("#table_results tbody").html(tbl_body); $("#table_results").table("re...

cluster analysis - clustering timestamp with timezone from twitter data -

i have postgres database tweets downloaded , use timestamp timezone column store current_timestamp. want cluster tweets great guy did https://gis.stackexchange.com/questions/11567/spatial-clustering-with-postgis but instead of geo-clustering want make time-clustering. mean want cluster tweets groups current_timestamp column. example have 10 tweets: time | text | tweet_id 2013-07-29 11:17:08.153+03 | text | 12345600bsa9 2013-07-29 11:19:08.153+03 | text | ang698f4s8s4 .. 2013-07-29 16:41:00.968+03 | hello | 6546448965445 2013-07-29 16:43:00.968+03 | world | w9087ol0930j3 so these 4 tweets want make 2 clusters (cluster checking hour distance) 1 cluster 11:.. hour , 1 16:.. hour. of course want extend day cluster, month cluster etc.. assistance guys? in advance sort data. ...

Difference between @classmethod and a method in python -

this question has answer here: what's example use case python classmethod? 6 answers what difference between @classmethod , 'classic' method in python, when should use @classmethod , when should use 'classic' method in python. classmethod must method referred class (i mean it's method handle class) ? and know difference between @staticmethod , classic method thx let's assume have class car represents car entity within system. a classmethod method works class car not on 1 of of car 's instances. first parameter function decorated @classmethod , called cls , therefore class itself. example: class car(object): colour = 'red' @classmethod def blue_cars(cls): # cls car class # return blue cars looping on cls instances a function acts on particular instance of class; first par...

python - Addition of chars adding one character in front -

what i'm trying implement function increments string 1 character, example: 'aaa' + 1 = 'aab' 'aaz' + 1 = 'aba' 'zzz' + 1 = 'aaaa' i've implemented function first 2 cases, can't think of solution third case. here's code : def new_sku(s): s = s[::-1] already_added = false new_sku = str() in s: if not already_added: if (i < 'z'): already_added = true new_sku += chr((ord(i)+1)%65%26 + 65) else: new_sku += return new_sku[::-1] any suggestions ? how ? def new_sku(s): s = s[::-1] already_added = false new_sku = str() in s: if not already_added: if (i < 'z'): already_added = true new_sku += chr((ord(i)+1)%65%26 + 65) else: new_sku += if not already_added: # carry still left? new_sku += 'a' ...

highcharts - How to apply custom color on candlesticks based on OPEN/CLOSE values? -

i'm working on candlesticks (highstock). there function through can change color of individual candlesticks based on open/close values ? default gives blue , white color, i.e. if opening values greater closing values color blues , , if closing value greater opening values color white. want apply green , red color instead on blue , white. want apply white color if closing price same opening. highly appreciated. in advance ;) you can find answer below link: highstock docs candlestick chart jsfiddle demo code: plotoptions: { candlestick: { color: 'green', upcolor: 'red' } },

multithreading - Simulate Fire & Forget scenario using C# Threading -

i have web service, takes lot of time execute. planning delegate processing task background thread & return acknowledgement response user immediately. in case worried life-time of background thread. background thread complete delegated task, before main method/thread finishes execution? you should call service asynchronously. var service = new youserviceclient(); service.somemethodcompleted += (sender, args) += { // put code here handle response , extract return value or whatever. } service.somemethodasync(); refer how to: call wcf service operations asynchronously more details.

migration - Migrate from Liferay Portal EE 6.1.20 to Liferay Portal CE 6.1.1 -

i migrate liferay portal ee 6.1.20 ga2 (developed locally trial version) liferay portal ce 6.1.1 ga2 (client requirement changed). is possible use same db (with downgrade process possibly) , configurations, developed portlets, data etc.? lot of information stored in db (organizations hierarchy, users, roles, site , page templates, etc) , hard migrate manually exports-imports etc. trying use same db throws following exception: java.lang.illegalstateexception: attempting deploy older liferay portal version. current build version 6120 , attempting deploy version 6101. is safe manually change liferay portal's build version in ee database's release_ table 6120 6101? finally, implemented described in question , seems work fine. i used same db liferay ee 6.1.20 installation , manually changed liferay portal's build version in ee database's release_ table 6120 6101. used liferay ce 6.1.1 bundle tomcat , copied ee bundle data folder (with document library ...

java - window.location.replace is not working on client side -

i have javascript function on jsp page. function gt() { var e=document.getelementbyid("parenttype"); var val=e.options[e.selectedindex].value; window.location.replace("iba1?value="+val); } i have created wizard functionality.the above code works fine in machine,but if test same thing on client browser giving error url not available. at same time if give whole location of jsp means working in client side not in machine.i've added path of jsp this window.location.replace("netmarkets/jsp/actionitem/iba1.jsp?value="+val); why happening?some ideas helpful did try giving whole path? url not work because relative path on server side.

jquery - cannot populate data in auto complete text field -

var data_names; jquery.ajax({ type: "post", url: 'autocompletehandler.php', data: {d_name: "d_name"}, datatype: "html", success: function(data) { data_names=data; console.log(data); } }); $("#p_name").autocomplete({ minlength: 2, source:data_names, focus: function(event, ui) { $("#p_name").val(ui.item.label); return false; }, select: function(event, ui) { return false; } }) .data("ui-autocomplete")._renderitem = function(ul, item) { return $("<li>") .append("<a>" + item.label + "/" + item.p_gender + "/" + item.p_age + "</a>") .appendto(ul); }; i tried above code populate autocomplete box data.but following error.when print json expected json.but when tried attach autocomplete box.i json array d...

backbone.js - ASP.NET Single Page Application (SPA) -

i new asp.net single page application (spa) using backbone.js , marionette.js can provide solid code example explanation started visual studio 2012 actually, need working example in vs2012 using asp.net spa(mvc4) + backbone.js , marionette.js instead knockout.js here 1 liked far: http://blog.patrickmriley.net/2013/06/mvc4-marionette-todomvc-template.html?showcomment=1375253174438#c3265360992803109932 but still no code explanation. any highly appreciated. thanks https://github.com/saqibshakil/spa-sample-app this project on github, not use mvc4 instead uses wcf json service. service detachable. implemented using marionette , and host of other open source library. support ie8 onwards. ie7 support needs inclusion of json2 library

Syntax error or access violation, SQL state 37000. MSSQL though ODBC from PHP -

i'm trying execute stored procedure in ms sql database using following php: $query = "{call dbo.storedproc('functionname', $date, 'id"; $resultset = odbc_prepare($connection, $query); odbc_execute($resultset, array()); odbc_result_all($resultset); the same stored procedure works fine different function, , results selected date ($date @searchstr): (eventstart >= @searchstr , eventstart < dateadd(dd,1,@searchstr)) however, when run code, errors without giving specific hints what's causing error. when query run in management studio, results returned correctly. sql error: [microsoft][odbc sql server driver]syntax error or access violation, sql state 37000 in sqlprepare in ... what's causing query error? odbc bug? thanks in advance, will the query seems missing ')} @ end.

(Probable) inconsistency in "id"s returned by facebook Graph API and Realtime Updates? -

related open graph api feed returning inconsistent results when publish post on page's feed using app, facebook returns id in form of <page_id>_<post_id> , when same app receives real time update same page—say or comment—the parent_id field of or comment contains <post_id> part! is bug or what? here response facebook engineers - this design. realtime update generated comment, parent_id show , not include page_id. for specific examples, please refer our documentation ( https://developers.facebook.com/docs/reference/api/page/#realtime ) , under sub-sections "feed example."

ios - mobile_house_arrest[xxx] <Error>: Max open files: 78 -

i'm using uiwebview wrapper around html5 application. application implements lot of video streaming - , medium size (js code). when actively use receive lot of errors: jul 31 13:21:34 ipad mobile_house_arrest[483] <error>: max open files: 78 jul 31 13:21:34 ipad mobile_house_arrest[485] <error>: max open files: 78 ... jul 31 13:21:35 ipad mobile_house_arrest[505] <error>: max open files: 78 in device's console - , stops respond. meantime works great in safari browser on same device. is there known memory leak issue or better workaround can apply? you might using "fopen" or "nsfilehandle"..etc create file handles not closing them appropriately (eg if using file * fopen ( const char * filename, const char * mode ) should close file using fclose ( file * stream ) )".only max 78 files can opened simultaneously in iphone device.

ios - Error "The App Name you entered has already been used." when adding new language -

i want upload new version of ios app itunes connect. new version of app contains support language. app name both languages should same. when try add metadata new language in itunes connect, following error: "the app name entered has been used." isn't possible use same app name different languages of same app? update: i experienced strange thing. when add metadata language (danish) can use same app name. when want use same name english translation, i'll error: "the app name entered has been used." it seems possible register existing app name if default languages differ. someone else might have registered app name default language set english. i asked question behaviour: https://stackoverflow.com/questions/19765154/why-is-it-possible-to-register-an-existing-app-name-in-itunesconnect-for-each-la

tomcat7 - Tomcat creates excessive output at webapp startup -

please see solution below, error description bit fuzzy since did not have idea wrong. i trying deploy new tomcat7 on linux, later whole machine cloned, set now. tomcat itsel starts properly, when trying deploy our application copying war file webapps dir, catalina error out file flooded 50mb of fine logging (see portion of below), , nothing put normal output file, , normal log file. the same not happen sample.war file provided tomcat docs (\appdev\sample\sample.war), starts usual lines of log. the logging.properties file default 1 every 'fine' replaced 'info', , every other tomcat file unmodified. what is customized: tomcat run jsvc , customized startup script. catalina_base separated catalina_home , tomcat run non-root user. edit: not sure if matters, startup script sets these startup parameters regarding logging: -djava.util.logging.config.file=<logging.proprties' path> -djava.util.logging.manager=org.apache.juli.classloaderlogmanager , cons...

android - displaying contents of an sqlite database -

i have update page allows inserting, updating , displaying contents of database. xml layout file looks this: <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/bckg1" android:gravity="top" android:orientation="vertical" > <textview android:id="@+id/gotomenu" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentbottom="true" android:layout_alignparentright="true" android:layout_marginbottom="46dp" android:layout_marginright="18dp" android:text="go main menu" android:textcolor="#221778" android:textsize="15sp" /> <edittext android:...

How to get the text having without any Element using Selenium Web driver -

i having hard time using selenium web driver find text below scenario. <td valign="top"> <br/> <span class="devicelabel">server</span> <br/> <span class="devicelabel">user name: </span> siva <br/> <span class="devicelabel">id: </span> 12323 how text "siva" , "12323" using selenium webdriver ? thanks in advance.

php - Cookie through a form and GET -

i using $_get function carry database field forward throughout form. have come across stumbling block when try pull information database: <?php $prodname=$_get["q"]; ?> <h3>product name: <u><?php echo $prodname; ?></u></h3><br /> <?php $con = mysql_connect("localhost","cl49-vogalcms","vogalcms"); if (!$con) { die('could not connect: ' . mysql_error()); } $prodname=$row['prodname']; $catagory=$row['catagory']; @mysql_select_db("cl49-xxx",$con)or die('unable select database ln 60:'.mysql_error()); $result=mysql_query("select * products prodname=$prodname")or die('ln 61 :'.mysql_error()); $cnt=$_cookie["count"]; setcookie("user",$myid,time()+10000); mysql_close($con); ?> <form name="newad" method="post" enctype="multipart/form-data" action="drtsavepic.php?q...

javascript - Bad image rotation -

i have issue javascript when rendering image before upload in correct rotation. seems when render image witch have correct rotation on exif data browser doesn't use it. users see different rotation between have on system on when image displayed on website javascript. the code basic: do know simple way correct rotation bug ? lbemeraude.handleimage = function (f) { if (f.type.match('image.*')) { var reader = new filereader(); reader.onload = (function (file) { return function (e) { var image = {}; image.dataasurl = e.target.result; lbemeraude.renderimage(image); }; })(f); var image = reader.readasdataurl(f); } } lbemeraude.renderimage = function (image) { var eimage = lbemeraude.createimgelement(image.dataasurl); $('someelement').append(eimage); }; lbemeraude.createimgelement = function (src) { var image = document.createelement(...

Cannot retrieve license from Marmalade SDK server -

Image
i have evaluation license, cannot retrieve it. of course connection working, firewall disabled , etc. check proxy settings in internet explorer. marmalade take proxy settings automatically ie. whenever have issue on new machine, disable auto proxy setting manual in ie , works.

javascript - Blending two transitions simultaneously in D3 -

i have started learning d3 , playing around bit it. have created small animation . not playing out how wanted. here's animation . ---> fiddle now if see in js , there small bit of code transition of circles takes place. below code. transitions c.transition() .attr("cy", 150) .duration(2000) .each("end", function () { d3.select(this).transition() .attr("cx", 150) .duration(2000); what want both vertical , horizontal transactions happen simultaneously. know d3 not used library i'm pretty sure community just put both attributes in 1 animation (updated fiddle http://jsfiddle.net/daevq/1/ ) c.transition() .attr("cy", 150) .attr("cx", 150) .duration(2000)

sql - vbscript insert array into access database -

i have simple task complex procedure. i'm creating tracking program tracks usage of applications, other pertinent info. i'm first recording data application in temporary text file deleted once data retrieved. data separated commas can stored in csv file. csv file used pull specific pieces of information review. data stored permanently in 2010 access database. i've been able store data in text file. i've been able create vbscript read data text file , copy csv file. need figure out why, when i've put message box above script inserts data database, can see info in message box, won't print database , i'm not receiving error messages. here's vbscript code: ' set constants reading, writing, , appending files const forreading = 1, forwriting = 2, forappending = 8 ' sets object variables. dim objexcel, objfso, objtextfile, objcsvfile, objtrackingfolder ' sets integer variables. dim intpathypos ' sets string variables program. dim desk...

java - Private Interfaces -

how can use methods of private interface in our code? abstract classes cannot instantiated. so, if need use methods of abstract class, can inherit them , use methods. but, when talk interfaces, need implement them use methods. the private keyword means "anyone in same class": public class foo { private interface x {...} private class x1 implements x {...} } this means classes declared inside of foo can use interface foo.x . a common use case command pattern foo accepts, say, strings , converts them internal command objects implement same interface. if add second class bar file foo.java , can't see foo.x .

How to remove an array containing certain strings from another array in Python -

example: a = ['abc123','abc','543234','blah','tete','head','loo2'] so want filter out above array of strings following array b = ['ab','2'] i want remove strings containing 'ab' list along other strings in array following: a = ['blah', 'tete', 'head'] you can use list comprehension: [i in if not any(x in x in b)] this returns: ['blah', 'tete', 'head']

c++ - How can i use my custom shader in Linderdaum Engine scene? -

currently replace default.sp custom shader , works fine. shader applied objects in scene. scene->setmtl() works materials , not opengl shaders. how can use custom shader objects? there method clscene::setmtlfromshader() accepts 3 clrenderstate variables. 1 each pass: normal, shadow , reflection. you need create own clrenderstate , set opengl shader program using clrenderstate::setshaderprogram() method. should work fine.

python - dnode working along nodejs on windows 8 error -

i have been trying dnode install link http://bergie.iki.fi/blog/dnode-make_php_and_node-js_talk_to_each_other/ i tried npm install dnode i gave me following error. gyp err! configure error gyp err! stack error: can't find python executable "python", can set pyt hon env variable. gyp err! stack @ failnopython (e:\program files (x86)\nodejs\node_modules\n pm\node_modules\node-gyp\lib\configure.js:118:14) could plz assist me issue appropriate commands :) much regards guys do have python installed? in path? which python if not can set python environment variable gyp can find it. export python=/path/to/python

html - Create nested list view from JSON -

i'm trying create nested listed view jquery. data in json file. looks this: { "fakultaeten": [ { "id": "1", "name": "carl-friedrich gauß", "institut": [ "mathematik", "informatik" ] }, { "id": "2", "name": "lebenswissenschaften", "institut": [ "biologie/biotechnologie", "chemie/lebensmittelchemie" ] }, { "id": "3", "name": "architektur, bauingenieurwesen und umweltwissenschaften", "institut": [ "department architektur", "department bauingenieurwesen und umweltwissenschaften" ] ...

java - Passing a variable value between activities -

i trying pass number edittext box in activity1 activity2 when button pressed, want number appear in toast or dialog box when action bar button pressed in activity2. have set intent , coded think should work seems crashing activity2 everytime. put in line of code should fetch variable. able see i'm going wrong. know passing data within variable should easy task. appreciated. activity1: public class activity1 extends activity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); //this.requestwindowfeature(window.feature_no_title); setcontentview(r.layout.screen_settings); this.setrequestedorientation(activityinfo.screen_orientation_portrait); final edittext inputtxt1 = (edittext) findviewbyid(r.id.conphonenum); button savebtn1 = (button) findviewbyid(r.id.btnsave1); savebtn1.setonclicklistener(new view.onclicklistener() { @override public void onclick(view view) { string phonenum1 = inputtxt1....

java - Oauth multipart request -

i want send files server oauth authorization. know how create oauth multipart request? use oauth lib requests. how can add lib ability send multipart? have plan rewrite httpclient4.java class. had such experience?

Delete from Array and return deleted elements in Ruby -

how can delete elements array , select them? for example: class foo def initialize @a = [1,2,3,4,5,6,7,8,9] end def get_a return @a end end foo = foo.new b = foo.get_a.sth{ |e| e < 4 } p b # => [1,2,3] p foo.get_a # => [4,5,6,7,8,9,10] what can use instead of foo.get_a.sth ? if don't need retain object id of a : a = [1,2,3,4,5,6,7,8,9,10] b, = a.partition{|e| e < 4} b # => [1, 2, 3] # => [4, 5, 6, 7, 8, 9, 10] if need retain object id of a , use temporal array c : a = [1,2,3,4,5,6,7,8,9,10] b, c = a.partition{|e| e < 4} a.replace(c)

MS Access VBA: Sending an email through Outlook -

how can send email through account using ms access vba? know question vague it's hard find relevant information online isn't outdated in way. edit: don't mean rude answering, i using ms access . cannot write actual code in outlook vba. add reference outlook object model in visual basic editor. can use code below send email using outlook. sub sendoutlookemail() dim oapp outlook.application dim omail mailitem set oapp = createobject("outlook.application") set omail = oapp.createitem(olmailitem) omail.body = "body of email" omail.subject = "test subject" omail.to = "someone@somewhere.com" omail.send set omail = nothing set oapp = nothing end sub

java - notify() not working in Runnable -

why can't notification reader in code: public class threadmain { public thread reader; private class serialreader implements runnable { public void run() { try { thread.sleep(3000); synchronized(this) { system.out.println("notifying"); notify(); } thread.sleep(3000); } catch (exception e){} } } threadmain() { reader = (new thread (new serialreader()) ); } public static void main(string [] args) { threadmain d= new threadmain(); d.reader.start(); synchronized(d) { try { d.wait(); system.out.println("got notify"); } catch (exception e) { system.out.println(e); } } } } i have line notifying in out...

javascript - Workaround for issues with KB2846071 -

because of patch kb2846071, getting issues in our web application wherever using window.event.clientx or window.event.clienty . one part of breaking critical functionality in our application. have looked of links after insalling kb2846071 event.clinety seems negative value did windows update 2846071 break break handling of window.event.clientx clienty? but none of these provide solution or workaround. know solution ms, right looking immidiate fix. can provide can use in place of below code? window.onbeforeunload = function(e) { if (event.clienty < 0 ) { // close session // warn user... } };

sharepoint 2010 - Search for phrases in docs in ClearCase -

i have lot of docs in clearcase not sorted , have migrate them sharepoint after sorting them. have folder structer of how want docs sorted in sharepoint. want search particular words in docs in clearcase , move doc respective folder in sharepoint. example, if doc contained word "design" go design process folder in sharepoint. want able search word phrases in docs stored in clearcase. possible? this isn't clearcase feature, rather simple grep issue. (unless want search in versions of clearcase file) i recommend loading docs in snapshot view , , use favorite grep tool on files .

jax rs - Jersey 2.1 - Consuming collection of POJO as JSON string -

i have collection of entities (list) need convert to/from json. the pojo: public class task { private long id; private string title; private boolean done; (...) } jersey produces following result [{"id":1,"title":"t1","done":false},{"id":2,"title":"t2","done":false}] when call method: @get @override @produces("application/json") public list<task> findall() { (...) return tasks; } so far good. now, need consume similar json string. assumed following method trick: @put @consumes("application/json") public void save(list<task> tasks) { (...) } but instead error below: severe: line 1:0 no viable alternative @ input '"[{\"id\":1,\"title\":\"t1\",\"done\":true},{\"id\":2,\"title\":\"t2\",\"done\":false}]"' what doing wron...

javascript - flowplayer cuepoints trouble -

hi sorry poor english .i creating bubble cuepoints manually using javascript in flowplayer. on mousehover show information .while page loading want load cue points(bubbles). having duration in seconds. how place bubbles in appropriate position(time). using flowplayer-3.2.16.swf , flowplayer-3.2.12.min.js . kindly me . cuepoints can added video adding data-cuepoints div holding video such: <div class="flowplayer" data-cuepoints="[6, 7, 8, 9]"> <video preload="none"> <source src="whatever.webm" type="video/webm" /> <source src="whatever.mp4" type="video/mp4" /> <source src="whatever.ogg" type="video/ogg" /> </video> </div> alternatively can add cuepoints via javascript such: <script type="text/javascript"> flowplayer.conf.embed = false; flowplayer.conf.fullscreen = true; flowplay...

php - Elastic Search: Boosting results -

i have many objects have been indexed in es. 2 of each object's properties "type" , "title". there way boost results if type in result set majority, title weighs more other properties such "description"? edit: boosting properties. want, given characteristic of result set(most types similar), further boost field. you can add boosting query: for example: "term": { "terms": { "value": "stranger fiction", "boost": 1.8 } read more here: http://www.elasticsearch.org/guide/reference/mapping/boost-field/

Can I write a custom template for the Liferay blog portlet? -

i want make major changes layout of liferay blog portlet. possible define own template somehow? want able change markup. kind of same way can make templates web content. unfortunately blogs portlet doesn't have same capability webcontent. however, depending on setup, might able "mimic" blog webcontent: categorize content according requirements, publish on assetpublisher , stick label "blog" on it. it depends bit on number of blog authors , location of blogs have: after all, you'll have enable them author/edit webcontent in 1 site. if that's not problem, use this. might use defined template, might able automate bit of work when provide custom portlet article input - advanced usecase.

java - Selenium2 Webdriver taking screen shot works for Firefox but nothing else -

i using selenium 2 testng. selenium-java-2.33.0 trying take screen shot of browser on failed test cases. storing webdriver in hashtable id associated each browser type (ie, firefox, chrome, , safari). in cleanup routine "@aftermethod", fetch webdriver. here code: //code 1: if (webdriver instanceof takesscreenshot) { file tempfile = ((takesscreenshot)driver).getscreenshotas(outputtype.file); fileutils.copyfile(tempfile, new file("screenshots.png")); } //code 2: eventfiringwebdriver efiringdriver = new eventfiringwebdriver(webdriver); file scrfile = efiringdriver.getscreenshotas(outputtype.file); fileutils.copyfile(scrfile, new file("screenshot.png")); both of code paths works firefox, other browsers, cast exception thrown. java.lang.classcastexception: org.openqa.selenium.chrome.chromedriver cannot cast org.openqa.selenium.firefox.firefoxdriver

google app engine - appengine app works only with my account -

i've developed simple appengine application google apps domain. access restricted users in domain, , app enabled in admin console domain. the authentication/authorization in application done using decorators, using json client secrets downloaded api console. i've created client secrets of type "client id web applications". my main handler, on method, follows: @decorator.oauth_aware def get(self): if decorator.has_credentials(): .... stuff ..... else: self.response.out.write("decorator doesn't have credentials") the problem application works when i'm logged in account. other users in same domain, "decorator doesn't have credentials" error. any clue on why case? the problem quite simple: user not logged in and, instead of presenting login window, app crashing. to present login window should use @decorator.oauth_required instead of oauth_aware , , put login: required in app.yaml file

image - Jquery JRAC get coordinates -

i've been trying 2 hours can't find way coordinates once have settled on cropped width , height. docs jrac not either. have experiencing getting values width,height,x,y? you can use jrac same example document add jrac , compare multi jquery plugin because jrac can move image area , jquery plugin can not jquery $('.imagearea img').jrac({ 'crop_width': parseint(math.round(cusw / 4) + 4), 'crop_height': parseint(math.round(cush / 4) + 4), 'crop_left': 0, 'crop_top': 0, 'zoom_min': 0, 'zoom_max': 0, 'zoom_label': '', 'viewport_onload': function () { $viewport = this; var inputs = $("div.coords").find("input[type=text]"); var events = [...

CakePHP Model Binding with TreeBehavior methods -

i making use of cakephp treebehavior class. $this->set('sports', $this->sport->children(1,true)); as can see bellow, function returns children need, not bind models. name of sport stored in table tags. associations defined in model , binds them if use 'find' method queries. there way use treebehavior functions , force model binding ? array( (int) 0 => array( 'sport' => array( 'id' => '2', 'parent_id' => '1', 'lft' => '6', 'rght' => '7', 'tag_id' => '51f0099f-ead0-4f41-8d0f-176c9c2b3e89' ) ), (int) 1 => array( 'sport' => array( 'id' => '3', 'parent_id' => '1', 'lft' => '8', 'rght' => '11', 'tag_id' => '79177f20-f46a-11e2-96ba-00116b93c9e5' ) ) ...

php - Ajax not filling target DIV correctly after form submit -

i trying implement form plugin website have. supposed simple, refuses behave want. it's simple php email form inside div, once correctly submitted, replaced success or failure message inside same div. js adds message on top of form. i stunned because thought tackled serious trouble experience doing this, can't past simple bug. want response message inside div once contained form. here's include php: if (isset($_request['sender']) && isset($_request['message'])) {//if "sender" , "message" filled out, proceed //check if email address invalid $mailcheck = spamcheck($_request['sender']); if ($mailcheck==false) { echo "an error has occurred" . $_request['sender'] . " " . $_request['message']; } else {//send email $email = $_request['sender'] ; $subject = "this subject" ; $message = $_request['message'] ...

winapi - WM_NCCALCSIZE, custom client area, and scroll bars -

Image
i have mfc app embeds scintilla text edit control. want customize scintilla control display custom controls next vertical scrollbar. essentially, want render controls in orange area below, green area represent scroll bars: i tried overriding wm_nccalcsize message of scintilla window , subtracting offset right side of client rectangle. here code: void cscintillactrl::onnccalcsize(bool bcalcvalidrects, nccalcsize_params* lpncsp) { cwnd::onnccalcsize(bcalcvalidrects, lpncsp); lpncsp->rgrc[0].right -= 100; } however, causes vertical , horizontal scroll bars reposition account smaller client width, shown below: i'm not sure if behavior caused scintilla or windows. there way can adjust client area , preserve positions of scroll bars? i found scintilla specific solution. can use sci_setmarginright command add margin right side of client area, , render controls inside that.

python - find all characters NOT in regex pattern -

let's have regex of legal characters legals = re.compile("[abc]") i can return list of legal characters in string this: finder = re.finditer(legals, "abcdefg") [match.group() match in finder] >>>['a', 'b', 'c'] how can use regex find list of characters not in regex? ie in case return ['d','e','f','g'] edit: clarify, i'm hoping find way without modifying regex itself. negate character class: >>> illegals = re.compile("[^abc]") >>> finder = re.finditer(illegals, "abcdefg") >>> [match.group() match in finder] ['d', 'e', 'f', 'g'] if can't (and you're dealing one-character length matches), could >>> legals = re.compile("[abc]") >>> remains = legals.sub("", "abcdefg") >>> [char char in remains] ['d', 'e', 'f...

archive - SQL Server Archiving Strategy (not Backup) -

our contracts our clients state manage , store data within last 3 months. because have such high volume application, archive production tables moving old data "archive" database. have stored procedure gathers older data, dumps tables in "archive" database , removes rows production database. pretty simple, straightforward process. we want keep archive database @ manageable size , "shelve" data onto offsite media. best way accomplish still allow load offline data in order retrieve old data customer @ request? there no such thing best way ;). your requirements way broad , need narrow these down. try come detailed specs , you’ll able come solution once have data. here things i’d analyze first: monthly amount of data needs moved offsite how amount change in future (safe bet assume numbers grow) budget how long should keep archives before deleting them turnaround time restoring archived data depending on these factors “best” solution...

html5 - How do you have to mark up a postal address so it allows invoking an intent on a mobile device? -

my goal when mobile user touches address on clients website appropriate intent invoked, allowing user to, example, display location on google maps or start gps navigation. similar behavior working great phone number. upon touching it, i'm asked if want complete action using skype or phone app. so far, i've marked address hcard microformat , localbusiness schema.org . i've added geographic coordinates , marked them well. while that's great structured data, didn't seem have effect regarding initial goal. is i'm trying achieve possible? before apple maps used put link 1 below. when tapped, open google maps app. don´t have iphone test right now, chrome android shows menu chose application handle type of link (chrome, maps, waze, etc). <a href="http://maps.google.com/maps?q=-22.90132,-43.176527">ccbb (centro cultural banco brasil)</a>

mysql - Upgrading umbraco from 4 to 6 -

i install umbraco 6.1.x, host suffers issue: http://issues.umbraco.org/issue/u4-1632 basically, can't install 6 due incompatibility mysql on linux , umbraco 6, read can upgrade 4.x.x , upgrade 6. question is, how do that? i.e. files need upload , edit such database remains, umbraco files version 6? yes, according bug report can install umbraco v4.11.x , upgrade v6.1.x , should work fine. the downloads available here: http://our.umbraco.org/download however, easiest way umbraco set use nuget in visual studio. run following line nuget console: install-package umbracocms -version 4.11.10 you'll have use console because if use package manager, install latest umbraco package version. next, load site in browser , configure database settings. upgrade using nuget again. find easiest way open nuget package manager in visual studio, select "updates", find umbraco package , click "update". automatically update files you. you need load site ag...

php - Extracting URL's from mysql database and setting as single word clickable link -

i extract url's mysql database. wish link url single word 'click' in table. the snippet of code below extracts data mysql database , puts in table series of rows. each row there respective url wish extract database. instead of showing full , long url want have word click against each row people can click access url. can body tell me how done? $q="select * railstp download='$changeday'"; $r=mysqli_query($mysql_link,$q); if ($r) { echo "<strong>network rail schedule (stp) updates downloaded: $changeday</strong>"; echo "<p> </p>"; echo "<table id='customers'> <tr> <th>headcode</th> <th>traction</th> <th>from</th> <th>to</th> <th>depa...