Posts

Showing posts from 2014

sql server - SQL : insert data from one table into two tables related to each other -

i have table tsource select result of cartesian product, there no unique id in set. in short lets table looks following: tsource ------- f1 | f2 ------- h | | b j | c k | d k | d i need "split" data of tsource tbl1 , tbl2 related each other: tbl1 tbl2 ------- ----------------- id | f1 id | tbl1_id | f2 ------- ----------------- 11 | h 51 | 11 | 12 | 52 | 12 | b 13 | j 53 | 13 | c 14 | k 54 | 14 | d 15 | k 55 | 15 | d id columns in both destination tables int identity any appreciated, thanx in advance do 2 insertions operations altogether in merge + output statement. merge @table2 t2 using ( select * @table ) src on (1 = 2) when not matched insert (f1) values (src.f1) output inserted.id, src.f2 @table3 (f1id, f2) ; complete example: declare @table table ( f1 char(1) , f2 char(1) ) insert @table va

html - can we use a variable to declare a div in JAVASCRIPT? -

i working in phone gap-android.i wanted set swipe view dynamically based on length of records. how do that? after long time,i tried implementing following code.am right or wrong? value= value_from_db.split("||"); (k=0;k<value.length;k++) { if (value[0] == paramname1) { return unescape(value[k]); console.log("no of swipe views "); } var val = k+1; var ni = document.getelementbyid('swiper-wrapper'); var newdiv = document.createelement('div'); var dividname = 'swiper-slide'+val; console.log("div name: "+dividname); newdiv.setattribute('id',dividname); newdiv.setattribute('class','swiper-slide'); var cnt1 = '<div id="container'+

Why we use TRUE in load a view in CodeIgniter -

controller: $data = array(); $page['left_content'] = $this->load->view('left_content', $data, true); $page['main_content'] = $this->load->view('left_content', $data, true); $page['right_content'] = $this->load->view('left_content', $data, true); $this->load->view('home',$data); view: <body> <?php if(isset($left_content)){echo $left_content;}?> <?php if(isset($main_content)){echo $main_content;}?> <?php if(isset($right_content)){echo $right_content;}?> </body> please take above code. code used view page in main homepage. take test. if remove true code code not work properly. means when remove view not prints @ right place. prints @ top of main view or main home page. have googled lot can not find cause use it. want know why use true in code? thnx when pass true optional parameter while loading view, returns content rather sending(displaying) data browser di

soap - Date filter in Microsoft Dynamics NAV webservice -

when sending filter webservice in php works fine, when need sort on dates encountered problem. need objects modified after date. in page have date element, so: <xsd:element minoccurs="0" maxoccurs="1" name="last_date_modified" type="xsd:date"/> and have tried solution explained here on so: dynamics nav (navision) webservice readmultiple date filter but our date format bit different, ours looks like: 2013-01-01 in our filter, have tried following: array( 'field' => 'last_date_modified', 'criteria' => '20130101..' ) and other variations, doesn't return anything. if leave blank returns everything. have idea can do? if somehow stored last_modified_date bigint unix timestamp? i've tested similar setup soapui , here i've got: outgoing message: <soapenv:envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:obj="urn:micros

c# - Set DateTimeCreate with EWS Proxy classes -

is possible change creationdatetime, sentdatetime, etc.???? i`m tring create/update message. run fine, need set field itemtype.createdatetime values (eg. need create message has time creation not today, year ego). have next code: //update created item itemidtype itemid = new itemidtype(); itemid.id = savedmessageid; itemid.changekey = savedmessagechangekey; itemtype setcreatedt = new itemtype(); setcreatedt.datetimecreated = new system.datetime(2000, 10, 10, 12, 12, 12); setcreatedt.datetimecreatedspecified = true; setitemfieldtype setitemfield = new setitemfieldtype(); setitemfield.item = new pathtounindexedfieldtype(); (setitemfield.item pathtounindexedfieldtype).fielduri = unindexedfielduritype.itemdatetimecreated; setitemfield.item1 = setcreatedt; updateitemtype request = new updateitemtype(); request.itemchanges = new itemchange

Swap items of void* pointer array without memcpy in C -

i writing school project, , need swap 2 items of void* pointer array. can following code: void swap(void *base, int len, int width) { void *p = malloc(width); memcpy(p,base,width); memcpy(base,(char*)base+width,width); memcpy((char*)base+width,p,width); free(p); } but need swap items without memcpy, malloc, realloc , free. possible? thank you why don't swap in way?: void swap(void *v[], int i, int j) { void *temp; temp = v[i]; v[i] = v[j]; v[j] = temp; } as qsort (swaps elements within array): void sort(void *v[], int left, int right, int (*comp)(const void *, const void *)) { int i, last; if (left >= right) return; swap(v, left, (left + right) / 2); last = left; (i = left + 1; <= right; i++) { if ((*comp)(v[i], v[left]) < 0) swap(v, ++last, i); } swap(v, left, last); sort(v, left, last - 1, comp); sort(v, last + 1, right, comp); }

Read XML document with LINQ TO XML -

i have little xml placed string, called mycontent: <people xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema"> <person id="1" name="name1" /> <person id="2" name="name2" /> (....) <person id="13" name="name13" /> <person id="14" name="name14" /> </people> and in c# have stored previous xml content in string variable below: private string mycontent = string.empty + "<people xmlns:xsi=\"http://www.w3.org/2001/xmlschema-instance\" xmlns:xsd=\"http://www.w3.org/2001/xmlschema\">" + "<person id=\"1\" name=\"name1\" />" + "<person id=\"2\" name=\"name2\" />" + (...) "<person id=\"13\" name=\"nam

javascript - Check status of all checkboxes in a form -

i have several check box in form wanna way check whether checked or not . if checked need store id in database(that can ) . question how determine whether checked or not instead of checking each check box on @ time . this code <!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> <title>insert title here</title> </head> <body> role id<input type="text" name="roll_id"/><br> role name<input type="text" name="roll_name"/><br> role description<textarea name="roll_desc"></textarea><br> <br> <br> screen1<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tab1<br>

iOS Run particular installed game from my app running in Guided Access -

i developing app ipad run in guided access. in app have entertainment tab open particular game installed on device , user should app again when exits. should run in guided access only. possible use custom url scheme in guided access? , if don't know url of particular game? please help. urls not open in guided access mode. can't open 1 in safari. there no way switch between apps in guided access mode. perhaps don't want guided access mode. can lock ipad down no apps can installed or deleted (without pin), , lock down web browser, etc., through settings restrictions.

java - How do I enter 2 inputs before entering -

i need program take 2 inputs, separated comma. example, user type in 5,12 , program read in both 5 , 12. how do that? read command-line arguments: public class echo { public static void main (string[] args) { (string s: args) { system.out.println(s); } } } if have comma separated input read 1 input: args[0] can split afterwards: string[] items = commaseparated.split(",");

android - AT&T XML speech recognition -

i have recognize alternative rules, don't know how mutual exclusion. example, if want recognize "play", "stop", or "set 1", "set 2", how can do? tried this, doesn't recognize when don't need number (for example, "start 2" correctly recognized, trivially don't want to). <grammar version="1.0" tag-format="semantics/1.0" xml:lang="en-us" root="main"> <rule id="main"> <ruleref uri="#actions"/> <ruleref uri="#numbers"/> </rule> <rule id="actions"> <item repeat="0-1"> <one-of> <item>play</item> <item>stop</item> <item>set</item> </one-of> </item> </rule> <rule id="numbers"> <item repeat="0-1"> <one-of>

sql - Select oracle schema which only contains specific table -

i'm looking way select schema on oracle server, contain table "mytable" how can ? i have query list schema in database. select username all_users; thank ! you can on all_tables system table: select distinct owner all_tables table_name = 'mytable'

matlab - Code Analyzer: INV is slow and inaccurate -

when try calculate matrix inverse using matlab's inv() operation: a = rand(10,10); b = rand(10,1); c = inv(a); d = c*b; i following warning @ last row: inv slow , inaccurate. use a\b inv(a)*b , , b/a b*inv(a). i can change code above into: a = rand(10,10); b = rand(10,1); c = inv(a); d = a\b; now don't warning, don't think solution better. note: need store both inverse of matrix inv(a)*c. also, in real file size of matrix can 5000 x 5000 or bigger. are there better solutions in terms of efficiency , accuracy or first method fine? you should listen matlab , use second option. inv(a)*b , a\b computed different algorithms under hood, , \ indeed more accurate. the documentation inv states: in practice, seldom necessary form explicit inverse of matrix. frequent misuse of inv arises when solving system of linear equations ax = b. 1 way solve x = inv(a)*b. better way, both execution time , numerical accuracy standpoint, use matrix division o

taking data from .xls file to python list -

open workbook import xlrd wb = xlrd.open_workbook('/home/alahab65/desktop/parameter.xls') check sheet names wb.sheet_names() get first sheet either name sh = wb.sheet_by_name('qa_test') l = [] iterate through rows, returning each list can index: for rownum in range(sh.nrows): l.append(sh.row_values(rownum)) print l when reading excel python list there come ‘u’ before every data. how can rid of this? read string? have convert every time? the 'u' not part of string, comes before quotes , indicates unicode string, should fine. also, may want have @ more recent openpyxl .

javascript - Retrieve list of a specific attribute from a Backbone collection -

i'm looking way to, backbone collection, retrieve kind of array of 1 specific attribute. var somemodel = backbone.model.extend({ defaults: function() { return { attr1: "something", attr2: "something", attr3: "darkside" }; } }); var somecollection = backbone.collection.extend({ model: somemodel, url: '/data.json', }); now assume have above , want collection/array/similar attribute 'attr3'. there nice way (not manually iterating through somecollection , building new collection)? understanding underscore function "filter" returns entire somemodel based on premise, i.e. not want. ideas? thanks if want 1 attribute, can use _.pluck somecollection.pluck('attr3'); for multiple attributes, can combine _.map on collections , _.pick on models somecollection.map(function (model) { return model.pick('attr2', 'attr3');

c - EXC_BAD_ACCESS, Could not access memory -

i have code doing numerical optimization (large program). in gdb exits with program received signal exc_bad_access, not access memory. reason: 13 @ address: 0x0000000000000000 [switching process 8673 thread 0x1203] 0x00007fff95d2a9fb in small_malloc_from_free_list () during backtrace told following line contains error, can't figure out what's wrong. 177 u = calloc(cols*cols,sizeof(double)); the code containing line is int fcn_invxx(double *x, int rows, int cols, double *invxx) { //--------------------------------------------------------------- // declarations //--------------------------------------------------------------- // counters , info int i, j, info; // upper triangular placeholder, u, , x'x double *u, *xx; // indicator upper triangular char s; // alpha , beta matrix multiplication - see dgemm documentation double alpha, beta; //---------------------------------------------------------------

caching - WSO2 ESB CACHE: return same responses for different SOAP request with same URL endpont -

i speack spanihs. try english. have wso2 proxy service backend soap webservice. works fine! problem starts when enable response caching proxy service, 20 seconds caching. set ports in tcpmonitor(localhost 8280 , 1 backend service). see when send different requests proxy, returns same cached response. return response cached first request 20 seconds of life cache. differents body http different requests, same headers , post uri. does esb hash headers+body or headers? thansk diego are suing cache mediator ? cache mediator caches response, whenevr sees same request comes system, sends cached response. or else did enable response caching fro proxy services?

osx - Automator: "run shell script" action only receives 1st line of input -

Image
i have weird looking problem (a similar 1 asked here, don't want accept automator pipes 1 line shell script action!: mac automator: shell script gets 1 line ) automator-workflow, type "service", 3 blocks: service receives "text" "run shell script", "bash", input via "stdin", shell script: "cat" copy clipboard" when select multiline text , run service first line finishes in clipboard. i made 3 other tests: skip shell script action - directly move selection clipboard >> works! instead of taking input text selection shell script action gets input via "read clipboard" action clipboard >> fails (first line only) instead of "bash" action selected "perl" action >> fails (first line only) so seems obvious run shell script action contains problem. have used shell script action (with web-content) many times before no problems. any ideas? maybe problem enc

android - How can I create a simple api to test my mobile app without having to code the api out on a server? -

i making android , ios app going interact server using api returns appropriate json responses. else on team doing server side work. don't want bother/wait finish server implementation. is there website out there me create test api whenever call it, return predefined json response? example: if website called api.com , if create account , call get api.com/my_account/get_key returns {"key": "fgjllpoiunvxaqw"} . hardcode response on website of course. thanks :) if just reading data server (e.g. making /get requests) can put .json files on server , read them app. for example, get_key, call get yourwebsite.com/get_key.json , parse data. way can simulate how app works network delays, useful start adding loaders , error handling ui. if need post, have php script write file on server, check later it's being posted: <?php file_put_contents('testpostuserdata.txt', file_get_contents('php://input')); ?> if require m

c# - How to serialize Wi-Fi config object to wpa_supplicant.conf -

there here example of wpa_supplicant.conf # allow frontend (e.g., wpa_cli) used users in 'wheel' group ctrl_interface=dir=/var/run/wpa_supplicant group=wheel # # home network; allow valid ciphers network={ ssid="home" scan_ssid=1 key_mgmt=wpa-psk psk="very secret passphrase" } # # work network; use eap-tls wpa; allow ccmp , tkip ciphers network={ ssid="work" scan_ssid=1 key_mgmt=wpa-eap pairwise=ccmp tkip group=ccmp tkip eap=tls identity="user@example.com" ca_cert="/etc/cert/ca.pem" client_cert="/etc/cert/user.pem" private_key="/etc/cert/user.prv" private_key_passwd="password" } i have object in c# code named wificonfig, used save ssid, key_mgmt, psk , etc., want use c# code create file if not exist, how serialize object , create file, there provide sample code that? i'm not sure if c# serialize tech. suitable method, thanks.

sql server - avoid "Cannot use SAVE TRANSACTION within a distributed transaction" error between SQL 2005 and 2008 -

in our production environment have stored procedure (in sql 2005 server) import data local table remote stored procedure (stored in remote sql 2008). the code this: insert <<local table name>> (fund, strat, clr, [id], position, unsettledposition) exec <<remote stored proc name>> 'aapl us' , '2013-05-13' i receive error: cannot use save transaction within distributed transaction. and the current transaction cannot committed , cannot support operations write log file. roll transaction. i have configured both local , remote dtc allowing dtc access on network, allowing remote clients option, allowing inbound & outbound communication, , enabling xa transactions, without success. until yesterday remote server old sql 2005 , code worked well, guess miss config settings in new server 2008. please me? this error reproduced, msdtc turned on: begin distributed transaction; ... save transaction abc; accord

c# - JSON.Net in Api controllers w/ param containing Dictionary is always null -

i've seen tutorials out there claim work, outdated or not work. how can use json.net serialize , deserialize data received , sent api controllers? we using vs2012. update i have model this public class searchmodel { public int pageindex { get; set; } public int pagesize { get; set; } public dictionary<string, object> terms { get; set; } } and api controller this public class modelsearchapicontroller : apicontroller { public list<model> get([fromuri] searchmodel search) { return new list<model>(); } } however, search provides correct value set in ajax request, property terms empty dictionary. i know can provide value [ { key:"foo", value:123 } ] why can't pass normal json object (ie { foo:123 } ) ??? why can serialize dictionary nice standard json object, cannot take exact same object , recreate dictionary . beyound me. edit in other words, if browser sends these arguments : pagein

Programmatic Object Creation in Objective-C -

below there 2 methods programmatically alloc , init objects of various classes , 'types'. - (id)buildobjectofclass:(nsstring *)classstring andtype:(nsstring *)typestring { id buildobject; class classname = nsclassfromstring(classstring); sel initwithtypeselector = nsselectorfromstring(@"initwithtype:"); if ([classname instancesrespondtoselector:initwithtypeselector] == yes) { buildobject = [[classname alloc] performselector:initwithtypeselector withobject: typestring]; } return buildobject; } this method implementation written more tersely simply: { return [[classname alloc] initwithtype:typestring]; } questions are: 1) verbose version necessary? , 2) if so, programmed best be? there shortcuts or best practices neglecting? the difference between verbose , terse versions of method verbose version validates class instances can respond -initwithtype:

tsql - SQL Server - Finding the first day of the week -

i've been looking around chunk of code find first day of current week, , everywhere see this: dateadd(wk, datediff(wk,0,getdate()),0) every place says code i'm looking for. the problem piece of code if run sunday chooses following monday. if run: select getdate() , dateadd(wk, datediff(wk,0,getdate()),0) results today (tuesday): 2013-05-14 09:36:39.650................2013-05-13 00:00:00.000 this correct, chooses monday 13th. if run: select getdate()-1 , dateadd(wk, datediff(wk,0,getdate()-1),0) results yesterday (monday): 2013-05-13 09:38:57.950................2013-05-13 00:00:00.000 this correct, chooses monday 13th. if run: select getdate()-2 , dateadd(wk, datediff(wk,0,getdate()-2),0) results 12th (sunday): 2013-05-12 09:40:14.817................2013-05-13 00:00:00.000 this not correct, chooses monday 13th when should choose previous monday, 6th. can illuminate me what's going in here? find hard believe no 1 has pointed out

git - GitX - Disabled View Buttons -

my gitx works fine main repo might working with. however, when main repo contains submodules , open gitx @ submodule directory, 'view' buttons disabled. preventing me accessing 'commit view' can stage , commit changes through gitx. anyone know why gitx might preventing me using 'view' buttons? you using out of date version of gitx. use actively maintained version: https://rowanj.github.io/gitx/

java - GCM Plugin for Unity, Could not find method GCMRegistrar.checkDevice -

i've seen posts before, none of solutions seem have worked me. i downloaded/installed eclipse mobile( http://www.eclipse.org/downloads/packages/eclipse-mobile-developers/junosr2 ), , created android application, using instructions found guy's video tutorial( http://www.youtube.com/watch?v=tazeiionva0 ) make library can drop unity. of course, tutorial mobclix, trying build gcm plugin, process similar. think have included dependencies need. in eclipse, in project see "android dependencies" includes: classes.jar(contains unity player hooks), gcm.jar , android-support-v4.jar. under "android 4.2.2" see "android.jar". under "referenced libraries" see classes.jar , gcm.jar. following other forum posts(such one: gcm : java.lang.noclassdeffounderror: com.google.android.gcm.gcmregistrar ) error had manually copied gcm.jar , classes.jar "libs" folder(i using adt 17), selected add build path. after of this, still see 2 errors when

How to pass a database value from asp.net to a javascript function (slideshowpro)? -

i have web pages containing slideshows powered javascript, , database connections powered asp.net. slideshows run flash files, urls stored in database. a static page have in headscript: > <script type="text/javascript"> var expressinstallswfurl = {}; var > flashvars = {}; var params = {}; var attributes = {}; > swfobject.embedswf("/_flash/2909.swf", "slideshowdisplay", "575", > "300", "9.0.0", expressinstallswfurl, flashvars, { wmode: > "transparent" }, attributes); </script> ... /_flash/2909.swf url of flash file static page, , "slideshowdisplay" target div. now need call flash file dynamically, eg replacing static 2909 <%# eval("myflashfileurl") %> filename datasource. fails: swfobject.embedswf(<%# eval("myflashfileurl") %>, .... my javascript sucks , i'm beginner asp (i speak vb, no c#), i'd appreciate solution that's

How to get caller flow name in private flow in Mule -

i've private flow shared lot of public flows using flow-ref . i'm looking caller flow name in private flow, using mel , using mule 3.3.0. possible? mule doesn't add property event when invokes private flow via flow-ref options are: use <set-variable> set variable flow name before calling private flow , read variable #[flowvars.yourvariablename] . use inbound endpoint of calling flow way tell who's calling. can either inbound endpoint url #[message.inboundproperties.mule_endpoint] or name #[message.inboundproperties.mule_originating_endpoint] . create custom messageprocessor implements flowconstructaware : way you'll flow name , able automatically set invocation variable on muleevent 's message. use custom-processor element in parent flows, before flow-ref .

regex - Trying to accomplish similar functionality of .contains on an array of string using substring -

i have array of directory paths: directory.getfiles(uploadpath) i want check array see if file exists in 1 of file paths. after looking @ of similar questions on so, came below. work except not match since file name substring of path in array. trying avoid loop. if array.indexof(directory.getfiles(uploadpath), filename) > -1 'do cool coding stuff exit sub end if my other thought getfiles method has searchpattern string parameter, guessing put regex there return value after last '\'. so have works perfectly: if directory.getfiles(uploadpath, filename).length > 0 'do code stuff exit sub end if the searchpattern argument of getfiles doesn't take regex , matches against filename, wouldn't need fancy. call getfiles passing in directory name search first argument , filename looking second.

c++ - IBM Rhapsody containers, need algorithms similar to STL -

i using ibm rhapsody in c++ , need perform generic algorithm on rhapsody containers omcollection, omlist or ommap similar stl's for_each, copy, remove, count_if, etc etc etc. there custom library or package perform this, or there adapter allow me apply stl generics rhapsody container ? want able write along lines of: omlist<omstring> mystringlist; for_each(mystringlist.begin(),mystringlist.end(),myfoid); without having use stl containers in rhapsody.

jboss - Ant Build Issue: NoClassDefFoundError -

i'm new ant , application. i'm not able decode error message. c:\eclipse\sources_int\external-sources>ant netstudy-generate-client buildfile: c:\eclipse\sources_int\external-sources\build.xml netstudy-generate-client: [delete] deleting directory c:\eclipse\ext_sources_int\external-sources\build\generated_classe s [mkdir] created dir: c:\eclipse\sources_int\external-sources\build\generated_classes [java] java.lang.noclassdeffounderror: org/apache/cxf/tools/wsdlto/wsdltojava [java] caused by: java.lang.classnotfoundexception: org.apache.cxf.tools.wsdlto.wsdltojava [java] @ java.net.urlclassloader$1.run(urlclassloader.java:202) [java] @ java.security.accesscontroller.doprivileged(native method) [java] @ java.net.urlclassloader.findclass(urlclassloader.java:190) [java] @ java.lang.classloader.loadclass(classloader.java:306) [java] @ sun.misc.launcher$appclassloader.loadclass(launcher.java:301) [java]

java - Need custom order in flat file from XML using XSLT -

i want create flat file xml using xslt output in order shown: nm1*cc*1*smith*john****34*999999999~ n3*100 main street~ from xml: <claim> <claimant lastname="smith" firstname="john" middlename="" suffixname="" indentificationcodequalifier="34" identificationcode="999999999"> <claimantstreetlocation primary="100 main street" secondary=""/> </claimant> </claim> with xslt created output in reversed desired order shown below due nature of how xslt works traverses input tree i'm assuming: n3*100 main street~ nm1*cc*1*smith*john****34*999999999~ what need change/add order looking xslt i've written shown: ` <xsl:template match="claim/claimant"> <xsl:apply-templates /> <xsl:text>nm1*cc*1*</xsl:text> <xsl:value-of select="@lastname" /> <x

ember.js - How to add/remove class to array of objects in Ember JS -

i try learn ember js. , can not find answer question . have template <script type="text/x-handlebars"> <table class="table"> {{#each app.todolistcontroller}} {{#view app.viewtable todobinding="this"}} <td>{{title}}</td> <td><a href="javascrpt:" {{action "deletetodo" target="view"}}>x</a></td> {{/view}} {{/each}} </table> <button {{action "deletetodo" target="app.todolistcontroller"}}>delete</button> </div> </script> in app.js have controller , view : /******************* controller *******************/ app.todolistcontroller = em.arraycontroller.create({ content : [], createtodo : function(title) { var todo = app.todo.create({title:title}) this.pushobject(todo) } }); /*******************

jobs - Torque PBS Manager permission rules cannot be changed -

when try change queue such: set queue standard total_jobs=16 i following error: qmgr obj=standard svr=default: cannot set attribute, read or insufficient permission total_jobs i issuing command root. total_jobs not appear valid qmgr parameter in documentation. http://docs.adaptivecomputing.com/torque/help.htm#topics/12-appendices/serverparameters.htm i'm not sure total_jobs supposed do. maybe looking max_user_queuable

android - How to get the pass one Json object into another -

i doing json parsing , have stuck on here, in jsonobject , inside have jsonobject. getting label etc values how parse actionparam values inside. { "label": " day schedule", "action": "schedule", "actionurl": "https:\/\/www.abc.com\/api\/2\/event\/schedule.php", "actionparams": { "id": "108501", "dr": "1390107600-1390194000", "track": "108625" } thank in advance so actionparams value nested jsonobject - indicated { } bracket. need think of parsing json unpacking set of russian nesting dolls. need to (1) create jsonobject intiial string contains actionvalues jsonobject firstobject = new jsonobject(stringvalue); (2) actionparams jsonobject initial object jsonobject actionparams = firstobject.getj

android - TextView fill with points -

sorry english i have 1 relativelayout , 2 textviews <relativelayout android:layout_width="fill_parent" android:layout_weight="1" android:layout_height="wrap_content" > <textview android:id="@+id/textview9" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignparentleft="true" android:layout_alignparenttop="true" android:singleline="true" android:textappearance="?android:attr/textappearancemedium" /> <textview android:id="@+id/textview10" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentright="true"

Pointer to struct in C# to create a linked list -

c# not pointers, need use them create linked list, in c. struct simple: public unsafe struct livro { public string name; public livro* next; } but error: "cannot take address of, size of, or declare pointer managed type". ideas? you can use class instead of struct : public class livro { public string name { get; set; } public livro next { get; set; } } this provide proper behavior automatically. that being said, might want use linkedlist<t> class framework directly.

java - Can't get application made with google app engine to run -

i have been following this tutorial to create to-do list app using google app engine. when go deploy error java.lang.exceptionininitializererror: from looking @ output in console links following line in code entitymanager em = emfservice.get().createentitymanager(); i have seen similar on site there no solution it. below classes related error dao.java public enum dao { instance; @suppresswarnings("unchecked") public list<todo> listtodos() { entitymanager em = emfservice.get().createentitymanager(); query q = em.createquery("select m todo m"); list<todo> todos = q.getresultlist(); return todos; } public void add(string userid, string summery, string description, string url) { synchronized(this) { entitymanager em = emfservice.get().createentitymanager(); todo todo = new todo( userid, summery, description, url ); em.persist(todo); em.close(); } } @suppresswarnings("unchec

How to use If statements in SQL? -

i trying create if statement in sql, possible? if start2 >= start1 , start2 <= end1, group_start=start1 (else start2) if end2 >=end1, group_end=end2 (else end1) not clear trying do, use case-statements this. try below code , see if after. select case when start2 >= start1 , start2 <= end1 start1 else start2 end group_start ,case when end2 >= end1 end2 else end1 end group_end ...

eclipse - Android force close when button clicked -

the application force close when click button. java, xml , manifest have no error. don't understand why application force closing when click button. java code. package com.aza.geopi; import android.app.activity; import android.os.bundle; import android.content.intent; import android.widget.button; import android.view.view; public class menuactivity extends activity implements view.onclicklistener { /** called when activity first created. */ button materi; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_menu); materi = (button)findviewbyid(r.id.button1); materi.setonclicklistener(this); } public void onclick(view view){ if (view==materi) { intent intent = new intent (menuactivity.this, materi.class); startactivityforresult (intent, 0); } } } this xml code <absolutelayout xmlns:android="http://schemas.android.com/apk/res/android"