Posts

Showing posts from February, 2014

AngularJS – append row after element in directive -

my question similar this one , instead of prepending row, want append. this doesn’t work: app.directive('createtable', function ($compile) { return { link: function (scope, element, attrs) { var contenttr = angular.element('<tr><td>test</td></tr>'); contenttr.parentnode.insertbefore(element, contenttr.nextsibling); $compile(contenttr)(scope); } } }); this job: app.directive('createtable', function ($compile) { return { link: function(scope, element, attrs) { if (element.next().length) { element.next().insertbefore(element); } var contenttr = angular.element('<tr><td>test</td></tr>'); contenttr.insertafter(element); $compile(contenttr)(scope); } } }); http://jsfiddle.net/3gt9j/3/

c# - Unable to create complex property of custom control -

i trying create on multi value complex propety of custom control written code not working, multi value read property coming in property explorer. here code it private mycomboproperties _mycomboproperties; public mycomboproperties mycombopropertiesvalues { { return _mycomboproperties; } set { _mycomboproperties = value; } } //mycomboproperties struct [system.runtime.interopservices.comvisible(true)] public struct mycomboproperties { private string _mysourcequery; private string _mydisplaymember; private string _myvaluemember; public mycomboproperties(string mysourcequery, string mydisplaymember, string myvaluemember) { _mysourcequery = mysourcequery; _mydisplaymember = mydisplaymember; _myvaluemember = myvaluemember; } public string mysourcequery { { return _mysourcequery; } set { _mysourcequery = value; } ...

printing - printf does not print complete string -

it displays "hello world". why? #include <stdio.h> int main(void) { printf("..... world\rhello\n"); return 0; } this because \r carriage return (cr). returns caret start of line. afterwards write hello there, overwriting dots. \n (line feed, lf) on other hand used to move caret 1 line downwards, why teletypewriters had sequence cr-lf, or carriage return followed line feed position caret @ start of next line. unix did away , lf on own. cr still exists old semantics, though.

objective c - iOS push notification alert message based on data in alert -

all, i sending push notifications data in string. example: { "aps": { "alert": "1,friendsname,3,4,pink, green", "sound": "default" } } or { "aps": { "alert": "2,drinks, adress", "sound": "default" } } now, want message in alert show text, based on values in string. (pseudo-code): if first character in "alert" = 1 => "alert = @"color %@ %@", friendsname, pink if first character in "alert" = 2 => `"alert = @"invite %@ @ %@", drinks, adress is possible @ all? , if so: how? no not possible in way want. ios handles push notification , app has no influence on way notification presented. ios present send in notification. however can use localization achieve want: "alert" : { "loc-key" : "alert_format", "loc-args" : [...

c# - Paste rows from one sheet to another with paste link option -

i able paste rows 1 worksheet using: sourcesheet.usedrange.copy(); destinationsheet.usedrange.pastespecial( excel.xlpastetype.xlpastevalues, excel.xlpastespecialoperation.xlpastespecialoperationnone, false, false); but want changes made cells in source sheet should reflected in destination sheet. (paste link option in excel) how in c#?

html5 - DOJO Full screen using HTML API -

i using html5 api view div tag(which displays dojo table). when place img tag, able toggle full screen when place dojo, full screen not toggled. 1 please help....

c# - How can i create sublist inside a xml -

i have xml dont know how can write this. because xml has got sub list inside. dont know how can write it? can me point ? <?xml version="1.0" encoding="iso-8859-9"?> <sales_invoices> <invoice dbop="ins" > <type>9</type> <transactions> <transaction> <type>4</type> </transaction> <transaction> <type>4</type> </transaction> </transactions> <payment_list> <payment> <date>01.01.2013</date> </payment> </payment_list> <affect_risk>0</affect_risk> <doc_date>19.03.2013</doc_date> <guid></guid> <eduration_type>0</eduration_type> <edtcurr_global_code>tl</edtcurr_global_code> </invoice> </sales_invoices> i write cod...

actionscript 3 - as3 get URL on click -

in as3 on click have 2 buttons , b, in movieclip when user click on button movie playing , want when if user click on button movie should play , when reach frame number 59 run geturl(abcd.html) , if user click button b reach fram 59 , geturl(xyz.html) both urls different create variable hold result of button clicked. like... int buttonclicked = -1; // assuming movie clip called 'movieplayermovieclip' movieplayermovieclip.stop(); then on buttons set value of said variable, like movieplayermovieclip.button1.addeventlistener(mouseevent.click, onbuttonclicked); movieplayermovieclip.button2.addeventlistener(mouseevent.click, onbuttonclicked); function onbuttonclicked(event:mouseevent):void { if(event.target == movieplayermovieclip.button1) { buttonclicked = 1; } else { buttonclicked = 2; } // let movie clip play movieplayermovieclip.play(); } the movie clip should have on enter frame handler, like… movieplayerm...

java - How can I "move" a tag on a file with Subeclipse? -

i have created tag subeclipse : team > branch/tag... i have changed file , want file part of tag have created. i have tried recreate same tag subeclipse refuses because tag exists. how can delete , recreate tag changed file ? or how can "move" tag on changed file ? (i have cvs background) i on command-line since branches/tags have special semantic in subclipse. a tag in svn "directory" in repository copy of files. remove tag , recreate ( svn remove ) or copy new file tag's location ( svn copy ).

python - Selenium webdriver send_keys() not working properly -

i using selenium web driver automate front end web ui actions in python script. in regard input value text filed (mandatory field), driver.find_element_by_xpath(<xpath>).send_keys(<value>) code used. though able see value has been typed in concerned text field, error message saying text box cannot empty being thrown on ui. browser : 23.0 (also tried old version 20.0, 16.0 reproduces same issue) python version : 2.7 here code: sel = webdriver.firefox() sel.find_element_by_xpath("//input[@name='minbid']")'.send_keys("2") sel.find_element_by_xpath("//div[text()='save']") upon running snippet, ui complaints saying min bid not supplied . please solve challenge. thank you. try clicking on field before input; sel.find_element_by_xpath("//input[@name='minbid']")'.click sel.find_element_by_xpath("//input[@name='minbid']")'.send_keys("2")

ubuntu svn post commit hook does not work, but works on manual running -

/usr/bin/svn update /var/project2_test/debug --username xxxx--password xxxx /bin/echo $rev >> /var/project2_test/svn.log the log has been updated while committing. working copy never update. , run /home/admin/svn/project/hooks/post-commit hand. works! post-commit hook (any hook really) running in empty environment running under user credentials, on running hand (user of svn-server used) anyway, have debug hook's script under real conditions (as hook). in orderto it, have intercept output of update command (by redirecting stdout stderr) show output user, perform commit, i.e, because stderr marshalled user in case of error in hook, have exit hook non-zero exit-code hook in debug-stage like /usr/bin/svn update /var/project2_test/debug --username xxxx --password xxxx > &2 /bin/echo $rev >> /var/project2_test/svn.log exit 1

sql - Convert Datetime format to varchar format style workaround -

i have datetime column need display in following format: yyyy/mm/dd 00:00:00:000 with convert , can't find suitable styles. the / in format important needs compared varchar column has text yyyy/mm/dd 00:00 part of description below: if can find way/style can use substring function compare value below: diary item added : 2013/08/20 14:12 i have had at: http://databases.aspfaq.com/database/what-are-the-valid-styles-for-converting-datetime-to-string.html but, can't find sufficient styles has / 's. -'s. you can use style closely resembles want compare on , use replace replace - \ . select replace(convert(<yourstyle>),'-','/'); edit cudo's @bluefeet select replace(convert(varchar(23), yourdate, 121),'-','/'); from technet : cast , convert 21 or 121 (2) odbc canonical (with milliseconds) yyyy-mm-dd hh:mi:ss.mmm(24h)

List of brightcove BEML iconName -

loking list of defined iconname. any idea can find list of predefined names iconname, used in button tag in beml. thnx mark you might find looking here or here

google maps - geoserver openlayer and googlemap offset -

in application using googlemap baselayer , geoserver wms server adding several layers googlemap, @ first load there offset between layers , googlemap, disappears if switch-on , off developing tool in browser, firebug on firefox , development tools in chrome, activated sphericalmercator on baselayer, still there offset, code visible @ pastebin.com/rn9xqbke, need more experienced point me on right direction google maps shown in projection srid epsg:900913. need make sure other layers being added application using same projection or being converted on fly.

What change of JLS 6/7 causes the following unchecked code with collections and generics to work in Java 7? -

the following code import java.util.*; import java.io.*; @suppresswarnings("unchecked") list<serializable> list = (list<serializable>) (list<?>) collections.singletonlist(new object()); (object el : list) { // -> classcastexception system.out.println(el); } is correct java (even though code suspicious). using javac , java 6 throws exception in thread "main" java.lang.classcastexception: java.lang.object cannot cast java.io.serializable while runs without error when using javac , java 7. is language change, fixed bug or hidden feature? (note: code compiled eclipse runs without error on eclipse versions checked - helios kepler.) you're polluting heap adding raw object collection (which you're having cast dance make happen). it's not technically illegal, bug. when pulling value out of implicit iterator, java 6 compiler appears casting immediately, while java 7 compiler isn't. it's more effic...

javascript - Programatically sending data to iframe -

i adding in backup jquery function replace formdata support of i.e 9 , below. have come across post: jquery iframe file upload i can see uploading files need have quite alot of fields in form. there way programatically text fields in form without using formdata. i have had @ using input fields no textarea fields , include images. $("form").each(function(){ $(this).filter(':input') //<-- should return input elements in specific form. }); or there better way this? don't want touch formdata works fine other browsers have included code if(document.formdata === "undefined") to detect , use function instead. 1 have sugestions? edit: just tried following: $(".inputfield").each(function(index,element){ form.attr("input:text",$(element).val()); }); but doesn't update iframe edit: this full code using upload form (hopefully) if(window.formdata === undefined){ // create iframe ...

javascript - jQuery - trigger a custom event on a link -

i trying run custom 'getoffer()' event using jquery <a href="javascript: void getoffer();" title="submit offer"><img src="images/img.jpeg"></a> i have tried following doesn't seem work (i using firefox firebug console.log window) $('a[title="submit offer"]').trigger('getoffer'); this page trying on: http://bit.ly/1dpimfk can suggest ideas? <a href="javascript: void getoffer();" title="submit offer"><img src="images/img.jpeg"></a> $(document).ready(function(){ $('a[title="submit offer"]').trigger('getoffer'); }); function getoffer(){ alert('link clicked'); } seems working fine me.i think didnt wrapped event trigger in document ready. demo

mongodb - Pass an array as parameter in ruby -

i'm trying diffusion (where send email lot of users). in model (with mongodb) key :email, array in controller: @users = params[:user] @emails = array.new @users.each |user| @emails << user.find_by_username(user).email end so in link pass argument array: <%= link_to "create diffusion", mailer_path(:user => user.all)%> in form: <%= f.input :email, :as => :hidden, :input_html => { :value => @emails } %> the problem in mailer: @message.email.each |email| mail(:to => email, :subject => @message.subject) end the problem @message not array, string. loop once-loop. i've tried @message.email.split(",") doesn't work. think great if @message array (how should be) someone can me? in advance well, if you're naming somehow reflecting objects dealing with, maybe should try: @emails.each |mail| mail(:to => mail, :subject => @message.subject, ...) end and why not: user.all.each...

ruby on rails - What exactly is the difference between has_many, has_and_belongs_to_many and embeds_many in mongoid? -

i understand not programming problem, unable find clear , descriptive solution. mongoid's documentation quite clear: embedded relations describe documents stored inside other documents in database. referenced relations describe documents reference documents in collection storing foreign key data (usually id) other document in itself. in detail: referenced 1-n / has_many when defining relation of nature, each document stored in respective collection, child document contains "foreign key" reference parent. # parent band document. { "_id" : objectid("4d3ed089fb60ab534684b7e9") } # child member document. { "_id" : objectid("4d3ed089fb60ab534684b7f1"), "band_id" : objectid("4d3ed089fb60ab534684b7e9") } referenced n-n / has_and_belongs_to_many when defining relation of nature, each document stored in respective collection, , each document contains "foreign key" ref...

HTTPS redirects to totally different website? -

i doing minor changes on friends website. noticed weird: when address is: https://websitename.com , leads visitor totally different website (and in address line still https://websitename.com address, notification bad ssl sertificate), selling shoes or something. http still ok. site checked viruses, computers also, twice, , nothing found. possbly cause this? website hosted on hostgator. edit: have mention have address of "wrong" website. when go it, shows empty page, , there nothing on domain. https://mywebsite.com pointing website cached somewhere. edit2: also, there problem google, indexed https version of website, , found links on "wrong" website, , indexed them too. now, can google https://mywebsite.com/something/shoe , , page not exists on http (giving 404). i think hosting issue. had similar problem subdomains, when on 1 of subdomains different site appeared. its due on 1 server (ip) there more 1 domain (shared hosting) , might not co...

java - Jersey 2.*. Custom InjectionResolver and "A HTTP GET method ... should not consume any entity" -

i have followed michal's guide answer question [ 1 ] on implementing custom annotation injecting arbitrary things resource methods. (gist) [ 2 ] contains minimalistic testbed adapted jersey-quickstart-grizzly2 archetype. refer in following text. i encountered few problems: my resolver parametrized type (or @ least make things more cleaner, in opinion) , can not bind in binder way michal suggests. // instead of suggested: // bind(myinjectionresolver.class).to(new typeliteral<injectionresolver<myannotation>>() {}).in(singleton.class); // do: bind(myinjectionresolverobject).to(new typeliteral<injectionresolver<myannotation>>() {}); when use myannotation in resource method, following warning on server start-up (but server still starts): warning: following warnings have been detected: warning: http method, public java.lang.string com.example.myresource.get02(java.lang.integer,java.lang.string), should not consume entity. when request resource ( ...

Initialize Octave process inside C++ program and write commands to the standered input -

i'm working on c++ project , need initialize octave process inside program , write octave commands octave standard input , results octave standard output , standard error. i searched , found octave forge engine package job. couldn't find how use package. want execute simple command such 5+5 , answer. is there way of doing using octave engine package or using other way. first created qprocess using qt. qstringlist arguments; arguments << "--persist"; //set arguments of octave process. --persist:go interactive after octave.setprocesschannelmode(qprocess::mergedchannels); //set process channel octave.start("/usr/bin/octave", arguments);//if octave has installed other directory should changed. after able write standered input of octave process. if(octave.state()==qprocess::starting){ octave.waitforstarted(); //todo:should set timeout , if timeout happens set error report. processwrite(command); ...

android - Conditionally formating a ListView. Function only works from OnListItemClick(), but not from OnCreate()? -

so have nice little list cursoradapter. after creation, i'm trying color rows depending on kind of values hold. function below. problem: if call function "list.setonitemclicklistener()...", runs perfectly. if call oncreate(), nullpointerexeption on "textview tv = (textview) childview.findviewbyid(r.id.row_eszkoz_leltarozott_allapot);" row. what causes this? public void conditionalcoloring() { (int position=0; position<adapter.getcount(); position++) { system.out.println("adapter child szám: " + adapter.getcount()); view childview = list.getchildat(position); //view childview = adapter.getview(position, null , list); textview tv = (textview) childview.findviewbyid(r.id.row_eszkoz_leltarozott_allapot); ///error here relativelayout rl = (relativelayout) childview.findviewbyid(r.id.row_eszkoz_container); string s = (string) tv.gettext(); system.out.println("szöveg: ...

map - d3js: Use view port center for zooming focal point -

we trying implement zoom buttons on top of map created in d3 - works on google maps. zoom event can dispatched programmatically using d3zoombehavior.scale(mynewscale); d3zoombehavior.event(mycontainer); and map zoom using current translation view. if using zoom buttons focal point (zoom center) no longer translation center of view port. zoom using scroll wheel have option of using zoom.center - apparently have no effect when dispatching own event. i'm confused how calculate next translation taking new scaling factor , view port center account. given know current scale, next scale, current translation , dimensions of map view port how calculate next translation, center of view port not change? i've found quite difficult in practice. approach i've taken here create mouse event triggers zoom when zoom buttons used. event created @ center of map. here's relevant code: .on("click", function() { var evt = document.createeve...

java - How can I mix Guice and Jersey injection? -

i've seen the following question on how inject @context dependencies jersey resource constructors. question different -- i'd inject @pathparam string. have class resembling following: @path("foo/{fooid}/bar") public class barresource { @inject public barresource(@pathparam("fooid") string foo, service service) { ... } ... } the service injected fine guice, path segment null. surprises me; if assumed guice loudly explode complaining unresolvable dependency. how can inject path parameter in manner? prefer avoid field injection purposes of keeping these resource classes unit-testable. it appears @pathparam not acceptable default constructor argument. new feature document states the arguments allowed in resource class constructor depends on resource provider used create instance of resource class [...]. default per-request resource classes can use combination of parameters annotated uriparam, uriparam, queryparam, matri...

jquery - i'm trying to insert after <div class="tbox"> and <div class="tarea"> only the latest <div class="properties"> but here every div it is inserted -

<fieldset id="tt"> <div class="cts"> <div class="tbox"> <input type="text" class="pp"/> </div> </div> <div class="cts"> <div class="tarea"> <input type="text"> </div> </div> <div class="cts"> <div class="tbox"> <input type="text" class="pp"/> </div> </div> <div class="cts"> <div class="tarea"> <input type="text"> </div> </div> </fieldset> $('.cts').find('div:first').each(function(i){ var attr = $(this).attr('class'); alert(attr) switch(attr) { case "tbox": $('<div class="fieldproperti...

How can I define an array inside a PHP class scope in PHP4 -

i need define constant array within scope of class, used statically (i.e. not creating instance of class). here sample code works in php5, not in php4: class mytest { static $arr = array(100, 200); function test() { print_r(mytest::$arr); } } mytest::test(); how can change code works in php4 (4.4.9-pl0-gentoo)? remarks: it has work in php4. i need access array preferrably in static manner, without creating instance. requirement dropped. i cannot use globals code has work within phpunit unit-testing. when doing so, array defined global in header of file not seen within unittest. i want define array (containing constant values) outside function being used. if no other possibility exists solve question, requirement dropped well. class mytest { public function getarray() { return array(100, 200); } } not pretty, can call mytest::getarray() without creating instance (or $this->getarray() inside class) retrieve data. ...

Visual GC in Java VisualVM via jstadt for remote Tomcat -

Image
i'm trying memory layout of remote tomcat visualized visual gc in java visualvm. on linux server hosts tomcat jstatd running (including tools.policy , proper [-j]-djava.rmi.server.hostname=[server_ip], found in jvm options of tomcat well). connection visualvm server/jstatd works properly: but can see in visual gc tab of jstatd connection memory details of jstatd jvm itself , not data of tomcat. edit: , in visual gc tab of tomcat connection (prod apl01 jmx) i'm being told: "not supported jvm" testing system run inhouse proper data here. the remote tomcat runs it's own user "tomcat". must jstatd started user well? or there issue might missing? any working alternative visual tool provides visualization similar 1 below absolutely acceptable. we're using yourkit well, couldn't find in there resembles visual gc easy understand style. having done more research , tests on our locale development environment realized haven'...

xml - Using [not] in xpath to retrieve content that does not match given values (PLSQL) -

i'm trying use following code filter out xml return tags not contain given status code: l_xml_return := (xmltype(l_xml_response).extract('//return[not(issuestatusid=84388)]| //return[not(issuestatusid=73630)]| //return[not(issuestatusid=67539)]| //return[not(issuestatusid=42527)]| //return[not(issuestatusid=22702)]| //return[not(issuestatusid=20643)]| //return[not(issuestatusid=4368)]| //return[not(issuestatusid=4363)]| //...

matlab - How to make a mask image? -

i'm using matlab's roipoly create mask. the problem have many points row , column arguments roipoly. when use fewer points, mean @ order of multiple tens, works correctly, give row , column arguments larger vectors, in order of hundreds, omits , give me mask made part of vectors! know how fix it? here code: function outputimage = fillselectedregion(inputimage,row,col) outputimage = inputimage; outputimage(:,:) = 0; outputimage = uint8(roipoly(outputimage,col,row)); if knows how fix or using method, please guide me. any appreciated.

java - Modification in one MultiValueMap affecting another -

i have 2 multivaluemap in class mapa , mapb . 2 maps equal. have iterate using mapa , did changes in mapb . affecting mapa . mapa changing. why happens. edit simple code multivaluemap mymap = new multivaluemap(); mymap.put("a", "1"); mymap.put("b", "2"); mymap.put("c", "3"); mymap.put("d", "4"); system.out.println("mymap => "+mymap); multivaluemap sec = mymap; if(mymap.containskey("a")) { sec.getcollection("a").clear(); sec.put("a", "11"); } system.out.println(mymap); // {d=[4], a=[11], b=[2], c=[3]} system.out.println(sec); // {d=[4], a=[11], b=[2], c=[3]} this -- -- happens because 2 maps contain references same objects. when modify object, automatically changes in both maps.

linux - How do you get monotonic clock in shell? -

i see no such option date /proc/uptime bootbased, not monotonic. and @ last found cat /proc/timer_list | grep now yields number of nsecs obtained via ktime_get returning monotonic time if understand correctly, that's quite cumbersome. update: returned value must same returned clock_gettime looks it's available in python 3.3: http://www.python.org/dev/peps/pep-0418/ failing that, write small c program calls clock_gettime : http://linux.die.net/man/3/clock_gettime

javascript - Accessing ConfigurationManager.AppSettings in Java script -

i had javascript code in aspx file page.aspx <asp:content id="content1" contentplaceholderid="head" runat="server"> ----some code---- added after suggestion satpal <script type="text/javascript"> var gaaccountid = '<%=configurationmanager.appsettings["gaaccountid"]%>'; </script> </asp:content> <asp:content id="content2" contentplaceholderid="maincontent" runat="server"> <%--<script type="text/javascript"> debugger; var _gaq = _gaq || []; _gaq.push(['_setaccount', '<%=configurationmanager.appsettings["gaaccountid"]%>']); _gaq.push(['_setdomainname', 'auto']); _gaq.push(['_setallowlinker', true]); _gaq.push(['_trackpageview', '/register']); _gaq.push(['_trackpageloadtime']); (function () { ...

c# - Create new Dictionary with javascript -

i trying figure out how c# "function" in javascript having no luck!? here c#: var parameters = new dictionary<string,string> { { "link", "http://mysite.com" }, { "name", "this test" } }; i want think have use "new array" not sure how this? any appreciated , in advance :-) here great explanation: javascript associative arrays demystified var parameters = new array(); parameters['link'] = 'http://mysite.com'; parameters['name'] = 'this test';

yii - Gii CRUD generator and related tables -

i using yii framework , have got problem crud generator. have got 2 tables called users , news following structures: create table if not exists `news` ( `id` int(11) not null auto_increment, `keyword` varchar(1000) collate utf8_persian_ci default null, `user_id` tinyint(3) unsigned not null, `title` varchar(100) collate utf8_persian_ci default null, `body` varchar(1000) collate utf8_persian_ci default null, `publishedat` date default null, `state` tinyint(1) unsigned default null, `archive` tinyint(1) unsigned default null, `last_modified` datetime default null, primary key (`id`), key `news_fkindex1` (`keyword`(255)), key `news_fkindex2` (`user_id`) ) engine=innodb default charset=utf8 collate=utf8_persian_ci auto_increment=3 ; create table if not exists `users` ( `id` int(11) not null auto_increment, `username` varchar(20) not null, `password` varchar(128) not null, `create_at` timestamp not null default current_timestamp, `lastvisit_at` t...

javascript - jQuery mobile 1.4 not enhancing content added with knockout.js -

i create list of elements knockout.js 'foreach', , want these enhanced jquery mobile buttons. <div data-role="content" class="content"> <div id="buttoncontainer" data-bind="foreach: buttons"> <div class="controllerbutton" data-role="button"> <span class="buttontext" data-bind="text: label"></span> </div> </div> </div> using jquery mobile 1.3.2, works fine. 1.4 alpha, jquery mobile doesn't elements. (i'm aware i'm asking alpha without documentation, features panels outside of pages make switch attractive @ point in time.) as of jquery mobile 1.4 data-role=button deprecated , removed on 1.5. replaced adding classes directly anchor . main class ui-btn convert element button. html <div data-role="content" class="content"> <...

P/Invoke from C to C# without knowing size of array -

right know in code have structure declared this, fixed 16, know @ compile time. struct console_screen_buffer_infoex { [marshalas(unmanagedtype.byvalarray, sizeconst = 16)] public int colortable[]; } but need able have structure: struct console_screen_buffer_infoex { int arraysize; [marshalas(unmanagedtype.byvalarray, sizeconst = 0)] public int colortable[]; } get arraysize c function response, initialize colortable array proper size, put result of response colortable. not sure if it's possible, doing investigation right now, , comments welcome. you can enough manual marshalling using marshal class. example: [dllimport(@"mylib.dll")] private static extern void foo(intptr structptr); private static intptr structptrfromcolortable(int[] colortable) { int size = sizeof(int) + colortable.length*sizeof(int); intptr structptr = marshal.allochglobal(size); marshal.writeint32(structptr, colortable.length); marshal.copy(colortable,...

c# - WPF ComboBox with image -

i'm trying populate combo images. defined as: <combobox selecteditem="{binding selectedlangcomboitem}" itemssource="{binding languages}"> <combobox.itemtemplate> <datatemplate> <stackpanel orientation="horizontal"> <image source="{binding image}" /> <textblock text="{binding label}" /> </stackpanel> </datatemplate> </combobox.itemtemplate> </combobox> where items languageitem classes: public class languageitem { public system.drawing.bitmap image { get; set; } public string label { get; set; } public string culture { get; set; } public languageitem(system.drawing.bitmap image, string label, string culture) { image = image; label = label; culture = culture; } } now, in viewmodel c'tor do: _languages = new observablecollection<languageitem...

HTTP Connection thread doesn't update result inside TimerTask - BlackBerry Java -

i'm doing http call ksoap within timertask can update data every 5 minutes. after getting data web service provide them interface via function procecssdata(). works out first time, although timer firing every time data stays same. in fact, ui being drawn every 5 minutes uses data first http call. have idea why might happen? seems me variables inside httpcall() function not being updated. public class connectionthread extends thread { soapobject request; soapobject result; soapserializationenvelope envelope; string[][] resultarray; int resultlength; public connectionthread(connectioncallback concallback) { callbackobj = concallback; refreshtask = new timertask() { public void run() { httpcall(); } }; new timer().schedule(refreshtask, 0, 50000); } public void httpcall() { request = new soapobject(servicenamespace, methodname); result = null; envelope = new soapserializationenvelope(soapenvelope.ver11); envelop...

vba - Get complement of filtered items with ADO recordset -

i have ado recordset containing table of products. have list of products used filter table - dynamically building filter (but longer) : rs.filter = "producttype = 'product a' " _ + "or producttype = 'product b' " _ + "or producttype = 'product c' " this worked fine me, copied filtered rows separate worksheet, fine. then new project requirements meant needed excluded items well. well, did boolean algebra, , ran same query opposite filter : rs2.filter = "producttype <> 'product a' " _ + "and producttype <> 'product b' " _ + "and producttype <> 'product c' " this worked fine. copy excluded items different worksheet, have both included , excluded items. but new requirement means have cope special case - product b included on specific dates. now, works fine positive filter, 1 find included items : rs.filter = "producttype = 'product a...

soapUI with Maven from IntelliJ -

i have soapui 4.5.2 project run using maven 3.0.5 through intellij 12. works great. of tests run , have pom file configured write log files want them. issue running this. soapui writing lot of data console , can't seem trim back. have tried own log4j settings: # print info root logger log4j.rootlogger=error, stdout log4j.logger.httpclient.wire.header=error log4j.logger.httpclient.wire.content=error log4j.logger.org.apache.commons.httpclient=error log4j.appender.stdout=org.apache.log4j.consoleappender log4j.appender.stdout.target=system.out log4j.appender.stdout.layout=org.apache.log4j.patternlayout # print date in iso 8601 format log4j.appender.stdout.layout.conversionpattern=%d [%t] %-5p %c - %m%n but soapui / maven still produces debug output console. example: 09:47:44,096 debug [soapuimultithreadedhttpconnectionmanager$soapuidefaultclientconnection] sending request: put /template/xyz/ http/1.1 09:47:44,722 debug [soapuimultithreadedhttpconnectionmanager$soapuidefaultc...

Not able to send/receive email from Jenkins using Email-ext plugin -

i using jenkins ver. 1.463 running on 32-bit windows server. have installed email-ext plugin version 2.30.2. i unable email notifications. what trying - send email after every job - irrespective of whether operation success, failure, abort, not-build, etc.. using jenkins run automated test suites. the way have configured test job "in post-build actions , have selected editable email notification", , filled in required fields(recipient list,etc). in advanced - selected triggers dropdown such "success, failure, aborted, regression, fixed, not-built, stable. i have verified smtp server, recipients, still unable email, in console output of job see following lines email triggered for: success sending email trigger: success. in jenkins server, in "jenkins.err.log", see following error message / exception being thrown, dont know exact cause aug 27, 2013 5:41:57 pm hudson.model.run run info: testjob-for-email #7 main build action ...

Checking Out a Branch in Git -

i've got git repository android app i'm trying overhaul , want keep current working version on hand. i've created branch new development, , checked out, when switching old branch files specific new development show up. my question this: when checkout different branch, git delete local files current branch , replace them new branch's local files? or git modify local files when checkout branch? i'm using windows if makes difference. you must add , commit new files in repository checked out branch in order have them not showing when switching branch. the reason git ignores files have not been added index, , quietly leaves them in place when swithcing branches not removed mistake.

ruby on rails - Setup so users can follow(bookmark) other users -

i have created 2 different sets of coding suppose allow user follow (bookmark) user. example user follows user b, c, & d. user goes favorites page , lists users they're following (b,c & d). 1 way follow. code created did not perform action of following user, decided follow railstutorial twitter following concept. getting "uninitialized constant relationshipscontroller". wrong routes. can take , perhaps point out wrong? on side note, feels lot of coding simple...even when doing myself without following tutorial. want users able bookmark users page url, have saved favorites page (essentially bookmark page) , give them option remove bookmark. think database wouldn't required this. routes: resources :sessions, only: [:new, :create, :destroy] resources :relationships, only: [:create, :destroy] resources :users 'settings', on: :member end user model: has_many :notifications has_many :users, dependent: :destr...

python - heroku django south does not appear to use migrations -

i'm having trouble django south migrations. may related how we've laid our project out working previously, , works fine locally. i pushed new code last night contained migration in my_app app. in local environment... $ ./manage.py migrate --list socialaccount (*) 0001_initial (*) 0002_genericmodels (*) 0003_auto__add_unique_socialaccount_uid_provider (*) 0004_add_sites (*) 0005_set_sites (*) 0006_auto__del_field_socialapp_site (*) 0007_auto__add_field_socialapp_client_id (*) 0008_client_id (*) 0009_auto__add_field_socialtoken_expires_at (*) 0010_auto__chg_field_socialtoken_token (*) 0011_auto__chg_field_socialtoken_token payments (*) 0001_initial users (*) 0001_initial my_app (*) 0001_initial (*) 0002_auto__add_organizerapplication in heroku, doesn't recognize my_app app migrations. when attempt migrate app.... $ heroku run my_app/manage.py migrate my_app --app=my_app running my_app/manage.py migrate my_app attached terminal... up, run.5016 app 'my_app...

php - Regex need to remove unwanted characters -

following recent question regarding regex html has been answered here (thank all), made decision stick regex last time. goal grab value updatexxxx following html code using curl: (...)<input type="hidden" id="_postupdate" name="_postupdate" value="updatexxxx" /><input type="hidden"(...) using $regex = '/name="_postupdate" value="([^"]*)" \/><input type="hidden"/s'; if ( preg_match($regex, $page, $list) ) echo $list[0]; i managed output: name="_postupdate" value="updatexxxx" /> i'm sure there simple way remove: name="_postupdate" value=" and " /> once again, advice , :) change echo $list[0]; echo $list[1]; you're outputting whole match, when want captured group ([^"]*) .

javascript - Trying to put png images through an php include... How is it possible? -

im working on dreamweaver php coded files, im using testing server located on computer... im trying add png images js 'swap' function, (an image when cursor on top changes). everytime put on include shows error message... did empty file put images swap js function , working in empty page. pictures swap .png , have links take different pages... work... when put include call pictures to, pictures not show. in main page want include put php include ("_includes/swaplinks.php") but put live show orange error message says include cant found... error says "the path not in server" not true cause checked , in server... correct... help? try using full paths: include( $_server['document_root'] . '/path/to/swaplinks.php' );

Force Update of RelativeSource Binding in WPF -

for application, have itemscontrol has distinct template (shorthanded template2) first item, , default template (template1) rest of items. have done following xaml: <datatemplate x:key="mydatatemplate"> <contentpresenter x:name="templatecontentpresenter" content="{binding relativesource={relativesource templatedparent}, path=content}" contenttemplate="{staticresource template1}"/> <datatemplate.triggers> <datatrigger binding="{binding relativesource={relativesource self}, converter= {staticresource isfirstitemincollectionconverter}}" value="true"> <setter targetname="templatecontentpresenter" property="contenttemplate" value="{staticresource template2}"/> </datatrigger> </datatemplate.triggers> </d...

cygwin - Command works in command line but gives 'no such file or directory' in bash script -

like tags say, in cygwin. i have command line program can run cygwin console: ./optalg.exe data/5node/1.dat 500 2>&1 > output/1.out i wrote following bash script put in loop #!/bin/bash inputfile in data/5node/*.dat outputfile=${inputfile##*/} #strip output name input name outputfile=${outputfile%.*} #strip output name input file outputfile+=".out" "./optalg.exe $inputfile 500 2>&1 > output/$outputfile" done when run bash script, every iteration of loop 'no such file or directory', e.g., ./batchopt.sh: line 8: ./optalg.exe data/5node/1.dat 500 2>&1 > output/1.out: no such file or directory what's happening here? i'm not sure i'm doing wrong. remove quotes around line 8. this: ./optalg.exe "$inputfile" 500 2>&1 > "output/$outputfile" by placing quotes around whole line tell bash execute command called ./optalg.exe $inputfile 500 2>&1 > ou...

Connecting to a SQL Server through another Sever connection that's not linked -

so tasked creating query uses data 2 separate databases on 2 separate servers. i've been told linking servers not option there sql command can used address server want connect to. can clue me in on command might be? ex: server 01 database_01 table01 server 02 database_02 table02 if had linked server this. select s2.*, s1.somefield [server 02].[database_02].[table02] s2 join [server 01].[database_01].[table01] s1 on s2.id = s1.id since don't have option, need find way reference server 02 if connected server 01. you'd need either openrowset or opendatasource found examples here : openrowset: select * openrowset('sqlncli', 'driver={sql server};server=myserver;uid=myuserid;pwd=mycleverpassword', 'select @@servername') opendatasource: select * opendatasource ('sqlncli', -- or sqlncli 'data source=otherserver\instancename;catalog=remotedb;user id=sqllogin;password=secret;').remotedb.dbo.some...

PHP SQL insert not working properly -

i'm having serious difficulty trying php sql insert work. i'm trying display user data echoes, "insert customer (cust_last, cust_first) values ('user','data') done. " obviously sql statement, copied directly w3schools' example php insert, i'm unsure why doesn't work. not supposed use "" or something? thanks help! <?php $db = odbc_connect('database1', '', ''); $sql="insert customer (cust_last, cust_first) values ('$_post[cust_last]','$_post[cust_first]')"; $rs=odbc_num_rows($conn); odbc_close($conn); echo "1 record added."; ?> the html form page is: <html> <body> <form action="insert.php" method="post"> last name: <input type="text" name="cust_last"> first name: <input type="text" name="cust_first"> <input type="submit"> </form> </bod...