Posts

Showing posts from June, 2010

How to use the variable of one method in another method in Java(android) -

i retrieving value of textview protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.calculation); textview heading = (textview) findviewbyid(r.id.paper_name); ...... } i have method in same class @override public void onclick(view v) { int black_and_white_multiuplier = 4200; int color_multiuplier = 6400; switch (v.getid()) { case r.id.btcalculate: int multiplier = rbcolor.ischecked() ? color_multiuplier : black_and_white_multiuplier; int column = integer.parseint((string) spcolumn.getselecteditem()); int inch = integer.parseint((string) spinch.getselecteditem()); tvamount.settext((multiplier * column * inch) + ""); break; } } i want set value of color_multiuplier , black_and_white_multiuplier based on value of heading have got oncreate method. possible? declare textview @ class level... textview heading; pro

c# - How to solve "RadAsyncUpload does not have permission to write files in the TemporaryFolder. ..." -

my webapp(asp.net webform c#) working when uploaded it, telerik's radgrid working radasyncupload giving me following error. radasyncupload not have permission write files in temporaryfolder. in medium trust scenarios, temporaryfolder should subfolder of application path. i found useapplicationpoolimpersonation , impersonate="true" in web.config will solve problem under tag should add it? way new iis7. if you're using windows authentication, want put inside <system.web> <identity impersonate="true" username="domain\username" password="mypassword" /> if you're using anonymous auth, don't need username or password. cheers

java - Mac JVM rendering JTabbedPane differences between 1.6 and above -

Image
this how jtabbedpane renders in java 1.6: when using java 1.7 (or 1.8 ea), see bottom of tabs getting clipped: i tried, without success (or effect) system properties -dcom.apple.macos.smalltabs=true , -dcom.apple.smalltabs=true . any solution or hack appreciated. running example , unable reproduce effect shown on mac os x 10.9.2 using java 7. suspect neglecting pack() enclosing window , might compare code 1 shown reference.

amazon ec2 - create a hybrid cloud between aws ec2 and my local openstack instance -

Image
i want create hybrid cloud demo purpose using public cloud aws ec2 instance , private cloud openstack instance present on local network. can give me idea begin. if successful, should able ping private ip address of ec2 instance openstack's instance? i have tried bit openvpn access server on openstack's instance , creating vpc , customer gateway in aws. right way it? tinc , work long have public ip address on 1 of vpc instances. keep in mind machines need connected same virtual tinc network. same way openvpn . require external public ip address. another way of doing creating customer gateway, virtual gateway , vpn connection in vpc configuration on amazon. can connect branch or office router vpn connection using ipsec. amazon recommends following router:

html - Css Triangle not rendering properly in IE -

i trying create css trianlge header navigation.i have achieved not rendering in ie. here working fiddle solution sample have created.i have fixed position when try run in ie(currently have ie 11.0) triangle rendered square box when try run in chrome , ff working fine. fiddler : http://jsfiddle.net/cknyq/20/ a:hover:after { background: white; border: solid black; border-width: 1px 1px 0 0; bottom: 0px; content: ' '; display: block; height: 10px; left: 32px; position: absolute; width: 10px; z-index: 99; -webkit-transform: rotate(-45deg); -webkit-transform-origin: 50% 50%; } use -ms-transform: rotate(-45deg)

jQuery Mobile: Submitted form not staying on "thank you" page -

i'm new jquery mobile, have started using wordpress site that's supposed used via smartphone. way looks added jqm equation. the problem have after submit form, correctly takes me "thank you" page, @ point single line of text reading "thank playing", after goes original form came from. might not able explain better, recorded video issue here: http://screencast.com/t/qmd0bprosg if disable ajax "$.mobile.ajaxenabled = false;" works, meaning doesn't go form, having ajax enabled , working way it's supposed to, rid of couple of other issues have. fixing behaviour save me lot of time! here's html: <form id="stop-spin" action="/thanks-for-playing" method="post"> <input type="hidden" id="stop-spin-nonce" name="stop-spin-nonce" value="c96ef6a79f"> <input type="hidden" name="_wp_http_referer" value="/spinner/">

mysql - mysqlslap access denied on windows8 -

i'm getting access deniedwhen trying run mysqlslap, , i'm suspecting has me running on windows 8.1 machine, can't confirm anywhere. the line i'm trying run mysqlslap.exe --query="myquery" --iterations=10 --user=root -p=password --host=127.0.0.1 --delimiter=";" --create-schema=mydb i've tried running -p without password prompted password, access denied before ever getting prompted password. i've tried , without --host, --delimiter , --password besides error on command prompt popup windows saying app cannot run on pc. searching mysqlslap , windows 8 didn't much. i confirmed password logging mysql via commandpropt user root , password passed argument mysqlslap try this: open cmd( here link showing how do). in cmd enter in mysql bin folder "c:\program files\mysql\mysql server 5.5\bin".(to open folder in cmd use comand "cd" or "cd.." folder, here link showing how todo do) so enter c

python - Django: Creating a form per user on one page -

sorry title isn't descriptive. context: have event full of participants. when event on want leave feedback of other participants. models.py class feedback(models.model): action = models.foreignkey(action) feedback_by = models.foreignkey(userprofile, related_name='feedback_by') feedback_for = models.foreignkey(userprofile, related_name='feedback_for') comment = models.charfield(max_length=200) no_show = models.booleanfield() created = models.datetimefield() modified = models.datetimefield() forms.py class feedbackformset(basemodelformset): def add_fields(self, form, index): super(feedbackformset, self).add_fields(form, index) form.fields['is_checked'] = forms.booleanfield(required=false) class feedbackform(forms.modelform): comment = forms.charfield(label=(u"comment"), widget=forms.textarea()) class meta: model = feedback fields = ['comment', 'no_show

algorithm - Calculate the index of a given number within a sorted set -

not sure if question should on math-overflow or here, try here first: suppose given number n 1s , m 0s. there (m+n)!/(m!*n!) different such numbers, can sorted in countable set. for example, sorted set of numbers 2 ones , 3 zeros, is: 0 00011 1 00101 2 00110 3 01001 4 01010 5 01100 6 10001 7 10010 8 10100 9 11000 how can efficiently calculate index of given number within corresponding set? note: input question only number, , not entire (corresponding) set. let choose (n, k) = n! / k! / (n-k)! . observe following structure of sorted set: 0 0|0011 1 0|0101 2 0|0110 3 0|1001 4 0|1010 5 0|1100 ------ 6 1|0001 7 1|0010 8 1|0100 9 1|1000 in sorted set, there choose (n + m, m) numbers (binary strings of length n + m ) in total. first go numbers starting zero, , there choose (n + m-1, m-1) of them. go numbers starting one, , there choose (n-1 + m, m) of them. each of these 2 sections sorted. so, if

c# - OutOfMemoryException when rendering TextBlock using WriteableBitmapEx -

i have fight outofmemoryexception again. i have code snippet render images using writeablebitmapex in windows phone background agent task (which have memory usage limit approach 10m). the following works fine: deployment.current.dispatcher.begininvoke(() => { var wbbg = bitmapfactory.new(0, 0); var bmp = bitmapfactory.new(0, 0); (int = 0; < 30; i++) { using (var iso = isolatedstoragefile.getuserstoreforapplication()) { wbbg = bitmapfactory.new(0, 0).fromcontent("assets/image" + + ".jpg"); wbbg.invalidate(); (int j = 0; j < 6; j++) { bmp = bitmapfactory.new(0, 0).fromcontent("assets/" + j + ".png"); bmp = bmp.resize(60, 60, writeablebitmapextensions.interpolation.bilinear); wbbg.blit(new rect(j * 65, 0, 60, 60), bmp, new rect(0, 0, 60, 60)); wbbg.invalidate(

Redirect response from C# Handler to PHP page with json data as POST -

i have c# handler calling @ regular interval using windows task. handler generates json object, need posted different php page. json object generation working fine. how can specify php page in c# handler code redirected? tried set path of php page context.response.redirectlocation . how can pass json data page via post. i'm able send json data context.response.write(json); , doesn't redirect required page, displayed json content in browser. can me? hope you http://www.codeproject.com/articles/20899/tips-to-make-asp-net-talk-to-asp-php-rails-and-jav how post data , redirect external page?

hadoop - FileNotFoundException dfs.include - Hortonworks for windows -

i tried install hortonworks 2.2.0.2.0.6.0-0009 windows on windows server 2012. seems clean during installation except when launching "start_local_hdp_services.cmd" start hadoop services. there, namenode , historyserver services fail start , generate folowing logs : for "hadoop-namenode-m1by1hadoop.log" : 2014-03-06 09:39:06,755 error org.apache.hadoop.hdfs.server.namenode.hostfilemanager: failed read include file 'c:\hdp\hadoop-2.2.0.2.0.6.0-0009/etc/hadoop/dfs.include'. continuing use previous include list. java.io.filenotfoundexception: c:\hdp\hadoop-2.2.0.2.0.6.0-0009\etc\hadoop\dfs.include (the system cannot find file specified) @ java.io.fileinputstream.open(native method) @ java.io.fileinputstream.<init>(fileinputstream.java:138) @ org.apache.hadoop.util.hostsfilereader.readfiletoset(hostsfilereader.java:54) @ org.apache.hadoop.hdfs.server.namenode.hostfilemanager$mutableentryset.readfile(hostfilemanager.java:265) @ org.apache.hadoop.hdfs

java - JPA one to many relationship query -

implemented 1 many relationship , working fine. my issue when run below query, if table has 100 employee rows, , each employee has 2 departments. database query called 101 times, because each employee calling department query, taking long complete calling hundred rows, can 1 suggest alternative solution? please see details below queries calling: first query : select * employee e next 100 queries : select * department d d.employeeid=? jpa database call : javax.persistence.query query = em.createnamedquery("select * employee e", employee.class); return query.getresultlist(); import javax.persistence.cascadetype; import javax.persistence.column; import javax.persistence.entity; import javax.persistence.fetchtype; import javax.persistence.id; import javax.persistence.namednativequeries; import javax.persistence.namednativequery; import javax.persistence.onetomany; import javax.persistence.table;

c# - Append template from a XSLT into another XSLT -

i working in visual studio 2012 c#. have 2 xslt files. 1 has few templates. has nodes defined there. want build function in c# using pass template name. using name search in 1 xslt , if there template given name, copies on second xslt. f("getmonth") should result following: xslt1: <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform"> <xsl:template name="getmonth"> <xsl:param name="month"/> <xsl:param name="putcall"/> <xsl:value-of select ="'a'"/> </xsl:template> xslt2: <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform"> <xsl:template match="/"> <documentelement> // code written </documentelement> </xsl:template>

android - Nexus 4 dialer - Creating contact without phone number -

i trying create contact programatically without phone number. manage create when open dialer crashes. if open contacts ok. also, if add contact manually without phone number works ok. i working nexus 4 - kitkat 4.4.2. this code use: /** * add new contact contacts list , contacts db. * @param contact * @param contactkey * @param ctx */ public void addcontact(retrievable contact,string name,string contactkey ,final activity ctx){ initializedb(ctx); if(groupid== null) groupid = getgroupid(ctx); arraylist<contentprovideroperation> ops = new arraylist<contentprovideroperation>(); ops.add(contentprovideroperation.newinsert(contactscontract.rawcontacts.content_uri) .withvalue(contactscontract.rawcontacts.account_type, null) .withvalue(contactscontract.rawcontacts.account_name, null) .build()); ops.add(contentprovideroperation.newinsert(con

sql - ORA-00001: unique constraint: 1node vs 3node -

we're using oracle 11.2.0.3.0, configured 3 node rac. in our application have hibernate on ucp , ojdbc compatible version rac. hibernate use sequence id record in database. database we've got table unique_constraint (some_value) on it. it's used synchronized many instance of application, every transaction in application requires unique row in table. application tries insert in table (some_value="a"), if other application inserted row (some_value="a"), first instance ora-00001 unique constrain violated, , retry other value (some_value="b"). unique_constraint fires often. 1 in 8tx. we run 2 tests: service pinned 1 node: response time avg 6ms service on 3 nodes: response time avg 800-1000ms high level question why? happening in 3 node rac when unique_constraint occurs, , why it's slowing down application. how can diagnose case? michal use service level scaling on rac. create "loader" service rac side. make se

Hadoop: How can I start tasktracker? -

i want open web/ui of tasktracker . localhost:50030/jobtracker.jsp doesn't work since there's no running tasktracker. hadoop applications have been working without tasktracker. found tasktracker should running in order open web/ui. don't know how start tasktracker. how can start tasktracker? tried lots of things don't work. my status & environment: localhost:50070 web/ui working well. jps command shows datanode, namenode, nodemanager, secondarynamenode, resourcemanager. hadoop version 2.2.0. os red hat 6.3(santiago). thank in advance. if using hadoop 2.2.0 has yarn framework, there no jobtracker in it. functionality split , replaced resourcemanager , applicationmaster . here expected jps prinout while running yarn $jps 18509 jps 17107 namenode 17170 datanode 17252 resourcemanager 17309 nodemanager 17626 jobhistoryserver

Javascript Memory Management Leaks -

currently creating web application. users should able running application day. having memory issues. browser seems crash. using kind of structure: function module() { var _me = this; this.init = function(){ _me.setbindings(); // using reference module instead of } // kind of functions this.init(); } which changed this . so more complex situation (which part of code atm): $.modules.dynamic_static_webpage.prototype.addredirect = function (anum, aeditor) { $.prompt( $.utils.gettranslation("redirect"), $.utils.gettranslation("geef de url op waar naar toe geredirect moet worden"), $.proxy(function (num, editor, input) { this.clearredirect(editor); var val = input.val(); if (val.indexof("www") == 0) { val = "http://" + val; } // timeout needed, because otherwise clear not

c# - Passing objects in the linq statement -

i using following linq statement in web api using entity framework. working fine except in linq statement dont know how pass icollection public class projoverview { public int proj_id { get; set; } public string name { get; set; } public virtual icollection<p_type> p_type { get; set; } } and linq statement var pover= (from c in db.pr_d select new pover { name=c.proj.name, proj_id=c.proj.p_id, p_type= icollection<c.proj.pro_type> }).take(7); return pover; i intellisense error on " p_type= icollection" saying type used variable. please let me know how fix it. thank the error message should helpful, setting p_type type ( icollection<t> ) instead of variable, need change this: var pover = (from c in db.p

html - Navigation bar rendering over main container rather than above -

so have navigation looks on both mobile , desktop because resizes , accordingly, can't content after go immeadiately below. if don't set padding-top, navigation being set on main_container being rendered under navigation bar , hence not being seen. i set padding-top property, problem is, mobile desktop site. setting padding-top property makes page rendering in mobile different desktop. leaves more padding in mobile in desktop. <div id="nav_cont"> <ul id="nav"> <?php $count=0; $count++; ?> <li><a href="index.php">home</a></li> <?php $count++;?> <li><a href="register.php">register new store</a></li> <?php $count++;?> <li><a href="new_mvi.php">add movie/series/game titles</a></li> <?php $count++;?> <li><a

java - What's wrong with my insertion sort? -

i'm trying sort large datafile using insertion-based sorting algorithm, code runs fine output incorrect. i've studied on , on absolutely no avail, can see i've gone wrong? public void sort(comparable[] items) { (int = 1; < items.length; i++) { comparable temp = items[i]; int j = - 1; while (j >= 0 && items[j].compareto(items[j]) > 0) { items[j + 1] = items[j]; j = j - 1; } items[j] = temp; } } an example datafile have produced is... 2 1 3 5 9 6 7 4 8 and output should 1,2,3,4... - instead 1 3 5 9 6 7 4 8 8 items[j].compareto(items[j]) should items[j].compareto(temp) , otherwise you're comparing item against - need comparing against object want insert. then items[j] = temp; cause arrayindexoutofboundsexception because, @ end of loop, items[j] smaller temp , or j == -1 , need insert @ position after - simplest fix changing items[j+1] = temp; .

h.264 - VP8 and VP9 support in mobile phone -

which mobile phones support vp8 , vp9 video compression format? otherwise can convert h.264 compatible phone vp8 / vp9 supported? android has vp8 support, see details here http://developer.android.com/guide/appendix/media-formats.html

android - Handling Back button press event when application not open -

i developing security app on android platform. requirement handle button press event when application not open or not in foreground screen. some code of application should run, need send notification application. when 3 time button press continuously when app closed is there way handle button event out of application?? know how handle press event when application in use dont know type of stuff. androidservice runs in background seems not work outside of activity this question asked here: pressing button on android through service

python - I'm getting the following error and can't work it out -

i'm learning python , started putting below code. i'm trying fread function working correctly i'm getting error. i've tried few ways fix of course if don't know what's causing i'm never going fix it. i'm hoping me out. error unknown@ubuntu:~$ ./attack.py -f wordfile.txt traceback (most recent call last): file "./attack.py", line 63, in <module> print fread(list) file "./attack.py", line 20, in fread flist = open(list).readlines() typeerror: coercing unicode: need string or buffer, type found` code #!/usr/bin/python import sys, getopt, socket, fileinput, traceback import dns.query, dns.message, dns.name, adns queue import queue threading import thread def usage(): print "-h --help: help\n" print "-f --file: file read bruteforce domain list from.\n" print "-p --proxy: proxy address , port. e.g http://192.168.1.64:8080\n" print "-d --domain: domain

javascript - requireJS why does each define has to be in different file? -

i using requirejs in sample demo app. code: require({ paths: { todomodel: '/scripts/todomodel.min', todo: '/scripts/todo.min', todoservice: '/scripts/todoservice.min' } }, ['todo'], function (todo) { ko.applybindings(new todo(), $('#todo')[0]); } ); i know need of files app loads. want combine todomodel, todo , todoservice 1 file , yet define them separate this: define('todomodel', [], function () { todomodel = function (data) { ko.mapping.fromjs(data, {}, this); } return todomodel; }); all moment in separate files can see in paths attribute. requirejs not require define calls in different files. it's in development "one file, 1 module (i.e. 1 define )" works pretty well. in fact, requirejs optimizer ( r.js ) combines multiple define calls 1 file during optimization. no problem there. the setup show in question looks me development setup. n

c# - blocking timer in windows service -

i using 'timer code' in windows service: var autoevent = new autoresetevent(false); timer = new timer(dowork, autoevent, 0, timeinmilliseconds); i wondering whether possible prevent invocation of dowork, if dowork has not finished yet? in other words, if timeinmilliseconds shorter time takes execute dowork? if understand correctly can prevent automatic callback , change timer once when need. timer = new timer(dowork, autoevent, 0, timeout.infinite);//prevent periodic timer void dowork(object state) { //do work , set timer again timer.change(timeinmilliseconds, timeout.infinite); } don't forget add try/finally block, if don't timer not called again in case of exception.

php - Ajax call giving error 500 -

i have 2 folders php on domain. 1 file want send data other via using ajax call. call worked me on localhost, when had website on live server gives 500 error on same ajax call ? how can solve issue ? my ajax call following: var data_to_send = {}; j.ajax({ url : '../orangehrm/symfony/web/index.php/auth/login', type: "post", data : data_to_send, async: false, success: function(data, textstatus, jqxhr) { time_zone = j(data).find('#hdnusertimezoneoffset').val(); }, error: function (jqxhr, textstatus, errorthrown) { } }); a 500 number error server-side exception - went wrong in apache or iis or whatever. determine was, can check error logs on server (event viewer on windows), or turn on "detailed error messages" in web service software remote requests see more information returned browser - browsing locally on serv

c# 4.0 - webAPI with RESTful service in asp.net -

i created new project in web api in vs 2013 asp.net . want create web service retrieve data client server, using rest service , when enter product code . can please give me link source code have generate , corresponding class files .

actionscript 3 - how to add a external document class to timeline based Flash website -

i have made timeline based flash website. there 4 buttons, each in different frame (home , gallery, etc.). frames have actions dependent each frame (simple stop(), gotoandplay etc.). i have found tutorial how create thumbs scroller as3 , xml http://www.fladev.com/free-files/create-a-thumbs-scroller-with-as3-and-xml/ this simple thumb scroller next prev buttons , caurina tweener classes. problem it's calls setting document class linked external file. when set document class in as3 settings , source path messes timeline based actions. have tried new mainclass() , import src.scroller.*; in gallery frame there 1180: call possibly undefined method... my question how can incorporate external flash site file without messing current scripts? there possibility? is there possibility? yes, is. it's bad, use main timeline manage states of website... but, if such approach, can move code provided in tutorial frame.

inheritance - Method in parent class that returns child class in java -

i have parent class product , children class camera , tv , etc... want create method in product fetches db common attributes children , returns instance of child, according object fetched db (i have lot of children class). possible this? if yes, can show me little example? my idea call method similar method in child class , fetching db non-common attributes. i think should have @ decorator pattern http://javarevisited.blogspot.co.uk/2011/11/decorator-design-pattern-java-example.html

google chrome - Wordpress content invisible -

i've problem wordpress site. out of no reason text of post disappears or invisible in frontend. zoom out , in text showing! problem friend reporting me. wasn't able cause issue myself. i've cleared cache , used safari, chrome , firefox in private mode friend did. me still sounds browser issue or miss issue? give example said coudn't cause issue myself. else except browser using? edit transitionally fixed quick n dirty jquery right above wp_footer , </body> tag. <script type="text/javascript" charset="utf-8"> jquery(function() { jquery('body').hide().show(); }); </script> related post google group if has better approach please let me know.

java - Get first and last day of month using threeten, LocalDate -

i have localdate needs first , last day of month. how do that? eg. 13/2/2014 need 1/2/2014 , 28/2/2014 in localdate formats. using threeten localdate class. just use withdayofmonth , , lengthofmonth() : localdate initial = localdate.of(2014, 2, 13); localdate start = initial.withdayofmonth(1); localdate end = initial.withdayofmonth(initial.lengthofmonth());

c# - How to create a parameterless indexer -

i might have coded myself corner here, hoping there simple way out of it. my logic layer static singleton instance has lots of properties accessing individual sub-logic layers. of put in place unit testing allow injection of custom repositories , works quite nicely that. boiler plate code each sub-instance repetitive , expect there way simplify it. below simplified example demonstrate how far have manages , stuck. 1 way works indexer on sub-logic class wrapper sub-logic, reads strangely. other way using random letter property on sub-logic class wrapper sub-logic. reads better, still has ripple effect on existing code. can done way want to, or should looking @ differently. apologies length of example. tried make simple possible while still keeping concept intact class program { static void main(string[] args) { var logic = new logic(); // old usage (desired) var abcs_1 = logic.abcs_1.list(); var defs_1 = logic.defs_1.list(); //

DOS batch: How to remove last part of folders names -

in batch file folder list of subfolders unknown number of underscores e.g.: a_b_10 c_d_e_2 f_17 i need remove last token of names i.e. a_b c_d_e f thanks you try last part underscore , remove string, works when last part unique. in sample last part seems number in spite of other parts. uses trick parse parts of string replace delimiter linefeed character. @echo off setlocal enabledelayedexpansion set lf=^ /f "delims=" %%x in ('dir /b /ad') ( call :removelastpart "%%~x" ) exit /b :removelastpart set "str=%~1" %%l in ("!lf!") ( /f "delims=" %%p in ("!str:_=%%~l!") set "last=%%p" ) echo last part '!last!' rem ** remove last part replacing nothing ** set "str=!str:_%last%=!" echo !str! exit /b

ios - UITableView slightly goes up when keyboard hides -

Image
i using uitableview (chattable) along uitabbar (chattabbar) , 1 textfield inside imageview. using autolayout. used following code change views when keyboard appears , disappears. - (void)keyboardwasshown:(nsnotification*)anotification { nsdictionary* info = [anotification userinfo]; // animation info userinfo nstimeinterval animationduration; cgrect keyboardframe; [[info objectforkey:uikeyboardanimationdurationuserinfokey] getvalue:&animationduration]; [[info objectforkey:uikeyboardframebeginuserinfokey] getvalue:&keyboardframe]; // resize frame [uiview animatewithduration:animationduration delay:0.0 options:uiviewanimationoptioncurveeaseout animations:^{ self.keyboardheight.constant = keyboardframe.size.height - tabbar_height ; [self.view layoutifneeded]; } completion:nil]; if ([chatdata count] != v

c# - How to create application for Motorola mc70 device? -

i new bee in field. have motorola mc70 device.i want create application in device scans barcode , put data of barcode sql server database. have worked in visual studio 2010. have motorola scanner sdk , user guide. don't know how create application these types of devices. have worked in c# familiar , using sql server database it. don't know start?? should make console application or other type of application. can sort out , provide procedure create application device... in advance... if you're gonna use .net have visual studio 2008 , download windows mobile sdk. removed support creating windows mobile applications in vs 2010 , up. in visual studio 2008 find smart device project etc.. , there emulator it. there other options create applications these devices. rhomobile suite. code html5 / css3/ javascript / ruby etcc. not free. developing applications in rhomobile free when deploying , uses features cost.

Printing Code128 barcode using printer object in vb6 (using font) -

we have ancient vb6 program creates barcode using printer objects relies on window fonts, works fine code39. need switch font code128, after work converted input code128 format string, , trying print using same method, however, printout not seem right (strange thing is, when copy converted string excel , use same code 128 font print out, display , print out prefectly) i wondering if had same experience, if so, can shred lights please? the following code used print out barcode dim sorg string sorg = "12345888" printer.fontname = "code39" printer.print sorg 'this prints out 'however when change font code 'this returns Í,bzx}Î can copy onto excel , print out sorg = convertto128(sorg) printer.fontname = "code 128" printer.print sorg 'print out part barcode line, part squares you may use following project includes vb6 project , open barcode font barcode fonts , encoders

c# - RegEx not being able to match data -

i using regex find , replace data. suppose code dictionary<string, string> data=new dictionary<string, string>(); data.add("jid","421587"); string template ="your unique job number {jid} .your part collected us" string result = regex.replace(template, @"{([^{}]+)}", delegate(match match) { string key = match.groups[1].value; return data[key]; }); _body = result; return this; actually trying find out character {jid} , want replace {jid} value store in dictionary guess patter used here @"{([^{}]+)} not right find out data , replace {jid} . so please me how find {jid} string , replace. thanks edit actually text trying replace huge html text , may why problem occur. so manage whole thing way. public mailtemplate parsetemplate(dictionary<string, string> data) { string template = getbody(); foreach(keyvaluepair<string, string> item in data) {

linux - Android sdk manager On ubuntu -

i download adt link http://dl.google.com/android/adt/adt-bundle-linux-x86_64-20131030.zip installed , when run eclipse/android sdk manager, process doing on later getting message : failed run android sdk manager.check android console view details. on windows in sdk folder , .exe file available run android sdk manager ubuntu not available. download android sdk manager linux. install ddms plugin eclipse. map android sdk platform-tools(adb) android properties[ click on window preferences , choose android].

java - XMPP and Android Part-2 -

this question continuation of previous question though have managed remove networkonmainthreaderror, have new errors fight with, previous question can found here: xmpp , android this time guess probelm host name, or may service name, trying connect openfire server. by way need add public class settingsdialog extends dialog menifest file my code connection: /** * gather xmpp settings , create xmppconnection */ public class settingsdialog extends dialog implements android.view.view.onclicklistener { private xmppclient xmppclient; public settingsdialog(xmppclient xmppclient) { super(xmppclient); this.xmppclient = xmppclient; } protected void onstart() { super.onstart(); setcontentview(r.layout.settings); getwindow().setflags(4, 4); settitle("xmpp settings"); button ok = (button) findviewbyid(r.id.ok); ok.setonclicklistener(this); } public void onclick(view v) {

Display width of unicode strings in Python -

this question has answer here: normalizing unicode 2 answers how can determine display width of unicode string in python 3.x, , there way use information align strings str.format() ? motivating example: printing table of strings console. of strings contain non-ascii characters. >>> title in d.keys(): >>> print("{:<20} | {}".format(title, d[title])) zootehni- | zooteh. zootekni- | zootek. zoothèque | zooth. zooveterinar- | zoovet. zoovetinstitut- | zoovetinst. 母 | 母母 >>> s = 'è' >>> len(s) 2 >>> [ord(c) c in s] [101, 768] >>> unicodedata.name(s[1]) 'combining grave accent' >>> s2 = '母' >>> len(s2) 1 as can seen, str.format() takes number of code-poin

c# - Error in deserializing body of request message for operation -

i'm writing service adapter use web services hosted vendor (pega). changing service not option me. when i'm calling method error : "error in deserializing body of request message operation" i tried increasing maxstringcontentlength , all. nothing worked. when examining response xml see empty values few long , int variables believe reason. is there fix this? this got resolved after removing empty tags service end. no solution found .net client end.

html - CSS odd even with 2 cols -

my html this: <article></article> <article></article> <article></article> <article></article> <article></article> <article></article> and there 2 articles in 1 line float , want them change color like: blue green green blue blue green green blue how can css? there 4 article s in pattern, offset of 4n ought trick. seems work ( fiddle ): article {color:blue} article:nth-child(4n-1), article:nth-child(4n-2) {color:green} if don't minus, plus works same ( fiddle ): article {color:blue} article:nth-child(4n+2), article:nth-child(4n+3) {color:green} just explain entire logic, it's matter of shifting 4n pattern: 4n-3 4n-2 4n-1 # color 4n 4n+1 4n+2 4n+3 -- ------ ----- ------ ------ ------ 1 blue - 0 - - 2 green - - 0 - 3 green - - - 0 4 blue 1 -

php - DOMPDF - Class 'Font' not found -

i'm trying add font via command line. every time try following error. fatal error: class 'font' not found in /home/scripts/public_html/marketingpalv2/load_font.php on line 139 i similar error when try use @font-face fatal error: class 'font' not found in /home/scripts/public_html/marketingpalv2/include/font_metrics.cls.php on line 346 hope guys can help. i figured out was. i downloaded newest version of php-font-lib needed older version.

android - How to programmatically display a view in center of another view -

i have buttonview1 , customview1 draws small circle. in main_layout buttonview1 visible. how can programmatically display customview1 in center of buttonview1 when button clicked. attention: dont want change button background. want show new view (customview or other view edittext) on view (button) when button pressed. layout code: <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingbottom="@dimen/activity_vertical_margin" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" tools:context=".mainactivity" > <button android:id="@+id/buttonview1"

C program reversed linked list -

im trying write program in c adds big numbers linked list. used reverse add numbers, cant reverse again. should used several times(iow, looped ask numbers until exit) #include <stdlib.h> #include <stdio.h> #include <string.h> #include "function.c" int main() { char n1[500]; int lensum, len; printf("welcome! \nthis program performs addition of big whole numbers can contain upto maximum of 500 digits."); printf("\nenter first number: "); scanf("%s", n1); len = strlen(n1); node *root = create(n1[0]); node *head = root; root, head = createlist(n1,root,head,len); root=head; printf("enter second number: "); scanf("%s", n1); len = strlen(n1); node *root2 = create(n1[0]); node *head2 = root2; root2, head2 = createlist(n1,root2,head2,len); root2=head2; root=head; printf("\nyour first number is:\t "); while(root!=nul

Equivalence of java.util.ResourceBundle in C++ -

i have java class uses more lines similar following ones private static final int param_1 = integer.valueof(resourcebundle.getbundle("solution.filtres").getstring("filtre.param1.solution")); private static final int param_2 = integer.valueof(resourcebundle.getbundle("solution.filtres").getstring("filtre.param2.solution")); and file filtres.properties found in solution folder contains: filtre.param1.solution=1.5 filtre.param2.solution=6 i know resourcebundle used user locale, seems assigns values static members specific file. i want similar in c++. have found this c++, seems little strange does; asking: is similar resourcebundle in c++ (not have found)? if yes, what, , can find examples? do advice me in simpler way? i appreciate code if did kind of assignments. resourcebundle allows retrieve textual data key, returning result based on specified locale. i'm not aware of exact match in c++, recommend using gnu