Posts

Showing posts from April, 2011

java - Faster method of Grouping Times -

i receive json object filled data , 1 of tasks data group times together. for example, if game_time 12:15 pm should under 12 pm header. i came solution monstrosity , difficult debug, there has better way this. dbdate = dateformatter.parse(json_data.getstring("game_time")); if (dbdate.compareto(dateformatter.parse("12:00 am")) == 0 || dbdate.compareto(dateformatter.parse("1:00 am") ) < 0) { users12am.add(json_data.getstring("in_game_name")); } else if (dbdate.compareto(dateformatter.parse("1:00 am")) == 0 || dbdate.compareto(dateformatter.parse("2:00 am")) < 0) { users1am.add(json_data.getstring("in_game_name")); } else if (dbdate.compareto(dateformatter.parse("2:00 am")) == 0 || dbdate.compareto(dateformatter.parse("3:00 am")) < 0) { users2am.add(json_data.getstring("in_game_name")); } else if (dbdate.compareto(dateformatter.parse("3:00 am&quo

c++ - Installing files using qmake: how to get the executable too? -

i'm building app qmake. my project.pro file looks like: template = app config += console config -= app_bundle config -= qt sources += [all source files] headers += [all headers] after build, want "make install" copy required in subfolder, added following: package.path = $${out_pwd}/package package.files += myapp.exe myapp.ini [other dlls] package.config = no_check_exist installs += package i cannot have in way compiled binary copied alongside; prefixed $$objects_dir/ , others, can't find right variable containing path build directory! it seems these variables meant way change qmake's behaviour, example change build directory. don't want change it; want access it! is there other variable use? basically, want put in "package.files" full path compiled executable binary. thanks! qmake puts complied executable (or library) in location pointed destdir . usually, when want put binary , support files, set destdir location want i

Batch programming - some questions -

i have problem understanding batch file part of task (sort of hackme). find hard find informations in google, dont know, feel there isnt batch language documentation or soemthing other solid. my first question, does? possible dont satisfy condition ? if not "!"=="" ( echo authorization failed! pause>nul exit ) secound question, kind of if's ?: set %1.pass=%2 if "!%1.pass:~5,1!"=="" ( ..... if not "!%1.pass:~6,1!"=="" ( thank you, @edit technet.microsoft.com/en-us/library/cc754340(v=ws.10).aspx i have read it, doesnt answer questions you might check out yourself: @echo off &setlocal if not "!"=="" (echo not equal) else echo equal setlocal enabledelayedexpansion if not "!"=="" (echo not equal) else echo equal set "property.pass=abcde" echo %property.pass:~0,1% %property.pass:~1,1% %property.pass:~2,1% %property.pass:~3,1% output

github - Git clone not working for ssh or https but is working for http -

does have clue why happening. when go clone using: git clone ssh-url it says cloning 'url'... never anything. i can clone http. figure out why happening. edit: also, using mysysgit. update: tried reradding ssh keys github , ran ssh -t git@github.com test if worked. following resulkting output: permissions 0660 '/home/thebo_000/.ssh/id_rsa' open. required private key files not accessible others. private key ignored. bad permissions: ignore key: /home/thebo_000/.ssh/id_rsa permission denied (publickey). your ssh key should have permission 600. otherwise ssh not accept private key out of security precautions. key, decrypt data send github, encrypted public key. you can fix doing: chmod 600 ~/.ssh/id_rsa this should settle issue. on unix permissons (with ls -l) should this: -rw--------

batch file - How to pass email body to an application -

Image
i have discovered can make rules in outlook. these can triggered number of events , number of things. 1 such thing launching application . seeing this, thought might able automate few emails. however, of these processes require information in body of email, have no idea how pass application. is there way can pass email body of message triggered event application being launched? note: i'm using outlook 2003 on xp it may possible pass information parameters script. mean lots of rules static information being passed based on email subjects. without using besides outlook , external batch script, not seem possible pass elements of email script. hate 'impossible'. there really cool things can done outlook , more advanced languages though :-). edit: live , learn . possible vb.

c - Do i must malloc a returned string inside a function? -

this question has answer here: string literals: go? 8 answers the following program print on screen "hello\nworld\n" ('\n' = line down) supposed to. actually, learned, here isn't done should be. "hello" , "world" strings defined inside function (and therefore local , memory released @ end of function's scope - right?). don't malloc them supposed (to save memory after scope). when a() done, isn't memory stack move it's cursor , "world" placed in memory @ same place "hello" ? (it looks doesn't happen here , don't understand why, , therefore, why need malloc if memory block saved , not returned after scope?) thanks. #include <stdio.h> #include <stdlib.h> #include <string.h> char *a() { char *str1 = "hello"; return str1; } char *b() { char *s

select by name and array value with jquery -

i thought this: i[1] = 23; // built regex $('select [name="sys_map\\['+i[1]+'\\]"]').css('border-color', '#ff5c5c'); or maybe $('select [name=sys_map\\['+i[1]+'\\]]').css('border-color', '#ff5c5c'); to select <select name="sys_map[23]"> quoting name shows error: [15:36:27.647] error: syntax error, unrecognized expression: select [name="sys_map[1]" you have space between 'select' , name attribute selector, you're looking elements match attribute selector descendants of select . change $('select [name="sys_map\\['+i[1]+'\\]"]') to $('select[name="sys_map['+i[1]+']"]') here's fiddle: http://jsfiddle.net/nyakm/ note had change array definition: var = []; i[1] = 23;

ruby on rails - Eager loadings for single object? -

i have controller find 1 record (its uniq) class collectionscontroller < applicationcontroller def show @collection = collection.find_by_active(true) end end this '@collection' have many :items, has many :photos so, in view this: - @collection.items.each |item| = image_tag item.find_active_photo.image_url(:small) and reproduce bunch of sql queries, example if item has 4 photos, 6 queries: collection load collectionitem load photo load (4 times) how can reduce count of n+1 queries? use eager loading @collection = collection.find_by_active(true, {:include =>{:items => :photos})

deb - Can't get the build process on my Ubuntu PPA to use my debian/install file -

i'm going insane here. i've built tool doesn't need actual compilation - it's perl script - , when run bzr builddeb on it, working .deb file copies script - zfsync - /usr/bin/zfsync when run dpkg -i zfsync_1.0.0-0ubuntu3_all.deb . however, when run bzr builddeb -s , dput resulting source.changes file ppa, builds without errors... apt-get install zfsync results in "successful" installation, binary isn't placed in /usr/bin! i have debian/install file contains zfsync usr/bin , nothing else. out of desperation, created simple makefile which, if make install run, copy zfsync /usr/bin also. nothing seems help, though, , half-hour "build" time on canonical's godawful arm-based ppa farm making me lose mind. when apt-get source zfsync, looking in source directory fetched shows me no debian/install file whatsoever. don't know why ppa stripping file, apparently - , without it, script doesn't installed. please, please, there

ios - iPhone Calculator App Unwanted Decimal Places -

i made watched tutorial calculator iphone app. works having issue unwanted decimal places, meaning app put dot after number , have 6 0s after it. looked how fix , tried saw, works when type in first number in. when click multiplication, division, subtraction, or addition button reappear , when shows answer includes unwanted decimals too. code below, please me thanks! viewcontroller.h // // viewcontroller.h // simple calculator // // created michael on 2013-08-08. // copyright (c) 2013 com.company. rights reserved. // #import <uikit/uikit.h> @interface viewcontroller : uiviewcontroller { float result; iboutlet uilabel *calculatorscreen; int currentoperation; float currentnumber; bool userinthemiddleofenteringdecimal; } -(ibaction)buttondigitpressed:(id)sender; -(ibaction)buttonoperationpressed:(id)sender; -(ibaction)cancelinput; -(ibaction)canceloperation; @end viewcontroller.m // // viewcontroller.m // simple calculator // // created

css - I'm not able to click a link inside of fixed div -

this link, inside of div called .user_minibar position:fixed; property, , being positioned @ top of page, can't clicked. when put mouse on link, cursor doesn't turn pointer. unless scroll down little bit, can't click (it works me when link precisely below h1 tag (weird, right?)). here's jsfiddle: http://jsfiddle.net/arkl1te/9xkha/ one of top elements overlapping div. try adding z-index: 1; .user_minibar .

linux - Need to move a limited # of files on MacOs -

i have requirement move files local macbook remote server using sftp. i need take 6000 files , move them remote server processing. due limitations on processing system, can process maximum of 100 files @ time. processing system bomb if there more 100 files in folder monitors. i'd set script run via crontab every x # of minutes , move 100 files folder on mac contains 6,500 files 'staging' folder. 2nd script pick , upload contents of 'staging' folder sftp folder. i've got crontab working fine, however, can't figure out how limit # of files move 100. here's i've done far. maybe i'm doing wrong, suggestions appreciated! #!/bin/bash cd /users/me/downloads/test # files unprocessed 6k files located. the 'ls' command returns '-bash: /bin/ls: argument list long' error ls unprocessed/*.pdf | head -n 99 > flist while read f mv "$f" . done < flist this script upload sftp server. ./exp.sh this

java - How to add column with header and data to the JTable -

i created class mytablemodel extends abstracttablemodel. , want is, have initialized 3 columns data? defaulttablemodel had option, use method takes paramater columnname , columndata addcolumn(object columnname, object[] columndata) , what's best way this? in table model can have return want. if have 3 list<string> or 1 list<threepropertypojo> have table model methods answer correctly: number of columns 3 number of rows list.size() display value cell (row,col) used list1.get(row) (or 2 , 3 depending on 'col') or depending on value of 'col' particular property list element. that pretty it. there lots of examples if google "java swing tablemodel example" http://www.javalobby.org/articles/jtable/ has nice example.

Rebuild a third party framework in Xcode -

i have third party framework connect bluetooth device (dice+) app, building ane (adobe native extension) use device in air ios aplication. to build ane, embed framework, air-ios works armv7 architecture framework "universal" (armv6, armv7 , mac os). there way repackage framework xcode armv7 architecture framework only? finally find real solution: i unzipped framework file. inside there file without extension , folder named headers add extension .a file without extension. add headers folder , file .a project. then compile. indeed when trying generate ipa, got 1 id64 error adobe air, can generate ipa in windows. difference between framework , static library in xcode4, , how call them

ruby - Rails regex with include -

i'm finding mx records based on user's email determine if use gmail. mx server records come this: aspmx.l.google.com alt1.aspmx.l.google.com alt2.aspmx.l.google.com aspmx2.googlemail.com aspmx3.googlemail.com alt4.gmail-smtp-in.l.google.com alt3.gmail-smtp-in.l.google.com alt2.gmail-smtp-in.l.google.com gmail-smtp-in.l.google.com alt1.gmail-smtp-in.l.google.com where non google mail servers send stuff like: mx2.emailsrvr.com mx1.emailsrvr.com nil what way determine if 1 of mx records contain google mx record. i've been trying: if mx.any? {|server| server.exchange.to_s.include? "google"} return true end this doesn't work requires match. elegant ideas? thanks assuming mx array: mx.any? { |server| server.exchange.to_s.downcase.include? "google" } should work. aside, because any? method returns true or false don't need explicitly return true , return value of any? method. example: [ "aspmx.l.googl

php - MySQL Syntax Error Error -

when calling function mysql syntax error appears, ideas? you have error in sql syntax; check manual corresponds mysql server version right syntax use near '' @ line 1 function getcomments1() { $query = mysql_query("select * comments") or die(mysql_error()); while($post = mysql_fetch_assoc($query)) { echo $post['author']; } } function addcomment($cname, $ccontent) { $query = mysql_query("insert comments values(null,'$cname','$ccontent'") or die(mysql_error()); } <?php include('includes/functions.php'); mysql_set_charset ( "utf8" ); if(isset($_post['submit'])) { if(isset($_post['commentname'])) { if(isset($_post['commentcontent'])) { addcomment($_post['commentname'],$_post['commentcontent']); header("location: derger.php"); } else { "text missing"; } } else {

css - jQuery Mobile Orientation Change Solutions -

i'm developing jquery mobile app. there's ton of dynamically generated css , far i've been developing portrait orientation. obvious problem when tilt device looks bad. don't need have landscape view app i'm not opposed either. can suggest easiest solution options being either landscape view or somehow locking app in portrait mode? there 2 way check orientation.. firstly 1) $(window).bind("orientationchange", function(evt){ alert(evt.orientation); /*do want.*/ }); secondly using css can check using min-width .i using ipad check 768 , 1024 .do things @media screen , (min-width: 768px){ #realtimecontents { overflow-y:auto; -webkit-overflow-scrolling: touch; position: relative; height:850px } } @media screen , (min-width: 1024px){ #realtimecontents { overflow-y:auto; -webkit-overflow-scrolling: touch; position: relative; height:600px } }

Java video output can only be opened using Quicktime but no other media player can open it -

i have program , captures screen , takes images , turns them movie. (using jpegimagestomovies.java customized work .png) have tried multiple extensions: .mov , .mp4 , .avi (i open trying others). however, regardless of extension use, when try open file windows media player following error: windows media player encountered problem while playing file. error code c00d11b1 i've tried opening file using vlc produces following error: no suitable decoder module: vlc not support audio or video format "twos". unfortunately there no way fix this. opening file using quicktime work. so question is, how can produce video file can opened if not media players . here jpegimagestomovie.java package maple; /* * @(#)jpegimagestomovie.java 1.3 01/03/13 * * copyright (c) 1999-2001 sun microsystems, inc. rights reserved. * * sun grants ("licensee") non-exclusive, royalty free, license use, * modify , redistribute software in source , binary

PHP new lines in CodeIgniter controller -

can see error following line of code codeigniter controller script - it's part of email script. the "\n" not appear new lines in email - "\n" raw code itself: $this->email->message($_post['name'] . " \n" . $_post['email'] . " \n" . $_post['message']); they enclosed in double-quotes, don't see issue be... i have done same thing trying (successfully) this: $msg=" name: ".$this->input->post('name')." email: ".$this->input->post('email')." message: ".$this->input->post('message'); $this->email->message($msg); hope helped you. if there problem, comment.

java - reinitialize arraylists between activities error -

i have 2 activities loginactivity , mymapactivity . problem when try open mymapactivity (login->mymapactivity (first time activity works)-> logout -> login) second time following error: 08-10 06:55:27.663: e/androidruntime(3630): fatal exception: main 08-10 06:55:27.663: e/androidruntime(3630): java.lang.runtimeexception: unable start activity componentinfo{com.example.pac/com.example.pac.mymapactivity}: java.lang.indexoutofboundsexception: invalid index 0, size 0 08-10 06:55:27.663: e/androidruntime(3630): @ android.app.activitythread.performlaunchactivity(activitythread.java:2247) 08-10 06:55:27.663: e/androidruntime(3630): @ android.app.activitythread.handlelaunchactivity(activitythread.java:2297) 08-10 06:55:27.663: e/androidruntime(3630): @ android.app.activitythread.access$700(activitythread.java:152) 08-10 06:55:27.663: e/androidruntime(3630): @ android.app.activitythread$h.handlemessage(activitythread.java:1282) 08-10 06:55:27.663: e/androidr

Make executable jar with JavaFx plugin for gradle -

i'm trying make executable jar. ide netbeans 7.3.1, using gradle plugin netabeans, using javafx plugin gradle. simple javafx application: i.lunin.autoposting.main: package i.lunin.autoposting; import java.util.logging.level; import java.util.logging.logger; import javafx.application.application; import javafx.event.actionevent; import javafx.event.eventhandler; import javafx.scene.scene; import javafx.scene.control.button; import javafx.scene.layout.stackpane; import javafx.stage.stage; public class main extends application { public static void main(string[] args) { launch(args); } @override public void start(stage primarystage) { primarystage.settitle("hello world! man!"); button btn = new button(); btn.settext("say 'hello world'"); btn.setonaction(new eventhandler<actionevent>() { @override public void handle(actionevent event) { try {

Jquery hover get Id issue -

hi have img , when hover on want unhide div, won't work. here attempt. $("img").hover( function () { var currentid = $(this).attr('id'); $('.'+currentid).show(); }, function () { var currentid = $(this).attr('id'); $('.'+currentid).hide(); } ); here html //intially hidden via display:none <div class="alligator sinensis" style="display:none;border:solid;float:right;"> //this image <img id="alligator sinensis" class="circular resultss imgs" src="http://media.eol.org/content/2013/02/20/13/27869_orig.jpg"> your id , class can't have spaces. <div class="alligatorsinensis" style="display:none;border:solid;float:right;"> //this image <img id="alligatorsinensis" class="circular resultss imgs" src=

c++ - What is the significance of comma in array and structure initialization? -

this question has answer here: int a[] = {1,2,}; weird comma allowed. particular reason? 17 answers while browsing through codes, came across method of initialization: #include<stdio.h> struct trial{ int x, y; }; int main(){ int a[10] = {0,1, };//comma here struct trial z = {1, };//comma here return 0; } what significance of comma operator? not find difference in method of initialization if comma operator removed. it makes sense if generate such code scripts. keeps script simple. no edge-cases. in particular, don't bother whether need add , first, before writing 1 more item; write 1 item followed comma , you're done! you don't care first item or last item. items same if there trailing comma. think code-generation point of view. start making sense. see python script generates such code: print ("int a[] =

jquery - HTML5 required input attribute lets me submit a form -

i have super simple form: <form> <input name="name" placeholder="your name" required> <input name="email" type="email" placeholder="your email" required> <input type="submit" value="submit"> </form> i'm submitting using jquery (coffeescript style): $('form').submit (event) -> event.preventdefault() $.post('../mail.php', $('form').serialize(), (data) -> $('form')[0].reset ) .done -> ... .fail -> ... .always -> ... in chrome (as in chrome canary) works charm, , won't let me submit form if of inputs empty (it displays "please fill out field" message, should). in lot of other browsers though (safari, webkit safari i.e.) lets me submit form inputs empty. what problem be? i'm little worried event.preventdefault , maybe stops browsers checking input s? you can

lua - how to prevent a ball from floating over the ground in corona sdk -

i have image (ground) transparent pixels on top of since ground has hills ups , downs ... problem ball isn't moving down , according hills ... ball floating on image. can ?? local bg2 = display.newimage("images/ground.png",true) bg2:setreferencepoint(display.centerleftreferencepoint) bg2.x = 0; bg2.y = _h/1.25; local physics = require("physics") physics.start() local redorb = display.newcircle( 0, 0, 25) redorb:setfillcolor(255,0, 0) physics.setgravity(0,9.8) redorb.x = 180; redorb.y = 190; redorb.rotation = 5 physics.addbody( bg2, "static", { friction=0.5, bounce=0.3 } ) physics.addbody( redorb, { density=3.0, friction=0.5, bounce=0.3 } ) when add body image has transparency , not automatically make body image itself. you can use tool physics body http://www.codeandweb.com/physicseditor http://www.codeandweb.com/blog/2012/05/24/getting-started-with-coronasdk-and-physicseditor-tutorial to view actual physics body can add code

navigation - Open the next html file in the directory -

i making sort of "html app" involves large number of seperate .html files. 'app' sort of 'pro tips' thing, on every page, life tip. wondering if there code opening next html file within same directory, instead of changing next tip's in each html file open it. example: <a href="1.html">next tip</a> in next tip's html file have put: <a href="2.html">next tip</a> , on: <a href="3.html">next tip</a> sorry if not being clear enough. if want client-side solution might work scenario. give tag id , add script part page. parse current filename, parses number it, adds 1 , buildsup next url, replacing value on a tag <html> <head> <script src="nav.js"></script> </head> <body> <!-- remember put id on --> <a id="next" href="n.html">next</a> </body> </html> and create new file call

ios - How to detect and verify a renewal for an auto-renewable subscription? -

so have setup auto-renewable subscription app period of 1 month, equals 5 minutes or in sandbox. in client app subscribe, send receipt server, gets verified , put record in database user has subscription. my question how check if subscription has been renewed? have read docs , can't figure out should do. here far: the initial receipt gets sent server verified status 0 , great. latest_receipt , replace in database oldest receipt. after 6 minutes when try verify latest_receipt , status 21006 (expired receipt) , this: { receipt: { original_purchase_date_pst: '2013-08-06 11:58:04 america/los_angeles', unique_identifier: '------------', original_transaction_id: '----------', expires_date: '1376129825000', transaction_id: '------------', quantity: '1', product_id: 'subscription', item_id: '--------', bid: 'com.--------

modal box login form ajax jquery php -

i looking login / register using form in modal box appears pop up, ajax , jquery post data , php/mysql update data in database. please point me in right direction? have written code opens separate page when "login" clicked. looking functionality http://www.krizna.com/jquery/jquery-ajax-form-submit-using-twitter-bootstrap-modal/?demo also, let me know if twitter bootstrap better or if should use own designs. for nice looking modal window can use - bootstrap and bootstrap better :)

android - Updated SDK Manager causes loads of errors -

couple of days ago updated sdk manager. used on api 8 , added api 11 , api 16 plus other updates sdk tools: http://img17.imageshack.us/img17/926/fka9.jpg (also, note error @ bottom: [sdk manager] system cannot find path specified.) updating extremely painful. had unzip downloaded files , copy them on existing ones. update broke lot of projects. first had redo imports google-play-services-lib, there's plethora of other problems. there's standard import r problem. guess it's caused errors in xml files. btw haven't been there before update. errors no resource identifier found attribute 'showdividers' in linear layout or errors in style.xml why these errors happening? android manifest still unchanged , minsdk version set 8 (targetsdk set 17). project properties set android 2.2 seen in image: http://img560.imageshack.us/img560/9738/da6b.jpg any appreciated. you have update adt. 1) go help. 2) go install new software. 3) updates shown

android - How can I show the buttons on the bottom when Menu hard-key is pressed? -

i made buttons.xml in layout directory. i'd show on bottom of screen when user press 'menu hard-key' my current code this. @override public boolean onkeydown(int keycode, keyevent event) { if(keycode == keyevent.keycode_menu){ if (mactionbar.isshowing()) { mactionbar.hide(); <<here, want hide buttons on bottom>> } else { mactionbar.show(); <<here, want show buttons on bottom>> } }else if(keycode == keyevent.keycode_back){ webview mywebview = (webview)findviewbyid(r.id.webview1); mywebview.goback(); } return true; } if referring options menu here how use it. have move xml layout menu folder.

CruiseControl.net changes Working Directory for SVN checkout when using filters -

i have strange problem. trying implement filter svn versioninfo.txt file gets checked in during build. using cc.net 1.6 on windows xp sp3 below xml code: with filtered tag commented out, code executes correctly , files checked out. filtered tag comment tags removed, following error: "source control operation failed: svn: e155007: 'c:\build\amazingcharts\working\checkout' not working copy" notice path above stops @ checkout when should contain module1 or module2 specified in working directory. somehow when specify filter, working directory in svn tags ignored , seems use global working directory. how around this? have been combing through 1.6 xsd hours , stumped on how fix this. <sourcecontrol type="multi"> <sourcecontrols> <svn> <executable>$(svn_path)</executable> <trunkurl>$(subversion_url2)</trunkurl> <workingdirectory>$(checkout_abs_dir)\module

html - Fluid Header, Footer and 3 columns CS layout (Cross browser) -

Image
i need css code , html cross browser css layout (ie7+) header, footer , 3 columns (midde/left/right) middle section. want main (see illustration) have flexible width, both sidebars fixed width (e.g. 200px). don't want sidebars collapse down when shrink window. the main div have minimum width, let's 800px. all elements should have fluid height. thanks check fiddle accordion center http://jsfiddle.net/pduxc/7/ for full example click here http://jsfiddle.net/pduxc/14/ body { margin: 0; padding: 0; overflow: hidden; } .sidebarleft { width: 100px; height: 350px; background: red; top: 0; left: 0; position: absolute; z-index: 7; } .sidebarright { width: 100px; height: 350px; background: red; right: 0; top: 0; position: absolute; z-index: 6; } .main { width: 100%; height: 350px; background: green; position: absolute; z-index: 5; }

algorithm - Criteria for choosing mod value -

i have array array = {}, size of array n my constraints this: n <= 100000 , array i <=100 i have find products of elements in array, given mod value have mod product. mod value changes time , mod value less or equal n. my problem when chose, global mod value r = 1000000000 (which far bigger mod constraint) , whenever product exceeds value, mod result. but dont know why result im obtaining zero. my question how chose r in such situations? i dont know code likey 0 correct result. pick r large prime , make sure none of elements divisible number in order result different 0.

java - Send javascript to phonegap web view -

i working on android app phonegap, want send piece of javascript native java code "alert('23')" web view, how? details: phonegap: 3.0.0 platform: android i use sendjavascript function purpose nothing happened , not working me. my code: public class helloworld extends droidgap { @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); // set <content src="index.html" /> in config.xml super.loadurl(config.getstarturl()); //super.loadurl("file:///android_asset/www/index.html") intent intent = getintent(); string action = intent.getaction(); string type = intent.gettype(); if (intent.action_send.equals(action) && type != null) { this.handlesendtext(intent); } } public void handlesendtext(intent intent) { string sharedtext = intent.getstringextra(intent.extra_te

Android Application Getting First Activity Name -

hi manifest below <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.android.mic.controller" android:versioncode="1" android:versionname="1.0" > <uses-sdk android:minsdkversion="8" android:targetsdkversion="15" /> <application android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/apptheme" > <activity android:name=".mainactivity" android:label="@string/title_activity_main" > <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </intent-filter> </activity> </application> </manifest> my problem when install application name appears beneath appli

PHP Escaped special characters to html -

i have string looks "v\u00e4lkommen till mig" after doing utf8_encode() on string. i string become v&auml;lkommen till mig where character \u00e4 = ä = &auml; how can achive in php? do not use utf8_(de|en)code. converts utf8 iso-8859-1 , back. iso 8859-1 not provide same characters iso-8859-15 or windows1252, used encodings (besides utf-8). better use mb_convert_encoding. "v\u00e4lkommen till mig" > string looks json encoded string utf8 encoded. unicode code positiotion of "ä" u+00e4 >> \u00e4 . example <?php header('content-type: text/html; charset=utf-8'); $json = '"v\u00e4lkommen till mig"'; var_dump(json_decode($json)); //it return utf8 encoded string "välkommen till mig" what source of string? there no need replace ä html representation &auml; , if print in utf8 encoded document , tell browser used encoding. if necessary, use htmlentities : <?php $j

sqlite - Recursive Math in MySQL -

i apologize if not using right term. anyway, have 2 tables. 1 item table id , value. second mod table link item table , modifier. there may multiple modifiers given item. if item.value 100 , 2 modifiers linked item (say mod.modifier value of 1.25 , 1.1) value 137.5 (100 *1.25 *1.1) rather 135 (100 *(1.25+1.1)). this test code have written far: drop table if exists item; drop table if exists mod; create table item ( item_id integer primary key, value decimal ); create table mod ( mod_id integer primary key, item_id integer, modifier decimal ); insert item (item_id, value) values (0, 100); insert item (item_id, value) values (1, 10); insert item (item_id, value) values (2, 1000); insert mod (mod_id, item_id, modifier) values (0, 0, 0.25); insert mod (mod_id, item_id, modifier) values (1, 0, 0.10); insert mod (mod_id, item_id, modifier) values (2, 2, 0.10); insert mod (mod_id, item_id, modifier) values (3, 2, 0.05); insert mo