Posts

Showing posts from May, 2012

TextView improperly displaying in Layout in Android 6 and below -

Image
i dynamically creating views in oncreate() , use setmargins() , setlayoutparams() position them on layout. this works expected in android 7 parameters ignored in android 6 , below. i assume has views not being created in oncreate() or dont know why work in android 7, or how around it. below example code of problem , screenshots visualization. @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); viewgroup viewgroup = (viewgroup) findviewbyid(android.r.id.content); relativelayout.layoutparams viewparam = new relativelayout.layoutparams( relativelayout.layoutparams.wrap_content, relativelayout.layoutparams.wrap_content); viewparam.setmargins(200, 400, 0, 0); textview mytextview = new textview(this); mytextview.settext("hello text"); mytextview.settextsize( typedvalue.complex_unit_px, 50); mytextview.setgr...

swift3 - cs193p cassini unable to show images -

working on xcode 8.3.3, using swift 3. following paul's cs193 course stanford on youtube. have not been able load images. zero. have hardcoded test image (and print shows present), it's not enough simulator. question: missing or needs change? first image second image

html - Bootstrap Squared Columns for Tic-Tac-Toe Board? -

i building tic-tac-toe interface, using html, css, , bootstrap. i'm trying board squared (1:1) i'm getting nowhere. the boxes have taller use more space. can playing height property using vw / vh units on columns, won't keep 1:1 ratio across resolutions. tic tac toe this other version has "pads" on each side of board , job breaks on sizes smaller tablets. apart lose space. tic tac toe pads now, here's code tic tac toe without pads: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>tic tac toe</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" integrity="sha384-/y6pd6fv/vv2hjna6t+vslu6fwyxjcftcephbnj0lyafsxtsjbbfadjzaleqsn6m" crossorigin="anonymous"> ...

uigesturerecognizer - Swift invert UIRotationGestureRecognizer for subviews -

i want invert rotation uirotationgesturerecognizer specific subviews. rotation occurs in 90 degree phases (so cgfloat.pi / 2 ) func localhandlerotategesture (localrotategesture: uirotationgesturerecognizer) { if localrotategesture.state == .ended { if localrotategesture.rotation > 0.0005{ localrotategesture.view?.transform = (localrotategesture.view?.transform)!.rotated(by: cgfloat.pi / 2) } localrotategesture.rotation = 0 } works fine. access subviews , try invert movement var thiscell = localrotategesture.view as! custommessagecell thiscell.cellbuttonsstackview.transform = (localrotategesture.view?.transform.inverted())!.rotated(by: cgfloat.pi / 2) the subviews rotate first attempt, , after doesn't! going on?

Javascript / Ajax: assigning value to a new object and deleting one of the element -

i'm making ajax request , assigning dataset of request new object {} using object.assign() method , subsequently wants delete 1 of item in new object. when console.log() original dataset, value deleted there aswell. why when i'm assigning using object.assign() method? how can stop js that? $.ajax({ url: "{% url 'filtered_financial' %}", method: 'get', data : { airline_category: 1, }, success: function(dataset){ var datacopy = object.assign({}, dataset); delete datacopy.financial_year console.log(dataset) // financial_year element deleted )};

web scraping - Using python scrapy to extract link and text -

i new python , scrapy. extract information website http://www.vodafone.com.au/about/legal/critical-information-summary/plans including link document, name , valid to. i tried code, not work. appreciated if explain , me. here file vodafone.py import scrapy scrapy.linkextractor import linkextractor scrapy.spiders import rule, crawlspider vodafone_scraper.items import vodafonescraperitem class vodafonespider(scrapy.spider): name = 'vodafone' allowed_domains = ['vodafone.com.au'] start_urls = ['http://www.vodafone.com.au/about/legal/critical-information-summary/plans'] def parse(self, response): sel in response.xpath('//tbody/tr/td[1]/a'): item = vodafonescraperitem() item['link'] = sel.xpath('href').extract() item['name'] = sel.xpath('text()').extract_first() yield item it doesn't work because page content generated dynamicall...

php - Faster counting and sum data faster in for loop -

i'm working on counting students' data database contains thousands of rows , have within loop, problem calculation slow. what's best way make faster? query command: $sql_query = $con->prepare("select id_number,title,name,lastname,classroom students academic='".$config['info']['year']."' order id_number"); $sql_query->execute(); while($fetchar = $sql_query->fetch(pdo::fetch_obj)){ $ss_data[] = $fetchar->id_number.'-'.$fetchar->title.$fetchar->name.'&nbsp;'.$fetchar->lastname.'-'.$fetchar->classroom; } $row_counts = count($ss_data); for($i=0;$i<$row_counts;$i++){ $e = explode("-",$ss_data[$i]); $id = $e[0]; //รหัสประจำตัวนักเรียน $personal_data = $e[1]; //ข้อมูลนักเรียน $room = $e[2]; //ระดับชั้น //คิวรี่จำนวนการร่วมกิจกรรมของนักเรียนแต่ละคน ทั้งโรงเรียน $sql = $con->prepare("select count(std_id) present_count attendance std_...

java - Google Media Framework (GMF) addListener to work with playStateChanged -

i using google media framework play video files. as mentioned in above link gmf built on top of exoplayer . my question how can addlistener(...) work playerstatechanged(...) mainactivity.java code activity_main.xml to play videos using framelayout : <framelayout android:id="@+id/video_frame" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" android:background="@android:color/background_dark"/> i found this link work exoplayer's playerstatechanged(...) not getting how can use same solution in existing code.

spring boot - SpringBoot 1.4 shutdown itself periodly -

i got problem springboot web app shutdown periodly. can't find exception in logs. 2017-08-16 20:43:01.376 info 24942 --- [ thread-3] ationconfigembeddedwebapplicationcontext : closing org.springframework.boot.context.embedded.annotationconfigembeddedwebapplicationcontext@6659c656: startup date [wed aug 09 09:09:44 edt 2017]; root of context hierarchy 2017-08-16 20:43:01.381 info 24942 --- [ thread-3] o.s.j.e.a.annotationmbeanexporter : unregistering jmx-exposed beans on shutdown

php - Fetching a json_encoded array exhausts memory -

i have 2 arrays form inputs trying combine , store in single database cell. able this, when trying retrieve it, gives fatal error of exhausting memory limit. i inserting main slider has additional slides within it. kind of. don't want create individual sql tables, maybe need to. my memory @ 256mb, know increase more i'd rather figure out why large. so inputs coming from: <fieldset class="form-group"> <label class="label-top" for="scroll-content[]">scroll text #1</label> <textarea rows="5" cols="50" name="scroll-content[]" id="scroll-content-"></textarea> <input type="hidden" name="slide-number[]" value="1"> </fieldset> <fieldset class="form-group"> <label class="label-top" for="scroll-content[]">scroll text #2:</label> <textarea rows="5" cols="50...

ping - Using sudo in python script -

i working on project pings lan devices , writes avg_time taken ping in mysql db. # python script update contents of mysql database import mysqldb import subprocess import re #connecting mysql database db = mysqldb.connect("localhost","templocal","thunderbolt","dbavgspeed") #initializing cursor cur = db.cursor() error = "request" while 1: # 0.1 interval between pings , 4 number of times ping operation performed , -t 1 sets timeout 1 sec command1 = ['ping','-n','-i','0.1','-t','1','-c','400','192.168.1.1'] p1 = subprocess.popen(command1,stdout=subprocess.pipe) #text string stores output terminal text1 = p1.stdout.read() if error in text1: status1 = 0 cur.execute("""update tbavgspeed set status = %s id = %s""",(status1,1)) db.commit() else: status1 = 1 find11...

java - Error - Failed to create JDBC connection Remote - MYSQL -

i connected remotely , have following error: failed create jdbc connection. internal error occured. details unexpected http response: 500 request { "address" => [ ("subsystem" => "datasources"), ("data-source" => "pedb02ds") ], "operation" => "test-connection-in-pool" } response internal server error { "outcome" => "failed", "failure-description" => "jbas010440: no se logró invocar la operación: jbas010447: la conexión no es válida", "rolled-back" => true } if connect locally, ok. someone can support me, thank much.

delphi - Invalid class typecast exception ,How I can solve it? -

i try use firebase4delphi there no documentation , , got exception invalid class typecast when try use ! i have got error when executing function (it compiles normally). procedure tfirebasechatfacade.parseresponse(aresp: ifirebaseresponse); var obj: tjsonobject; i: integer; key: string; chatmsg: tchatmessage; jsonresp: tjsonvalue; begin jsonresp := tjsonobject.parsejsonvalue(aresp.contentasstring); if (not assigned(jsonresp)) or (not(jsonresp tjsonobject)) begin if assigned(jsonresp) jsonresp.free; exit; end; obj := jsonresp tjsonobject; try tmonitor.enter(fmessages); try := 0 obj.count - 1 begin key := obj.pairs[i].jsonstring.value; if not fmessages.containskey(key) begin chatmsg := tchatparser.getmessage (obj.pairs[i].jsonvalue tjsonobject); //exception raise here. fmessages.add(key, chatmsg); onnewmessage(chatmsg); removeoldermessage; ...

php - how to update GUI with button click -

i'm making web application how can add update button in admin panel update button replace gui or replace whole html file example <?php if ( admin clicked update button) !== false) { replace login.html https://github.com/new-version } can me idea ? you can in html on click when user presses button <button onclick="location.href='https://github.com/new-version'">update</button> ok sorry try <?php unlink("login.html"); copy("https://github.com/new-version/login.html", "login.html");

java - TransientPropertyValueException: object references an unsaved transient instance - save the transient instance beforeQuery flushing -

i have 2 hibernate entities coupon , couponhistory uni directional relationship between couponhistory , coupon. @entity @table(name = "validity_coupon") public class coupon { @id @column(length = 50, unique = true, nullable = false) private string code; private int validity; private boolean used; ...} @entity @table(name = "coupon_history") @tablegenerator(name = "seqgen", table = "shunya_id_gen", pkcolumnname = "gen_key", valuecolumnname = "gen_value", pkcolumnvalue = "coupon_history_seq", allocationsize = 1) public class couponhistory { @id @generatedvalue(strategy = generationtype.table, generator = "seqgen") private long id; @temporal(temporaltype.timestamp) private date createdon; @manytoone(fetch = fetchtype.lazy) private coupon coupon; ...} there transactional service method tries saves both entities in single transaction. spring being used handle transaction here. @transaction...

javascript - Return a variable to use as image src -

i have variable image needs display based on form field if first form field says xyz123 picture need displayed in server filesystem , named xyz123.jpg i can't work out syntax put in <td colspan=3 align="center"><img src="pictures/thumbnails/logo-20170820013631.jpg" alt="logo" border=1 height=150 width=150></img><br>click enlarge.</td> this works fine if use static image name, need dynamic i have function called whenever first field changed <div><b>edit customer details</b><br><input type="text" name="key" onchange="changedreference(this.name);" placeholder="enter customer id"></div> //calls function function changedreference(n) { var ref = el(n).value; var img = el(n).value; if (ref == null || ref == "") return; var x = getxmlhttprequest(); if (x == null) { alert("unable xmlhttprequest...

mysql - DB Schema for an application -

i've application, need post comments on blog paragraphs, not comment on blogs. paragraphs separated 2 new-line characters. i'll splitting post received using post.split('\n\n') , saving post , paragraphs in separate tables ( blog , paragraphs ). whenever new comment received, i'll saving in comments table para_id received. following db schema i'm planning build. table blog -id -title -date table paragraphs -id -para -sequence_no -blog_id(fk) table comments -id -comment -para_id(fk) -date the above design has flaw. consider example when post updated, ie, either new paragraph inserted between 2 paragraphs, or paragraph removed. result in distortion of sequence(ordinal number). how handle such use-case? calculate unique hash value each paragraph , use combination of postid+paragraphhash primary key. store timestamp along each paragraph. every time user edits post, update timestamp existing paragraphs. easy spot deleted paragraphs...

parsing - PHP Parse/Syntax Errors; and How to solve them? -

Image
everyone runs syntax errors. experienced programmers make typos. newcomers it's part of learning process. however, it's easy interpret error messages such as: php parse error: syntax error, unexpected '{' in index.php on line 20 the unexpected symbol isn't real culprit. line number gives rough idea start looking. always @ code context . syntax mistake hides in mentioned or in previous code lines . compare code against syntax examples manual. while not every case matches other. yet there general steps solve syntax mistakes . references summarized common pitfalls: unexpected t_string unexpected t_variable unexpected '$varname' (t_variable) unexpected t_constant_encapsed_string unexpected t_encapsed_and_whitespace unexpected $end unexpected t_function … unexpected { unexpected } unexpected ( unexpected ) unexpected [ unexpected ] unexpected t_if unexpected t_foreach unexpected t_for unexpected t_while unexpected t_do ...

Duplicate images with same id in Docker -

when download image docker-compose file, images duplicated. here docker-compose.yml version: "3" services: ubuntu: build: ./linux container_name: ubuntu stdin_open: true tty: true my dockerfile in linux folder ubuntu the output of command "$docker images": repository tag image id created size ubuntu latest ccc7a11d65b1 9 days ago 120 mb ubuntu_ubuntu latest ccc7a11d65b1 9 days ago 120 mb in dockefile, used from ubuntu , inherited image , did nothing out of it. new image nothing same ubuntu image. , why seeing same id repository tag image id created size ubuntu latest ccc7a11d65b1 9 days ago 120 mb ubuntu_ubuntu latest ccc7a11d65b1 9 days ago 120 mb it doesn...

c - char to integer pointer conversion -

void main() { char *s="abcdefg"; clrscr(); int *ptr=(int *)s; printf("%c %d\n",*(ptr+1),*(ptr+1)); //op :- c 17475 printf("%c %d\n",*(s+1),*(s+1)); //op :- b 66 getch(); } i know integer pointer increments 2 bytes whereas char pointer increments 1 byte. here when int pointer increments 1, c printed (only first byte considered). because have %c specifier ? also, not able understand how 17475 printed output. in second case 66 ascii value of b. can me? to start important notice code has undefined behavior . means can not generated output solely referring c standard. output may/will differ system system , systems may not able execute code. the problem have number of char (a char array) access using int pointer. not allowed. however, on specific system (your system) possible consideration why output looks does. but remember not valid c code. note: pointed out antti haapala code syntax valid - it's be...

lispy repl-loop substitution with IPython? -

is there way substitute lisp interpreter repl() loop ipython. http://www.norvig.com/lispy2.html here full source code : https://github.com/norvig/pytudes/blob/master/lispy.py

java - How to make a toast in an onfailure method -

so use okhttp in separate service fetch data twitter api. have been trying alert user tweets cannot loaded without internet connection. when try this, application crashes.the error : java.lang.runtimeexception: can't create handler inside thread has not called looper.prepare(). here's code private void gettweets(final string topic) { final twitterservice twitterservice = new twitterservice(); twitterservice.findtweets(topic, new callback() { @override public void onfailure(request request, ioexception e) { e.printstacktrace(); log.e("traffic activity", "failed make api call"); toast.maketext(getapplicationcontext(), "bigger fail", toast.length_long).show(); } probably calling toast.maketext wrong thread. needs called ui thread. try instead activity.runonuithread(new runnable() { public void run() { toast.maketext(activity, msg, toast.length_short).sh...

android - No view found for id ... for fragment in a Dialog -

i want show 2 tabs in custom dialog in activity , getting following error. error: no view found id 0x7f0f0134 (com.hiro.chatio:id/viewpage_theme) fragment postcolorpickerfragment{35ffefce #0 id=0x7f0f0134 android:switcher:2131689780:0} java.lang.illegalargumentexception: no view found id 0x7f0f0134 (com.hiro.chatio:id/viewpage_theme) fragment postcolorpickerfragment{35ffefce #0 id=0x7f0f0134 android:switcher:2131689780:0} mainactivity : private button pick_color; @override protected void oncreate(final bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_create_blog); pick_color = (button) findviewbyid(r.id.create_blog_color_btn); pick_color.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { final dialog dialog = new dialog(createblogactivity.this); dialog.setcontentview(r.layout.blog_theme_picker); dialog.setcan...

excel - How to populate cell values matching multiple conditions from one worksheet to another -

i improving once again our company's duty roster spreadsheet (workbook of 30+ sheets, each sheet covers 2 calendar weeks of roster) have grown on years extensive database , tool daily operation. for streamlining purposes , avoid re-occurring errors due ever changing data (five users have editing permission), incorporate element of centrally recorded , administered annual leave days. for purpose have created separate worksheet (in same workbook) in annual leave days being recorded , data of worksheet automatically populate respective roster worksheets. bi-weekly roster worksheet, simplified demonstration purposes annual leave worksheet, simplified demonstration purposes in simple terms, person 1 took annual leave on 1-jan (cell s2). how can excel populate information (labelling 'al1' 'annual leave day 1') respective cell (m13) of respective worksheet of week of 1-jan? so far, have played around index, match, , vlookups skills not reach far enough tr...

r - Cross table graph similar to excel -

Image
i need put 3d kind of graph similar attached image created in excel. not sure whether can in ggplot? structure(list(name = c("a", "b", "c", "d"), p = c(15089, na, na, 43083), q = c(1589, na, na, 18120), r = c(93751, na, 4709, 211649), s = c(34167, 1323, 1520, 82378), t = c(8831, na, 4544, 15157)), .names = c("name", "p", "q", "r", "s", "t"), row.names = c(na, 4l), class = "data.frame") i have worked following code. ggplot(a, aes(x = a$a, y = a$amount, fill = a$b)) + geom_col(position = 'stack') + geom_text(aes(label = a$amount), position = position_stack(vjust = .5), color='grey25', size=2) + coord_flip() the problem labels shows on top the graph overlapping updated: actually, thought need reshape data achieve kind of graph, not sure though. reshaped below structure(list(aa = c("a", "a", "a", "a...

Distinguish non-clustered points using MapBox Android -

i'm using mapbox sdk android , i'm trying distinguish non-cluster points in 2 different categories. how can this? { "type":"featurecollection", "features":[ { "type":"feature", "geometry":{ "type":"point", "coordinates":[ 102.0, 0.5 ] }, "properties":{ "propertytest":"value0" } } ] } actually try filter properties present in used geojson, nothing. bitmap icon = bitmapfactory.decoderesource(mapfragment.this.getresources(), r.drawable.com_facebook_button_icon); mapboxmap.addimage("my-marker-image", icon); bitmap icon2 = bitmapfactory.decoderesource(mapfragment.this.getresources(), r.drawable.messenger_button_blue_bg_selector); mapboxmap.addimage("my-marker-image2", icon2); sy...

php - larravel, Normal error Logged, but only One error with white screen -

i'm using laravel 5.4 withe laravel-datatables plugin i have no problem debugger plugin , normal larval log error, reason, 1 of bug not show @ , laraval display white page no error :( i believe code related eloquent relation ship problem follow code product white page error return datatables::of(invoiceproduct::where('purchasing_order_id', 1))->make(true); the above error happen if database purchasing_orders not empty. i using db try same result follow without , error return datatables::of(db::select('select * invoice_products purchasing_order_id = ' . $id))->make(true); could please help, need see error can fix :( thank time you using query builder, not standard fetch result, need chain call ->get() return datatables::of(invoiceproduct::where('purchasing_order_id', 1)->get())->make(true); this not create query execute it.

binding - How is this called overloading - Java -

this question has answer here: java overloading , overriding 9 answers i have class bindingsample method takes no parameter public class bindingsample { public void printmsg(){ system.out.println("binding sample no parameter"); } } and class extends bindingsample , uses same method signature adds parameter it public class application extends bindingsample { public void printmsg(int i){ system.out.println("changed value " + i); } public static void main(string[] args) { application app = new application(); app.printmsg(5); } } the output changed value 5 why did work if parameters different? , why called overloading? don't think it's overriding because override method, method signature , parameter should same. why did work if parameters different? you application class h...

c++ - how can i integrate one qt application with another qt project -

i have developed 2 different qt application project , want integrate 1 project, how can link these 2 project so, can call function of each other , use value too. example, in 1 project void mainwindow::readdata() { qbytearray data = serial->readall(); qdatastream stream(data); double value; stream>>value; console->putdata(data); qdebug()<<value; } i want use "data" project further calculation , print on project. how can that. give me light on it. i'm absolute beginner in qt c++. thank in advance.

python - Kivy UrlRequest doesn't trigger callback -

this minimal version of i'm trying do. main.py file: class mainscreen(screen): def __init__(self): super(mainscreen, self).__init__() self.url_input = textinput() self.start = button(text='download') self.start.bind(on_release=partial(self.on_start_press)) self.add_widget(self.url_input) self.add_widget(self.start) def on_start_press(self, *args): downloadtask(self.url_input.text) ... and task.py file contains downloadtask . class downloadtask(object): def __init__(self, url): self.url = url self._get_headers() def _get_headers(self): urlrequest(url=self.url, on_success=self._on_headers_fetched, method='head') def _on_headers_fetched(self, req, resp): self.content_length = int(req.resp_headers.get('content-length')) but on_success callback never called. on line 439 of urlrequest.py : if self.on_success: func = self.on_suc...

css - How to make expand/collapse in bootstrap 3 stricly horizontal -

Image
i'm using bootstrap 3. idea expand/collapse words between other words (transcriptions in dictionary) clicking on 1 button. words , transcriptions between them have class display: "inline-block" . it's there way make strictly horizontal transition, , avoid display:"block" part of it? panel heading should in 1 line. (and avoid write additional js) <div class="panel-heading"> <div class="note">{{note}} </div> <div class="word -arabic-text-big">{{word}}</div> <div class="collapse transcription">[******]</div> </div> <button type="button" class="btn btn-info" data-toggle="collapse" data-target=".transcription"> transcipt </button> sorry, answer simple. before did wrong... .note, .word, .transcription { display: inli...

java - Android Studio: Error:Execution failed for task ':app:transformClassesWithJarMergingForRelease'. > -

i need help, im new in android studio , im getting error: error:execution failed task ':app:transformclasseswithjarmergingforrelease'. com.android.build.api.transform.transformexception: java.util.zip.zipexception: duplicate entry: android/support/v4/database/databaseutilscompat.class here build.gradle file , hope can help: android { compilesdkversion 25 buildtoolsversion "25.0.2" defaultconfig { applicationid "com.app_name.vallic.hr" minsdkversion 14 targetsdkversion 25 multidexenabled true ndk { modulename "player_shared" } } buildtypes { release { minifyenabled false shrinkresources false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.txt' } } configurations { all*.exclude group: 'com.android.support', module: 'support-v4'...

angularjs - Response string JavaScript undefined -

Image
i have program written in angularjs. i'm receiving json data server when online. i'm developing offline mode now.. i have problem here dont know why cant fix. i saved json info localstorage when program offline json string. service.js - webservicecall webservicecallpost: function(data, action) { console.log("data "+json.stringify(data)); console.log("action "+json.stringify(action)); var deferred = $q.defer(); if (navigator.connection.type != "none") { return $.ajax({ type: "post", url: appconst.serviceurl.service + action, crossdomain: true, datatype: "json", data: data, timeout: 2000000, async: true, success: function(response) { localstorage.setitem(data + action, ...

python - Bash For Loop skip numbers -

i want create bash script. that skip 1000 on each loop untill 2m, i'm stuck here: for in {1..2000000} ; done; for exmple: the first loop: offset=0 second loop: offset=100 3rd loop offset=2000 until 2m i try few ways no success. python welcome also how can that? use while loop : i=0 while [ $i -lt 2000000 ] echo offset=$i i=$(($i+1000)) done

mysql - Delete a table id from Several Tables -

i use mysql database web project. have image table , several tables includes image ids image table. want delete image , @ same time need delete image id related table don't know table carry image id. this, think check every table whether row includes image id or not. if includes update null. can easier way?

postgresql - What is a simple SQL query to select the ID of a person with the SECOND highest salary -

if had relation: employee(id, salary). simplest sql query select id of person second highest salary. i know how select highest salary using: select max(salary) employee salary < (select max(salary) employee); but how select id of person, , display id of person second highest salary (without using limit). i use row_number() or rank() , depending on mean second highest salary: select e.* (select e.*, rank() on (order salary desc) seqnum employee e ) e seqnum = 2; if want use query -- , seems way more complicated -- can use subqueries: select e.* employee e e.salary = (select max(e2.salary) employee e2 e2.salary < (select max(e3.salary) employee e3 ) ); it nice see sql has made progress in last 30 years.

c# - Set mapcontrol's children topmost -

Image
i'm adding stackpanel mapcontrol. below but of points added before on top of stackpanel. how set stackpanel topmost? xaml: <grid x:name="gridmain"> <maps:mapcontrol x:name="mapcontrol" zoominteractionmode="gestureandcontrol" tiltinteractionmode="gestureandcontrol" rotateinteractionmode="gestureandcontrol"> <!--zoomlevel="{x:bind viewmodel.zoomlevel, mode=oneway}" center="{x:bind viewmodel.center, mode=oneway}"--> <maps:mapitemscontrol x:name="mapitems"> <maps:mapitemscontrol.itemtemplate> <datatemplate> <grid tapped="magpoint_tapped" maps:mapcontrol.normalizedanchorpoint="{binding normalizedanchorpoint}" maps:mapcontrol.location="{binding location}"> ...

Applying a schema to a Spark's Dataset of a java object -

there's similar issue here: how add schema dataset in spark? however issue i'm facing have predefined dataset<obj1> , want define schema match data-members. end goal able join between 2 java objects. sample code: dataset<row> rowdataset = spark.getspark().sqlcontext().createdataframe(rowrdd, schema).todf(); dataset<myobj> objresult = rowdataset.map((mapfunction<row, myobj>) row -> new myobj( row.getint(row.fieldindex("field1")), row.isnullat(row.fieldindex("field2")) ? "" : row.getstring(row.fieldindex("field2")), row.isnullat(row.fieldindex("field3")) ? "" : row.getstring(row.fieldindex("field3")), row.isnullat(row.fieldindex("field4")) ? "" : row.getstring(row.fieldindex("field4")) ), encoders.javaserialization(myobj.class)); if i'm printing schema of row ...

c# - Firebase in Unity - Disable persistence -

i'm making mobile game android using firebase. game has system allows player play offline , update/retrieve data database depending on saved date-time. this date-time (written in local file) should same 1 saved in database, , wrote this: reference.child("users/"+this.id+"/updatedate").setvalueasync(updatedate).continuewith(task => { if (task.iscompleted) { debug.log("setting new update date file: "+updatedate); this.lastupdatedate = updatedate; writefile(); } }); the problem that, if there no internet connection, value gets modified condition below never satisfied happens this: if read value, without internet connection, read "new" date-time, while file still contains "old" 1 (the 1 in database). i know best solution delete , let offline persistence work, did couple tests , doesn't work on android's build. question following: is there way disable offline persistence in unity? ...

jquery - Side menu (help), onClick() opens (but I want it to close if one clicks else where outside the menu -

on click menu opens problem stays open, want closed when user clicks outside menu. copy code , save html file , try run try it, if it, keep it. if there confusing, ask me, i'll answer i. sooooooooooo annoying!~ stackoverflow not letting post simple question, $(document).ready(function () { $("#itemtree").click(function () { $("#subcontainer").toggleclass("subcontainer"); $("#disabled").toggleclass("disabled") }); }); p { color: #fff; padding-left: 10px; } .sidecontainer { background-color: #676464; width: 28px; height: 100%; position: fixed; border-right: 5px solid #676464; } .subcontainer { background-color: #333; width: 300px; height: 100%; margin-left: 28px; ...

content:url in CSS for multiple images -

i asked similar question before , thought had been solved wasn't solved. time, i'm going use specific example i'm working on see if it's problem particular code. i have in css desktop: div.image { content:url(http://www.masterpiecetransformers.com/images/masterpiece- transformers.jpg); } div.imagea1 { content:url(http://www.masterpiecetransformers.com/images/news.jpg); }​ div.imagea2 { content:url(http://www.masterpiecetransformers.com/images/releases.jpg); }​ div.imagea3 { content:url(http://www.masterpiecetransformers.com/images/design-team-interview-archives.jpg); }​ div.imagea4 { content:url(http://www.masterpiecetransformers.com/images/reviews.jpg); }​ then in css mobile: div.image { content:url(http://www.masterpiecetransformers.com/images/masterpiece- transformers.jpg); width:100%; }​ div.imagea1 { content:url(http://www.masterpiecetransformers.com/images/news.jpg); width:25%; }​ div.imagea2 { content:url(http://www.masterpiecetransformers.com/i...