Posts

Showing posts from August, 2012

ios - dispatch_after wont run code under it when executed in swift -

when use dispatch_after method produce delay never executes code after it. need return array skips on it. here matt's delay method: func delay(delay:double, closure:()->()) { dispatch_after( dispatch_time( dispatch_time_now, int64(delay * double(nsec_per_sec)) ), dispatch_get_main_queue(), closure) } here method error occurs: func rolldice() -> array<int> { var dicearray = [int]() let timertime:nstimeinterval = 0.3 delay(timertime) { //my code } return dicearray //never gets here } you don't seem understand delay is. code operate in order: func rolldice() -> array<int> { var dicearray = [int]() // 1 let timertime:nstimeinterval = 0.3 delay(timertime) { // 3 } return dicearray // 2 } so, rolldice return empty dicearray before code inside delay ever runs. whatever doing inside delay ineffective point of view; has, , can hav...

python - Combining linked lists iteratively -

i'm trying combine 2 linked lists iteratively, have right giving me reverse of result. there way combine lists in correct order without having reverse if after result list created? class link: empty = () def __init__(self, first, rest=empty): assert rest link.empty or isinstance(rest, link) self.first = first self.rest = rest def __add__(self, lst): """ >>>s = link(1, link(2)) >>>s + link(3,link(4)) link(1,link(2,link(3,link(4)))) """ result = link.empty while self not link.empty: result = link(self.first,result) self = self.rest while lst not link.empty: result = link(lst.first, result) lst = lst.rest return result conceptually, combine 2 linked lists, need find tail of first list, , connect head of second list, , return head of first list. major proble...

javascript - Why jQuery .val() work and js .value doesn't work -

i have problem jquery .val() method , native js .value. have function use in 2 different page, html code : <input type="hidden" name="checkentreelun" value=""/> <input type="hidden" name="checkentreemar" value=""/> <input type="hidden" name="checkentreemer" value=""/> <input type="hidden" name="checkentreejeu" value=""/> <input type="hidden" name="checkentreeven" value=""/> <input type="hidden" name="checkentreesam" value=""/> <input type="hidden" name="checkentreedim" value=""/> and other page same code, except there default value in inputs. , in js function, need value of each input. here have : for (i=0;i<days.length;i++){ var nameentree = "checkentree"+days[i]; var checkentreematin = $("inpu...

programatically add a function to a javascript file from another javascript -

i want add function/code java script file script. have below code in a.js /*some comments.. 4-5 lines*/ module.exports = { aaa: aaa, add: add }; var asd = 'test'; function aaa() { console.log('ddddd --- ' + asd); } function add(a, b) { var sum = + b; console.log(sum); } from js file need add below function a.js , update module.exports list function diff(c, d) { ///some code } i parsed contents of a.js , new function esprima parser , splice function added code. converted ast code recast , wrote file comments gone. how insert code without affecting other content of original file?

python - How do I split a string BEFORE a certain character? -

timeline = ''' 1961 - second child, john, born. 1963 - ordained presbyterian minister. makes on-camera debut host of series of 15-minute episodes children produced in toronto. program titled "mister rogers." 1964 - returns pittsburgh , turns 15-minute show half-hour "mister rogers' neighborhood." 1968 - "mister rogers' neighborhood" debuts on pbs , wins first of several emmy awards. rogers appointed chairman of forum on mass media , child development of white house conference on youth. 1969 - wins first of 2 george foster peabody awards television excellence. fred rogers readies opening pitch start pirates' season in 1988. (post-gazette archives) 1971 - forms production company, family communications inc. 1975 - ceases production on "mister rogers' neighborhood," continues air on pbs in reruns. 1978 - creates pbs series "old friends, new friends," focusing on older people. 1979 - production re...

asp.net mvc - jquery limit adding partial view -

i think simple, not know why code not work. i dynamically adding textboxes in view using partial view, want add restrictions number of rows added. below code not limit number of rows added. kindly help, in advance. @section scripts { @scripts.render("~/bundles/jquery") <script> $("#btnadd").on('click', function () { var counter = 0; if (counter > 5) { alert("limit exceeds"); return false; } else { $.ajax({ async: false, url: '/employee/add' }).success(function (partialview) { $('#add > tbody').append("<tr>" + partialview + "</tr>"); }); } counter++; }); function deleterow() { var par = $(this).parent().parent(); par.remove(); }; $("#add").on("click", ".btnremove...

binary - How to edit the file generated by file sink of Gnu Radio? -

i find file generated file sink block binary format, can not edit gedit under linux or else, how can edit file? i send dat file contains "hello world" , want recieve file contains "hello world" this asked often. here's link faq , excerpt: all files in pure binary format. bits. that’s it. floating point data stream saved 32 bits in file, 1 after other. complex signal has 32 bits real part , 32 bits imaginary part. reading complex number means reading in 32 bits, saving real part of complex data structure, , reading in next 32 bits imaginary part of data structure. , keep reading data. take @ octave , python files in gr-utils reading in data using octave , python’s scipy module. the exception format when using metadata file format. these files produced file meta sink: http://gnuradio.org/doc/doxygen/classgr_1_1blocks_1_1file__meta__sink.html block , read file meta source block. see manual page on metadata file format more informa...

mysql - HTTP Status 500 - An exception occurred processing JSP page /ratinglist.jsp at line 50 -

ok have tried working on hour , sure it's easy think blind own code. page should retrieve data sent arraylist retrieved query mysql. here tomcat log: 06-mar-2016 20:42:26.465 severe [http-nio-8084-exec-12] org.apache.catalina.core.standardwrappervalve.invoke servlet.service() servlet [ratingservlet] in context path [] threw exception [an exception occurred processing jsp page /ratinglist.jsp @ line 50 47: <tr> 48: <td>${newrating.scale}</td> 49: <td>${newrating.userid}</td> 50: <td>${newrating.text_rating}</td> 51: <td></td> 52: <%-- <td>${newrating.text_rating}</td> --%> 53: <td></td> stacktrace:] root cause javax.el.propertynotfoundexception: property 'text_rating' not found on type edu.csueb.cs6665.bean.ratings @ javax.el.beanelresolver...

python - pyspark how to plus between two RDDs with same key match -

suppose have 2 rdds where rdd1 has (key1,key2,value) and rdd2 has (key1, value) now want combine operation ( + or minus ) rdd2 rdd1 key1 has match here example rdd1 has [1,1,3],[1,2,2],[2,2,5] rdd2 = sc.parallelize([1,1]) i want result rdd3 [1,1,4],[1,2,3],[2,2,5] first , second data added while third 1 wasn't i try use left outer join find match on key1 , operation lost data don't need operation there way operation in partial data? assuming want pairwise operations or data contains 1 0..1 relationships simplest thing can convert both rdds dataframes : from pyspark.sql.functions import coalesce, lit df1 = sc.parallelize([ (1, 1, 3), (1, 2, 2), (2, 2, 5) ]).todf(("key1", "key2", "value")) df2 = sc.parallelize([(1, 1)]).todf(("key1", "value")) new_value = ( df1["value"] + # old value coalesce(df2["value"], lit(0)) # if no match (null) take 0 ).alias("value...

Arduino BLE Raspberry reading data -

trying send data on ble redbear blend micro arduino board raspberry pi (raspian), bluez 5.37. i'm using nrf8001 helloworld.ino sketch . i can receive "hello world" if running redbear ble controller app on android. from rpi can use gatttool , connect blend micro. questions: how can find out the different handles represents? how can read "hello world" gatttool? my end purpose read data dht11 humidity sensor , display on dashboard using d3js on websockets. got chain work fine serial usb "only" need bluetooth going. python code i'm trying go vanilla possible using pexpect , gatttool. thanks in advance. pi@raspberrypi:~ $ sudo gatttool -b ec:ea:fa:d8:f9:77 -t random -i [ec:ea:fa:d8:f9:77][le]> connect attempting connect ec:ea:fa:d8:f9:77 connection successful [ec:ea:fa:d8:f9:77][le]> primary attr handle: 0x0001, end grp handle: 0x0007 uuid: 00001800-0000-1000-8000-00805f9b34fb attr handle: 0x0008, end grp handle: 0x000b uui...

c - Strip AES padding during fread/fwrite -

i'm using libgcrypt encrypt , decrypt files. when take in proper amount of bytes using fread, need pad 16-n bytes in order encrypted gcry_cipher_encrypt . upon decryption however, null bytes/padding still present. there way read , write in 16 byte blocks , still strip padding @ end? #include <stdio.h> #include <gcrypt.h> #define algo gcry_cipher_aes128 #define mode gcry_cipher_mode_cbc #define key_length 16 #define block_length 16 int main(){ char iv[16]; char *encbuffer = null; file *in, *out, *reopen; char *key = "a key goes here!"; gcry_cipher_hd_t handle; int bufsize = 16, bytes; memset(iv, 0, 16); encbuffer = malloc(bufsize); in = fopen("in.txt", "r"); out = fopen("out.txt", "w"); gcry_cipher_open(&handle, algo, mode, 0); gcry_cipher_setkey(handle, key, key_length); gcry_cipher_setiv(handle, iv, block_length); while(1){ bytes = fread(e...

image - Android Glide download before display -

i'm using glide , want know if it's possible download images without display them fill cache display them later ? tried images not downloaded : for (string url: urls) { glide.with(getbasecontext()).load(url); log.v("download", "processing"); } can me ? i solved problem can use download images : glide .with( context ) .load( "http://futurestud.io/icon.png" ) .downloadonly(2000, 2000); and , display images in cache, should use same url , add diskcachestrategy parameter : glide.with(context) .load( "http://futurestud.io/icon.png" ) .diskcachestrategy(diskcachestrategy.all) .into(imageview);

c# - Counting number of occurrences of characters from array in string? -

i'm writing code determine whether password contains enough punctuation characters. how count number of occurrences of characters set? something along these lines: private const string nonalphanumericcharset = "#*!?£$+-^<>[]~()&"; ... public static bool passwordmeetsstrengthrequirements(string password) { return password.length >= minimum_password_length && password.numberofoccurences(nonalphanumericcharset.tochararray()) >= minimum_nonalphanumeric_chars; } bonus points elegant linq solution. how count number of occurences of characters set? var count = password.count(nonalphanumericcharset.contains);

c++ - Packing structure results in return of reference to local? -

i've got following code, , i'm struggling understand why packing structure causes warning (and subsequently segfault when run.) firstly code: #include <iostream> using namespace std; template <typename t, std::size_t d, std::size_t s> struct __attribute__((packed)) c { union __attribute__((packed)) valuetype { char fill[s]; t value; }; valuetype data_; const t& get() const { return data_.value; } friend std::ostream& operator<<(std::ostream& str, const c& f) { return str << f.data_.value; } }; template <typename t, std::size_t d> struct __attribute__((packed)) c<t, d, d> { t value; const t& get() const { return value; } friend std::ostream& operator<<(std::ostream& str, const c& f) { return str << f.value; } }; template <typename t, std::size_t s = 0> struct __attribute__((packed)) d { c<t, sizeof(t), s> c; c...

javascript - Cannot figure out how to get css/js masking code to work in meteor -

i have found example code , thought sweet have plug in, new meteor , making simple naive mistakes. thought jquery included in meteor , if use $ or document.getelementbyid in "client" code section work, either null latter , $ not defined former :( i tried concise possible code in post. here javascript code masking in project: if (meteor.isclient) { var canvas = document.getelementbyid("canvas");; if (canvas[0].getcontext) { var context = $canvas[0].getcontext('2d'); context.fillstyle = 'red'; context.fillrect(10, 10, 300, 60); } } here relevant css code: #box { width: 150px; height: 150px; background-color: blue; border-radius: 50px; overflow: hidden; -webkit-mask-image: url(data:image/png;base64,ivborw0kggoaaaansuheugaaaaeaaaabcaiaaacqd1peaaaagxrfwhrtb2z0d2fyzqbbzg9izsbjbwfnzvjlywr5ccllpaaaaa5jrefuenpiygbgaagwaaaeaagba+ojaaaaaelftksuqmcc); /* fixes overflow:hidden in chrome/opera */ } ...

c++ - Why I can't read from file using "file_ptr>>variable" in my program? -

in following program trying understand how read , write files. #include<iostream> #include<fstream> using namespace std; int main() { fstream myfile; string str1; myfile.open("h:/input_file.txt"); if(myfile.is_open()) { myfile<<"test1 writing files"<<" "; myfile>>str1; cout<<str1<<endl; } return 0; } why don't output on console though "test1 writing files" written file? the file need opened both read , write (i'm sorry, ignore that; fstream opened both read & write default). after writing (and flushing output), need seekg() beginning of file, or trying read comes after last thing wrote, of course nothing. myfile<<"test1 writing files"<<" "; myfile.flush(); myfile.seekg(0, ios_base::beg); myfile>>str1; seekg used change position read (get) file. seekp used change position write (put) fi...

math - Finite differences for 2D Parabolic PDE -

this modified problem numerical computing-kincaid's book, chapter 15. (not physics) how can implement boundary conditions? conditions u(0,y,t) = u(x,0,t) = u(nx,y,t) = u(x,ny,t) = 0. i not doing correctly, seems. code below. i trying write fortran code solve 2d heat (parabolic) equation using finite differences. when print out results, divergent results , 'nan'. seems not defining boundary conditions correctly. did code in 1 dimension, trying generalize in 2 have troubles @ boundary. note, i,j x , y position loops respectively, m time loop. nx,ny,w number of grid points in x , y direction , time respectively. lx,ly , tmax size of position , time intervals mesh. position(x,y) steps , time steps given hx,hy,k respectively, , hx , hy equal example below. store solutions in variables u , v shown below. program parabolic2d implicit none integer :: i,j,m integer, parameter :: nx=10., ny=10., w=21. real, parameter :: lx=1.0, ly=1.0, tmax=0.1 r...

How to create an enum entity type in Olingo OData V4 java API -

i have created enumeration: public enum rolecategory { low ("low risk", 0), medium ("medium risk", 1), public final string attrname; public final int value; rolecategory(string attrname, int value) { this.attrname = attrname; this.value = value; } public static rolecategory valueof(int val){ switch(val){ case 0: return low; case 1: return medium; default: throw new illegalargumentexception("blablabla"); } } public int toint() { return value; } } according starter tutorial i've created normal odataprovider class. i'm missing peace of code enum fqdn type property instantiation: csdlproperty p = new csdlproperty().setname("myenum").settype( ?getenumtype("myenum")? ) ok, found simple solution myself. it's not best one: 1.) i've added new static fullqualifiedname: public static final fullqualifiedname cet_rol...

javascript - Fire a fuction after Google Maps AutoComplement -

im trying run function after user select address on google address list . tried onblur action fire before user select address giving me incomplete one. i read these topics: how fire place_changed event google places auto-complete on enter key google places api - place_changed listener not working events other 'place_changed' google maps autocomplete and tried place_changed still cant run function. html <html> <head> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=edited(my key)&libraries=places"></script><script src="mapa.js" language="javascript" type="text/javascript"></script> <script type="text/javascript" src="jquery-ui.custom.min.js"></script> <script type="text/javascript" src="jq...

android - getjson as response in retrofit 2.0 -

iam trying json resopse come improper json format how can string in proper format call<hashmap<object,object>> call = restclient.getclient().aladata(apputil.getauthkey(dashboardactivity.this),string.valueof(mselectedcategory.getid()), string.valueof(mlat), string.valueof(mlng), string.valueof(50), string.valueof(offset * 50)); call.enqueue(new callback<hashmap<object,object>>() { @override public void onresponse(call<hashmap<object,object>> call, response<hashmap<object,object>> response) { string hashmapstring=response.body().tostring(); try { jsonobject jsonobject=new jsonobject(hashmapstring); string jsonstr=jsonobject.tostring(); } catch (jsonexception e) { e.printstacktrace(); } hashmap<object,object> hashmap2=response.body(); } ...

ios - React Native UITabBar looks too small on iPad -

not sure why tab bar keeps getting smaller , smaller. surely should same size on iphone 4s on ipad? font small can't seen , icons despite having @2x , @3x @ recommended 75x75 sizes way small on ipad. not mention whole bar much, thinner on ipad. small on iphone 6 plus never mind ipads. edit: reason post has been edited show 'tab bar' rather tabbarios not generic tab bar in react native different , behaves differently. tabbarios module.

node.js - Strongloop querying data with (or) and (and) at the same time -

i need this. select * person (firstname '%a' or lastname "%a") , id not in (1 , 2) node.js: begroupduser.find({ limit: limit, skip: skip, where: { id: { nin: adminids }, or: [{ firstname: {like: '%' + _query + '%'} }, { lastname: {like: '%' + _query + '%'} }] } }, function (errors, users) { }); try this { "where": { "and": [ { "id": { "nin": adminids } }, { "or": [{ firstname: {like: '%' + _query + '%'}}, { lastname: {like: '%' + _query + '%'}} ] } ] } }

html - Why does my regular navbar cover header while the collapsed one does not? (bootstrap/fullpage) -

i have problems navbar covering header instead of positioning below relative header height. when use smaller screen , navbar goes on collapse positions below should, how come? main { position: relative; background-image: url(asdasdads-321-redigerad-2.jpg); top: 0; width: 100%; height: 100%; background-color: white; background-repeat: no-repeat; background-position: bottom; background-size: cover; } header { width: 100%; height: 100px; position: fixed; top: 0; } .container { position: relative; } .navbar-fixed-top { position: relative; } .navbar-default { position: relative; width: 100%; background-color: rgba(255, 255, 255, 0); border-bottom: 3px solid rgba(51, 51, 51, 0); } <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet"/> <header> <h1>header</h1> <p>asdf asdas dasdadf dgfsd sdf asf fsdfsdf sd...

android - Phonegap PushNotification to open a specific app page -

i doing pushnotification both android/ios.i have used phonegap push-plugin https://github.com/phonegap-build/pushplugin , seems work great. i receiving message on device problem when click on received message goes app index.html page.but want open someother page eg home.html when clicked message , in home.html showing message. how achieve this? myphonegapactivity.java package com.test; import org.apache.cordova.droidgap; import android.os.bundle; public class myphonegapactivity extends droidgap { @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); super.setintegerproperty("splashscreen", r.drawable.splash); super.setintegerproperty("loadurltimeoutvalue", 60000); super.loadurl("file:///android_asset/www/index.html", 10000); } } index.js <script type="text/javascript"> var pushnotification; function ondeviceready() { $(...

PHP Arrays and $_POST acting strange -

i have following html: <input type="checkbox" name="plusfri[]" value="fri"> friday <input type="checkbox" name="plussat[]" value="sat"> saturday <input type="checkbox" name="plussun[]" value="sun"> sunday <input type="checkbox" name="plusmon[]" value="mon"> monday that posts following php: $plus = array(array("name" => "", "days" => "", "age" => "","conc" => "")); foreach($_post['plusname'] $k => $p) { $plus[$k]['name'] = $p; $plus[$k]['age'] = $_post['plusage'][$k]; $plus[$k]['conc'] = $_post['plusconc'][$k]; $plus[$k]['days'] = "x"; if($_post['plusfri'][$k]=="fri") $plus[$k]['days'] .= "1"...

java - Continous syntax error at the end of the code -

i don't understand why syntax error being prompted @ last bracket. no matter how rearrange code, error seems have stuck @ end of code , doesn't go away. there 2 errors shown. 1st: insert ";" complete fielddeclaration. 2nd: insert "}" complete classbody. if can please me figure out? thanks! ` public class akmainactivity extends activity { private static final string activities = "activities"; private spinner spinner1; private edittext etinfo; private sharedpreferences savedactivities; private arraylist<string> details; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_akmain); spinner dropdown = (spinner)findviewbyid(r.id.spinner1); string[] items = new string[]{"walking", "running", "stairs", "generic"}; arrayadapter<string> adapter = new ...

c# - Update JSON object using path and value -

i have csv file contains paths , values in following format: path;value prop1.prop2.1;hello prop1.prop2.2;world prop1.prop2.3;! prop1.prop3.test;hi prop1.prop4;value and wand json: { "prop1": { "prop2": { "1": "hello", "2": "world", "3": "!" } "prop3": { "test": "hi" } "prop4": "value" } } i've parsed csv file this: dictionary<string, string> dict = new dictionary<string, string>(); while (csv.read()) { string path = csv.getfield<string>(0); string value = csv.getfield<string>(1); dict.add(path, value); } could me method, create json dictionary using json.net library. of course properties in original file can different. you can use function json string dictionary public static string buildjson(dictionary<string, string> dict) { dynamic ...

javascript - Angularjs two-way data binding not working; $watch doesn't work either -

as new angular developer, went through few tutorials , built few stand-alone or firebased angular practice apps, , thought getting handle on framework. wanted start real app paired server , database, found laravel powered angular stack on github: https://github.com/jadjoubran/laravel5-angular-material-starter to make long story short, code generated stack angular controllers looks foreign angular i've seen: class createstringformcontroller{ constructor(){ 'nginject'; // } } i added class createstringformcontroller{ constructor($scope){ 'nginject'; $scope.string = 'test'; $scope.stringed = $scope.string+'ed'; // } } and template: <textarea rows="4" columns="50" class="form-control">{{string}}</textarea> <h3>parsed string: <span>{{stringed}}</span></h3> the idea here when type in text area, h3 below outp...

javascript - Use CamanJS on webworker -

can use caman.js library processing image on webworker? far known, webworker cant run code contain operation document. how can run such of code have working document on worker? within worker, it's possible import external scripts importscripts()

neo4j - py2neo graph.node(ID) throws "Unsupported URI scheme" -

i iterating on record returned cypher.execute() : | p ---+---------------------------- 1 | (:a)-[:r]->(:b)-[:r]->(:c) the code use iterate on this: recordlist = graph.cypher.execute(<some query>) record in recordlist: rel in record[0]: print self.graph.node(rel.start_node) but following error: file "/usr/local/lib/python2.7/dist-packages/py2neo/packages/httpstream/http.py", line 943, in __get_or_head return rq.submit(redirect_limit=redirect_limit, **kwargs) file "/usr/local/lib/python2.7/dist-packages/py2neo/packages/httpstream/http.py", line 433, in submit http, rs = submit(self.method, uri, self.body, self.headers) file "/usr/local/lib/python2.7/dist-packages/py2neo/packages/httpstream/http.py", line 302, in submit raise valueerror("unsupported uri scheme " + repr(uri.scheme)) valueerror: unsupported uri scheme 'node/(n4979' what doing wrong here? ...

linux - Can anybody let me know the command to obtain the current maximum size to store the object in the Memcached -

can let me know command obtain current maximum size store object in memcached. in documentation have not come across getting actual size of memcached capacity. it's available in output of stat settings command. didn't if wanted maximum size of single item or total available memory both available. maximum item size (at least in not old releases, checked 1.4.13). using telnet: telnet <hostname> <port> > stat settings (...) item_size_max 1048576 (...) maximum capacity in bytes available both in stat , stat settings : telnet <hostname> <port> > stat settings (...) maxbytes 10737418240 (...) > stat (...) limit_maxbytes 10737418240 (...) remaining capacity as far know, it's not directly available, have compute stat command output: > stat (...) bytes 5349380740 (...) limit_maxbytes 10737418240 (...) here have limit_maxbytes - bytes = 5388037500 bytes remaining. documentation this confirmed documentation ...

javascript - Return Value back to controller in angular js -

i want send data controller service if size of file extents how can achieve here code. myapp.service('fileupload', ['$http', function ($http) { this.uploadfiletourl = function (filedata, uploadurl) { if (filedata.size > 50000000) { var fd = new formdata(); fd.append('file', filedata); $http.post(uploadurl, fd, { transformrequest: angular.identity, headers: { 'content-type': undefined } }) .success(function () { }) .error(function () { }); } else { return "image size more 5mb"; } } }]); you should use $q service deferred execution of request - myapp.service('fileupload', ['$http','$q', function ($http,$q) { this.uploadfiletourl = function (filedata, uploadurl) { if (filedata.size > 50000000) { var fd = new formdata(); fd.append('file', filedata); var...

sql server - Error returning SQL results via PHP into a html table -

i'm having issues below code, returns first 2 rows , throws sql exception error (see below). first row returned has spaces, second not not , remaining 6 or 7 rows not return. tell me i'm doing wrong? query works ok if excecute in management studio. thanks $tracedbcon = mssql_connect("dbaddress", "username", "password") or die("couldn't connect sql db"); $result = mssql_query ("select loadindex, palletno1, palletno2, palletno3, palletno4 [loadmanifest].[dbo].lm_lines lmheaderid = $lmheaderid order loadindex asc", $tracedbcon); echo "<table>"; while($row = mssql_fetch_array($result)){ echo "<tr><td>" . $row['loadindex'] . "</td><td>" . $row['palletno1'] . "</td><td>" . $row['palletno2'] . "</td><td>" . $row['palletno3'] . "</td><td>" . $row['palletno4'] ...

mysql - SQL : Subquery returns more than 1 row -

hello create application , task found daily closed cashier mount but have problem in query in mysql when run query pnpmyadmin give me message subquery returns more 1 row this sql query : select tblcashieropeningbalance.mount cob, (select tblcashiers.cashiername tblcashiers tblcashiers.cashierid = tblcashieropeningbalance.cashierid ) cashiername , (select tblcashdeposit.mount tblcashdeposit tblcashdeposit.cashierid = tblcashieropeningbalance.cashierid ) cd , (select tblbankcashiertransfer.mount tblbankcashiertransfer tblbankcashiertransfer.cashierid = tblcashieropeningbalance.cashierid ) bct, (select tblsupplierrefund.refund tblsupplierrefund tblsupplierrefund.cashierid = tblcashieropeningbalance.cashierid ) spr, (select tblcustomrefund.refund tblcustomrefund tblcustomrefund.cashierid = tblcashieropeningbalance.cashierid ) cur, (select tblcustomrefund.refund tblcustomrefund tblcustomrefund.cashierid = tblcashieropeningbalance.ca...

postgresql - btree_gin index is not used for sorting -

let's assume have table: create table test.widgets ( id bigserial primary key, categories int[] not null ); with btree_gin index: create extension btree_gin; create index widgets_idx on test.widgets using gin (categories, id); i insert test data: insert test.widgets (categories) ( select array[ (random() * 1000)::int, (random() * 1000)::int, (random() * 1000)::int, (random() * 1000)::int ] generate_series(1,100000) ); then want query widgets given category, ordered id : select id, categories test.widgets array[48] <@ widgets.categories order id; instead of using btree_gin index sorting, sorting done in memory: sort (cost=2124.05..2125.45 rows=561 width=40) (actual time=5.107..5.120 rows=402 loops=1) sort key: id sort method: quicksort memory: 56kb -> bitmap heap scan on widgets (cost=1244.35..2098.43 rows=561 width=40) (actual time=4.759..5.061 rows=402 loops=1) recheck cond: ('{48}'...

java - Where / How to specify Topic ARN in SNS http end point using spring aws-cloud -

i writing sns http end point using spring aws-cloud messaging support specified in link spring boot web application. how should specify topic arn using aws-cloud ? meant below important note in link : currently not possible define mapping url on method level therefore requestmapping must done @ type level , must contain full path of endpoint.

java - Rendering Image in Libgdx -

recently started developing libgdx , have encountered problem can seem resolve. want render image object scene2d screen doesn't render anything. it's shows blank screen. here skin.json file: { com.badlogic.gdx.scenes.scene2d.ui.image: { logo: { drawable: logo } exit: { drawable: exit } }, com.badlogic.gdx.graphics.color: { green: { a: 1, b: 0, g: 1, r: 0 }, white: { a: 1, b: 1, g: 1, r: 1 }, red: { a: 1, b: 0, g: 0, r: 1 }, black: { a: 1, b: 0, g: 0, r: 0 }, }, } here skin.atlas file: skin.png format: rgba8888 filter: nearest,nearest repeat: none logo rotate: false xy: 1, 1 size: 384, 93 orig: 384, 93 offset: 0, 0 index: -1 rotate: false xy: 387, 30 size: 65, 64 orig: 65, 64 offset: 0, 0 index: -1 musicoff rotate: false xy: 454, 30 size: 65, 64 orig: 65, 64 offset: 0, 0 index: -1 musicon rotate: false xy: 521, 30 size: 65, 64 orig: 65, 64 offset: 0, 0 index: -1 exit rotate: false xy: 588,...