Posts

Showing posts from September, 2010

javascript - Adding a function after completion of ng-hide -

i have tr : <tr ng-hide="func(item.status)" ng-repeat="item in itemarray" > <td></td> . . </tr> in func() item.status compared value of dropdown d can changed user @ time. i have div need show if current number of visible tr == 0. storing number of visible tr $scope.qvisible = $("#tableid tbody tr:visible").length; how can have qvisible updated once ng-hide statements have been executed correct result? i going assume have dropdown somewhere looks like.. <select ng-model="selectedstatus" ng-options="status status in statuses"></select> so ng-hide can <tr ng-hide="item.status !== selectedstatus" ng-repeat="item in itemarray" > <td></td> . . </tr> in controller, need setup watch on selectedstatus.. $scope.qvisible = false; $scope.$watch("selectedstatus",function(newval){ //for loop on items.. counting number

php - Need properties to pass to google chart javascript -

i working wordpress checked if typical wordpress question, usual php , jquery question. i have piece of code executed 12 times different data. have collect data jquery , pass widget shown if click widget clicked. other widget must show data of clicked widget , present google chart. show on purpose , google chart thing no problem, problem pass data. tried lot of things new jquery , have lack of skills @ moment hope guys can me. have simplified code show examples , structure. the code executed 12 times: <a href="javascript:void(0);" class="span1 <?php echo $color .' '. $stylename; ?>"> <div class="box_top"> <div class="icon"></div> <div class="title"><h2><?php echo $title; ?></h2></div> </div> <div class="box_middle"> <?php echo $currentvalue; ?> </div> <div class="box_bottom&q

git deleted files shows in red, how to remove them -

after deleted files directory on git status command git bash cli i'm getting list of deleted files in red like deleted: myproject/commands/fileone.txt now when i'm using git status command i'm getting huge list of these deleted files. which command use remove this? thanks you can "add" deleted files next commit using git add -u

c# - How to Bind the the value of a TextBlock which is inside a DataTemplate? -

hi want bind value of textblock inside datatemplate text property of textblock change runtime according file/folder listing. have written below code string empty. working env windows phone 8 visual studio 2012. <grid x:name="contentpanel"> <phone:longlistselector> <phone:longlistselector.listfootertemplate > <datatemplate > <textblock name="tbfooter" text="{binding footertext, mode=oneway}" /> </datatemplate> </phone:longlistselector.listfootertemplate> </phone:longlistselector> this textblock name= tbfooter has updated runtime footertext value. now in code behind have defined property private int _footertext; public int footertext { { return this._footertext; } set { this._footertext=value notifypropertychanged("footertext"); } } however value of teh textblock tbfooter null, not showing null. can me out

jar - Unjar in powershell -

i'm quite new @ using powershell , have problem. i want use script unjar .war file , using code: jar -xf myjarfile.war but error like: jar : java.io.ioexception: meta-inf : not create directory. if same thing in powershell command windows works fine, not when running in script doesn't. do know what's wrong. case closed, jackie getting me on track. when running script in powergui script editor got error. when running script in command shell works fine, don't need run through pguise.

Changing name of uploaded file in php -

i using code bellow upload file using php , inserting file name database. want rename of file on uploading , want insert new renamed name database. know how insert name database don't know how rename uploaded file name. please help. using code bellow: $target = "uploads/"; $target = $target . basename( $_files['uploaded']['name']); move_uploaded_file($_files['uploaded']['tmp_name'], $target); $add_file = $_files['uploaded']['name']; thank much.. is looking for? <?php rename("/tmp/uploaded_file.txt", "/home/user/login/uploaded/67a7466b576.txt"); ?> so new code be: $target = "uploads/"; $target = $target . basename( $_files['uploaded']['name']); rename($_files['uploaded']['tmp_name'], $target); $add_file_to_db = $target;

firefox - Safari sending floated div to new line, chrome and IE are fine -

the situation: parent div: 300px child 1: 50px width, 5 px border child 2: 232px width, 8px margin left works fine in chrome , ie, safari , firefox drop second 1 new line. reason this? if remove 1 px overall, having 7px left margin, fit place. also, measurements match in firebug, don't see why thew 2 not fitting in same line. try removing other padding or margin parent div , children. these caused default browser styles. (or use css reset elements) also, note, safari , opera little bit lying measurements if have decimal number. round or down, not exact firefox or chrome.

Touch inputs do not work after restart of Android froyo with locking application -

i have developed locking application (kiosk mode) android. working on android honeycomb , ice cream sandwich. if set category android:name="android.intent.category.default" in androidmanifest.xml file touch inputs not work after restating froyo 2.2 tablet.

android facebook sdk 3.0 login and get user info -

i'm developing app using needs few facebook info register own website. at first using facebook sdk 1.5, working well. until facebook says they'll stop supporting old(v2.0 , below) sdk since june 2013. so have upgrade 3.0, , re-write code. here's have done far after read facebook's official tutorial : manifst.xml <!-- stuff --> <uses-permission android:name="android.permission.internet" /> <meta-data android:name="com.facebook.sdk.applicationid" android:value="@string/fbappid"/> <activity android:name="com.facebook.loginactivity" android:label="@string/app_name" /> strings.xml <!-- stuff --> <string name="fbappid">1234567890</string> <!-- know id fake, right ? --> code public class loginfragment extends sherlockfragment { private uilifecyclehelper uihelper; private session.statuscallback callback=new session.statuscallback() { @over

grails - quartz job plugin not getting invoked on jboss startup -

i have grails 1.3.5 quartz plugin integrated running jobs during start of application , continuously after time interval not able identify issue jobs not getting initiated on application startup (using jboss 4.2.2). checked defaultquartzplugin.groovy files r ok working on 1 server , same code when shifted server not working. only diff working 1 server linux red hat linux 2.6.18-274.el5,amd64 the 1 not working red hat 2.6.32-131.0.15.el6.x86_64,amd64 but know java application run on jvm server should not make diff such. thanks praveen t

java - How to make a subString from another string by searching for certain characters -

string x = "id:12 patient name:..."; string z = = x.substring(3, x.indexof(' p')); i want id number you're there. use this:- string z = x.substring(x.indexof("id:")+3, x.indexof("patient")-1); +3 - because don't need id: -1 - because don't need space before patient this taking account there single space before patient , if not, @buhakesindi suggested use trim() method this:- string z = x.substring(x.indexof("id:")+3, x.indexof("patient")); z = z.trim();

lua - Awesome WM 3.5 seperate config files -

i'm not sure if ok ask things here tell me if not :) . have no idea else ask. i have problem awesome wm. try separate rc.lua different files (because starts long) , load them in rc.lua. i have function changing xrandr layout. code works fine, when inserted directly rc.lua. -- xrandr settings switcher -- -- active outputs local function outputs() local outputs = {} local xrandr = io.popen("xrandr -q") if xrandr line in xrandr:lines() output = line:match("^([%w-]+) connected ") if output outputs[#outputs + 1] = output end end xrandr:close() end return outputs end local function arrange(out) -- need enumerate way combinate output. assume -- want horizontal layout. local choices = {} local previous = { {} } = 1, #out -- find permutation of length `i`: take permutation -- of length `i-1` , each of them, create new -- permutations adding each output @ end of if

c# - Selecting multiple columns from a DataTable -

my code : productrangesfornewrowsdt = productrangesdt.select("product_name, min_quantity, max_quantity, comission_template provider_id = " + provider_id).copytodatatable(); where productrangesfornewrowsdt datatable , productrangesdt datatable contains these columns: product_id product_name provider_id.provider_name min_quantity max_quantity comission_template i getting error : syntax error in expression. the datatable.select returns array of datarow providing columns exist in datatable return columns in row anyway. .select used where clause can this: datarow[] rows = productrangesdt.select("provider_id = " + provider_id); and use whatever method rows target data table. to columns want, should derive dataview data table, copy data table , query new set. dataview view = new dataview(productrangesdt); datatable dtquerytable = view.totable(false, new string[] { "provider_id", "product_name", "min_qu

php - facing issue with htpasswd in wordpress site -

i trying develop http authentication in 1 of wordpress site. i have done below code this. in .htaccess file @ root folder. # begin wordpress <ifmodule mod_rewrite.c> rewriteengine on rewritebase /htpass_wordpress/ rewriterule ^index\.php$ - [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . /htpass_wordpress/index.php [l] </ifmodule> # end wordpress i have created 1 more.htaccess file wp-admin folder. authtype basic authuserfile /htpass_wordpress/wp-admin/.htpasswd authname "my private area" require valid-user i have created 1 htpasswd file , put in wp-admin( same directory htaccess wp-admin stored). i have stored user name , base 64 encrypted password in file. now when access wp-admin area, pop appears ask login. provide username/pass , allows me access wp-admin. gives me 500 server error. does 1 know going wrong?

SQL Server - Select inserted rows in a table, inside THE SAME transaction -

i need confirmation 1 "tricky" question. in transaction, in insert rows in table. after that, querying same table, , based on results, insert in table. my question is: inserted rows in first table visible when inserting in second table? (i need inserted rows visible). my first insert : insert biousers select newid(),a.badgenr,getdate(),a.persnr ( select cb.persnr,c.badgenr curbiodistribution cb inner join cur c on c.persnr = cb.persnr cb.[type] = 1 , cb.groupnr = @nr , cb.persnr in (select persnr curbiodistribution groupnr = @nr) except (select persnr, badgeid badgenr biousers) ) i want insert biouserid's in first table in table, contains field biouserid , if not in it. when select first one, want inserted rows too. ps: searched problem, find answers issue when multiple transaction (from different clients)

java me - Blackberry App is working on wi-fi but not on Packet Data/GPRS -

i have created blackberry application working fine on wi-fi. when turn off wi-fi , use mobile network not able run application. shows no internet connection available. i had written these lines. if (deviceinfo.issimulator()) { deviceinfo = deviceinfo.concat(";deviceside=true"); } here http connection class import java.io.ioexception; import java.io.inputstream; import javax.microedition.io.connector; import javax.microedition.io.httpconnection; import net.rim.device.api.system.deviceinfo; import net.rim.device.api.system.radioinfo; import net.rim.device.api.ui.uiapplication; import net.rim.device.api.ui.component.dialog; public class httpconn { public string jsonresponse (string url) { string response = null; httpconnection httpconnection = null; inputstream instream = null; int code; stringbuffer stringbuffer = new stringbuffer(); string deviceinfo=url;

nhibernate - QueryOver child collections giving cartesian products -

i have domain trying query looks (with other unimportant properties omitted) , related mapping: // domain: public class order { public virtual site release { get; set;} public virtual site return { get; set;} } public class site { public virtual calendar { get; set; } } public class calendar { public virtual ilist<holidaydate> holidays { get; set; } } // mapping: public class ordermap : classmap<order> { public ordermap() { references(x => x.release); references(x => x.return); } } public class sitemap : classmap<site> { public sitemap() { component(x => x.calendar, component => { component.map(x => x.workingdays); component.hasmany(x => x.holidays).cascade.alldeleteorphan(); }); } } i query orders, having specific status , joining both release , return release , join in calendar (which component-mapped entity) , calendar join in hol

javascript - easyXDM failing on IE8 with undefined object -

Image
this script working great in browser ie8, error points me line 434 colum 75 telling me there undefined object. error log: messaggio: 'undefined' è nullo o non è un oggetto linea: 434 carattere: 75 codice: 0 uri: http://127.0.0.1:81/apitest/js/easyxdm.js and function on line: function testfornamepropertybug(){ var form = document.body.appendchild(document.createelement("form")), input = form.appendchild(document.createelement("input")); input.name = iframe_prefix + "test" + channelid; // append channelid in order avoid caching issues has_name_property_bug = input !== form.elements[input.name]; document.body.removechild(form); } the line 434 column 75 is: input edit: link: http://postimg.org/image/n1ogavda3/

excel - extract multiple xml nodes into array without looping -

i have xml doc looks this: <rng> <col1> <row1>a</row1> <row2>b</row2> <row3>c</row3> <row4>d</row4> </col1> <col2> <row1>e</row1> <row2>f</row2> <row3>g</row3> <row4>h</row4> </col2> </rng> there lot more of col nodes, , each 1 contains several thousand row elements. i'd parse out values row elements , put them onto spreadsheet. i'm doing follows: ' list of col elements (thi sits in loop go through them all) set oxmlcolnodelist = oxmldoc.selectnodes("//savestates/rng/*") ' lop through each column colnum = 1 oxmlcolnodelist.length ' row nodes coulmn set oxmlrownodelist = oxmldoc.selectnodes("//savestates/rng"/col" & colnum & "/*") ' loop through row nodes rownum = 1 oxmlrownodelist.length ' node set oxm

c++11 - C++ Read only random lines in a file -

i had requirement read text file large decide read lines in file. can use seek method jump given line? can read line because text file large reading whole file wasting lot of time. if not possible, 1 give better solution that? (seek given line , read it) (i know binary text files reading byte byte) ex of file event1 0 subevent 1 subevent 2 event2 3 (in file after 1 event display number of lines want seek previous event) yes, can seek point in file read there. 1 possible problem if lines different lengths, random location in file have higher probability of being in longer line: you're not getting evenly distributed probabilities of different lines. if really must have identical probabilities need make @ least 1 pass on file find start of each line - can store offsets in vector , randomly select vector element guide seeking line data in file. if care little bit, can perhaps advance small random number of lines past 1 seek to... odds bit, avoids initial pass

Perl - Regex to extract only the comma-separated strings -

i have question hoping with... i have variable contains content webpage (scraped using www::mechanize). the variable contains data such these: $var = "ewrfs sdfdsf cat_dog,horse,rabbit,chicken-pig" $var = "fdsf iiukui aawwe dffg elephant,mouse_rat,spider,lion-tiger hdsfds jdlkf sdf" $var = "dsadp poids pewqwe antelope-giraffe,frog,fish,crab,kangaroo-koala sdfdsf hkew" the bits interested in above examples are: @array = ("cat_dog","horse","rabbit","chicken-pig") @array = ("elephant","mouse_rat","spider","lion-tiger") @array = ("antelope-giraffe","frog","fish","crab","kangaroo-koala") the problem having: i trying extract comma-separated strings variables , store these in array use later on. but best way make sure strings @ start (ie cat_dog) , end (ie chicken-pig) of comma-separated list of animals not prefixe

c# - How to check for object of particular type in a HashSet in windows 8? -

i have hashset of generic type usercontrol , can have various usercontrol (login, settings). want check whether set contains object of particular type (say login). if want element. i know quite easy loop, there better way? unfortunately, cannot without loop, because need try elements of collection check types. in fact, not matter have hash set: work same list, or other enumerable. however, linq lets hide loop, this: var item = hashset.oftype<desiredtype>().firstordefault();

concurrency - Hash map with concurrent values (in C++) -

i have hash map, string key pointer thread-safe class. each object of class contains mutex use synchronize between various methods. in addition, every once in while want discard values not used time. want able safely delete value pointer , remove hash map, while making sure no 1 uses value. what's best way achieve (in general, , in c++)? if want people use hash map these pointers able keep using them without having notify hash map class they've finished it, storing shared pointers in hash map easiest way time actual object deletion time last user of object finishes it. hash map free erase it's shared pointer object @ time.

c# - How to read cell values from existing excel file -

i want read each cell value in excel file, not able cell values after trying different examples in net. not getting result following code, can 1 on this. using .net framework 2.0 string filepath = "f:/bulktest.xlsx"; microsoft.office.interop.excel.application excelapp = new microsoft.office.interop.excel.application(); excelapp.visible = true; microsoft.office.interop.excel.workbook wb = excelapp.workbooks.open(filepath, missing.value,missing.value,missing.value,missing.value,missing.value,missing.value,missing.value,missing.value,missing.value,missing.value,missing.value,missing.value,missing.value,missing.value); microsoft.office.interop.excel.worksheet sh = (microsoft.office.interop.excel.worksheet)wb.sheets["sheet1"]; range excelrange = sh.usedrange; (int i=2; i<= excelrange.count + 1 ; i++) { string values = sh.cells[i,2].tostring(); } till trying take cell values directly variables, try take cell values array using range. thanks!!!!

java - BSA calculation results me Zero -

public static int calculatebsa(double height, double grams) { double weightforbmi = convertgramstopounds(grams); return (int) math.sqrt(((convertcentimetertoinches(height) * weightforbmi) / 3131)); } here code converting centimeter inches , grams pounds. private static double convertcentimetertoinches(double height) { return (math.round((height / 2.54) * 100) / 100); } public static int convertgramstopounds(double grams) { double gramstopoundunit = .00220462262; double pounds = (grams * gramstopoundunit); return (int)(math.round(pounds * 100) / 100); } bsa calculation results me zero . doing math.sqrt rightly inside bsa. if call calculatebsa(1e4, 1e4) it returns 5. relative small values of grams convertgramstopounds(double grams) returns 0 because casted int. similar happens calculatebsa , convertcentimetertoinches methods. if can accept double values 1 can modify code as: public double calculatebsa(double height, double grams) { d

jquery - Accessing the value of a given cell in a tr array -

i getting rows of fiddle http://jsfiddle.net/qupln/3/ like var x = $("tr").map(function(i,j){ return $(j).text(); }); i can access item in array like console.log(x[1]); console.log(x[1]); holds data of row interested in.however value of each cell in console.log(x[1]); how access instance firstname value in x[1]; try this: var x = $("tr").map(function(i,j){ return $(j).text(); }); var firstname = x[1].split("\n")[2]; var lastname = x[1].split("\n")[3];

javascript - jQuery autocomplete and locally fetched json data -

i struggling jquery ui autocomplete , reading autocomplete values variable stores data returned json array. javascript looks like: function populate_branch(){ $.get('/branch/list', {bank_name : $("#select_bank_name").val()}, function(branch_data){ branch_index = branch_data; },"json"); }; for( var = 0; < branch_index.length; i++ ) branch_autocomplete += "" + "\'" + branch_index[i].branch_code + "\'" + "},"; $("#branch_auto_complete").autocomplete({ source: branch_autocomplete }); what happens when try use auto complete textbox console weird, returns this: //localhost:3000/undefined%7b'label':'301105'%7d,%7b'label':'301205'%7…'label':'639625'%7d,%7b'label':'639845'%7d,%7b'label':'639948'%7d,?term=41 404 (not found) any help? this did make work, var branch_ind

angularjs - angular.js boradcast error: $rootScope.broadcast is not a function -

i adding items dynamically array of items , let directive know there new items. inside controller function additem() trying following: settimeout(function(){ $rootscope.broadcast("itemadded"); // tried: $scope.broadcast("itemadded"); isn't working }); problem: i'm getting error: $rootscope.broadcast not function any clues? happy post more code if need more information. its typo : $rootscope.$broadcast(name, args)

jenkins - Selenium Grid2 Print Screen -

i wondering how people have gone getting screenshots selenium grid test. presumably screenshot saved machine selenium node running on, how can common location? ideally want images in work directory in jenkins... the screenshot saved machine machine you're executing tests on, not grid nodes. not using jenkins, using ruby environment. #ruby screenshot driver = selenium::webdriver.for :ie driver.get "https://www.google.com" driver.save_screenshot("./screen.png") the screenshot stored on machine instantiate webdriver instance of webdriver connects selenium grid. believe there environment variable in jenkins allows set stored. have limited knowledge of jenkins though.

android - How to get a TableLayout with 2 columns of equal width -

Image
why doesn't table have equal column widths? here's complete layout: first table, 2 buttons in linearlayout outside of table, divided equally. <?xml version="1.0" encoding="utf-8"?> <scrollview xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content" > <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" > <tablelayout android:layout_width="match_parent" android:layout_height="wrap_content" android:padding="4dp" > <tablerow android:layout_margintop="2dp" android:gravity="center_vertical" >

objective c - finding iteration formula for points arranged in a triangle -

i want arrange sprites @ following points using loop: ccp(240.0, 160.0); ccp(300.0, 120.0); ccp(300.0, 200.0); ccp(360.0, 80.0); ccp(360.0, 160.0); ccp(360.0, 240.0); i trying iteration formula these points using loop. i've been @ while. below visual representation of points. please help. * * * * * * do want this? (its quick, sketch only) assume initial parameters: initpoint (x0, y0) initvector (vx,vy) num of iteration c index = c while index for(j = index, currentpoint = initpoint+(c-index)*(0,2*vy); j;j--, currentpoint += initvector) draw currentpoint index-- basically main idea is, start top right point, , shifts context of drawing initial vector many times, iteration holds (to bottom left corner) , draws points. shifts initial point down along y axis , repeat minus 1 times.

Stored Procedure result to Django Model -

if have model like: class person(models.model): id = models.integerfield() first_name = models.charfield(max_length=50) last_name = models.integerfield() birthday = models.datefield() address = models.charfield(max_length=250) phone = models.timefield() to create person class objects data stored procedure, like: cursor = connection.cursor() cursor.callproc('sp_get_person_by_id', {id:1234}) results = cursor.fetchall() [person(*row) row in results] but "sp_get_person_by_id" returns more fields person class attributes. therefore "shit happens", error happens because there fields don't have attributes map. it's possible map attributes? how can that? thx in advance. cheers. if know order of attributes you're getting stored procedure can pass them model this: cursor = connection.cursor() cursor.callproc('sp_get_person_by_id', {id:1234}) results = cursor.fetchall() result_list = [] r

asp.net mvc 4 - Foundation 4 MVC4 Grid Issue -

some context: foundation 4.0.9 sass & compass(newbie), asp.net mvc 4 device: screen chrome/26.0.1410.64 can reproduce issue in user agents: firefox, chrome, ie windows 7 64-bit i have issue single column appears centred/offset left edge of containing row. expect column flush against row's left edge? <div class="row"> <div class="large-12 columns"> <div style="width: 500px; height: 500px; outline: solid black 1px"> </div> </div> </div> here fiddle http://jsfiddle.net/meanfiddler/awnbp/ i aware foundation includes classes center columns such large-centred although example not apply directly , not see them being applied external stylesheets under chrome dev tools panel. is aware of in-depth tutorials of using foundation 4? cheers remove panel div , should see desired result. panel adds margin and/or padding which, assume, don't want. edit: i'

windows - Condition based file installtion in x64 and x86 machines -

hi how can update installer script condition install following files on x86 , x64 machines. <component id="comp.comp1" guid="*" > <condition><![cdata[versionnt < 602]]></condition> <file id="file1" source="$(dir1)\testfile.dll" /> </component> <component id="comp.comp2" guid="*" > <condition><![cdata[versionnt >= 602]]></condition> <file id="file2" source="$(dir2)\testfile.dll" /> </component> thanks, that code install files fine on x86 x64 machines. note windows installer requires 64-bit package built install 64-bit locations. 32-bit packages install 32-bit locations. unfortunately, 64-bit packages cannot install on 32-bit machines. the end result need 2 packages natively install on 32-bit , 64-bit machines.

php - Console line output redirecting blocks file and prevents to read it -

how redirect output console app (php.exe in case) text file (output.txt in case) without blocking it? php script takes lot of time , need async read output (from httpd->javascript->webpage) nevermind - passthru php function helped me lot :)

source of json in Multiselect jQuery -

i have multiselect of jquery , want source json. took source code autocomplete combobox works, here not work. my code: $(document).ready(function () { var warning = $("#message"); $("select").multiselect({ //selectedtext: function (numchecked, numtotal, checkeditems) { // return numchecked + ' of ' + numtotal + ' checked'; //}, source: function (request, response) { $.getjson('http://' + $("[id$='ip']").val() + "/json/auctocomplete.aspx?city=1&term=" + request.term, function (data) { response(data); }); }, select: function (event, ui) { $("#mfr").textcontent = ui.item.id; }, selectedlist: 5, header: "choose 5", click: function (e) { if ($(this).multiselect("widget").find("input:checke

vb.net - SAP Catching Data with RFC_CALL_TRANSACTION RFC VB -

i become errorcode 1001, sap remote error? i've googled alot didn't find anything. maybe knows whats problem here. im using sap 720. system.runtime.interopservices.comexception (0x000003e9): sap remote function call bei microsoft.visualbasic.compilerservices.latebinding.lateget(object o, type objtype, string name, object[] args, string[] paramnames, boolean[] copyback) bei microsoft.visualbasic.compilerservices.newlatebinding.lateget(object instance, type type, string membername, object[] arguments, string[] argumentnames, type[] typearguments, boolean[] copyback) ... here code: public functionctrl object function login_call() try dim conn object functionctrl = createobject("sap.functions") conn = functionctrl.connection conn.system = xxx conn.applicationserver = xxx conn.systemnumber = xxx conn.client = "xxx" conn.user = xxx conn.passwo

java - Android - Image in TextView via Html.fromHtml? -

i want display image textview in android , thought possible html.fromhtml() . found different tutorials image local resource. possible when have url image? if yes, can give me example? i have solution that. put following code add smiles in text view. private static final factory spannablefactory = spannable.factory .getinstance(); private static final map<pattern, integer> emoticons = new hashmap<pattern, integer>(); static { addpattern(emoticons, ":)", r.drawable.happy); addpattern(emoticons, ":(", r.drawable.sad); addpattern(emoticons, ":d", r.drawable.very_happy); // ...as many pattern want. make sure have images in drawable directory } private static void addpattern(map<pattern, integer> map, string smile, int resource) { map.put(pattern.compile(pattern.quote(smile)), resource); } public static boolean addsmiles(context context, spannable spannable) { boolean haschanges = fals

windows phone 8 - Pager property of StoredContact not found -

i trying extract properties storedcontact-object created in custom contact store. following extract property: storedcontact contact = ... var properties = await contact.getpropertiesasync(); var number = properties[knowncontactproperties.mobiletelephone]; however, number type "pager" not found within knowncontactproperties-class. how pager number storedcontact object? the knowncontactproperties merely provides string constants getting common property names - may case pagers not considered in widespread use provide constant property name. instead, why not @ keys in properties in debugger contact pager, , use instead?

javascript - display date independent of system locale and as per the application language -

my web application supports 2 languages: english & french in date displayed in header of each page. now, happening date displayed per the user system's locale.if end user system locale slovakia date displayed in slovakia.if english displayed in english. no matter in language web application running english or french. because using datestring.tolocalestring() below code: var reg = new regexp("[,]+", "g"); var tableau = thedate.split(reg); var value = new date(tableau[0], (parseint(tableau[1], 10) - 1), tableau[2], tableau[3], tableau[4], tableau[5]); return value.tolocalestring(); where thedate comma separated string contains month, day, year, time(like 10.21,2012,51,50,32 ) now, concern want show date in format in application running. if running in french should displayed in french or if in english should displayed in english. independent of user system's locale. current date format is(in english locale): thursday, april

xml parsing - Interaction between XMLDocument and JQuery .append() -

on 1 of .js files i've noticed weird interaction between 2 elements mention on title. i'm first going provide sample code , after address issue in more detail. var xmlclone = xmlcreatedocfromstring(this.xmltemplate); $(conf.current[currenttab]).find('#' + refid).after($(xmlclone).children()); where definition of xmlcreatedocfromstring is: function xmlcreatedocfromstring(str) { var xmldoc; if ( window.domparser ) { var parser = new domparser(); xmldoc = parser.parsefromstring(str, "text/xml"); } else { xmldoc = new activexobject("microsoft.xmldom"); xmldoc.async = false; xmldoc.loadxml(str); } return xmldoc; } i'm testing on chrome pay attention "if" block in there. the issue is, after first line in first code block, xmlclone have contents of this.xmltemplate, after using ".after()" jquery function (or .before, or .append) xmlclone becomes , empty xmldoc , screwing code. so, need way ap

regex - Javascript removes letters duplicates and sequence in string -

there many posts , have found few solutions there not perfect. 1 of them: "aabbhahahahahahahahahahahasetsetset".replace(/[^\w\s]|(.+)\1+/gi, '$1') the results is: abhahahahahahaset i want result: abhaset how ? .+ greedy . takes as can. half of ha s \1 can match second half. making repetition ungreedy should trick: /[^\w\s]|(.+?)\1+/gi by way, i doesn't change here. to rid of nested repetitions (e.g. transform aabbaabb ab (via aabb or abab )) run replacement multiple times until result not change more. var pattern = /[^\w\s]|(.+?)\1+/g; var output = "aabbaabb"; var input; { input = output; output = input.replace(pattern, "$1"); } while (input != output) i admit naming of output bit awkward first repetition, know... 2 difficult problems in computer science cache invalidation, naming things , off-by-one errors.

perl - Java - Simulate Slowloris HTTP DoS attack -

i need write java code test simulate slowloris http dos attack on web server. i've found perl code that: http://ha.ckers.org/slowloris/ my environment not constant, meaning can't guarantee active-perl installed on machine. there way that? there way use jerl ( https://code.google.com/p/jerl/ ) without active-perl installation (maybe can add needed liberaries java project?)? switch (dosmethod) { case get: while(!stopworking) { for(int i=0;i<per_thread;i++) { if(socks[i].isconnected()) { try { printwriter pw = new printwriter(socks[i].getoutputstream()); pw.println("get / http/1.1"); pw.println("host: " + hp.gethosttext()); pw.println(); pw.flush(); }

ios - Xcode cannot run using the selected device - error corresponding to Xcode version? -

my code working fine till did update of iphone os (it ios 6.1. no longer able deploy on device - gives me error "xcode can not run using selected device". the same issue has appeared in many other stackoverflow questions none of them seem work me. question @ xcode cannot run using selected device , thinking need upgrade xcode. current version = 4.5.2 - not show ios 6.1 deployment target. try latest xcode 4.6.2 meanwhile thought pose question here. thanks! your asumption right : if watch xcode release notes ( http://developer.apple.com/library/ios/#releasenotes/developertools/rn-xcode/index.html ), can see ios sdk 6.1 added xcode 4.6.

c# - What's the difference between `ImmutableSortedSet` and fsharp `Set`? -

bcl has introduced group of immutable collections i wondering what's difference between immutablesortedset , native fsharp set ? seems performance signatures of both similar. saw somewhere sortedset implemented red black tree, guess immutablesortedset same. what internal implementation of fsharp map ? is red black tree claimed here or avl tree found out here? in addition, why msdn documents don't state clear actual data structure library collection? know these implementation details , change. point if don't want bind library data type type of known data structure, should @ least offer summery of methods performance signatures in terms of complexity? i wondering what's difference between immutablesortedset , native fsharp set? they similar. main difference f# set supports fast set theoretic operations (union, intersection , difference). here simple f# program measures performance of common operations: open system.collections.immutable

javascript - Getting "null or not an object" error when validating form -

i'm using this: <script type="text/javascript"> var emailrule = /^[_\w\-]+(\.[\w\-]+)*(\.[\d]{2,3})$/; if (emailrule.test(document.forms[0].email.value)) window.alert("that valid email address"); else window.alert("that not valid email address"); </script> to validate this: <form action=""> <p>email: <input type="text" name="email"/> <input type="submit" value="sign up"/></p> <br> </form> that form form on page , input box form element on page. error: document.forms.0.email null or not object i've tried changing document.forms[0].elements[0].value same type of error. because calling page renders element not exist yet. you need have code wrapped in validation function called onsubmit.

html - jquery appending value to input field -

i'm trying add dynamically 1 input field values jquery. passed value won't appended target. code looks follows //on click popup modal form $(document).on('click', '#form', function(e) { e.preventdefault(); $('<div></div>').load($(this).attr('href')).dialog({ title: $(this).attr('title'), //autoopen: false, modal: true, draggable: true, width:900, position: ['top',50], close: function(event, ui) { $(this).dialog('destroy').remove() } }); //this value should appended 1 of input field, value exists on alert not getting appended $('input#inputprepend cashback').val( $(this).closest('tr').children('td.cashback').text() ); }); notes: //this value picked jquery datatable clicked row $(this).cl

html - How can I resize a background-image to fit my element (without set width) in CSS 2? -

my problem have remain compliant ie 8, no css3 answers do. i know can use background-image property, can't use background-size property, css3 only. i know can resize image , apply it, however, don't know element's size (i don't mind setting height "px" value, use percentages width, body element [nobody likes horizontal scroll-bar!]). i have center text on background-image, tried inserting <img> tag , putting text in span element position: absolute; doubt using left , top properties kind-of "micromanage" positioning prove same in browsers, screen sizes, , screen resolutions (please, correct me, if i'm wrong, public site, , has same everybody). having been said, not opposed using approach if can assured using positioning same, regardless of user's personal browser, screen, or resolution choices. is there way handle without relying solely on css3? i don't think there reason post markup or css, let me know if , i'l

deployment - WebService management -

i have few web-services parts of 1 application. built jenkins , builds stored in folders. run them starting few ssh sessions, doing lot of scp's, , run each nohup ./start -dport=.. & it ok until application. there five. , each deploy hell. so, there software automate this? want copy few files on ssh, run few bash scripts, monitor service activity , expose on web-ui. possible create myself, don't want reinvent bicycle. kwatee (i'm developer) free tool that. have web ui configure , operate deployment on number of servers. can automate whole process in continuous build environment via ant/maven plugins or python shell commands.

backbone.js - My JavaScript code throws a SyntaxError (Unexpected token <) -

any 1 me find our issue, going on code.. i getting error : uncaught syntaxerror: unexpected token < my code here : $(function() { var userdetails=[ {firstname:'lakshmi', lastname:'narayanan',age:32}, {firstname:'harish', lastname:'manickam',age:28}, {firstname:'madan', lastname:'gopal',age:27} ] var usermodel = backbone.model.extend({ defaults:{ firstname:"", lastname:"", age:"" } }); var userlist = backbone.collection.extend({ model:usermodel }); var userview = backbone.view.extend({ tagname:"tr", classname:"userlist", template: $("#listtempalate").html(), render:function(){ var temp = _.template(this.template); this.$el.html(temp(this.model.tojson())); return this; } })

mysql - Strange logic in SQL Query -

i have strange case building mysql query: here is. i need sort results based on first_name , last_name my expected result using concat(first_name, last_name) in order by but restricted not use concat in order by. there way can build query raw sql : select concat(first_name, last_name) users order concat(first_name, last_name) cases: first_name can empty example first name last name b b c d now need sort order ab b cd try this: select full_name ( select concat(first_name, last_name) full_name users ) tmp order full_name

github - Working with team in Git -

i working in team on git project , don't understand process should following. i clone project working on github i checkout develop branch work i git add .; git commit -a add new files but working of other team players added new files git gives me error on git push . what command should run right before push see if changed anything? i believe looking git pull . this command perform git fetch changes made colleagues. try perform git merge merge changes onto local working tree. if merge not successful need resolve conflicts. then able perform git push , colleagues need pull changes before push. p.s. if have trouble using process use visual git client github, tower, smartgit or others.

c# - Trying to insert DateTime.Now into Date/Time field gives "Data type mismatch" error -

if try write datetime record in ms-access database easy way, this cmd.commandtext = "insert [table] ([date]) values (?)"; cmd.parameters.addwithvalue("?", datetime.now); i exception saying "data type mismatch in criteria expression." can tell me why? goes wrong here? after little experimentation, found can make work if write oledbparameter parm = new oledbparameter("?", oledbtype.date); parm.value = datetime.now; cmd.parameters.add(parm); but doing seems less neat, less straightforward. why necessary? overlooking simple? the problem of mismatch in criteria expression due oledbtype assigned parameter used represent datetime.now value when call addwithvalue . the oledbtype choosen addwithvalue dbtimestamp , access wants oledbtype.date . http://support.microsoft.com/kb/320435 searching on net have found intersting tip. core problem lies in oledbparameter cannot handle milliseconds part of datetime.now. forcing oledbty

eclipse - How to solve "Plugin execution not covered by lifecycle configuration" for Spring Data Maven Builds -

i trying work spring data , neo4j . started trying follow this guide linked main site. in particular based pom.xml off of "hello, world!" example file . here snip pom.xml plugin causing issues... <plugin> <!-- required resolve aspectj-enhanced class features --> <groupid>org.codehaus.mojo</groupid> <artifactid>aspectj-maven-plugin</artifactid> <version>1.0</version> <configuration> <outxml>true</outxml> <aspectlibraries> <aspectlibrary> <groupid>org.springframework</groupid> <artifactid>spring-aspects</artifactid> </aspectlibrary> <aspectlibrary> <groupid>org.springframework.data</groupid> <artifactid>spring-data-neo4j</artifactid> </aspectlibrary> </aspectlibraries>