Posts

Showing posts from May, 2014

android - Converting string to data -

i getting duration of audio file , convert int , convert int string , string 00:32 . converted string correct, problem convert string data here code: file file = new file(environment.getexternalstoragedirectory()+"/myimages/.audio1.wav"); mediaplayer mp = new mediaplayer(); fileinputstream fs = null; filedescriptor fd = null; try { fs = new fileinputstream(file); } catch (filenotfoundexception e) { // todo auto-generated catch block e.printstacktrace(); } try { fd = fs.getfd(); } catch (ioexception e) { // todo auto-generated catch block e.printstacktrace(); } try { mp.setdatasource(fd); } catch (illegalargumentexception e) { // todo auto-generated catch block e.printstacktrace();

unityscript - Unity3D - Multiple enemies patrolling multiple paths in the same script -

i'm new writing code. enemy patrol between 2 paths. when player enters detection area around enemy follow player. if wanted more 1 enemy , multiple paths, how add code able that. creating script each enemy waste, correct? public var enemypath1 : transform; public var enemypath2 : transform; private var target : transform = null; private var charactercontrols: charactercontroller; function start () { settarget(enemypath1); charactercontrols = getcomponent(charactercontroller); } function settarget(newtarget : transform) : void { target = newtarget; } function update() : void { var lookatposition : vector3 = vector3(target.position.x, this.transform.position.y, target.position.z); transform.lookat(lookatposition); charactercontrols.simplemove(transform.forward); } function ontriggerenter(node : collider) : void { if(node.transform == target) { if(t

php - Inject code after X paragraphs but avoiding tables -

i inject code after x paragraphs, , pretty easy php. public function inject($text, $paragraph = 2) { $exploded = explode("</p>", $text); if (isset($exploded[$paragraph])) { $exploded[$paragraph] = ' mycode ' . $exploded[$paragraph]; return implode("</p>", $exploded); } return $text; } but, don't want inject $text inside <table> , how avoid this? thanks i'm bit crazy, go patterns lazy, time i'm going hazy. $input = 'test <table><p>wuuut</p><table><p>lolwut</p></table></table> <p>foo bar</p> test1 <p>baz qux</p> test3'; # input $insertafter = 2; # insert after n p tags $code = 'code'; # code want insert $regex = <<<'regex' ~ # let's define (?(define) (?p<table> # match nested table tags <table\b[^>]*>

Export csv or xml file from a dataset in Postgresql -

i export dataset of table in csv or xml file, depending on easier. i'm using postgresql dbms. knows how that? thank you. use copy command or run query psql , redirect std out file. other methods exists well.

jquery - How do i load content from .php files with AJAX? -

im using ajax , history.js load content separate pages index-page. reason can load .html-pages - how make function load .php-pages? is solution add extensions in in var = urlpath? other ideas? // ajax load onklik $('body').on('click', 'a', function(e) { var urlpath = $(this).attr('href'); var title = $(this).text(); history.pushstate({urlpath: urlpath}, title, urlpath); $("#content").load(urlpath); return false; }); edit: i using links no extension example loading page 'about.html': <a href="/about">about</a> which generates url in browser when testing locally: http://localhost/about thats ok, nothing happens when try loading .php-page fx 'home.php' same way - nothing gets loaded. seems ajax / history.js breaks somehow. but - if add extension .php in link page 'home.php', page loads via ajax .html-pages: <a href="/home.php">about&l

File download not working in php -

but same error below code well… can please share me suggestions.. error: warning: cannot modify header information - headers sent (output started @ /home/stthohuu/public_html/sp/announcements.php:1) in /home/stthohuu/public_html/sp/announcements.php on line 45 warning: cannot modify header information - headers sent (output started @ /home/stthohuu/public_html/sp/announcements.php:1) in /home/stthohuu/public_html/sp/announcements.php on line 46 <?php if(isset($_get['id'])) { ob_start(); // if id set file id database $con = mysql_connect('localhost', abc’, 'abc') or die(mysql_error()); $db = @mysql_select_db('stthohuu_church', $con); $id = $_get['id']; $query = "select name, type, size, content " . "from newsletter id = '$id'"; $result = mysql_query($query) or die('error, query failed'); list($name, $type, $size, $content) = mysql_fetch_array($result); header("con

python - Apache and sharing media in a separate directory -

i building django app runs out of /users/me/dropbox directory. localhost pointed @ /users/me/sites directory. mod_wsgi installed. apache installed django installed , app working fine in development mode i trying embed media in template media comes directory outside of django app - in root of machine - /proyectos the permissions directories , preceding directories readable _www i think understand that mod_wsgi serve dynamic files apache serve static files css , template files, media files referencing in /proyectos directory i have following in settings.py: staticfiles_dirs = (os.path.join(base, "static"), ) static_url = "/static/" media_url = "/proyectos/" wsgi_application = 'mbrain.wsgi.application' in /etc/apache2/extra/vhosts/localhost.conf have: <virtualhost *:80> documentroot "/users/me/sites/localhost" servername localhost wsgidaemonprocess localhost python-path=/users/me/dropbox/mbrain_adam/mbrain/

c++ - I need a text field or "Label vs TextField" -

i develop game cocos2d-x rc1 , need text field show score of player. 1 use cocos2d::label or textfield defined in cocos/ui/uitextfield.cpp ? difference? example, have noticed label has enableshadow , textfield misses. don't use textfield mere output field. (jeff johnson: "gui bloopers", blooper #17.) text fields meant input. fact can active or passive doesn't mean should used in always-passive mode output. display result, use label indicating following value is, , label value itself. score: 42 later 1 reason inactive textfield typically has appearance dampens visibility, being grayed out. 1 border surrounding textfield identifies place data can entered, if not now, other time; , bound irritate users trained observe such niceties - , there are , me 4 1 ;-)

RegEx for quoted string with missing open parenthesis -

what regex find quoted string having close parenthesis @ end, : "people)" but not "(people)" something so: "[^(]+?\)" should fit bill. might need escape quotation marks , backslash well, depending on regex engine using. some details on how regex work available here .

android - Cannot redirect to next page -

here home.java code. not redirecting next page, if change intent (home.this, mainactivity.class): import android.app.activity; import android.content.intent; import android.os.bundle; public class home extends activity { protected void oncreate(bundle savedinstancestate) { // todo auto-generated method stub super.oncreate(savedinstancestate); setcontentview(r.layout.fragment_main); thread timer = new thread() { public void run() { try{ sleep(2000); } catch (interruptedexception e) { e.printstacktrace(); } { intent openmainactivity = new intent("com.droid.mine.mainactivity"); startactivity(openmainactivity); } } }; timer.start();}{ } } here mainactivity.java code. i.e next page getting error classcastexception: import android.app.activity; im

php - Saving relations in yii2 forms - how to avoid duplication in attributes? -

i have student model (id, name, school_id) , school model (id, name, ...) relation schema is: school has many students, student can have 1 school. <?php class school extends \yii\db\activerecord { /*.....*/ public function getstudents() { return $this->hasmany(student::classname(), ['school_id' => 'id']); } /*.....*/ } ?> now want render checkboxes each student on school create form: <?= $form->field($model, 'students')->checkboxlist(arrayhelper::map($allstudents, 'id', 'name')) ?> ($model school instance. simplicity let's assume there not lot of students - checkboxes control enough) now, if want add validation rule allow max 5 students (using school::rules() method) - on form submit "trying set read-only attribute students" okay, means ar relations readonly attributes in models. but how can use yii2 activeform , validations using rules then, without creation of bogus attribute (studen

asp.net mvc - unable to retrieve metadata in MVC -

Image
my application working fine.now added model "logon.cs" public class logon { public int id { get; set; } public string username { get; set; } public string password { get; set; } } public class logoncontext : dbcontext { public dbset<logon> logons { get; set; } } i build app , wanted add controller,it when press add button getting error what mean?what missed? i found here . may resolve problem: in root web.config file change name of <connectionstrings> <add name="yourconnectionstring" ...other code goes here... </connectionstrings> to: <connectionstrings> <add name="defaultconnection" ...other code goes here... </connectionstrings> also, have rebuild after change connection string name.

Polylines with start and end of location in Google maps v3 -

i have drawing polylines following: var data = json.parse(data); var linecordinates = new array(); (i=0; i<data.length; i++){ linecordinates[i] = new google.maps.latlng(data[i].fields.latitude, data[i].fields.longitude); } linepath = new google.maps.polyline({ path: linecordinates, geodesic: true, strokecolor: '#ff0000', strokeopacity: 1.0, strokeweight: 2 }); linepath.setmap(map); } i want place marker @ start of polygon line , end of polygon line. how that? documentation on google.maps.polyline markers var startmarker = new google.maps.marker({ position:linepath.getpath().getat(0), map:map }); var endmarker = new google.maps.marker({ position:linepath.getpath().getat(linepath.getpath().getlength()-1), map:map });

PHP How to edit HTML element Content? -

just $('#elementid').html('html code'); in php. there way change live content php without reloading page? tried <?php echo '<script type="text/javascript"> $('#element').html('<p>i text</p>'); </script>' ?> <div id='element'>i changed!</div> is there shorter way, 1 not works everytime. $.post('test.php','',function(response){ $('#element').html(res); }); test.php $name = "sham"; echo "this variable $name"; output of html <div id='element'>this variable sham</div>

debian - Problems building GMP 4.3 -

i'm trying build gmp 4.3* (for compatibility project i'm using), it's not cooperating. install file says run './configure' file doesn't exist. when try building autoconf, pages of errors things possibly defined (but they're right there in acinclude.m4). produce configure file, doesn't work. so, how proceed? ~/prj/gmp-4.3$ cc=gcc-4.2 cxx=g++-4.2 cppflags=-fexceptions ./configure --enable-cxx --prefix=/path/to/prefix zsh: no such file or directory: ./configure ~/prj/gmp-4.3$ autoconf configure.in:30: error: possibly undefined macro: gmp_version if token , others legitimate, please use m4_pattern_allow. see autoconf documentation. configure.in:51: error: possibly undefined macro: gmp_init configure.in:62: error: possibly undefined macro: am_conditional configure.in:68: error: possibly undefined macro: am_init_automake configure.in:69: error: possibly undefined macro: am_config_header configure.in:70: error: possibly undefined macro: am

javascript - Angular JS sorting and converting strings to integers -

i'm facing , issue here cant seem around. have json contains array of people , inside each person array of strings. in array have numbers , actual string values. integers being treated strings when use orderby sorts incorrectly because thinks integers strings. what trying figure out of way can convert strings integers using ng-repeat spit out integers. here current html: <div ng-controller="tablectrl"> <p><strong>page:</strong> {{tableparams.page()}}</p> <p><strong>count per page:</strong> {{tableparams.count()}}</p> <table ng-table="tableparams"> <tr ng-repeat="person in $data"> <td data-title="'name'" sortable="'0'">{{person[0]}} {{person[1]}}</td> <td data-title="'age'" sortable="'2'">{{ person[2] }}</td> </tr> </table&g

Facebook Conceal .so files not uploading in Android Project -

i cannot conceal library work, may doing wrong, wish instructions bit more detailed. http://facebook.github.io/conceal/documentation/ i have added crypto.jar project, , instructions tell me add files armeabi/*.so jni folder. "add dependency crypto.jar java code using favorite dependency management system, , drop .so files in libs.zip jni/ folder." i don't have jni folder, since project normal android progect, not ndk project. how can work, tried creating folder , adding build path, did not work. lost on this. in source code loading libraries this: static { // load facebook conceal crypto files system.loadlibrary("libconceal.so"); system.loadlibrary("libcryptox.so"); } then instructions tell me add files armeabi/*.so jni folder. that's bug in documentation. pre-compiled .so files go in libs/ . so, should wind libs/armeabi/*.so . i tried creating folder , adding build path that never right answer , can screw th

python - Django Nose Tests Failing - Traceback from Nose Code -

i unable run django nose tests, processes fail traceback: traceback (most recent call last): file "/system/library/frameworks/python.framework/versions/2.7/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap self.run() file "/system/library/frameworks/python.framework/versions/2.7/lib/python2.7/multiprocessing/process.py", line 114, in run self._target(*self._args, **self._kwargs) file "/users/jeffquinn/code/nuna/data-intrawebve/lib/python2.7/site-packages/nose/plugins/multiprocess.py", line 652, in runner keyboardcaught, shouldstop, loaderclass, resultclass, config) file "/users/jeffquinn/code/nuna/data-intrawebve/lib/python2.7/site-packages/nose/plugins/multiprocess.py", line 669, in __runner config.plugins.begin() file "/users/jeffquinn/code/nuna/data-intrawebve/lib/python2.7/site-packages/nose/plugins/manager.py", line 99, in __call__ return self.call(*arg, **kw) file "/users

reformatting - reformat blocks of text to line width -

as programmer, find myself using text editors rather proprietry editing tools (like word) smudge out blocks of text. , i'm sure many of ocd find rather annoying when need edit line above you've written, causing jutting line out nicely formatted lines. have had no other solution problem other re-new-lining every single line thereafter correct margins. for lack of better definition: there better way of reformatting blocks of text given line width. if possible selection well? possible scenario: lorem ipsum dolor sit amet, consectetur adipisicing elit, sed eiusmod tempor incididunt ut labore et dolore magna aliqua. ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. becomes: lorem ipsum dolor sit amet

c - while loop and arithmetic operator -

int = 5; while(i>5) printf("%d",i); prints nothing. int = 5; while ( 5<i<10 ) { printf("%d",i); i++; } prints 5 in both cases shouldn't result "prints nothing" . because 5 not less 5. in c integer used boolean: 0 false , else true . @jonathanleffler noted (see comment below), in c99 , c11 there standard boolean datatype, expands integer constants ( 0 , 1 ). link . when write expression 5 < < 10 , treated (5 < i) < 10 , 5 < i boolean expression, returns 0 . (0) < 10 , true, that's why loop's body executed. in order make loop condition correct, shoould use like: while (5 < && < 10)

java - How to open recent files added to menu in Swing? -

when open file added recent menu in file, when click added path of recent menu opened. how? here code: public class recentitemlist extends javax.swing.jframe { jtextarea tx; int i=0; int recentitems_count=0; string filename; string recentitem; queue<string> q; public recentitemlist() { q=new linkedlist<>(); initcomponents(); } @suppresswarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="generated code">//gen-begin:initcomponents private void initcomponents() { tp = new javax.swing.jtabbedpane(); jmenubar1 = new javax.swing.jmenubar(); jmenu1 = new javax.swing.jmenu(); create = new javax.swing.jmenuitem(); save = new javax.swing.jmenuitem(); open = new javax.swing.jmenuitem(); recentitems = new javax.swing.jmenu(); setdefaultcloseoperation(javax.swing.windowconstants.exit_on_close);

c# - Select all column in QueryExpression CRM 2011 -

i have queryexpression in code. queryexpression query = new queryexpression() { }; query.entityname = "country"; query.columnset = new columnset("name", "2digitiso", "3digitiso"); entitycollection retrieved = _service.retrievemultiple(query); my question is, there way select columns in "country" without providing columnset? pretty want select * sql query. yes, if change third line this query.columnset = new columnset(true); then select columns

git - Initial Commit: "fatal: could not create leading directories of ..." -

i trying make initial commit git repository on github unity project. followed along this guide am. note: reason or another, couldn't set unity's asset serialization mode force text, settled on mixed (which believe should work). when call git clone --bare . , error. note not creator of repository , contributor (though making initial commit). here's in terminal (i'm using git bash): welcome git (version 1.8.4-preview20130916) run 'git git' display index. run 'git <command>' display specific commands. cheddar@cheddar-pc ~ $ cd documents/ics168swarch/ cheddar@cheddar-pc ~/documents/ics168swarch $ git init initialized empty git repository in c:/users/cheddar/documents/ics168swarch/.git / cheddar@cheddar-pc ~/documents/ics168swarch (master) $ git add . warning: lf replaced crlf in assets/prefabs.meta. file have original line endings in working directory. warning: lf replaced crlf in assets/prefabs/pellet.prefab.meta. file have original

Can't understand C program output -

Image
i making basic programs , made program #include<stdio.> int main() { printf("%d\n",-1>>4); return 0; } output = -1 i not understand how happens ? is -1 2's complemented first , shift operation done .and again 2's complement done produce result. i want know how output comes int main() { unsigned int a=4; printf("%d\n",-a>>4); return 0; } result = 268435455 for start, you're doing non-portable. iso c11 states, in 6.5.7 bitwise shift operators : the result of e1 >> e2 e1 right-shifted e2 bit positions. if e1 has unsigned type or if e1 has signed type , nonnegative value, value of result integral part of quotient of e1 / 2^e2 . if e1 has signed type , negative value, resulting value implementation-defined. so it's not wise that. what's possibly happening have implementation preserves sign on negative values. whereas >> may shift in 0 bits on left hand side (an

python - attribute error: when trying to write in form xml -

i trying update form view xml. here code: def update_column(self,cr,uid,ids,context=none): id in ids: temp=self.pool.get('deg.form').browse(cr,uid,id) fields={'myname':temp.name,'mytype':temp.data_type} self._columns.update(fields) print (self._columns) result = super(deg_form, self).create(cr,uid,{},context=none) return result def fields_view_get(self, cr, uid, view_id=none, view_type='form', context=none, toolbar=false, submenu=false): res = super(deg_form,self).fields_view_get(cr, uid, view_id, view_type, context, toolbar, submenu) objn = self.pool.get('deg.form').browse(cr, uid, 145) if view_type=='form': str_fields=str(res['fields']) str_fields=str_fields[:len(str_fields)-1]+ ", 'father_name' :{'selectable': true, 'views': {},'type':'char', 'string': &#

struts2 - UrlRewriteFilter skipping i18n Interceptor in Struts 2 -

i managed have struts 2 i18n interceptor working change session locale. it's working if call directly action, example: https://localhost:8443/loadclientlogin.action?request_locale=fr but if use urlrewritefilter map rule, calls action, seems 18n interceptor skipped, since locale not changed. this url rewriter's rule wrote action: <rule> <from>^/client/login(\??)(.*)$</from> <to type="forward">/loadclientlogin.action$1$2</to> </rule> and url use change locale: https://localhost:8443/client/login?request_locale=fr by other side, if change type of rule "redirect" works, browser address show "ugly" forwarded url. it's strange other custom interceptor use manage user session it's called always. update: i put log trace in action write locale session: public string loadclientlogin() { logger.debug("locale: " + actioncontext.getcontext().getlocale()); return acti

csv - CKAN : Upload to datastore failed; Resource too large to download -

Image
when try upload large csv file ckan datastore fails , shows following message error: resource large download: 5158278929 > max (10485760). i changed maximum in megabytes resources upload ckan.max_resource_size = 5120 in /etc/ckan/production.ini what else need change upload large csv ckan. screenshot: that error message comes datapusher, not ckan itself: https://github.com/ckan/datapusher/blob/master/datapusher/jobs.py#l250 . unfortunately looks datapusher's maximum file size hard-coded 10mb: https://github.com/ckan/datapusher/blob/master/datapusher/jobs.py#l28 . pushing larger files datastore not supported. two possible workarounds might be: use datastore api add data yourself. change max_content_length on line in datapusher source code linked above, bigger.

php - PDO Insert Query Not Working For Integer -

i have code insert new row mysql db using pdo: $query = insert asset_positions (pos_asset_id, pos_latitude, pos_longitude, pos_timestamp) values (:pos_asset_id, :pos_latitude, :pos_longitude, :pos_timestamp) $statement = $pdo->prepare($query); $array = [':pos_asset_id' => 1, ':pos_latitude' => -8.5, ':pos_longitude' => 125.5, ':pos_timestamp' => 1398160487]; $statement->execute($array); echo $pdo->lastinsertid(); the query runs without error shown. newly inserted row id echoed. however, when in db, insert latitude, longitude , timestamp. pos_asset_id field in newly inserted row empty. could point out problem? there no error message displayed. i've been trying solve hours without avail. ps. first time using pdo, please bear me. thanks. edit solved! didn't notice there's fk relation between asset_positions.pos_asset_id , asset.asset_id . once remove relationship constrains, insert works now, pos_asset_id v

mysql - How to search ignoring spaces between words? -

i want search names using search module ignoring white spaces . ex: if want search name "a b zilva" i want disply results on dropdown if type name "ab zilva". currently search without space not working $db = jfactory::getdbo(); $searchp=$_get["term"]; $searchp = str_replace(' ','%%', trim($searchp)); //$searchp= preg_split('/ /', $searchp); $query = $db -> getquery(true); $query="select * content title '%".$searchp."%'and categories_id=82 order title asc "; $db -> setquery($query); // load results list of associated arrays. $results = $db -> loadassoclist(); $json=array(); foreach ($results $json_result) { $json[] = array('value' => $json_result["title"], 'label' => $json_result["title"]); } please advice . update : jquery.extend( jquery.ui.autocomplete.prototype, { _renderitem: function( ul, item ) {

android - Can't handle with Handler -

i playing music form sd card , want seekbar getprogress every 2 sec when music playing. trying handler. dont know how use handler coretly here code: @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); seekbar1 = (seekbar) findviewbyid(r.id.seekbar1); button1 = (button) findviewbyid(r.id.button1); button2 = (button) findviewbyid(r.id.button2); textview1 = (textview) findviewbyid(r.id.textview1); button1.setonclicklistener(new onclicklistener() { @override public void onclick(view v) { mediaplayer mediaplayer = new mediaplayer(); try { mediaplayer.setdatasource(environment.getexternalstoragedirectory()+"/myimages/.audio2.wav"); mediaplayer.prepare(); mediaplayer.start(); } catch (illegalargumentexception e) { // todo auto-g

I want to compare a text of red color background of two different web pages using selenium webdriver -

i want compare text of red color background of 2 different web pages using selenium webdriver. if both same should display true else false. please me out this. you can use method .getcssvalue("background-color"); can called webelement, , use assert statement check value equal "red".

codeigniter - Pyrocms: display an image in a page -

in pyrocms admin, have created image field under default.i pull field in page. currently code looks this {{ if page:slug == "contact" }} <img src="{{ template:contact_main_image:img}}"> //the field name contact_main_image {{ endif }} but can't see image.

android - Bug AutocompleteTextView width in dual pane Fragment UI -

Image
i'm facing problem custom autocompletetextview, dropdown filling totally screen want fill 1 of fragment width. how can solve ? here "beautiful" sketch of view: thanks in advance :)

.net - Object not set to the instance of an Object ERROR Excel 2013 Automation VB.NET -

trying create small report program in vb.net. works in excel 2003 , 2010, throws error in excel 2013 when trying create second worksheet. procedure listed below, point out line errors. doesn't catch in try , catch added comes across "unhandled exception". the target framework 3.5 have tried x86, x64, , cpu target cpu i used 2003 , 2010 .dlls reference. imports microsoft.office.interop.excel private sub drpts() try dim strfiledirname string = "" me.cursor = cursors.waitcursor 'morning report sheet 1 dim mornrpt string = "select datecreated, reportclass, sum(qtyordered), sum(extendedprice) " & _ "from tmp_dailyreport group datecreated, reportclass" dim oexcel object dim obook object dim osheet1 object dim osheet2 object oexcel = createobject("excel.application") obook = oexcel.workbooks.add osheet1 = ob

math - Mathematical Formula for working out font size -

can me i'm not having luck want try workout ideal fontsize text based on width of image it's overlaying , amount of characters in text string. me formula this. i got semi-working due infinite monkey theorem! // gets text1 count $charcount = strlen($line1); // gets text1 size count $newsize = ($width / floor($charcount)); $add = ( 20 % $newsize ); $newsize = ($newsize + $add); // changes font size $text1->setfontsize( $newsize ); i use based on width or height of image: resize_font = function () { // play around denominator until font size want var fontsize = parseint($("#your_image_div").width()) / 2 + "%"; //then apply css text div element $(".your_text_class").css('font-size', fontsize); }; // hook whatever event want $(document).ready(resize); hope helps. trick handy making elements resize in relation veiwport too. hope helps.

java - How to tell if Android screen lock setting is set to None -

i need check if screen lock setting set "none" (or not). i deploying app being sent out users on pre-configured tablets. this pre-configuration done manually tablet supplier. one of settings pre-configure set screen lock none (it bad thing if tablet reached end user screen lock still enabled). the last thing person configuring device start app, able see check list confirm settings have been set accordingly in order avoid missed/incorrect settings. the screen lock setting have been unable find way either read or set programmatically. the tablets rooted , running 4.2.2. assume end user incapable of interacting in way tablet - other powering on , reading display.

javascript - Keep sticky nav sticky when divs are deleted -

morning, i have onepage website using sticky navigation. delete couple of divs when do, sticky navigation no longer sticks when scroll down. can add spacers add extra/empty space. how can delete menu card div , faq div , still make navigation stick top , not jump way now? link: mktminc.com/ecraftinc/new/onepage.html any appreciateed.

php - keep radio button values and set default checked -

i have form radio button group. want set 'checked' default second radio button, , keep value after submitting form if user clicks on first one. note i'm using <span class="custom-radiobutton"></span> style radiobuttons, lower z-index real <input type="radio" , has opacity:0 . this snippet of code: <div class="group-wrapper"> <div class="radiobutton-wrapper boolean"> <span class="custom-radiobutton"></span> <input type="radio" id="hosting-1" name="hosting[]" value="1" class="w100" <?php if ((isset($_post['hosting'])) && ((isset($_post['hosting'])) == 1)) {echo 'checked="checked"';}; ?> /> <label for="hosting-1">sí</span> </div> <div class="radiobutton-wrapper boolean"> <span class="custom-radiobutton

wpf - Close Application to System Tray -

i have wpf app exit "x" button only. system tray icon launched when application starts up. either "hide" or close main window system tray when "x" clicked. how can achieve this? the main thing need change shutdownmode application onexplicitshutdown . can set in app.xaml , app stay alive until call application.shutdown() code (probably based on explicit user command). how handle reopening window tray icon dependent on specific implementation should @ least started.