Posts

Showing posts from July, 2012

sql - Reuse of select query result oracle -

i've got following query select id marmelades mrm not exists (select 1 toys toys mrm.id = toys.id , mrm.ingredient = toys.ingredient , mrm.box_type = 2) , mrm.box_type = 2 it returns 400+ results of id, example [12, 33, 45, ... , 3405] now, want remove ids list everywhere database. not marmelades , toys. also, have example 35+ tables can have id). i happy if query extract in functions all_unneeded_ids can use this: delete another_table_1 id in ( all_unneeded_ids ) delete another_table_2 id in ( all_unneeded_ids ) delete another_table_3 id in ( all_unneeded_ids ) delete another_table_4 id in ( all_unneeded_ids ) ... delete another_table_35 id in ( all_unneeded_ids ) it possible in oracle reuse such results? use first query within subsequent queries. ie: delete another_table_1 id in ( select id marmelades mrm not exists (select 1 toys toys mrm.id = toys.id , mrm.ingredient = toys.ingredient

javascript - MongoDB regex does not match string between 2 pipes -

so want regex match type of elements, regex created in javascript. i assume in mongo need \\ escape instead of one element: toto|titi|tata|tete if value tete or titi or tata or tete return false if value to or ze or we return true toto|titi value not matter because have regex removing specials characters value (it become tototiti ) atm used "(^|\|)" + value + "(\||$)" opposite - when value tete or titi or tata or tete return true when value to or ze or we return false i tried "(^|\|)(?!" + value + ")(\||$)" didn't work "(^|\|)(?!" + value + ").*(\||$)" didn't work i have no more idea, have 1 ?

google bigquery - ARRAY_AGG leading to OOM -

i'm trying run pretty simple query it's failing resources exceeded error. read in post heuristic used allocate number of mixers fail time time. select response.auctionid, response.scenarioid, array_agg(response) responses rtb_response_logs.2016080515 group response.auctionid, response.scenarioid is there way fix query knowing that: a response composed of 38 fields (most of them being short strings) the max(count()) of single response kind of low (165) query failed error : resources exceeded during query execution. job id : teads-1307:bquijob_257ce97b_1566a6a3f27 it's current limitation arrays (produced array_agg or other means) must fit in memory of single machine. we've made couple of recent improvements should reduce resources required queries such this, however. confirm whether issue, try query such as: select sum(length(format("%t", response))) total_response_size rtb_response_logs.2016080515 group respo

php - Can't get login page to redirect when user credentials are entered -

hi there i'm having problem little project i've been working on. i'm 17 years old in high school , trying learn as can html, php, mysql, etc. created database mysql , know have setup correctly, because login page i'm using able know right, , wrong user accounts. cant seem able page redirect welcome page on successful login. here code. login page code <?php include("config.php"); session_start(); if($_server["request_method"] == "post") { // username , password sent form $myusername = mysqli_real_escape_string($db,$_post['username']); $mypassword = mysqli_real_escape_string($db,$_post['password']); $sql = "select id admin username = '$myusername' , passcode = '$mypassword'"; $result = mysqli_query($db,$sql); $row = mysqli_fetch_array($result,mysqli_assoc); $active = $row['active']; $count = mysqli_num_rows($result); // if result matched $myusername , $mypas

android - Cardboard sample, method must be called from UI thread -

trying develop app google cardboard, downloaded sample official sdk. in inner class imageloadertask ( should helper class manage threading ) class imageloadertask extends asynctask<pair<uri, options>, void, boolean> { /** * reads bitmap disk in background , waits until it's loaded pano widget. */ @override protected boolean doinbackground(pair<uri, options>... fileinformation) { options panooptions = null; // it's safe use null vrpanoramaview.options. inputstream istr = null; if (fileinformation == null || fileinformation.length < 1 || fileinformation[0] == null || fileinformation[0].first == null) { assetmanager assetmanager = getassets(); try { istr = assetmanager.open("andes.jpg"); panooptions = new options(); panooptions.inputtype = options.type_stereo_over_under; } catch (ioexception e) { log.e(tag, "could not dec

jquery - Get height ul first -

i´m using $(this).find("ul").filter(":first").height(); first ul. but height not defined, height -20 my ul: ul style="width: 252px; min-width: 820px; padding-bottom: 20px;" class="jqx-tree-dropdown-root" best regards. i created quick jsfiddle displays rather code should work fine. using "this" incorrectly :) https://jsfiddle.net/qoxub22u/ html mockup <div class="container"> <h5>first 1 has height of 40px</h5> <ul style="height:40px"> <li>test</li> <li>test1</li> </ul> <h5>second 1 has height of 70px</h5> <ul style="height:70px"> <li>test</li> <li>test1</li> <li>test2</li> <li>test3</li> </ul> </div> <button id="submit">get height</button> jquery part $( "#submit" ).click(functio

visual studio 2015 - Why do I get the message "The 'NuGetPackage' package did not load correctly"? -

i spent weekend updating visual studio 2015 installation update 3. , installed core .net cli (command tools interface). , rant update "asp.net , webtools tooling". i work, start visual studio, open our project, , this: the 'nugetpackage' package did not load correctly. the problem may have been caused configuration change or installation of extension. can more information examining file: 'c:\users\samuel\appdata\roaming\microsoft\visualstudio\14.0\activitylog.xml' restarting visual studio resolve issue. continue show error message? here error activity log: createinstance failed package [nugetpackage]source: &apos;mscorlib&apos; description: not load file or assembly &apos;nuget.tools, version=3.4.4.1321, culture=neutral, publickeytoken=b03f5f7f11d50a3a&apos; or 1 of dependencies. system cannot find file specified. &#x000d; &#x000a;system.io.filenotfoundexception: not load file or assembly &am

java - Struts2 - redirect request to another application - video -

i have struts2 application , need show inside video being showed in web app. this code shows video. ip not accessible in internet, on server struts app located. <img src="http://<ip_from_other_server/showvideo"> i need action in struts2 can make request , forward response other server. possible? besides struts solution try setup (apache) proxy, redirect request video server. don't have huge software stack. examples here: apache mod_proxy but if decide use struts solution, here ideas: create action possibility connect video server, maybe fileoutputstream answer: download file java use file (saved temporary somewhere), open stream , retur in <img href="mypicture"> -action, maybe here: struts2 servletresponseaware or here struts stream result if want, can little bit more in detail.

java - Is there a way to retrieve the autoincrement ID from a prepared statement -

is there way retrieve auto generated key db query when using java query prepared statements. for example, know autogeneratedkeys can work follows. stmt = conn.createstatement(); stmt.executeupdate(sql, statement.return_generated_keys); if(returnlastinsertid) { resultset rs = stmt.getgeneratedkeys(); rs.next(); auto_id = rs.getint(1); } however. if want insert prepared statement. string sql = "insert table (column1, column2) values(?, ?)"; stmt = conn.preparestatement(sql); //this error stmt.executeupdate(statement.return_generated_keys); if(returnlastinsertid) { //this error since above error resultset rs = stmt.getgeneratedkeys(); rs.next(); auto_id = rs.getint(1); } is there way don't know about. seems javadoc preparedstatements can't return auto generated id. yes. see here . section 7.1.9. change code to: string sql = "insert table (column1, column2) values(?, ?)"; stmt = conn.preparestatement(sql,

javascript - Scrollable table with Vue.js -

so have table gets filled using vue.js v-for method: <table> <tr><th>name</th><th>surname</th></tr> <tr v-for="user in users"><td>@{{user.name}}</td><td>@{{user.surname}}</td></tr> </table> and need table maximum 300px in height, , if gets longer, becomes scrollable. so need set max-height , overflow:auto parameters in css, problem code not "see" table appropriately because rendered vue. so far i've tried adding parameters in css , adding them dynamically after loading table; none of these worked. but, if call $('table').height() , returns actual height of rendered table. maybe can use somehow? would highly appreciate possible help! can wrap table in <div> ? this way div controls scrolling , table free go it's own way.

python - Selecting many rows in Qt table -

i trying create qtableview in qt efficient large tables. i've managed make display of data efficient defining own abstract table model: from pyqt4 import qtcore, qtgui pyqt4.qtcore import qt class datatablemodel(qtcore.qabstracttablemodel): def columncount(self, index=none): return 3 def rowcount(self, index=none): return 10000 def headerdata(self, section, orientation, role): if role != qt.displayrole: return none if orientation == qt.horizontal: return 'c' elif orientation == qt.vertical: return 'r' def data(self, index, role): if not index.isvalid(): return none if role == qt.displayrole: return "({0},{1})".format(index.row(), index.column()) app = qtgui.qapplication([""]) viewer = qtgui.qtableview() model = datatablemodel() viewer.setmodel(model) viewer.show() this works fine, because data meth

android - Instantiate custom view programmatically the right way -

Image
i have custom view called eventitemview i'm using in both xml file , in custom adapter (which extends recyclerview.adapter , used in recyclerview ). problem appearance in recyclerview weird not in xml file : declared using xml instantiated dynamically in adapter and believe due way instanciate views in adapter, doing new eventitemview(context) , not passing additional arguments attributeset, int, int needed render xml version. problem don't know how them in adapter. here's custom view declaration : eventitemview.java public class eventitemview extends framelayout { public eventitemview(context context) { this(context, null); } public eventitemview(context context, attributeset attrs) { this(context, attrs, 0); } public eventitemview(context context, attributeset attrs, int defstyleattr) { super(context, attrs, defstyleattr, 0); init(context, attrs, defstyleattr, 0); } @targetapi(build.ve

ios - Type 'NSPredicate has no subscript members' -

i trying implement search call results database. manage database print in console not access via search. here code use : import uikit class searchtableviewcontroller: uitableviewcontroller, uisearchresultsupdating { var searchpredicate = nspredicate() var filteredappleproducts = [string]() var resultsearchcontroller = uisearchcontroller!() var arrdataarticles: nsmutablearray! override func viewdidload() { super.viewdidload() self.searchpredicate = nspredicate(format: "self like[c] %@", resultsearchcontroller.searchbar.text!) self.resultsearchcontroller = uisearchcontroller(searchresultscontroller: nil) self.resultsearchcontroller.searchresultsupdater = self self.resultsearchcontroller.dimsbackgroundduringpresentation = false self.resultsearchcontroller.searchbar.sizetofit() self.tableview.tableheaderview = self.resultsearchcontroller.searchbar self.tableview.reloaddata() self.getallarticles() } func getallarticles() { a

c# - System.Drawing.Image Parameter Not Valid -

i know has been asked numerous times... , have searched , tried can, still not sure why "parameter not valid" exception... i have amazon ec2 instance running windows server 2012. on machine, running unity3d (unity 5). unity application sending frames (images) ec2 instance local laptop, via tcp. client running windows 10, not make difference. to image data, following: byte[] getscreendata() { // create texture size of screen, rgb24 format int width = screen.width; int height = screen.height; rendertexture rt = new rendertexture(width, height, 24); texture2d tex = new texture2d(width, height, textureformat.rgb24, false); camera camera = gameobject.find("main camera").getcomponent < camera > (); camera.targettexture = rt; camera.render(); rendertexture.active = rt; // read screen contents texture tex.readpixels(new rect(0, 0, width, height), 0, 0); camera.targettexture = null; rendertexture.active = null; destroy(rt);

Django redirect from one page to another -

i working on project in django , i'm facing issue while redirecting 1 page on click of link. no matter i've tried, end having url like: localhost:8080/page1/page2 instead of moving localhost:8080/page1 localhost:8080/page2 i've tried using httpresponseredirect(url) the recommended way use {% url 'url-name' arg1 arg2 kwarg='foo' %} in django template. shouldn't hardcode urls in template use url names. more details: https://docs.djangoproject.com/en/1.9/ref/templates/builtins/#url the equivalent in python code django.utls.reverse returns te absolute url or django.shortcuts.redirect equivalent httpresponseredirect(reverse('url_name')) https://docs.djangoproject.com/en/1.10/ref/urlresolvers/#django.urls.reverse edit #1 use database pass items between views. models.py from django.db.models import model class item(model): # model fields views.py def list_view(request): items = item.objects.all() cont

css - HTML email doesn't work :/ -

i got problem html newsletter. when run code internet website, all's clear. when import on outlook, css doesn't count. normal? thank's email here html & css here <style> body { max-width: 600px; background-color: rgb(67, 153, 186); } h1 { color: rgb(214, 196, 0); } h2 { font-weight: bold; } * { font-family: "univers lt 45", sans-serif; } p { background-color: rgba(255, 255, 255, 0.2) } #newsletterprona { flex-direction: column; rgb(67, 153, 186); } #news {} #yellow { background-color: rgb(214, 196, 0); width: 100%; margin-bottom: auto; overflow: hidden; } #

javascript - Tooltip plothover doesn't appear on modal -

i use flot chart library show graph on modal window.it works fine tooltip popover doesn't appear when plothover. here .js code : $(document).on('click','a[data-target="#evolutieprodus"]',function(){ var route = 'http://www.fabricademagie.ro/metronic/comenzi/returnordersyear'; var productcode = $(this).data('productcode'); var productid = $(this).data('productid'); var data = { 'productcode': productcode, 'productid': productid }; $.post(route,data,function(response){ response = jquery.parsejson(response); //console.log(response); var obj = response.an ; var an_prezent = object.keys(obj).map(function(e){ return [number(e), obj[e]]; }); var obj2 = response.precedent ; var an_precedent = object.keys(obj2).map(function(e){ return [number(e), obj2[e]]; }); var obj3 = response

java - How to use UserSearchManager to check user has registered or not in xmpp? -

i have started develop chat application. needed check user has registered or not in xmpp server.so when user trying register,i want check user has registered or not in xmpp server. after xmpp server connected successfully,tried search number using usersearchmanager.but getting error java.lang.illegalargumentexception: must have local(user) jid set.either didn 't configure 1 or not connected @ least once @ org.jivesoftware.smack.filter.iqreplyfilter. < init > (iqreplyfilter.java: 94) @ org.jivesoftware.smack.abstractxmppconnection.createpacketcollectorandsend(abstractxmppconnection.java: 699) @ org.jivesoftware.smackx.search.usersearch.getsearchform(usersearch.java: 73) @ org.jivesoftware.smackx.search.usersearchmanager.getsearchform(usersearchmanager.java: 71) @ com.techno.samplechat.myxmpp.searchusers(myxmpp.java: 335) @ com.techno.samplechat.myxmpp$xmppconnectionlistener.connected(myxmpp.java: 284) @ org.jivesoftware.smack.abstractxmppconnection.callconnectionc

javascript - How do you JSON (instead of serialize) a form that has name="Item[][things]" without obtaining an object with null children? -

this pretty specific issue , can't find online or couldn't find solution until @ least. i have form, contains inputs have: name = "item[][things]" in item. can't change that. want turn json send server. can't use serialize, need turn json. this doesn't work tried: json.stringify($myform.serializeobject()) . because form contains name="item[][differentotherthings]", array of nulls [null, null, ..., null] i added serializeobject() custom method jquery-serialize-object project. any ideas on how json form without null issue? see bellow snippet $(function(){ $("#serialize").click(function(){ var $myform = $("form").eq(0); var str = json.stringify($myform.serializeobject()); console.log(str); var object = json.parse(str); console.log(object); }) }); $.fn.serializeobject = function() { var o = {}; var = this.serializearray(); $.each(a, function() {

symfony - Error in Knp Paging -

i new in symfony , trying integrate pagination knp pagination. i using symfony2.8. did below code in controller $repository = $this->getdoctrine()->getrepository('adminbundle:cmspage'); $query = $repository->createquerybuilder('cmspage')->getquery(); $limit = 10; //$setting->getadminpagelimit(); //pagination $paginator = $this->container->get('knp_paginator'); $pagination = $paginator->paginate($query, $this->container->get('request')->query->get('page', 1), $limit); i received below error catchable fatal error: argument 1 passed knp\component\pager\paginator::__construct() must instance of symfony\component\eventdispatcher\eventdispatcher, instance of symfony\component\httpkernel\debug\traceableeventdispatcher given, called in e:\xmapp_5.6\htdocs\elite\app\cache\prod\appproddebugprojectcontainer.php on line 1423 , defined

php - file get content with json not working -

www.youtubeinmp3.com/fetch/?format=json&video=http://www.youtube.com/watch?v=i62zjga8jom example output : { "title":"happy forever alone day (forever alone song)", "length":"125", "link":"http:\/\/youtubeinmp3.com\/download\/get\ /?i=k1makl%2fylh6kutehqyqlg9xwtuuwo" } i want using php json file content not working. <?php $json_url = "www.youtubeinmp3.com/fetch/?format=json&video=http://www.youtube.com/watch?v=i62zjga8jom"; $json = file_get_contents($json_url); $data = json_decode($json, true); echo "<pre>"; print_r($data); echo "</pre>"; ?> but nothing working please me .. $json_url = "www.youtubeinmp3.com/fetch/?format=json&video=$videoid"; $videoid dyanamic value getting using post variable . likie <?php $video=$_post['yturl']; echo $video;?> thanks. using code output. $curlsession

dataframe - r subset rows by criteria and by factor group -

i have data.frame lot of nas: df <- data.frame(a = rep(letters[1:3], each = 3), b = c(na, na, na, 1, na, 3, na, na, 7)) df > df b 1 na 2 na 3 na 4 b 1 5 b na 6 b 3 7 c na 8 c na 9 c 7 i subset dataframe obtain factor group rows have no less 2 values, such this: b 1 b 1 2 b na 3 b 3 i have tried function doesn't work: subset(df, sum(!is.na(b)) < 1, = a) > [1] b <0 rows> (or 0-length row.names) any suggestion? (other packages solutions welcome) we can use data.table . convert 'data.frame' 'data.table' ( setdt(df) ), grouped 'a', if sum of logical vector (i.e. non-na elements - !is.na(b) ) greater 1, subset data.table. library(data.table) setdt(df)[,if(sum(!is.na(b))>1) .sd , = a] # b #1: b 1 #2: b na #3: b 3 or using dplyr , same logic, after grouping 'a', filter rows. library(dplyr) df %>% group_by(a) %>% filter(sum(!is.na(b))>1) # b #

c# - How to fire Property Changed Event when it's not actually changing -

so have model contains 2 variables, list , datetime. in usercontrol have dependencyproperty , defined propertychangedcallback. public static readonly dependencyproperty myproperty = dependencyproperty.register("my", typeof(list<mycontainer>), typeof(uc), new frameworkpropertymetadata(null, new propertychangedcallback(onmyproperty))); public list<mycontainer> { { return getvalue(myproperty) list<mycontainer>; } set { setvalue(myproperty, value); } } private static void onmyproperty(dependencyobject d, dependencypropertychangedeventargs e) { uc control = d uc; //do stuff } on form there button, changes on other model variable (on datetime). private void date_click(object sender, routedeventargs e) { mymodel model = datacontext mymodel; if (model != null) { model.date = model.date.adddays(1); } } and here model. public class mymodel : inotifypropertychanged { private list

r - How to log when using foreach (print or futile.logger) -

i want use foreach package in conjunction logging. use futile.logger package. when work given workers logging information lost (which strange need indicate foreach logging package) i've seen this post not use foreach library(foreach) library(futile.logger) library(doparallel)

jquery - AJAX div not working properly -

am working on grails application. need retrieve database data using ajax. i'm having trouble replacing content, it's unnecessarily refreshing header. structure is: <div id="header"> <g:render template="/test/header"></g:render> </div> <div class="addrow"> table content db </div> my code is: success: function(response){ $(".addrow").html(response); } it's refreshing header also, not data. tried these no luck: $(".addrow").parent().html(response); $(".addrow").replacewith(response); now avoid refreshing header?

powershell - casting to XML by default parsing HTML tags too -

i have xml document contains <?xml version="1.0" encoding="utf-8"?> <web-app> <context-param> <description>only applicable if &quot;server&quot; set default.</description> </context-param> </web-app> $gcxml = get-content -path "c:\temp.xml" write-output $gcxml the &quot; preserved in code above, not in code below: $xdoc = [xml] $gcxml $xdoc.'web-app'.'context-param'.'description' here &quot; being parsed " , don't want. output is: only applicable if "server" set default. how can preserve &quot; ? you might re-encode string if that's need , not wish (or cannot) change xml content: # load system.web assembly add-type -assembly system.web [system.web.httputility]::htmlencode($xdoc.'web-app'.'context-param'.'description') versions of powershell older 5 may need additional paren

Android change google maps zoom buttons style -

question how resources of google map , change background these buttons. so, i've found solution via debugger: view mapview = super.oncreateview(inflater, container, savedinstancestate); // button view view locationbutton = ((view) mapview.findviewbyid(1).getparent()).findviewbyid(2); but cant understand how id's views need debugger use findviewbyid( hardcode ) no safely. better disable native control(setzoomcontrolsenabled(false)) , attach yours(you have full access eg animation, color, styles, characters, drawable etc).

java - How to assign a class to execute onClick? -

fellow coders! so i'm pretty fresh on coding, , migrated c# java! everythings works out way want: i've coded fancy looking circular buttons, , created following class: package com.example.haavard.gosecure; /** * created haavardkleven on 08.08.2016. */ import java.util.random; public class passwordgenerator { public static void main(string[] args) { int length = 16; //adjust lenght of generated password here system.out.println(generatepswd(length)); } static char[] generatepswd(int len) { system.out.println("your secure password is:"); string charcaps = "abcdefghijklmnopqrstuvwxyz"; string chars = "absdefghijklmnopqrstuvwxyz"; string numbers = "1234567890"; string symbols = "!@#£$%^*_=+-/.?<>)"; string passsymbols = charcaps + chars + numbers + symbols; random rnd = new random(); char[] password = new char[len];

SQL Server split string and get the value -

hi please me the get result select details table enter code here result : title|firstname|lastname|mobilephone~mr|jack|steve|123456789~mr|test|ltest|123456789~mrs|demo|ldemo|12345678~mrs|fname|lname|1234567 i need below result title firstname lastname mobile mr jack steve 1234567789 etc... you need write stored procedure scan complete line , give pipe separated values in loop.

asp.net - Get User in web method called by external source -

i have web application user logged in. application have webmethod (previously webapi) accessed external source ajax post request. i need logged-in user's id if user logged-in in application (via form authentication) , application consuming webmethod requesting same browser. note: can't change ajax request. please provide solution changes in application.

android - Actionbar text not changed to custom font after using Calligraphy library -

i using calligraphy library , working fine except in actionbar. using below lines calligraphy work in oncreate(): calligraphyconfig.initdefault(new calligraphyconfig.builder() .setdefaultfontpath("fonts/regular.ttf") .setfontattrid(r.attr.fontpath) .build()); and @override protected void attachbasecontext(context newbase) { super.attachbasecontext(calligraphycontextwrapper.wrap(newbase)); } using above fonts customized except in action bar. other steps need add? tried below error saying cannot resolve constructor spannablestring s = new spannablestring("my title"); s.setspan(new typefacespan(this, "mytypeface.otf"), 0, s.length(), spannable.span_exclusive_exclusive); any options? calligraphy version - compile 'uk.co.chrisjenx:calligraphy:2.2.0' try using toolbar described here . check this comment calligraphy: i don't support action bar, toolbars. it'

java - Optimize EditText Syntax Highlighting ( Spannable ) -

im developing android code editor, when apply syntax highlighting it, laggy, there way optimize it? here code: protected void oncreate(bundle savedinstancestate) { scripteditor.addtextchangedlistener(new textwatcher() { @ override public void aftertextchanged(editable s) { applysyntax(s); } }; } public void applysyntax(spannable spannable) { matchz = wordpat.matcher(spannable); while (matchz.find()) { integer color = null; if (stringkeyword.contains(matchz.group())) { color = integer.valueof(keycolor); type = "keyword"; } if (stringkeyword2.contains(matchz.group())) { color = integer.valueof(keycolor2); type = "keyword"; } if (stringkeyword3.contains(matchz.group())) { color = integer.v

html - Getting database info for a django template with ajax -

i'm new django , ajax, i'm trying following: in html have few "select" elements, , every "select" there button called "view". when click "view" want retrieve database info dependent on option selected in "select" corresponding clicked "view". should done ajax, , want display of said database info in html (without refreshing page obviously). i understand should add onclick event buttons, , in there send selected option info via ajax, i'm confused following: in such scenario, should use or post? , why? what url contact ajax? should create special url used function (and presumably won't visited user in normal way)? once have ajax call, how should return database info template? assume somehow done in view corresponding url calling? somehow use "success" function in javascript calls ajax? the relevant question here found 1 django: database object value in template using ajax , doesn'

java - Retrieve data being parsed by SAXParser on runtime -

i have method parse xml data inputstream public static void parsexml(inputstream stream, defaulthandler handler) { try { saxparserfactory factory = saxparserfactory.newinstance(); factory.setvalidating(false); saxparser parser = factory.newsaxparser(); parser.parse(stream, handler); } catch (parserconfigurationexception pce) { // code here } catch (saxparseexception spe) { // if exception caught, log current data being parsed saxparser here } catch (saxexception se) { // if exception caught, log current data being parsed saxparser here } catch (ioexception ie) { // code here } } is there anyway log data being parsed saxparser whenever saxparseexception/saxexception caught?

swift - UILabel does not appear on SKScene -

i trying create label on skscene not appearing. don't know wrong. code seems fine: class end: skscene { var label = uilabel() override func didmovetoview(view: skview) { scene?.backgroundcolor = uicolor(red: cgfloat(59.0/255.0), green: cgfloat(89.0/255.0), blue: cgfloat(152.0/255.0), alpha: cgfloat(1.0)) label.text = "game over!" label.backgroundcolor = uicolor.blackcolor() label = uilabel(frame: cgrect(x: 0, y: 0, width: view.frame.width/3, height: 30)) label.center = cgpoint(x: view.frame.size.width / 2, y: view.frame.size.width/7) label.textcolor = uicolor.whitecolor() self.view?.addsubview(label) } } the problem have set textcolor , backgroundcolor both whitecolor() , change 1 show text properly. edit: i think want add label inside view passing parameter use view.addsubview(label) instead of self.view?.addsubview(label) .

String Encoding Methods: Base 43 -> Base 95 -

i'm looking fast way change base 43 strings (i.e. ascii 32-126 excluding alphabet) base 95 (ascii 32-126). these strings 3-20 characters long - have pseudocode this? i don't believe there other way first decode base-43 string 'big integer' , encode base-95 string. for string of 20 characters, intermediate integer log(43)/log(2)*20 = 109 bits long. if have access big integer math, conversion easy implement. if can stay under 128 bits (23 characters in base-43) calculations can quite fast.

jquery - Buttons won't add to column using custom-command ( Kendo-UI ) -

Image
i'm trying add buttons last column make onclick -> modal window. the buttons not show new column ... the browser sees js file identical in visualstudio i've tried rebuild project rename js file reboot :) the browser inspector gives me understanding there no new column generated ... pls give me clue went wrong? lot!!! $(document) .ready(function() { //kendogrid var tabstrip; var gridobject; var expandedrowdataitem; var accountinfotabdata; var rowobject; $("#grid") .kendogrid({ datasource: { transport: { read: { url: "/api/griddata/getcustomers", datatype: "json" } }, pagesize: 20, schema: { parse: function(response) { $.each(response, function(idx, elem)

postgresql - Write spark dataframe to postgres Database -

the spark cluster setting follows: conf['sparkconfiguration'] = sparkconf() \ .setmaster('yarn-client') \ .setappname("test") \ .set("spark.executor.memory", "20g") \ .set("spark.driver.maxresultsize", "20g") \ .set("spark.executor.instances", "20")\ .set("spark.executor.cores", "3") \ .set("spark.memory.fraction", "0.2") \ .set("user", "test_user") \ .set("spark.executor.extraclasspath", "/usr/share/java/postgresql-jdbc3.jar") when try write dataframe postgres db using following code: from pyspark.sql import dataframewriter my_writer = dataframewriter(df) url_connect = "jdbc:postgresql://198.123.43.24:1234" table = "test_result" mode = "overwrite" properties = {"user":"postgres", "password":"password"} my_writer.jdbc(url_connect, table, mode