Posts

Showing posts from May, 2011

android - Launch a Dialog Fragment on button click from a custom base adapter>getView [IMG INCLUDED] -

Image
alright have list(which fragment dialog) displays users friends , each item in list has button(labeled friends in picture) , when users click button id display fragment dialog displays options interacting user(friend request, block, send private message ect...) problem button , onclick listener implemented via overriding listview adapters getview method , create fragmentdialog requires access fragment manager. there way make work? edit: cannot post actual code project , ive attached simplified base adapter w. onclicklistener should make clear im trying . cannot access fragmentmanager base adapter class make dialog fragment possible lazyadapter.java package com.example.androidhive; import java.util.arraylist; import java.util.hashmap; import android.app.activity; import android.content.context; import android.view.layoutinflater; import android.view.view; import android.view.viewgroup; import android.widget.baseadapter; import android.widget.imageview; import android.widget.te...

PHP String Replacement Not Working Properly -

here php code, $string = 'https://www.mydomain.lk/'; $wordlist = array("http://", "www.", "https://", "/"); foreach ($wordlist &$word) { $word = '/\b' . preg_quote($word, '/') . '\b/'; } echo $string2 = preg_replace($wordlist, '', $string); i want remove last "/" $string. add "/" $wordlist array, not working. can me fix this. thanks. you want replace / @ end of string, need $ , /$ , preg_quote end escaping $ . the best way remove trailing / using rtrim, sudhir suggested. alternatively remove preg_quote loop , use regular expressions in $wordlist : $string = 'https://www.mydomain.lk/'; $wordlist = array("#https?://#", "#www\.#", "#/$#"); echo $string2 = preg_replace($wordlist, '', $string);

facebook - Not able to submit open graph stories -

i'm new facebook open graph , graph api. have created story custom action , objects. able test testers , test users. works. story seen others , told submit review. in review status,it shows action story . can see preview submit button disabled. says- "you, or app's open graph test user,must have published action before being able submit review"

java - Invalid App Id:facebook app Id -

i have been trying create application in android sharing content facebook.but whenever try login facebook through login button in application....it shows me invalid app id:facebook app id .i goggled lot these , found link https://developers.facebook.com/docs/android/getting-started/facebook-sdk-for-android/ register our application in facebook,before run on emulator.even after following above link , registering application in facebook,am getting same error..plz me..

c++ - how to sort vector with multi data? -

i have such vector: struct statfaces { std::string facename_1; std::string facename_2; float percentageperson ; }; std::vector<statfaces> listfaces_; and want sort vector. want sort group. example.. i have facename_1 = john , facename_2 = kate , percentageperson = %90 facename_1 = john , facename_2 = nastia , percentageperson = %95 facename_1 = bill , facename_2 = jamie , percentageperson = %91 facename_1 = bill , facename_2 = anna , percentageperson = %72 output should ; facename_1 = bill , facename_2 = jamie, percentageperson = %91 facename_1 = bill , facename_2 = anna , percentageperson = %72 facename_1 = john , facename_2 = nastia , percentageperson = %95 facename_1 = john , facename_2 = kate , percentageperson = %90 sort algorithm must group firstname_1 , sort according percentageperson ps: not @ c++ you can pass custom comparison function std::sort . trivially implementable using std::tie : #include <tuple...

ios - UISwitch in a UITableView cell in editing mode -

i followed uiswitch in uitableview cell put uiswitch inside tableview. here code: uiswitch *myswitch = [[uiswitch alloc] init]; cell.accessoryview = myswitch; but problem when put table editing mode: self.tableview.editing = yes; the uiswitch dissapears. do know how can go around issue? add uiswitch contentview of cell. the contentview of uitableviewcell object default superview content displayed cell. if want customize cells adding additional views, should add them contentview positioned appropriately cell transitions , out of editing mode. [[cell contentview] addsubview:switch];

java - Transfering Base64 String over Http REST service with JSON response -

i have webservice returnds json response , json response contains both plain text , base64 encoded images , consuming service using android app implemented progress bar indicate progress . implementing progress bar forces me use bufferedinputstream read response , update progress based on app reading . the problem working fine , progress updating correctly, after collecting response , exiting while loop , try convert string json format using jsonobject. here code snippet bufferedinputstream bis = new bufferedinputstream(responseentity.getcontent()); stringbuilder sb = new stringbuilder(); string line = null; int total = 0 ; int count = 0 ; byte[] buffer = new byte[4096]; stringbuffer sbuffer = new stringbuffer(); stringwriter sw = new stringwriter(); string content = new string(); while((count = bis.read(buffer)) > 0){ content += new string(buffer,ch...

javascript - Clear a property of element with jquery -

i'm designing basic form. have input text , button. when click button, if "input text" has no text inside, "x" icon appears inside in "input text". i'm putting icon jquery. dont know how remove it. want clear icon when user clicks inside input text. here's jquery code. $('#lbl1').click(function () { if ($("#fill").val().length==0) { $("#fill").css({ background: "url(image/cikis.png) no-repeat right"}); } }); $('#fill').click(function () { //some codes here }); here html lines: <label id="lbl1">tıklama </label> <input type="text" id="fill" /> $("#fill").click(function() { $(this).css("background-image", "none"); });

spring - Error while getting JSON when data has spaces -

i facing issue while fetching json data when data has white spaces . i using spring, in spring controller doing below, string json=new gson().tojson(agents, new typetoken>() { }.gettype()) i able see proper json in logger too, after setting model attribute below one model.addattribute("json",json); here model 'org.springframework.ui.modelmap' in jsp able fetching data till no space found. example : original json string: ilove java fetching string in jsp: ilove only please me out out using encoding string.

mysqldump - How to take a backup of year specific records from mysql table to a file? -

how take backup of last year records mysql table file? this should work mysqldump --databases x --tables y --where="1 limit 1000000" or mysql cli mysql -e "select * mytable" -u myuser -pxxxxxxxxx mydatabase > mydumpfile.txt reference mysql dump query

How to add event to an image when insert it from link in javascript? -

first, have image exist in html, add dblclick event toggle class in windown.onload , work ok. //html <button onclick="insertimageimagefromlink('../pic02.png')" > add new image </button> <div contenteditable="true"> <img src="../pic01.png" /> </div> //css button{ width: 100px; height: 50px; } img { border:5px solid white; } .ontap-2{border-color:green;} //javascript function toggleclass(elem, name) { if (elem.classname.indexof(name) < 0) { elem.classname += ' '+name; } else { elem.classname = elem.classname.split(name).join(''); } } function clearselection() { var selection = window.getselection ? window.getselection() : document.getselection ? document.getselection() : document.selection; if (selection && selection.removeallranges) { // w3c-style selection.removeallranges(); } else if (...

RTMFP and peer-to-peer ports/firewalls -

trying implement rtmfp video/audio conferencing app. the developers have cited issue: rtmfp , firewall/nat traversal options we have openrtmfp (cumulus) server , running. have sat inside or outside company network (outside "cloud" service, inside "local instance" service). firewall/nat issue looks show stopper. has on come ? if you're looking answer "it possible use rtmfp inside company network", yes, possible. little bit complicated, possible. we set turn server allow flash clients communicate outside world (contacting adobe's servers or other peers). server must have access internet, of course. that's not : udp should allowed inside lan , between desktop pc , turn server (mostly firewalls rules). no need precise port since can't know port used. finally : telling flash client use our rtmfp turn server. should write line in mms.cfg file on windows 7 : rtmfpturnproxy = your.turn.server.org you can create .bat f...

java - How to load application context from string in Spring 2.5? -

as title says, want load beans string. this approach works in spring 3 because genericxmlapplicationcontext unavailable in version 2.5. use approach outlined here . 1 additional step, pass defaultlistablebeanfactory genericapplicationcontext (this 1 has been around since spring 1.1 , genericxmlapplicationcontext convenience class doing more or less same in blog post). so should work string content = ... genericapplicationcontext ctx = new genericapplicationcontext(); xmlbeandefinitionreader reader = new xmlbeandefinitionreader(ctx); reader.loadbeandefinitions(new bytearrayresource(content.getbytes())); ctx.refresh(); the applicationcontext should ready use.

html - CSS can't select classes/id's with numbers in it? -

i ran problem. i gave div other divs in class named center , 400-width. means div has centered , have width of 400. <div class="center 400-width" id="position"> <div class="" id="header"> header </div> <div class="" id="content"> content </div> <div class="" id="footer"> footer </div> </div> the css selects class 400-width means container gets width of 400px. , background-color checking if it's true. .400-width{ width:400px; background-color:blue; color:white; } it doesn't happen right can see: http://jsfiddle.net/gekkeabt/xqje4/1/ i solved problem replacing 400- four. becomes fourwidth but question is. why can't use numbers in css , there way of doing job? thanks! i have faced same problem.... not problem anyway.. instead of '.400-width' use '.width-400'

iphone - Selecting a specific row in UITableview -

i have address book in app. in that, there tableview , contact details page(refer screenshot). when add new contact, added contact details displayed in contact detail page how make added contact selected in tableview..? note: contacts sorted in alphabetical order in tableview.. if adding recent array in end of tableview if (indexpath.row==[yourcontactary count]-1) { [tableview selectrowatindexpath:indexpath animated:no scrollposition:uitableviewscrollpositionnone]; } or if adding in tableview index of array indexpath applycode, like. nsinteger indexofarry=[yourcontactary indexofobjectidenticalto:yourrecentaddedrecord]; nsindexpath *indexpath=[nsindexpath indexpathforrow:indexofarry insection:section];

mysql - sql join query issue with three table -

i new mysql.here structure of db table.*how can join 3 table give results fourth table? table product id name category user_id 1 abc 2 1 2 syz 3 1 table categories id name 1 aaa 2 bbb 3 ccc table product_image id image product_id 1 abc.jpg 1 2 xyz.jpg 1 forth table result looks like id name category_name image 1 abc aaa xyz.jpg please me solve this. tried not getting correct result. select product. * , categories.name cat_name, product_image.image product_image `product` inner join categories on categories.id = product.category , `user_id`='1' inner join `product_image` on product_image.product_id = product.id order rand( ) limit 1 editing part we need 1 image product_image associated multiple image in according product_id try one select p.id, p.name , c.name category_name,...

shell - Wait for all jobs of a user to finish before submitting subsequent jobs to a PBS cluster -

i trying adjust bash scripts make them run on ( pbs ) cluster. the individual tasks performed several script thats started main script. far main scripts starts multiple scripts in background (by appending & ) making them run in parallel on 1 multi core machine. want substitute these calls qsub s distribute load accross cluster nodes. however, jobs depend on others finished before can start. far, achieved wait statements in main script. best way using grid engine? i found this question -w after:jobid[:jobid...] documentation in qsub man page hope there better way. talking several thousend jobs run in parallel first , set of same size run simultatiously after last 1 of these finished. mean had queue lot of jobs depending on lot of jobs. i bring down using dummy job in between, doing nothing depending on first group of jobs, on second group depend. decrease number of dependencies millions thousands still: feeles wrong , not sure if such long command line accepted shell...

MySQL JOIN Tables with referenced Columns -

i try most(30) ordered products db. in table order have column type values (1 or -1). 1 valid user order, -1 cancellation order(in case order has reference id user order) reference_id id of order (in same order table)| 1 row referenced row. order table: id | reference_id | type ---------------------------------- 1 | | 1 ---------------------------------- 2 | | 1 ---------------------------------- 3 | 1 | -1 ---------------------------------- products table: id | order_id | quantity ---------------------------------- | 1 | 4 ---------------------------------- b | 2 | 7 ---------------------------------- | 3 | 2 ---------------------------------- mysql query: select *, sum(product.quantity) quantity, count(*) score product left join order on ( product.order_id=order.id ) (..?..) group product.id order score desc limit 30; this select, sum , count ...

iphone - UIActionSheet button is not working -

i have uiactionsheet. displays title array. when click button nothing happen. used nslog also. it's not displaying anything. button title displaying array. click not working code: actionsheet: tsactionsheet *actionsheet = [[tsactionsheet alloc] initwithtitle:@"design"]; (int = 0; i<[catearray count]; i++ ) { [actionsheet addbuttonwithtitle:[catearray objectatindex:i] block:^{ }]; } button click: -(void)actionsheet:(uiactionsheet *)actionsheet clickedbuttonatindex:(nsinteger)buttonindex { if (buttonindex == 0) { nslog(@"button"); } else if (buttonindex == 1) { nslog(@"button 1"); } else if (buttonindex == 2) { nslog(@"button 2"); } else if (buttonindex == 3) { } } array: if (sqlite3_open([path utf8string], &database) == sqlite_ok) { const char *sql = "select id,cat_name categories"...

mongodb - Sorting in distinct data -

on calling db.distinct() method return data in ascending order sorted. way can data sorted in descending order? the distinct command returns javascript array, can sort , reverse it: var array = db.coll.distinct("{field_name}") array.sort() array.reverse() if using java driver, can such as: list list = coll.distinct("{field_name}"); collections.sort(list); collections.reverse(list);

osx - How to make "php" link to php5.5 on Mac (already created symlink on /usr/local/bin/php)? -

i installed php version 5.5 through homebrew , want php on command line refer new version. in /usr/local/bin ran ls -l , saw line: lrwxr-xr-x 1 myself admin 37 aug 26 13:06 php -> /usr/local/cellar/php55/5.5.1/bin/php but php -v tells me have php 5.3.15 does know need have point version 5.5.x? ==update== turned out symlink broken somehow, made brew fix , works charm! excuse me confusion! it turned out symlink broken somehow, made brew fix , works charm! excuse me confusion!

c# - site will not redirect to custome page and throw 404 error in asp.net site -

i don't know question asked or not. stuck in 1 problem. i have 1 cms application in page static , dynamic. when access url using http://abc.com/abc.aspx now in case if abc.aspx cms page redirect me page if not cms page redirect me custom page http://abc.com/page-not-found.aspx now question if write http://abc.com/abc didn't redirect me http://abc.com/page-not-found.aspx throw me error 404 page or directory not found. now have check 2 things 1) if custome page not there display http://abc.com/page-not-found.aspx 2) when http://abc.com/page redirect me http://abc.com/page-not-found.aspx please me our this. work fine in local problem in live environment. thanks in advance. regards ab vyas you may need handlers in web.config . http://msdn.microsoft.com/en-us/library/46c5ddfy(v=vs.100).aspx

How to extract a number into digits using R? -

suppose have number: 4321 and want extract digits: 4, 3, 2, 1 how do this? alternatively, strsplit : x <- as.character(4321) as.numeric(unlist(strsplit(x, ""))) [1] 4 3 2 1

sql server - Displaying multiple values from same column in one row in SQL -

i'm working on stored procedure, extend 1 function here on job. @ moment have problem in displaying multiple values same column in 1 row, , have differed , presented 25,26,27 so i've been trying. declare @myvariable varhcar(200) null) select @myvariable = coalesce(@myvariable + '','','') + stringvalue table column1 = somevariable , issue = column2 select @headtext = 'name' + convert(varchar, @myvariable) before in sp create table, displays other data. want sp create rows data aswell. still got troubles not sure have this, first timer kind of sp. your code should like: declare @myvariable varhcar(200); select @myvariable = coalesce(@myvariable + ',', '') + stringvalue table column1 = somevariable , issue = column2; select @headtext = 'name' + @myvariable; another way concatenate variables is: select @myvariable = stuff((select ',' + stringvalue table ...

c# - Tcl Channel in GUI Application -

im trying embedded tcl interpreter c# gui application, , works fine, attachingnewfunction tclcommand. 1 thing hard me, want redirect stdout, stdin, stderr textbox'es. im working c++, becouse easier debug , compile. using code tcl_channel stdout = tcl_getstdchannel(tcl_stdout); tcl_unregisterchannel(interp,stdout); tcl_channel mystdout = tcl_createchannel(typeptr, "stdout", null, tcl_readable | tcl_writable); tcl_registerchannel(interp, mystdout); tcl_setstdchannel(mystdout, tcl_stdout); to register new stdout, typeptr like typeptr->typename = "stdout"; typeptr->version = tcl_channel_version_2; typeptr->gethandleproc = tcl_mydrivergethandleproc; typeptr->inputproc = tcl_mydriverinputproc; typeptr->outputproc = tcl_mydriveroutputproc; typeptr->flushproc = tcl_mydriverflushproc; typeptr->watchproc = tcl_mydriverwatchproc; typeptr->closeproc = tcl_mydrivercloseproc; typeptr->blockmodeproc = tcl_mydriverblockmodeproc; typep...

Squid proxy MySQL authentication config -

i'm wondering know how configure squid server mysql authentication. i've found config example following: auth_param basic program /usr/local/squid/libexec/squid_db_auth --user dbusername --password dbuserpassword --plaintext --persist auth_param basic children 5 auth_param basic realm web-proxy auth_param basic credentialsttl 1 minute auth_param basic casesensitive off http://linuxpoison.blogspot.com/2010/08/configuring-squid-server-to.html and tested on localhost. worked well. in case, mysql server located on server. so, need specify "hostname" , "port" of mysql server. can ? thanks in advance. as per code make changes in squid_db_auth example below, my $dsn = "dbi:mysql:database=yourdbname;host=remotemysqlserverip"; add above line `squid_db_auth?. have tested same squid 3.1.10.

asp.net - Validate RadioButton List Using Javascript and CustomValidator -

i using customvalidator radiobuttonlist,instead of requiredfieldvalidator, can assign css class using javascript.the validation check @ least 1 of items selected. foll. code not working: js: function validateradiobuttonlist() { var target = document.getelementbyid('<%=rbgender.clientid %>'); var radiobuttons = target.getelementsbytagname('input'); var is_valid; if (radiobuttons[0].checked || radiobuttons[1].checked) { is_valid = true; target.classname = ""; } else { target.classname = "validate"; is_valid = false; } args.isvalid = is_valid; } aspx: <asp:radiobuttonlist id="rbgender" runat="server" repeatdirection="horizontal" repeatlayout="flow" autopostback="false"> <asp:listitem...

php - I got an error in my magento test automation framework -

i try run magento test automation framework net beans, got error php warning: require_once(symfonycomponents/yaml/sfyaml.php): failed open stream: no such file or directory in c:\programs\mtaf\framework\mage\selenium\helper\file.php on line 29 php fatal error: require_once(): failed opening required 'symfonycomponents/yaml/sfyaml.php' (include_path='c:\programs\mtaf\framework;c:\programs\mtaf\testsuite;.;c:\programs\php\pear') in c:\programs\mtaf\framework\mage\selenium\helper\file.php on line 29 but pear components , unit components installed successfully. the below commands used install pear , php unit. c:\programs\php>pear upgrade c:\programs\php>pear channel-discover pear.phpunit.de c:\programs\php>pear channel-discover pear.symfony-project.com c:\programs\php>pear channel-discover components.ez.no c:\programs\php>pear install phpunit/phpunit c:\programs\php>pear install phpunit/phpunit_selenium c:\programs\php>pear install phpunit...

java - Difference between calling stop from applet menu and restart in appletviewer -

have animation program using threads , applet. when call stop option applet menu in appletviewer program works when press restart there abnormality in working. thread not come out of while loop on calling restart @ line no.34 class saver { . . public void run() { system.out.println("run "+thread.currentthread().getname()); func(); system.out.println("out of synchronized block"); } synchronized public void func() { int i; while(running) { for(i=0;i<4;i++) { gap[i]+=10; if(gap[i]==360) gap[i]=0; system.out.println(thread.currentthread().getname()); calc(gap[i],400,i%2==0?(byte)1:(byte)-1); yb[i]=(int)(y)+yc; xb[i]=(int)(x)+xc; } repaint(); try { thread.sleep(1000); } ...

php - How to get the specific <td> while scraping a web page table using a DOM? -

i've table , of number of columns can change depending on configuration of scrapped page (i have no control of it). want information specific column, designated columns heading. sample table: <table> <tr> <td>name</td> <td>age</td> <td>marks</td> </tr> <tr> <td>a</td> <td>20</td> <td>90</td> </tr> <tr> <td>b</td> <td>21</td> <td>80</td> </tr> <tr> <td>c</td> <td>22</td> <td>70</td> </tr> </table> my working php code display columns: foreach($html->find("table#table2 tr td") $td) { $code = $td; echo $code; } needed code format: foreach($html->find('table#table2 td') $td) { /* td1 data */ /* code1 store td dat...

asp.net - How to hide show the div on usercontrol using javascript -

i have develop functionality que , rply have create user contol per requirment fallow , have add div text box rely , submit button on user control , keep div disply style none , call javascript on reply link shows div. <%@ control language="c#" autoeventwireup="true" codebehind="suppreview.ascx.cs" inherits="laafoodwebapp.suppreview" %> <div> <table style="width:100%;"> <tr> <td rowspan="2" style="width: 15%; vertical-align: top;"> <asp:label id="lblmsgtype" runat="server"></asp:label> <br /> <asp:label id="lblmsgid" runat="server"></asp:label> </td> <td style="width: 70%; vertical-align: top;"> <asp:label id="lblmsgtbody" runat="server"></asp:label...

Android Google Map Polygon click event -

this question has answer here: polygon touch detection google map api v2 6 answers i working on map application on android , using google maps android api v2. polygon data web service, convert xml parse , can show on map without problem. isn't there way open pop-up when user touches on polygon? or maybe if user wants change coordinates of selected polygon. saw many examples, done javascript or using different third party. has advice? in advance. i had same problem. onmapclicklistener not called when user taps polygon, it's called when other overlays (such polygons) not process tap event. polygon process it, can see - gm moves polygon center of screen. , event not passed onmapclicklistener, that's it. workaround it, intercept tap events before gm handles them, in view wrapping mapfragment, described here , project clicked point screen coordinates ...

multithreading - How does notify work in Java threads? -

i new using threads in java . have simple reader writer problem when writer comes in on thread, reader wait writer complete. however, when run program, find thread doesn't notified? why this? my code below: public class readerwriter { object o = new object(); volatile boolean writing; thread readerthread = new thread( "reader") { public void run() { while(true) { system.out.println("reader starts"); if(writing) { synchronized (o) { try { o.wait(); system.out.println("awaked wait"); } catch (interruptedexception e) { e.printstacktrace(); } } } system.out.println( "reader thread working "+o.hashcode()); } } }; thread writerthread = new thread("writer" ) { public void run() { system.out.p...

Escaping xml tag in XSLT -

i have input xml, say: <myxml> <myelement id="1" /> <myelement id="2" /> <myelement id="3" /> </myxml> i want create xslt creates output xml of different form, say: <theirxml> <theirelement id="1" /> <theirelement id="2" /> <theirelement id="3" /> </theirxml> since cannot create xslt tag inside tag (e.g. "<theirelement id="<xslt:...>" >" found way cdata follows (presented relevant part of xslt): <xsl:for-each select="myxml/myelement"> <xsl:text><![cdata[<theirelement id="]]></xsl:text><xsl:value-of select="@name" /><xsl:text><![cdata[" />]]></xsl:text> </xsl:for-each> however produced output not contain "<theirelement ..." rather "&lt;theirelement ...". need output contain ...

CSS styling for Mono C# -

i develop c# mono launcher via xamarin studio. there way use css style of ui components? found this: gtkcssprovider , looks c++. maybe there other way use css or other style methods ui components. every help. greetings chryb i think pixate tries this. https://github.com/pixate/monotouch-pixate no idea how though.

unable to access SharePoint 2010 website from local -

i have installed sharepoint foundation 2010 in ms server 2008 operating system , able access central administration website local system. i'm when i'm trying access 1 of website created on central administration not working local system, website accessible server. it seems nothing happening local or seem have don't have access created website local, why have central administration website access. please provide information why i'm not able use other website local system. many in advance. finally fixed issue..it more firewall issue. normal firewall doesn't allow incoming port less 1023. these port numbers used server internally.. have create inbound rule port number 90 , allowed connections.

c# - GridView.SelectedIndexChanged doesn't fire -

hello have gridview connected event selectedindexchanged , on hidden panel when try fire event don't anything. code of gridview: <asp:gridview id="gridview1" runat="server" cssclass="mgrid" width="847px" onselectedindexchanged="gridview1_selectedindexchanged2"> <columns> <asp:buttonfield text="borrar" /> </columns> </asp:gridview> this code on event: protected void gridview1_selectedindexchanged2(object sender, eventargs e) { gridviewrow row = gridview1.selectedrow; response.write(row.cells[2].text); } that's because button isn't selectbutton , 1 approach set autogeneratesselectbutton property on gridview true . rid of other button you're trying make work. if need other button you'll need make commandfield , set showselectbutton true. configurat...

zend framework - Getting row data from Ingot_JQuery_JqGrid -

i'm using ingot_jquery_jqgrid in zend project. know how edit data double click, have no idea how extract data selected row. thanks ok, our fix problem sending parameter through ajax request: function sendrowid(rowid,status) { var mydata = "row=" + rowid; $.ajax({ url: "<?php echo $this->url( array ('module' => 'gmarim', 'controller' => 'student', 'action' => 'select'), null, false, true );?>", data : mydata, type: 'post', success: function(d,s,x){ }, async: false }); }

android - Notifications being erased if I get a new one from myself -

i have below class gets called whenever receive push notification. (works wherever though). issue that, if send notification device mobile (lets iphone) getting notification , stays in notification bar. if not touch it, , send one, 1 arrive , 2 icons appear in notification bar, however, moment send notification own mobile myself, current notifications in bar disappear , replaced mine. when send new one, additional icon not appear, rather old 1 gets updated. how can make each notification appear in notification bar ? (because each 1 has unique id sent via intent specific thing upon opening of designated activity) private void sendnotification(string data, string id, context ctx) { mnotificationmanager = (notificationmanager) ctx.getsystemservice(context.notification_service); intent myintent = new intent(ctx, myactiviy.class); myintent.putextra("data", data); myintent.putextra("id", id); pendingintent contentintent = pendingintent.getactivity(ctx, 0, myinte...

php - socket_sendto(): unable to write to socket [1]: Operation not permitted -

i trying send udp packet dedicated ip server. called provider , able have udp ports 7812 , 50000 opened on firewall incoming , outgoing data. here script: <?php $msg = "220055"; //$msg = pack("h*" , "220055"); $len = strlen($msg); print($msg); print($len); $error = socket_last_error(); echo socket_strerror($error); $sock = socket_create(af_inet, sock_dgram, sol_udp); socket_set_option($sock, sol_socket, so_broadcast, 1); socket_sendto($sock, $msg, $len, 0, '70.92.255.81', 7812); socket_close($sock); phpinfo(); ?> when run $error = socket_last_error(); echo socket_strerror($error); , success message, when check error log, see: php warning: socket_sendto(): unable write socket [1]: operation not permitted in /my webserver/phpfile.php on line 20. i have listener set on endpoint , able send packet through phone using app same port , ip address. what error , how fix it?

authorization - Connecting TeamCity to TFS -

this question has answer here: connect teamcity visual studio online 3 answers i'm struggling trying connect teamcity project tfs project. tried bunch of stuff, same error: tfs failed. exitcode: 111, command: c:\teamcity\webapps\root\web-inf\plugins\tfs\bin\tfs-native.exe @@c:\teamcity\temp\tc-tfs-25-7939_109\command.params, in file: {https://budiedimas.visualstudio.com/defaultcollection/testeteamcity, /hash:s, /noproxy, c:\teamcity\temp\tc-tfs-25-7939_108.result, connectiontest, $/testeteamcity/testeteamcity}, completed in: 1 second(s) stdout: tfs native verifier v8.0 copyright (c) 2006-2013 jetbrains s.r.o. running under .net framework 4.0.30319.18052 info - info - use team explorer 2012 info - tfs native accessor v8.0 copyright (c) 2006-2013 jetbrains s.r.o. info - connecting server https://budiedimas.visualstudio.com/defaultcollection/testeteamcity in...

python - List stored in variable converted to dictionaries -

i using following perform wmi query on windows endpoint returns results in list. want convert list dictionary key:value can search keys "name" name return: "aspnet" "guest" "admin". import wmi_client_wrapper wmi wmic = wmi.wmiclientwrapper( username="corp.testdomain.com/administrator", password="fakepassword", host="192.168.1.100", ) output = wmic.query("select * win32_useraccount localaccount = true") {'status': 'ok', 'domain': 'localhost', 'description': 'account used running asp.net worker process (aspnet_wp.exe )', 'installdate': none, 'caption': 'localhost\\aspnet', 'disabled': false, 'passwordchangeable': false, 'lockout': false, 'accounttype': '512', 'sid': '45474748484848-1002', 'localaccount': true, 'fullname...

django - Python DateTime Format Error -

i new @ python. trying play time , date objects. wrote simple test program parse string specific time format. throwing valueerror . can please me out here? here code: import time testdate = "tuesday, febuary 23 2011 12:00:00 utc" today = time.strptime(testdate,"%a, %b %d %y %h:%m:%s %z") print today and error: traceback (most recent call last): file "d:\python\pythontest\src\helloworld.py", line 3, in <module> today = time.strptime(testdate,"%a, %b %d %y %h:%m:%s %z") file "c:\python27\lib\_strptime.py", line 467, in _strptime_time return _strptime(data_string, format)[0] file "c:\python27\lib\_strptime.py", line 325, in _strptime (data_string, format)) valueerror: time data 'tuesday, febuary 23 2011 12:00:00 utc' not match format '%a, %b %d %y %h:%m:%s %z' you had february misspelled. code works. import time testdate = "tuesday, february 23 2011 12:00:00 utc...

iframe - What happens when removing an object used by a ngRepeat in AngularJS? -

edit: jsfiddle example here. i have ngrepeat spawns directives containing iframes . div(ng-repeat='element in elements') ng-switch(on="element.type") a-directive(ng-switch-when="something") another-directive(ng-switch-when="somethingelse") now, inside directive loading content iframe after event, doing: $iframe[0].contentwindow.d_contents = "html" $iframe[0].src = 'javascript:window["d_contents"]' everything works nicely. when remove 1 of these elements model (in controller) like: elements.remove(object) //using sugarjs, that's not issue, same behaviour splice the ui gets updated accordingly, i.e. element disappear. the problem this works expected: elements.push(ele1) elements.push(ele2) .. init iframes inside ele1 , ele2 content .. elements.remove(ele2) result: ele2 disappears ui, ele1 still there iframe loaded this not: elements.push(ele1) elements.push(el...

html - Box model only apply when container have a padding or a border? -

Image
take @ 2 links: http://jsfiddle.net/carloscalla/n8q27/10/ html: <!doctype html> <body> <div id="container"> <h1>title</h1> <h2>subtitle</h2> </div> <div id="container2"> <p>hola</p> </div> </body> css: h1 { background-color: green; } h2 { background-color: blue; } #container { background-color: yellow; border: solid black 2px; } #container2 { background-color: orange; border: solid blue 2px; } rendered: http://jsfiddle.net/carloscalla/n8q27/11/ html: <!doctype html> <body> <div id="container"> <h1>title</h1> <h2>subtitle</h2> </div> <div id="container2"> <p>hola</p> </div> </body> css: h1 { background-color: green; } h2 { background-color: blu...

database - Android best way to retrieve images and view them from external source -

i'm going making wallpaper app need guidance on how going able store, retrieve , view wallpapers. will need make use of imageview able display images? i'm going need sort of database/website store of wallpapers on. best thing do, use database or website? how go retrieving wallpapers chosen source? any help/advice appreciated, thanks. a common practice use rss feed of images. then, hook app rss feed , have check updates periodically. here reference on reading xml (rss) in android: http://www.ibm.com/developerworks/opensource/library/x-android/index.html good luck.

ios - disclosure indicator moves cell subviews -

i have table cells using disclosure indicator , not. obviously disclosure indicator scrunches contents not of cells line in perfect columns. how can adjust contents stay in same location regardless of there being disclosure indicator or not? one trick solve issue create empty view , use cell's accessoryview . cells don't have detail disclosure. the trick setting size of view properly. little trial , error should it. in cellforrowatindexpath:... method: uitableviewcell *cell = ... // cell if (/* there no detail disclosure */) { // try different "width" value view desired results uiview *view = [[uiview alloc] initwithframe:cgrectmake(0, 0, 10, 40)]; cell.accessoryview = view; }

javascript - jQuery addClass() / removeClass() not working -

<ul> <li class="selected"></li> <li></li> <li></li> </ul> that html. , selectors using right are: $("ul li:eq(0)").removeclass('selected'); $("ul li:eq(1)").addclass('selected'); problem can not add or remove 'selected' class these elements. html , jquery both pretty straight-forward , many examples find did same way, including official jquery docs. (the script loaded before body tag, if matters) why can't remove , add classes this? the entire html page here probably because forgot add $(document).ready() ,also make sure added jquery.min.js file $(document).ready( function () { $("ul li:eq(0)").removeclass('selected'); $("ul li:eq(1)").addclass('selected'); });

ssh - Permission denied (publickey,keyboard-interactive) in planetlab -

i uploaded public key , tried ssh 1 of site nodes. each time getting permission denied. log information attached. openssh_6.1p1 debian-4, openssl 1.0.1c 10 may 2012 debug1: reading configuration data /etc/ssh/ssh_config debug1: /etc/ssh/ssh_config line 19: applying options * debug1: connecting planetlab2.utdallas.edu [129.110.125.52] port 22. debug1: connection established. debug1: identity file /home/nazim/.ssh/id_rsa type 1 debug1: checking blacklist file /usr/share/ssh/blacklist.rsa-2048 debug1: checking blacklist file /etc/ssh/blacklist.rsa-2048 debug1: identity file /home/nazim/.ssh/id_rsa-cert type -1 debug1: remote protocol version 2.0, remote software version openssh_4.7 debug1: match: openssh_4.7 pat openssh_4* debug1: enabling compatibility mode protocol 2.0 debug1: local version string ssh-2.0-openssh_6.1p1 debian-4 debug1: ssh2_msg_kexinit sent debug1: ssh2_msg_kexinit recenter code hereeived debug1: kex: server->client aes128-ctr hmac-md5 none debug1: kex: client-...

php - Issue of retriving data into javascript using checkbox -

ok,i have data retrieve database in table format. check-box there each record. retriving data : <tr> <td><input name="<?php echo $row['id']; ?>" type="checkbox" class="check"></td> <td><center><?php echo htmlspecialchars_decode($row['id'], ent_quotes); ?></center></td> <td><center><?php echo htmlspecialchars_decode($row['section'], ent_quotes); ?></center></td> <td><center><?php echo htmlspecialchars_decode($row['chapter'], ent_quotes); ?></center></td> <td style="padding-left:25px;margin:15px"><?php echo $_session['question']=htmlspecialchars_decode($row['question'], ent_quotes); ?></center></td> <td><center><?php echo htmlspecialchars_decode($row['correctanswer'], ent_quotes); ?></center></td> ...