Posts

Showing posts from January, 2011

c# - Stereo Calibration and 3d Reconstruction -

the result of 3d reprojection function matrix has x,y,z of each pixel. let's take first element of matrix points[0] has: x= 414.580017 y= -85.03029 z= 10000.0 what unit here , can find pixel in image ? , why not x=0,y=0,z=10000.0! points = pointcollection.reprojectimageto3d(disparitymap, q);

struts2 - Creating two or more sitemesh decorators in struts 2 app? -

i creatig struts 2 application using sitemesh 2.4 plugin in want apply multiple decorator acording requested resource. decorators.xml <?xml version="1.0" encoding="utf-8"?> <decorators defaultdir="/decorators"> <decorator name="layout1" page="layout1.jsp"> <pattern>/first/*</pattern> </decorator> <decorator name="layout" page="layout.jsp"> <pattern>/second/*</pattern> </decorator> </decorators> i have created 2 different layout file named layout.jsp , layout1.jsp inside decorators directory , have create navigation file this <%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator" prefix="decorator" %> <decorator:usepage id="thepage" /> <html> <head> </head> <body> <% string selection = thepage.getproperty("meta.selection"); %> <p> &l

javascript - How can I get the value from a series of textbox with same id -

i have series of textboxes same name <%for(i=0;i<=nooftasks;i++){%> <input type="text" id="duration" name="duration" class="td4" onkeyup="durationformat()"> }%> in javascript have add colon after 2 digits function durationformat() { var duration = document.getelementsbyname("duration").value; if(duration.length==2){ duration=duration+":"; } } but not desired result not string textbox of particular text box. any ideas? <input type="text" id="duration" name="duration" class="td4" onkeyup="durationformat(this)"> <script> function durationformat(obj) { if ((obj.value.length)== 2) { obj.value+=":"; } } </script>

css - CSS3 background-position issue with Safari only -

the following code renders in ie9, firefox, chrome, not in safari: .search-choice { position: relative; background-clip : padding-box; background-image: url('../design/icon_chosen_close.gif'); background-repeat: no-repeat; background-position: top 6px right 6px; } <ul class="chzn-choices"> <li class="search-choice" id="sellvb_chzn_c_0"> <span>multi1</span><a href=# class="search-choice-close" rel="0"></a> </li> </ul> safari doesn't seem take account background-position. have tried number of variants (like background-position-x: right 6px), nothing seems work. can't offset background image in safari starting top right corner. any ideas? lot time! found out safari marks following line invalid , background image won't displayed: background-position: top 15px right 0px; but when type only: background-position: top right;

Android Apps to asynchronously read some kind of buffer -

i assigned task research , implement 2 apps following: app writes content buffer/register of sort app terminates app b starts , reads buffer the apps not supposed run @ same time. first of don't know possibilities have. came following: write file write shared memory range are 2 options possible , have grant app b right access file or memory range? furthermore supposed check network sockets usage "buffer". know go against supposed done expected! trying use datagramsocket because can open kind of socket, send packets on it, close socket , terminate app. thought there system buffer holding packets until calls receive on datagramsocket same port. possible or system throw packets away when nobody receiving them immediately? there class in android api created allow sharing data between different applications - contentprovider . you should create contentprovider in charge of data (i recommend using sqlite database store data), , both apps can

events - Handler on DOM elements in GWT -

i want add handler on buttonelement , have implemented follow. please me in resolving error in code. not want add handler directly on button widget. button button = new button("click"); element buttonelement = button.getelement(); event.seteventlistener(buttonelement, new eventlistener() { @override public void onbrowserevent(event event) { string string = event.gettype(); if(string.equalsignorecase("click")) { system.out.println("click"); } } }); event.sinkevents(buttonelement, event.onclick); your code correct, might added widget after sink event. have add widget before sink event. example: button button=new button("click"); element buttonelement = button.getelement(); rootpanel.get().add(button); event.sinkevents(buttonelement, event.onclick); event.seteventlist

c# - TemplateBinding a GradientStop Offset -

i'm trying bind gradientstop offset in order display sort of progress bar inside ellipse. customcontrol button , if possible i'd keep way. of course there several dependency properties , offsetprogress 1 of them. is possible templatebind gradientstop offset? languages c# xaml wpf. here's code if thinks can useful: <ellipse stroke="black" strokethickness="1" stretch="uniform"> <ellipse.fill> <lineargradientbrush endpoint="1,0" startpoint="0,0"> <gradientstop color="{binding path=background.color, relativesource={relativesource mode=templatedparent}}" offset="{templatebinding offsetprogress}" /> <!-- not working --> <gradientstop color="#ffffffff" offset="0.5" /> </lineargradientbrush> </ellipse.fill> thank you!

.htaccess - how to handle htaccess rewriteReule -

i have wp site, , have htaccess: <ifmodule mod_rewrite.c> rewriteengine on rewriterule ^mypage/ /z____articles/mypage/ [r=301,l] </ifmodule> this makes redirection in browser, dont want redirect, want page: site.com/mypage/ showed content of site.com/z____articles/mypage/ i tried use these flags [nc,l] or [l] none of them works..

Unit test for Windows Strore Apps deletes Local Storage -

i have created test project windows store app. there method createdb creates sqlite database. in test project have written test method calls createdb method , checks if database created. when execute test method goes well, test execution ends local storage gets deleted. how prevent this? i'm pretty sure test framework designed create , remove data what in case serialize out object or convert byte array, put break point before end of method, debug, break there, , copy value out file.

python - mayavi mlab.savefig() gives an empty image -

i trying learn mayavi2 python , can not savefig show plots. found example code: from numpy import pi, sin, cos, mgrid dphi, dtheta = pi/250.0, pi/250.0 [phi,theta] = mgrid[0:pi+dphi*1.5:dphi,0:2*pi+dtheta*1.5:dtheta] m0 = 4; m1 = 3; m2 = 2; m3 = 3; m4 = 6; m5 = 2; m6 = 6; m7 = 4; r = sin(m0*phi)**m1 + cos(m2*phi)**m3 + sin(m4*theta)**m5 + cos(m6*theta)**m7 x = r*sin(phi)*cos(theta) y = r*cos(phi) z = r*sin(phi)*sin(theta) # view it. mayavi import mlab a= mlab.mesh(x, y, z) mlab.show() now want save figure, add: mlab.savefig(filename='test.png') this saves gray image test.png. must actual image save? this same issue results using matplotlib, the best option save before show .

watir - You are using an old or stdlib version of json gem -

i've seen following issue mentioned in thread few days ago amongst other problems, solution issue (to me) didn't seem addressed. i ran test on ruby 1.9.2-p290 environment , presented following error when ran test script: you using old or stdlib version of json gem please upgrade recent version adding gemfile: gem 'json', '~> 1.7.7' this issue continued when created fresh ruby 1.9.3-p392 environment, running on windows xp (don't ask). confuses me when have json 1.7.7 or 1.8.0 installed (gem list pasted below), still message when run test. it's not affecting test results, warning rather annoying see each time. which gemfile need add version into, , located? gem list: bigdecimal (1.1.0) childprocess (0.3.9) commonwatir (4.0.0) ffi (1.8.1 x86-mingw32) io-console (0.4.2, 0.3) json (1.8.0, 1.7.7, 1.5.5) mini_portile (0.5.0) minitest (5.0.0, 2.5.1) multi_json (1.7.3) rake (10.1.0.beta.3, 10.0.4, 0.9.2.2) rdoc (4.0.1, 3.9.5) rubygems-update

Use Javascript to scroll in HTML tables? -

i have few table in scrollbox. upon loading page automatically scroll first empty table row using javascript. possible? $("table tr").each(function() { var cell = $.trim($(this).find('td').text()); if (cell.length == 0){ var el = cell; el.scrollintoview(true); } once have empty row, can scroll this. function scrollintoview(el){ window.scrolltop( el.offset().top - ($(window).height()/2) ); }

android - Exclude Broadcast Receiver from Recent Application List/Task Manager -

i have semi-successful app on market uses broadcast receivers few of features. request many of users, have excluded few activities "recent applications list" adding line activities in manifest: android:excludefromrecents="true" i trying same thing broadcast receiver. have tried adding line receiver , of dependant activities no avail. can "hide" broadcast receiver user? supposed work, or there alternative? also, how stop app showing in task manager (running application list) when broadcast received? there quite few apps on phone (my app included) show in 3rd party task manager not show running applications in default settings->apps->running list. can please explain why case, , can possibly keep off task manager list (without knowing how each individual task manager searches apps)? thanks! note: use word "hide" apprehensively. de-clutter recent applications list requested users. no ill intents :d. when receive broadcast

output - Is there a way to view the console of CruiseControl.NET remotely? -

is there way remotely view terminal output of cruisecontrol.net remotely? @ present, running following command using instance of git bash on terminal log file located on windows share: tail -f <filename> this works (and nice in conjunction using "grep -v" filter out unwanted lines output), terminal updates new output , misses new lines written console output file. there plugin or built in way hook ccnet , remotely view console output without having monitor file on windows share? i believe take @ log4net appenders, since ccnet uses logging library write output file, , it's configuarable through config file (respectfully service or console). there many different appenders in log4net: https://logging.apache.org/log4net/release/sdk/log4net.appender.html hopefully 1 of them suited better needs (i can't recommend any, haven't used log4net..)

twitter - Issue in getting the Time of creation of a tweet -

i'm using tweetsharp library display latest 5 tweets posted user. i've created app @ dev/twitter , got required tokens. want show time lapsed since tweet posted. "tweet.createddate" method tweetsharp library provides time 5-6 hrs before time of tweeting. public dataset generatetweetdataset() { string time = ""; int hrs = 0, mins = 0; int days = 0; twitterservice service = new twitterservice(consumerkey, consumersecret); service.authenticatewith(accesstoken, accesstokensecret); listtweetsonusertimelineoptions tweetoptions = new listtweetsonusertimelineoptions(); tweetoptions.count = 5; tweetoptions.screenname = _twitter.screenname; var tweets = service.listtweetsonusertimeline(tweetoptions); datatable tweetstable = new datatable(); tweetstable.columns.add("text"); tweetstable.columns.add("datetime"); tweetsta

java - Render multi value hash map with single key and multiple values in JSP -

i have following multihashmap in controller.java multihashmap multimap= new multihashmap(); list<samplelist> list1 = (list<samplelist>) request.getportletsession().getattribute("list1"); iterator<samplelist> samplelistiterator= list1.iterator(); while(samplelistiterator.hasnext()){ samplelist samplelist = samplelistiterator.next(); list <sublist> sublist = samplelist.getsublist(); iterator<sublist> sublistiterator = sublist.iterator(); while(sublistiterator.hasnext() ){ sublist sublist2 = sublistiterator.next(); multimap.put(sublist2.getcategorysubcategory(),sublist2.getcost()); } } in jsp have table displays above hashmap <table> <tbody> <c:foreach var="item" items="${multimap}"> <tr> <th> ${item.key}</th> <c:foreach var="valuelist" items=${item.

backup - How to protect folder containing a git history -

i'm using git keep track of writing projects , other personal work on own pc (running version of ubuntu). although work being version controlled, worried might 1 day lose whole folder (containing .git file , work itself) mishap or technical failure. what best way protect or work? (aside copying whole folder drive.) you can work using git itself. i might propose 3 ways that: periodically repository pen drive: plug flash drive pc; git init --bare repository on it; add named remote in main repository: git remote add --mirror=push pendrive /media/that_drive_id that --mirror=push command-line option ensure simple call git push pendrive suffice push everything pushable. back repository there using like git push pendrive unmount drive. the next time up, plug drive do git push pendrive another option use git-bundle command might used export whole repository (with history) single file can copied off external storage. this approach looks super

soap - Mule ESB choice flow control route -

in mule have following flow : there choice flow control test input , verify if input string equals 'ctr1'. <flow name="mediationflow1" doc:name="mediationflow1"> <file:inbound-endpoint path="c:\mulestudio\sandbox\input" pollingfrequency="3000" responsetimeout="10000" doc:name="file"/> <file:file-to-string-transformer doc:name="file string"/> <choice doc:name="choice"> <when expression="payload=='ctr1'"> <cxf:jaxws-client operation="find" serviceclass="services.port.portws" port="portwsport" enablemulesoapheaders="true" doc:name="port"/> <http:outbound-endpoint exchange-pattern="request-response" method="post" address="http://localhost:8080/actors/portws" doc:name="portws"/>

postgresql - how to circumvent missing record type on insert -

i'd make copy of row in 1 table addressed field in table, this: create or replace function f_ins_up_vorb() returns trigger $$ declare dienst dienst%rowtype; account record; begin -- ... execute format('select * %s id=$1',dienst.tabelle) using new.id account; execute 'insert ' || dienst.tabelle || 'shadow select ($1).*, now(), $2' using account, jobid; return new; end $$ language plpgsql; but yields: error: record type has not been registered context: sql statement "insert accountadshadow select ($1).*, now(), $2" pl/pgsql function f_ins_up_vorb() line 30 @ execute statement the tables addressed dienst.tabelle have no common type target table ( dienst.tabelle || 'shadow') superset of source table. should work (and does work in trigger function, use new , seems have record type). is there way around this? try like: create or replace function f_ins_up_vorb() returns trigger $$

sql server - How can I substitute IDs in a string with corresponding values from a table? -

i've got 2 tables in sql server 2008 r2 database - rules , items a rules record has id , expression, eg: 1, "(1 , 2)" an items record has id , name, eg: 1, "foo" 2, "bar" is there way select rule expressions , substitute items ids names in single query? select magic(expression) rules id = 1 will give me "(foo , bar)" i'm thinking of doing .net console app, can leverage regex, if there's way in sql, isn't messy, i'd rather go route. there's thing called clr stored procedure. msdn clr stored procedure so use regex .net. it's not fast though. simple rule string functions in sql, more complex ones cause serious pain. think i'd tempted outside of sql myself, if there's lot of it.

c++ - Trouble defining multi_index_container ordered_non_unique -

i'm playing around boost containers, came blockade can't seem define multi_index_container correctly. i'm following example grabbed offline still gives me , error message: struct boost::multi_index::global_fun<const node&, int, <error-constant>> error: expression must have constant value here declaration: #define _crt_secure_no_deprecate #define _scl_secure_no_deprecate #include <boost/config.hpp> #include <string> #include <iostream> #include <boost/multi_index_container.hpp> #include <boost/multi_index/key_extractors.hpp> #include <boost/multi_index/hashed_index.hpp> #include <boost/multi_index/global_fun.hpp> #include <boost/multi_index/ordered_index.hpp> using namespace boost::multi_index; struct node { node(std::string da, int in) { data = da; numerical = in; }; std::string data; int numerical; }; int main() { typedef multi_index_container< node

Is it possible to have a std::list as a member of a structure in C++? -

i'll describe question using example. have structure triangle: struct triangle { int perimeter; double area; list <mystruct> sides; }; where mystruct is: struct mystruct { int length; } is possible? there problems may appear? yes, it's possible. in fact it's composition . can use this: mystruct s; s.length = 10; triangle t; t.sides.push_back(s); object composition way combine simple objects or data types more complex ones.

css - CSS3 Transitions - Adding 2 different transitions to the same element -

i having issues css3 transitions: div.one_fifth{ border: 1px solid #48484a; transition : border 400ms ease-out; -webkit-transition : border 400ms ease-out; -moz-transition : border 400ms ease-out; -o-transition : border 400ms ease-out; font-size: 18px; transition : font 300ms ease-out; -webkit-transition : font 300ms ease-out; -moz-transition : font 300ms ease-out; -o-transition : font 300ms ease-out; } div.one_fifth:hover{ border: 1px solid #ed2124; font-size: 20px; } now problem when define both transitions, border 1 not work...so seems 2 transitions interfere , font 1 overrides border one...how intergrate them, if so, how different speeds(ms)? you can specify 2 or more comma-separated transitions, using single transition property: jsfiddle demo div.one_fifth { border: 1px solid #48484a; font-size: 18px; -webkit-transition : border 400ms ease-out, font 300ms ease-out; -moz-transition : border 400ms e

c# - How to get checkboxlist item value -

this how adding values , text checkboxlist in c# private void populatefruitlist() { string selectcommand = "select fruitname, fruitid fruit_crate"; using (sqldatasource ds = new sqldatasource(connectionstring(), selectcommand)) { checkboxlist1.datasource = ds; checkboxlist1.datatextfield = "fruitname"; checkboxlist1.datavaluefield = "fruitid"; checkboxlist1.databind(); } } this how trying value intellisence not helping, foreach (checkbox cb in checkboxlist1.items) { if(cb.checked) mylist.add(cb.value); // says wrong syntax can direct me right syntax please? simple. checkboxlist not contain checkbox items (or shouldn't), it's collection of listitems . should this: - foreach (listitem cb in checkboxlist1.items) { if(cb.selected) { mylist.add(cb.value); } }

javascript - Justify stack labels -

i having problems stack labels. have them rotated -90 degrees , have set align left , vertical align bottom. reason label aligned bottom of each column not expected do. center of text label align bottom, not first letter of label. there way accomplish want without manually calculating y offset each individual stack label? , if not, how best tiresome calculation? see attached fiddle: $(function () { $('#container').highcharts({ chart: { type: 'column' }, title: { text: '' }, xaxis: { categories: [""] }, yaxis: [{ title: { text: '', style: { color: '#4572a7'} }, labels: { formatter: function () { return highcharts.numberformat(this.value, 0) + " usd" }, style: { color: '#4572a7' } }, stacklabels: { enabled: true, style: { fontsize: '1.5em', fontweight: 'bold'

java - how to send same payload to multiple component in mule? -

i have problem 1 mule component transform payload object other value. ex: suppose payload contain student object. initial value of student name=a; my first mule component change student name x; student s=new student(); s.setname("x"); my second mule component receive name x payload. want original value 'a' . tried checking original payload of mule value changed.. <flow ..... <component> </component> // 1st component <component></component> //2nd component </flow> i want same payload(original) (student object name a) in both component..how can that? have checked original payload , has been transformed.. thanks you can use <all> send same payload different components <flow ..... <all> <component> </component> // 1st component <component></component> //2nd component </all> </flow> or, different way approach same thing store origin

.net - long running sql procedure hangs website -

i have mvc 4 web application calls business layer calls data layer method executesp asynchronously. data layer method executesp calls long running stored procedure this: public class maindatalayer { private database database; //enterprise library 5 private dbcommand dbc; private list<spparams> spparams; public maindatalayer() { _database = databasefactory.createdatabase("strconn"); //set multiple sp params 1 below _spparams.add(new spparams() { paramname = "@pid", paramvalue = id }); } public dataset executesp() { dbc = database.getstoredproccommand('long_running_sp'); dbc.commandtimeout = 300; foreach (spparams p in spparams) { dbc.parameters.add(new sqlparameter(p.paramname, p.paramvalue)); } dataset ds = _database.executedataset(dbc); return ds; } } //this class used in class above setting sp parameters publ

actionscript 3 - Flex - change in Timezone only picked up on Minutes Change. Why? -

i have timer running, every second, checks systems date/time, , updates date displayed on application. if change system time, app updates next second. if change system timezone, app registers change when current minute changes. i have little sample app shows problem occuring (if wish see yourself) where call localdate:date = new date() , localdate.timezoneoffset not reflect current system timzone until current minute changes. if change system seconds, update on next timer tick <?xml version="1.0" encoding="utf-8"?> protected function windowedapplication1_creationcompletehandler(event:flexevent):void { mytimer = new timer(1000, 0); mytimer.addeventlistener(timerevent.timer, timerhandler, false, 0, true); mytimer.start(); } private function timerhandler( event:timerevent):void{ var localtime:date = new date(); offsetlabel.text = localtime.

makefile - Linking step doesn't get object files from correct location -

i've written makefile links in few ffmpeg libraries , compiles basic hello world piece of code. want object files , executable go ./bin folder. use vpath include ./bin directory when dealing .o files. when compile after make clean, first time, during link step, tries .o file current directory, instead of path specified in vpath. second time though, there isn't problem. i create bin directory folder in make file , may have it, however, don't see problem in compile step when generates .o files. here make file: ifeq (0, ${makelevel}) cur-dir := $(shell pwd) whoami := $(shell whoami ) host-type := $(shell arch ) endif cc=gcc cflags :=-c -wall -pthread -o $(bindir)/$@ ldflags :=-lpthread ffmpeg := ${cur-dir}/ffmpeg fflibs := -lavcodec -lavdevice -lavformat fflibpath := -l${ffmpeg}/libavcodec -l${ffmpeg}/libavdevice -l${ffmpeg}/libavformat sources := pthreadex.c objects := $(sources:.c=.o) bindir := ./bin executable := micgrabber incfile := -i${ffmpeg}/libavformat \

.NET WebBrowser poor JavaScript performance -

i using .net webbrowser control (2.0) viewing web sites on internet in application – works fine! unfortunately discovered huge drawback on that: speed. far have found out, control performs consistently very poorly javascript (6000ms+ in sunspider vs. 150ms in ie10). verified using “retro” mode of maxthon browser, minimum working example (i.e. simple form containing browser , no other logic), , visual studio’s built-in browsers – perform equally bad. of them use ie10 version of control (turned on via registry), in theory similar performance can expected, or thought. looking spy++ @ differences between ie10 , programs using hosted control, additional wrapper shell docobject view can found: shellembedding. http://imgur.com/csuddau shows wrapper in lower part in desktopgap's hosted webbrowser control, while ie's browser window can seen without shellembedding in upper part. this, believe, responsible poor performance – neither know way around nor there sources - leads m

In a script, how to known if Matlab is running in Interactive (trough emacs) or in Batch? -

in matlab script discriminate case script run in interactive trough emacs matlab mode or in batch. by running in batch mean running explained on matlab website here http://www.mathworks.com/support/solutions/en/data/1-15hng . for example trough variable doing think this: if (script_running_in_batch==1) do_this; end is there way doing this? i use following: function retval = iscommandwindowopen() jdesktop = com.mathworks.mde.desk.mldesktop.getinstance; retval = ~isempty(jdesktop.getclient('command window')); end as mentioned earlier, copy here

java - Applets, HTTPS and Windows Domain -

i'm experiencing trouble applet authentication on https. seems when try log in using windows authentication account, domain \ username , applet remove domain , authentication fails. ldap configured because iis autentication works. is normal? there check can do?

javascript - generate random NOT in array -

this question has answer here: select random value not in array 7 answers i trying generate random number not exist in restricted number array. js var restricted = [3, 4, 7]; function getrand () { rand = math.floor(math.random() * 10); if ($.inarray(rand, restricted) === -1) { return rand; } else { try again } } rand = getrand (); if problem how implement "try again" part, call getrand recursively: var restricted = [3, 4, 7]; function getrand() { var rand = math.floor(math.random() * 10); if ($.inarray(rand, restricted) === -1) { return rand; } else { return getrand(); } } var rand = getrand(); also, if you're using jquery $.inarray method, suggest using array.prototype.indexof instead (for incompatible browsers, shim available here ).

r - order the ggplot x-axis using a list -

Image
i have dataframe plot barchart categorical x-values in specific order specify list. show example using mtcars dataset. #get small version of mtcars dataset , add named column mtcars2 <- mtcars mtcars2[["car"]] <- rownames(mtcars2) mtcars2 <- mtcars[0:5,] # plot using following p = ggplot(mtcars2, aes(x=car, y=mpg))+ geom_bar(stat="identity") the values of x-axis sorted in alphabetical order. if have list of cars , ggplot preserve order: #list out of alphabetical order orderlist = c("hornet 4 drive", "mazda rx4 wag", "mazda rx4", "datsun 710", "hornet sportabout") # plot bar graph above preserve plot order # this: p = ggplot(mtcars2, aes(x= reorder( car, orderlist), y=mpg))+ geom_bar(stat="identity") any pointers appreciated, zach cp set levels on car factor order want them, e.g.: mtcars2 <- transform(mtcars2, car = factor(car, levels = orderlist)) then

delphi - TDirectionsResult from a Memo -

with code below trying reload directionsresult tgmdirections. procedure form2.button2click(sender: tobject); var dr: tdirectionsresult; i: integer; begin dr:= tdirectionsresult.create(form1.fdirection, 0); dr.xmldata.beginupdate; i:= 0 memo1.lines.count - 1 begin dr.xmldata.append(memo1.lines[i]); end; dr.xmldata.endupdate; showmessage(form1.fdirection.directionsresult[0].routes[0].leg[0].endaddress); end; all seems until showmessage list out of bounds message. take dr has not been created or memo has not loaded directionsresult. further adaption has confirmed directionsresult[0] not exist. help correction appreciated. you can't add tdirectionsresult directionsresult array programatically, need invoke execute method tgmdirections object. however can this procedure tform1.button1click(sender: tobject); var dr: tdirectionsresult; begin dr:= tdirectionsresult.create(gmdirection1, 1); dr.xmldata.text := memo1.lines.text; showmessag

.net - DeployLX show Machine ID -

Image
i have series of projects, .net winforms, use deploylx licensing. product relies on machineid generate key. flow is: -the user installs product -the user calls machineid -we generate key using machineid -the user enters , validates the problem deploylx doesn't show machine id on screens. developed custom screen shows totally out of workflow. there other option available show customer machineid can it? when select activate code option, deploylx show machine code automatically. if you'd show machine code in other location in - box, can reference deploylx.licensing.v5.machineprofile.profile.hash property.

php - Counting similarity of arrays inside array -

i have problem pretty unsure how solve this. given arrays in such format: $array01 = array( 0 => array("hallo", "welt", "du", "ich"), 1 => array("mag", "dich"), 2 => array("nicht", "haha", "huhu") ); $array02 = array( 0 => array("haha", "welt", "dich"), 1 => array("hallo", "mag", "nicht"), 2 => array("du", "ich", "huhu") ); now want calculate kind of similarity value of these arrays. these arrays result of clustering terms according meaning. what want know how similar these terms clustered 2 different users ($array01 = user1, $array02 = user2) . 0,1,2 clusters (they don't have same length) edit: try describe little bit further: every array result of user clustering terms (hallo, welt, du, ich...) according meaning. every sub-array 1 cluster defined

Django South schemamigration error AttributeError: 'Options' object has no attribute 'index_together' -

i working on django web app south db migration. quite new south, , django well. tried using south official tutorials, failed exception: attributeerror: 'options' object has no attribute 'index_together' . run south command this: python manage.py schemamigration southtut --initial the southtut models this: class knight(models.model): name = models.charfield(max_length=100) of_the_round_table = models.booleanfield() my project models this: class author(models.model): name = models.charfield(max_length=64) authorid = models.charfield(max_length=32) def __unicode__(self): return self.name class meta: db_table="author" class video(models.model): videoid = models.charfield(max_length=32) videourl = models.urlfield(max_length=200) author = models.foreignkey(author, null=true, related_name="videos", on_delete=models.set_null) class meta: db_table="video" class

jquery - animate toggle and background -

i try to: - click animate div logo - click again div logo , should go initial position - click background , should go initial position (if not already) i set var check position of div, not work , not know if right direction. here play: http://jsfiddle.net/xnmz3/ html: <div id="logo"></div> <div id="background"></div> css: body{margin:0;} #logo { position:fixed; bottom:-40px;left: 5%; width:70px; height:80px; background:blue; cursor:pointer; z-index:1; } #background { position: absolute; width: 100%; height: 100%; background:yellow; z-index:0; } jquery: $(function(){ var hidden = $("#logo").css("bottom","-40" + "px"); $("#logo").click(function(event) { event.stoppropagation(); if (hidden) { $("#logo").animate({bottom: "0"}, 500); } else { $("#logo").stop.animat

forms - div call to javascript stops working after styling table -

i have javascript uses div call php file. has been working ok. working on appearance of webpage adding styles table , seems have broken div. here javascript <script type="text/javascript"> function getnextcheck(str) { if (str=="") { document.getelementbyid("checkno").innerhtml=""; return; } if (window.xmlhttprequest) {// code ie7+, firefox, chrome, opera, safari xmlhttp=new xmlhttprequest(); } else {// code ie6, ie5 xmlhttp=new activexobject("microsoft.xmlhttp"); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readystate==4 && xmlhttp.status==200) { document.getelementbyid("checkno").innerhtml=xmlhttp.responsetext; } } xmlhttp.open("get","getnextcheck.php?id="+str,true); xmlhttp.send(); } window.onload = function() { document.getelementsbyname('id')[0].onchange(); } </script> here website html. <form id="paybills&quo

java - Alloy UI time format 24 hours Liferay 6 -

hi there how show allow ui date picker time field using 24 hours format? i'f i'm using [code] <% calendar dob = calendarfactoryutil.getcalendar(); dob.settime(new date()); %> <aui:input name="schedule_msg" model="<%= message_schedule.class %>" bean="<%= msch %>" value="<%= %>" label="schedule time"/> [/code] it shows in am/pm mode...or if using am/pm mode how value??normally if want value in portlet class [code] int day = paramutil.getinteger(request, "schedule_msgday"); int month = paramutil.getinteger(request, "schedule_msgmonth"); int year = paramutil.getinteger(request, "schedule_msgyear"); int hour = paramutil.getinteger(request, "schedule_msghour"); int min = paramutil.getinteger(request, "schedule_msgminute"); try { msgsch

java - Sizing srollpane on textarea & textfield -

i writing code, have 1 textfield & 1 textarea seperate scrollpane each. now need want set size of scrollpane such should automatically move cursor next line, whenever user reaches end of first row of textarea or textfield. please tell me if can me out. below code set scrollpane textarea & textfield: jscrollpane talkpane = new jscrollpane(talkarea,jscrollpane.vertical_scrollbar_always, jscrollpane.horizontal_scrollbar_never); talkpane.setviewportview(talkarea); jscrollpane inputpane = new jscrollpane(inputfield, jscrollpane.vertical_scrollbar_always, jscrollpane.horizontal_scrollbar_never); a text field displays single line of text makes no sense text field. don't add text field scrollpane. user uses caret scroll forwards/backwards see more text. for jtextarea can turn wrapping on. text automatically wrap next line along caret type. textarea.setlinewrap(true); now need want set size of scrollpane

php - Soundcloud 500x500 artwork by default -

if($song->artwork_url != null) { $song_artwork = $song->artwork_url; } else { $song_artwork = 'img/no_art.png'; } by default soundcloud pulls -large (which 100x100) how make pull (t500x500) can have higher res image? just replace large.jpg t500x500.jpg in filename, so: $song_artwork = str_replace('large.jpg', 't500x500.jpg', $song->artwork_url); in fact, support number of different formats different requests: t500x500: 500px×500px crop: 400px×400px t300x300: 300px×300px large: 100px×100px (default) t67x67: 67px×67px (only on artworks) badge: 47px×47px small: 32px×32px tiny: 20px×20px (on artworks) tiny: 18px×18px (on avatars) mini: 16px×16px original: uploaded image i found documentation in soundcloud api reference , search artwork_url .

Using Informix dbaccess in SSIS to export data to be imported into SQL Server -

i have ssis package similar 1 detailed here loops on list of tables in ibm db2 database, exports table contents text files using "data transfer iseries server" each table , imports them sql server using bulk insert task. we moving new informix 11.50 fc7w3 database , use ssis package of similar nature export tables sql server. i believe need execute dbaccess appropriate .sql files containing unload statement. firstly, going possible execute dbaccess via ssis argument of .sql file containing unload statement. secondly, arguments or command line prompt need execute. i trying test on server has ibm informix client installed , dbaccess tool though when run tool receive following error: error: not initialize security subsystem. please ensure account has necessary privileges , ensure informixserver value exists in registry , environment. any suggestions on how can rectify issue above? have little no knowledge of administering informix database/server

nhibernate - Changing HQL to Linq? -

i have situation using named hql query, dal has changed, don't know how re-do named query in linq. have entity called holtertest, read in. need create workitem contain holtertest, in order that, need find of existing holtertests don't yet have workitem associated them. here original hql named query: <query name="get.holtertests.without.workitems" > <![cdata[ holtertest ht not exists (from workitem wi wi.holtertest.id = ht.id) , ht.recordingstartdatetime == null]]> </query> here nhibernate mapping workitem entity: <class name="workitem" table="workitems" where="" dynamic-update="true" dynamic-insert="true" > <id name="id" column="workitemid" type="int32" > <generator class="identity"/> </id> <property name="status" type="ansistring" /> <property name="iscomp

c++ - Conditional-Operator in Constant Expression -

i tried following code snippet msvc 10, works fine. enum { foo = (sizeof(void*) == 8 ? 10 : 20) }; int main() { return foo; } what know is: c++ standard (preferably c++98) allow me use conditional-operator in constant expression when operands constant expressions, or microsoft quirk/extension? this valid , sensible standard c++. the ternary conditional operator forms expression , , expression constant expression if operands are. the standard reference c++11 5.19/2: a conditional-expression core constant expression [...] note 5.16, ternary conditional expressions 1 type of conditional-expressions . other types things 2 == 3 .

mongodb - Error while setting up compound index -

i want setup compound index on fb_id , ts in mongodb. so, did: primary> db.sessions.ensureindex( { fb_id: 1, ts: 1 }, { unique:true } ); but got following error: e11000 duplicate key error index: tracking.sessions.$fb_id_1_ts_1 dup key: { : null, : null } so checked indexes in collection using db.sessions.getindexes() , got: [ { "v" : 1, "key" : { "_id" : 1 }, "ns" : "tracking.sessions", "name" : "_id_" } ] it doesn't duplicate key me. doing wrong here? mongodb tells you have several documents (more one) same fb_id , ts values, null values. in other words, there documents without fb_id , ts fields. so, violates unique constraint across collection. as workaround, should take @ sparse indexes. quote docs: sparse indexes contain entries documents have indexed field. document missing field not indexed. index “spa

Issues Implementing Android fling gesture -

i'm attempting implement fling gesture. have same function native android contact app, you'll swipe listview , it'll open dialer. i'm having issue getting 100% though. of listview loads should, after googling, , tutorials i've come , need help. simplegesturefilter public final static int swipe_up = 1; public final static int swipe_down = 2; public final static int swipe_left = 3; public final static int swipe_right = 4; public final static int mode_transparent = 0; public final static int mode_solid = 1; public final static int mode_dynamic = 2; private final static int action_fake = -13; //just unlikely number private int swipe_min_distance = 100; private int swipe_max_distance = 350; private int swipe_min_velocity = 100; private int mode = mode_dynamic; private boolean running = true; private boolean tapindicator = false; private activity context; private gesturedetector detector; private simplegesturelistener listen