Posts

Showing posts from April, 2015

javascript - How to set the active status for a navbar? -

i've tried multiple codes setting active status on navbar menu link, none of them works. found bootply link works: http://bootply.com/70331 , won't work on menu. here's navbar: <div class="navbar"> <div class="navbar-inner"> <div class="container"> <!-- .btn-navbar used toggle collapsed navbar content --> <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </a> <!-- sure leave brand out there if want shown --> <a class="brand" href="{{ url::to('news/index') }}">emiaac</a> @include('common.menu_addition') @include('common.view_special') <!-- w

android - Fully opaque ImageButtons layered over a CameraPreview -

i have framelayout containing camerapreview , relativelayout . relativelayout contains imagebutton s. thus: <framelayout> <camerapreview/> <relativelayout> <imagebutton/> <imagebutton/> </relativelayout> </framelayout> i'm using camerapreview live-preview image coming camera. works correctly. imagebutton s display drawable bitmaps, , appear on camera preview. the problem buttons semi-transparent: camera image visible in background. want them fully-opaque make them more visible. how do this? i've tried calling setalpha() on buttons doesn't appear have effect. can suggest how can make buttons opaque? the problem turned-out image buttons had no background drawable resource , weren't inheriting 1 of views in parent hierarchy. adding android:background="@android:drawable/btn_default" imagebutton 's xml definition solved problem.

android - phonegap development, What is the easiest way to add plug-in? -

i have started phonegap using below link. http://docs.phonegap.com/getting-started/1-install-phonegap/desktop/ i have followed steps , able run first phonegap app successfully. i excited till now, stuck when want add plug-in(speech synthesis) same app. doing google, found that, need install below things. there other easy way this? install java (set path in environmental variables) download adt bundle , extract , set path in environmental variables. download , install node.js http://nodejs.org/ link. (set path in environmental variables if not set automatically) download apache ant. also step step links above steps broken, please suggest correct , easiest way add plug-in phonegap application. i found myself now.. below steps.. install npm https://nodejs.org/en/ install phonegap cli below command $ npm install -g phonegap instal git if not installed on desktop fro site or using below command. npm install -g git add plugin using below command @ pro

android - Updating ProgressBar from AsyncTask lagging UI -

i have fragment recyclerview , recyclerview 's viewholder holding progressbar show progress of downloading process. public static class viewholder extends recyclerview.viewholder { .... private progressbar progressbar = null; .... public viewholder(view itemview) { super(itemview); .... this.progressbar = (progressbar) itemview.findviewbyid(r.id.progessbar); .... } } i created callback fragment : public interface callbackitemchanged { void onitemchanged(final int position); } and if called do: @override public void onitemchanged(final int position) { this.adapter.notifyitemchanged(position); } and in asynctask : protected void onprogressupdate(integer... progress) { super.onprogressupdate(progress); this.entry.setprogress(progress[0]); this.entry.setprogressstring(progress[0] + "%"); this.callbackitemchanged.onitemchanged(this.entry.getposition()); } the progress publish

java.sql.SQLException: ORA-00933: SQL command not properly ended -

select substr(mesg,98,15) acc,from tbaadm.rtt cust_or_card_id= "+no+"'" + "and to_date(to_char(system_date_time,'mm-dd-yy'))= "+trandate+"'" + "and to_number(sno)=' "+sno+"'" + "and dcc_id='swt' , cmd='prcr' , bank_id='pmc01' "; you have quotations @ places or miss them else. , comma should deleted before from . "select substr(mesg,98,15) acc tbaadm.rtt cust_or_card_id= '"+no+"' " + "and to_date(to_char(system_date_time,'mm-dd-yy'))= '"+trandate+"' " + "and to_number(sno)= "+sno+" " + "and dcc_id='swt' , cmd='prcr' , bank_id='pmc01' ";

javascript - How to have a function wait until an object's value is not undefined js setTimeout -

i need stop function proceeding until php script gets contents file takes bit of time load. once loaded update object holds information on javascript file: var setdata = seoapp.sitedata.result.wordcount; i have created function updates html elements based on results of wordcount . i want script continually check if var setdata not undefined every few seconds wait script load setdata. thought settimeout using code: for (var = 0; < 10; i++) { settimeout(function () { console.log(i); if(setdata !== undefined){ // stops loop running again = 11 //run if statements here. }else { } }, 6000); } well didn't work. waits few seconds , fires loop without waiting 6 seconds until next one. what doing wrong , best way approach this? as requested php script scrape data: <?php $url = $_get["url"]; $string = $_get["keywords"]; libxml_use_internal_errors(true); //prevents warnings, remove if

ios - How to check IPv6 address of an IPhone -

i have setup ipv6 nat64 environment based on apple recommendations https://developer.apple.com/library/ios/documentation/networkinginternetweb/conceptual/networkingoverview/understandingandpreparingfortheipv6transition/understandingandpreparingfortheipv6transition.html , however when connect iphone 6 network not able see ipv6 address in wifi network settings connected. please me ipv6 address of iphone. the iphone tool of hurricane electric useful check network settings , connectivity: https://itunes.apple.com/us/app/he.net-network-tools/id858241710 the built-in user interface apple doesn't show ipv6 information unfortunately.

Sort 2D array in JavaScript -

i'm trying sort numbers in each array greatest smallest, first 1 being sorted. need nested loop? i'm stuck. function sortnums(arr) { for(var = 0; < arr.length; i++){ arr[i] = arr[i].sort(function(a, b){return b-a;}); return arr; } } sortnums([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]); when using return keyword function terminated. move outside iteration , should good: function sortnums(arr) { for(var = 0; < arr.length; i++) { arr[i] = arr[i].sort(function(a, b) { return b - a; }); } return arr; } sortnums([[4, 5, 1, 3], [13, 27, 18, 26], [32, 35, 37, 39], [1000, 1001, 857, 1]]);

python - Should my unit tests also test third-party library/package features? -

i've started using unit tests , i'm trying figure out how comprehensive tests should be. 1 particular thing comes when use packages/libraries components subject tests of own. should carrying out similar tests on components myself, or should testing features i've added? for example, suppose developing web app in python , i'm using wtforms validate input. should writing tests e.g. check behaviour when email input invalid, or when required field empty, etc, though wtforms contains own tests of form? my gut feeling bit redundant, since can run wtforms test suite on installation myself, i'm not sure if it's kind of no-no assume tests good. by definition unit's test responsability control behaviour of 1 single piece of code. responsability developper consistenly write unit test you (or team) develop. when speak of testing wtforms, have no reason write unit tests it. can make sense write integration test control way use in context (your cod

python - Windows 7 cmd, from Visual Studio, not displaying floats -

in visual studio 2015, made program calculate pi. variable pi float (i wasn't sure if necessary thought might in case), anyway.. here's function: float pi(int accuracy) { float pi = 3; int nint = 2; int next; (int = 0; < accuracy; i++) { next = 4 / (nint * (nint + 1) * (nint + 2)); nint += 2; if (i % 2 == 0) { pi += next; } else { pi -= next; } } return pi; } so far can see, should return float variable. when call it, use 2000 parameter, , should return quite accurate representation of pi. visual studio displays cmd, instead of writing decimal places, shows 3 . decided test in python. here's code: pi = 3 n_int = 2 # i'm using 1000 accuracy, because python's slower. in range(1000): nextint = 4 / (n_int * (n_int + 1) * (n_int + 2)) n_int += 2 if % 2 == 0: pi += nextint else: pi -= nextint print(pi) input() i tested python

shell - Dont understand (Pipes) usage unix -

i studying 'operational systems' exams @ uni , having hard time understanding pipes usage (|). here example found on internet: ps -ax | grep finder use ps command list of processes running on system, , pass list grep search lines containing "finder". (usually, it'll find two: finder, , processes executing grep finder.) what if first write ps -ax , @ next line grep finder ? wont have same result? why have pipe them together? ps: bigginer @ unix shell commands , how works. it's redirecting input , output. if type ps -ax > processes , create file processes list of processes. redirecting output. data shown screen instead written file. if type grep finder < processes , search file processes word finder. redirecting input. pipe both. redirects output of command on left side , redirects input of command on right side. $ ps -ax | grep finder is like $ ps -ax > temp $ grep finder < temp except on 1 line no temp

swift - Custom User Location Annotation Callout doesn't work -

Image
i want change standard annotation callout view user location annotation in swift. therefore created custom xib , custom class. in mapkit delegate load respective annotations. custom annotations appear every map annotation added expected not "current user location". here standard 1 being displayed still. how need change code standard 1 exchanged 1 below? func mapview(mapview: mkmapview, viewforannotation annotation: mkannotation) -> mkannotationview? { var identifier = "" if (annotation mkuserlocation) { identifier = "userlocation" let annotationinfo:[string:anyobject] = ["featuretypeid": gisfeaturetype.annotationcurrentposition.rawvalue] if let userannotation = mapannotation(annotationinfo: annotationinfo) { userannotation.title = "aktueller standort" let annotationview = mapannotationview(annotation: userannotation, reuseidentifier: ide

Sending email using PHPMailer PHP Syntax error? -

hey guys trying use php mailer send email through contact form on website. i used these settings. if (empty($errors)) { $m = new phpmailer; $m->issmtp(); $m->smtpauth = true; $m->host = 'smtp.gmail.com'; $m->username = 'myemail@gmail.com'; $m->password = 'its correct password'; $m->smtpsecure = 'ssl'; $m->port = 465; $m->ishtml(); $m->subject = 'submission of contact form'; $m->body = 'from:' . $fields['name'] . ' (' . $fields['email'] . ')<p>' . $fields['message'] . '</p>'; $m->fromname = 'contact'; $m->addaddress('myemail@gmail.com', 'myname'); if ($m->send()) { header('location: thanks.php'); die(); } else { $errors[] = 'sorry, try again later.'; } } i new php, seems have syntax error somewher

firebase setup on android -

Image
i can't setup updated version of firebase on android studio. i've created json file of project on site firebase , copied project , after coping lines in gradle: buildscript { // ... dependencies { // ... classpath 'com.google.gms:google-services:3.0.0' } } apply plugin: 'com.android.application' android { // ... } dependencies { compile 'com.google.firebase:firebase-core:9.0.1' } // add @ bottom apply plugin: 'com.google.gms.google-services' i following error: failed resolve: compile 'com.google.firebase:firebase-core:9.0.0' how can fix it? i had same problem. if using android studio, should update google repository in sdk manager. following build.grade(app) apply plugin: 'com.android.application' android { compilesdkversion 23 buildtoolsversion "23.0.3" uselibrary 'org.apache.http.legacy' defaultconfig { applicationid "packa

multidimensional array - Nested json unmarshaling with 2d slices into struct not working in golang -

i have json structure looks like { "devices": [ { "server": { "bu": { "add_info": false, "applications": [ [ "systems", 12 ], [ "someproject", 106 ] ], "name": [ [ "somename", 4 ], [ "commonname", 57 ] ], "owners": [ "someowner1", "someowner2" ], "users": [ "someuser1",

php - httpURLConnection.getInputStream() - 403 response - android -

Image
i learning android. trying achieve here simple connection between server , android device. i using wamp , have installed it. when try hitting php page (server script retieve db) via browser (using postman) able achieve want. i configured own network ip url below , worked fine in wamp , did work in postman well. using real android device , in same connection of system (wifi) my code i have 2 activies , corresponding xml's mainactivity ( login page) register welcome (on successful login) i have class named backgroundtask perform transaction backgroundtask class public class backgroundtask extends asynctask<string,void,string> { context ctx; backgroundtask(context ctx) { this.ctx = ctx; } @override protected void onpreexecute() { super.onpreexecute(); } @override protected string doinbackground(string... params) { string reg_url = "http://<my ip here>/<myproject>/register.php&qu

sql - Adding index to temporary table results in single row result set -

inside sp_executesql select statement used concatenate variable , value of column temporary table. this gives weird results when apply index temporary table , use ordering in aforementioned select statement. this happens when amount of rows of temporary table bigger 50 rows. i don't pasting big code examples, not able reduce further. if @maxjob >= 8, resulting @htmllog contains 67 characters. unexpected result. if @maxjob < 8, resulting @htmllog contain more 67 characters. expected result. furthermore, when remove index idx_key #acl_log table, issue disappears when @maxjob >= 8. or when remove 'order [key] asc' @executesql_sql issue disappears well. why? declare @logtable varchar(max) set @logtable = '#acl_log' if (object_id('[tempdb]..#acl_log')) not null drop table #acl_log create table #acl_log( [key] int identity, [message] nvarchar(max) not null, index idx_key ([key]) ) declare @job

google app engine - Why does my application print debug messages after deployment? -

i deployed project google app engine (gae) noticed debug messages can seen in dev-tool. i thought compiler remove debug output compiles release. this current logging configuration in module.gwt.xml <inherits name="com.google.gwt.logging.logging"/> <set-property name="gwt.logging.loglevel" value="all"/> <set-property name="gwt.logging.enabled" value="true"/> <set-property name="gwt.logging.consolehandler" value="enabled" /> <set-property name="gwt.logging.simpleremotehandler" value="disabled"/> <set-property name="compiler.stackmode" value="emulated"/> <set-configuration-property name="compiler.emulatedstack.recordlinenumbers" value="true"/> <set-configuration-property name="compiler.emulatedstack.recordfilenames" value="true"/> how can rid of debug output on deployed

itunesconnect - iOS - In-app purchases and beta testing -

i test app external testers. give them sandbox account test in-app purchases. in-app purchases hosted apple. my question is, after testing finishes, disable app testing in itunesconnect, submit app apple, , app becomes available on app store. testers download app app store. in-app purchases tested still there? installation app store act app update? i tried disabling app testing in itunesconnnect making "not available testing" , i'm still able use app, , test in-app purchases. if can't disable app testing testers in-app purchases test free? am missing something? can disable app testing completely? the app in testflight last 30 days day of download. after app not available. the live version different , needed downloaded separately app store. unique application compared beta app. treated fresh install. will in-app purchases tested still there? no will installation app store act app update? no will [users] in-app purchases test

actionscript 3 - Is it possible to run multiple Air clients in the same project (Intellij IDEA) -

basically, need test multiplayer functionality, , more useful have 2 air instances running @ same time. the way achieve creating 2 different projects, it's quite cumbersome. is there way inside same project?. it possible if use flash player instead though. restriction connected fact air-app id (which defined in app descriptor) should unique. so, set few flash build configurations in module in project structure, in each of them should set different application descriptors different app ids in tab "air package". then should create run configurations each of them , run them.

algorithm - wrong detail is written on the file in c programming -

Image
i'm using switch case , have loop , if/else in case. there no error detected,i still cant figure out why wont display correct type of car in file. frustrating bc due date tomorrow. coding @ case number 3. aim write information on customer_info file. here's coding , output: coding : #include<stdio.h> void display_cars(); float total_price_a(int); float total_price_b(int); float total_price_c(int); void readcustomerrent_info(); main() { int i,selection,answer; int noofcustomer; char car; printf("number of customers: "); scanf("%d", &noofcustomer); char fullname[noofcustomer][50], ic[noofcustomer][50], phonenum[noofcustomer][50], license[noofcustomer][50]; int renthour[noofcustomer]; float total_price[noofcustomer]; printf("\t=================================================="); printf("\n\t\t car rental system\n"); printf("\t==========================================

swift - Making Facebook login with new Firebase -

i want implement facebook login new firebase , can't right. i added cocoapods, went through docs both firebase , facebook. when open simulator this: http://d.pr/i/bvpz/4ibjkx9t this viewcontroller: import uikit import fbsdkcorekit import fbsdkloginkit import firebase class viewcontroller: uiviewcontroller, fbsdkloginbuttondelegate { let loginbutton: fbsdkloginbutton = fbsdkloginbutton() override func viewdidload() { super.viewdidload() // optional: place button in center of view. loginbutton.center = self.view.center loginbutton.readpermissions = ["public_profile", "email", "user_friends"] loginbutton.delegate = self view!.addsubview(loginbutton) } func loginbutton(loginbutton: fbsdkloginbutton!, didcompletewithresult result: fbsdkloginmanagerloginresult!, error: nserror?) { if let error = error { print(error.localizeddescription) return

apache spark - How to cast Any Scala to Double -

i iterating dataframe , need apply custom code each row i'm doing convertedpaths.foreach { row : row => cfmap = row.getvaluesmap(channelset.toseq) assume channelset set of column names. i've declared cfmap of type [string, any] getvaluesmap (as understood return data type of column) also, columns of long type trying : channelset.foreach { key : string => var frequency = cfmap.get(key).get.asinstanceof[double] var value = c * frequency given c variable of type double , value needs product of c , frequency gives me following error : overloaded method value * alternatives: (x: double)double <and> (x: float)double <and> (x: long)double <and> (x: int)double <and> (x: char)double <and> (x: short)double <and> (x: byte)double cannot applied (any) why asinstanceof[double] not correct solution , solution this? although doesnt answer problem statement , i'm trying read on accumulators on how collect result

ruby - ArgumentError `initialize': wrong number of arguments(8 for 0) -

so i'm new ruby , i'm trying learn more converting python script i'm working on ruby. however, i'm running annoying problem. every time try run following code, error: player.rb:81:in initialize': wrong number of arguments(8 0) (argumenterror) player.rb:81:in new' player.rb:81:in `' i'm positive there 8 arguments in initialize method, , have checked spelling many times over. can't seem figure out why interpreter doesn't believe constructor doesn't have arguments. inform me going wrong below? class player def determinelevel @xp_req4lvl = [0, 1000, 2250, 3750, 5500, 7500, 10000, 13000, 16500, 20500, 26000, 32000, 39000,47000,57000,69000,83000,99000,119000,143000,175000,210000,255000,310000,375000,450000,550000,675000,825000,1000000] if xp <= 1000 @level = 1 return end i=0 while < xp_req4lvl.length if xp > xp_req4lvl[i]

Deploy Appveyor build as GitHub release without making a tag -

i have project hosted on github , have compiling appveyor. i set appveyor each build deployed github release, each build overwriting last. way there 1 github release appveyor have latest build attached. i can't see how this, because if specify release in appveyor.yml error saying release exists (yes want overwrite it), , if don't, each deployment creates new tag current build, litter repository useless tags. on top of that, every time release gets deployed, creates new tag in turn triggers appveyor build. means every push repository triggers 2 identical builds. has worked out way deploy same github release continuously, replacing files latest versions, , prevent new appveyor build being triggered in response appveyor deployment? you can add force_update: true github deployment provider settings overwrite existing release.

javascript - handling focus and blur event in angular 1.5 component -

recently working in angular js project. happens face situation in need handle focus , blur events textbox. scenario need append $ sign when focus out textbox , append $ when textbox focused. i tried create component that angular.module('myapp').component('dollartext', { templateurl: '<input type="text">', controller: function($scope, ielm, iattrs){ ielm.bind('change', function(){ ielm.val('$'+ielm.val()); }); } }); but cant access focus event. know not doing correct. how can trigger both focus , blur in angular component. angular component best choice task. if want handle div or other, example, in ng-repeat or in long list of element, need use function(this) , on javascript side need use function(context) interact element. here's working plunker of suppose looking for. html: <html ng-app="my

xsd - Is this code still valid or too old? XML Field Rules Value Validation -

basically, want value validation there 1 field has number, field1 = # , field2 needs have same # (and give little red error if doesn't). i'm seeing following: <fieldrules xmlns="http://urlthatdoesn'texist" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema"> <valuevalidation><booleanrules><booleanrule type="error"> <expression type="winwrap">csng("0" &amp; "%amount%") &lt;&gt; csng("0" &amp; "%amount%") </expression> <message>field1=field2</message> </booleanrule> </booleanrules> </valuevalidation> </fieldrules> the problem is, i'm trying figure out needed in code , isn't , google isn't pointing me in right direction. need xmlns url?

networking - Communicating through two separate computer using java sockets -

i trying make chat server , client can communicate on 2 separate computers connected internet. 1 of them connected wifi , 1 through modem. here server code. greetingserver.java import java.net.*; import java.io.*; public class greetingserver extends thread { private serversocket serversocket; public greetingserver(int port) throws ioexception { serversocket = new serversocket(port); serversocket.setsotimeout(100000); } public void run() { while(true) { try { system.out.println("waiting client on port " + serversocket.getlocalport() + "..."); socket server = serversocket.accept(); system.out.println("just connected " + server.getremotesocketaddress()); datainputstream in = new datainputstream(server.getinputstream()); system.out.println(in.readutf()); dataoutputstream o

node.js - Cypher Query Return matched Nodes and optional relationships -

i trying find optimal way of returning matched nodes , relationships might have? here's problem: i need return users created project, so match (u : user)-[r:create]->(p: project) return u, collect(p) simple enough, user have other relationships , include them or optionally check (return true/false) for example user have relationship recommend, don't want limit it, if check if exists node? ideally return table this: user1 - project(s) - recommended user user2 - project(s) - null (nobody recommending) optional match match pattern , return null if not exist match (u : user)-[r:create]->(p: project) optional match (u)-[:recommend]->(rec) return u, collect(p), collect(rec)

proguard - Should I keep android.support.v4.app.Fragment and its derived classes when building a release version of my app? -

i read answer , undestood why should keep names of services, activities, , custom views. should keep classes derive android.support.v4.app.fragment? i took @ defualt proguard config file %sdk_dir%\sdk\tools\proguard\proguard-android.txt , , there no rules regarding fragments. the main reason why need keep class , because accessed via reflection. fragments not accessed via reflection, don't have keep them . except if reference them directly in layout files (because parsing layout files uses reflection).

android - Set button size as big as a fingertip in libgdx -

in libgdx game need display row 8 14 round buttons. i'm looking best way make sure buttons @ least size of fingertip (between 0.8 , 1 mm) not larger, because want them fit screen without scrolling if possible. i've found several possible solutions, don't know best, or if i'm missing better: use extendviewport, virtual size 480x360 example, , find suitable size buttons. easiest implement, result varies depending on screen density, size , aspect ratio. use stretchviewport, fix width of buttons, , calculate height @ runtime using device aspect ratio in order keep them round. depends on screen density , size, not on aspect ratio. use device density , physical size calculate @ runtime size of buttons. seems better approach buttons @ right size, more complex , low-level, find strange there isn't simpler ways this. so, think way go? joanq, use (slightly modified) suggestion 2 cover types of screens: use stretchviewport, fix width of buttons ( as pe

Android Volley - Waiting for multiple responses to complete and then do something -

so basically, send 3 requests using volley retrieve data database. because i'm using different adapters instances display each set of data. send them in order request1 request2 request3 i have put code inside onresponse() method of response3 processes data retrieved previous requests too. need wait all responses finish before processing. here lies problem though. there times request3 has least data retrieve, finishing faster others. responses this: response3 . here code processes data response1 , response2 executes before 2 have finished, getting wrong results. response1 response2 if there way wait all responses finish, can put processing code in method. don't know how that. ideas? simply write 2 methods: executesecondrequeset() has response2 executethirdrequeset() has response3 and inside onresponse() of first request call executesecondrequeset() declared , in onresponse() of call executethirdrequeset() method :)

javascript - Why is json_encode returning arrays instead of objects? -

if inclined downvote question, please indicate reason can learn mistakes. php - edit <?php require_once "dbconnect.php"; function isempty($str) { return strlen(trim($str)) == 0; } function getwritersdata() { try { if (!isset($_request["userid"]) || isempty($_request["userid"])) { throw new exception('a user-id must supplied.'); } $userid = $_request["userid"]; $dbh = connect2db(); $dbh->setattribute(pdo::attr_errmode, pdo::errmode_exception); $stmt = $dbh->prepare("select title, worktype, formtype, genre, numberofpages, filename, originalfilename writers fkaccounts = :userid"); $stmt->bindparam(':userid', $userid, pdo::param_int); $stmt->execute(); $rows = $stmt->fetchall(); echo json_encode($rows, json_force_object); } catch (pdoexception $e) { echo 'database error: '

javascript - Firebase synchronisation of locally-modified data: handling errors & global status -

Image
i have 2 related questions regarding firebase web platform 's synchronisation of locally-modified data server : every client sharing firebase database maintains own internal version of active data. when data updated or saved, written local version of database. firebase client synchronizes data firebase servers , other clients on 'best-effort' basis. 1. handling sync errors the data-modification methods ( set() , remove() , etc) can take oncomplete callback parameter: a callback function called when synchronization firebase servers has completed. callback passed error object on failure; else null . var oncomplete = function(error) { if (error) { console.log('synchronization failed'); } else { console.log('synchronization succeeded'); } }; fredref.remove(oncomplete); in example above, kind of errors should fredref.remove() callback expect receive? temporary errors? client offline (network connection l

java get byte from object that is not serializibe -

this question has answer here: converting object byte array in java 5 answers is there way bytes of object doesn't implement serializeble? in cpp know can copy size of object bytes address of object in memory, there way in java? edit: don't see how duplication of converting object byte array in java clarify meant convert specific non serilizable object no, isn't possible raw bytes of object. java doesn't have such view of world, objects have underlying byte representation. note serialization doesn't give access byte representation of object either. serialization way of encoding information in object byte array. doesn't give raw bytes. if somehow searched through memory serialized bytes wouldn't find them.

Accessing nameless attributes from JSON in VB .Net using DataContract -

i'm trying serialize in vb .net json file contains this: "scripts": [[123, 80, [["whenkeypressed", "space"], ["nextcostume"]]], [55, 32, [["whenkeypressed", "space"], ["doplaysoundandwait", "hello"]]]] i'm using datacontract , <datamember(name:="scripts")> , works fine rest of file, in case, attributes don't have names. jsonlint.com , json validator, saying valid json. how suppose qualify datamembers? also, has nameless array in it, how can can access it? any appreciated. i found workaround assigning scripts list(of object) in datacontract , casting scripts desired type @ runtime. casted ilist(of object) lists , iterated in them for loops. it doesn't "feel" "object-oriented" rest , can't reference fields name (since have none), works (with lot of casting, since work option strict on ). if there better way,

mysql - Query not outputting all relevant results from database -

i trying output relevant values database using code below. reason, information not output should be, , don't know why. i'm guessing there wrong query? $result = mysql_query( "select tbl_status.id statid, tbl_status.from_user statfrom, tbl_status.status statstatus, tbl_status.deleted statdel, tbl_status.date statdate, tbl_users.id usrid, tbl_users.name usrname, tbl_photos.profile photosprofile, tbl_photos.photo_link photolink, tbl_photos.default_photo photodefault tbl_status inner join tbl_users on tbl_status.from_user = tbl_users.id inner join tbl_photos on tbl_photos.profile = tbl_users.id tbl_status.deleted = '0' , tbl_photos.default_photo = '1' order tbl_status.date desc; "); based on query, here 4 possible reasons you're not seeing statuses: you're using inner join tbl_pho

java - troubles with converting byte[] to bitmap (android) -

i saw various people got problems this. use retrofit 2.0.0 beta 2 library. in android application, want have profile picture (so have actions upload new image , see profile (with image). server asp.net web api. i've been reading lot , far able upload image (not sure if correctly seems yes). have problems when trying image server display it, got answer server, when trying convert bytes array bitmap got null result. here's code, u can check out: android side (retrofit methods) @post("userprofile/upload") call<responsebody> updateimage(@body requestbody file); @get("userprofile/getuserimage") call<responsebody> getuserimage(); usage of methods: private void getprofilepic(){ call<responsebody> call = service.getuserimage(); call.enqueue(new customcallback<responsebody>(getactivity()) { @override public void onresponse(response<responsebody> response, retrofit retrofit) {