Posts

Showing posts from July, 2013

ios - How to implement UIVibrancyEffect for table view header? -

ios - How to implement UIVibrancyEffect for table view header? - i table view section headers text rendered in vibrant style, underlying ui shines through text. have tried following, nil appears header if returned nil . override func tableview(tableview: uitableview, viewforheaderinsection section: int) -> uiview? { //add vibrancy text effect allow blureffect = uiblureffect(style: .light) allow vibrancyeffect = uivibrancyeffect(forblureffect: blureffect) allow vibrancyeffectview = uivisualeffectview(effect: vibrancyeffect) //label vibrant text allow vibrantlabel = uilabel() vibrantlabel.text = "testing" vibrantlabel.font = uifont.systemfontofsize(11.0) vibrantlabel.textcolor = uicolor(white: 0.64, alpha: 1) vibrancyeffectview.contentview.addsubview(vibrantlabel) homecoming vibrancyeffectview } solved it. problems code provided in question are: had set frames view , label (duh), , needed specify blur effect

sql - golang database Open function ambiguity -

sql - golang database Open function ambiguity - in go, invoke database open db, err = sql.open("sqlite3", "./bar.db") this returns database of type *sql.db , function , type both members of database/sql . however, in sqlite3 driver package, there open function returns *sqlite3.conn type. i've noticed of functions defined in sqlite3 driver bundle not work on database opened using default database/sql . additionally, there functions in sqlite3 bundle similar database/sql 's functions, namely query , exec , homecoming different types. database/sql contains func query returns type *sql.rows . mxk/sqlite/sqlite3 , mattn/go-sqlite3 both have query function, homecoming different types. i want run functions such mxk/sqlite/sqlite3 's busytimeout on database connection, isn't right type. have re-write of code open database connection sqlite3 driver instead of using database/sql 's open ? what's advantage of databa

security - character entities in HTML attributes -

security - character entities in HTML attributes - i'm studying article: https://www.owasp.org/index.php/xss_%28cross_site_scripting%29_prevention_cheat_sheet , , thought html entities must escaped in attribute values different html content. but want know origin, html spec? can't find it, can point me direction? thanks. it's more of dom issue. here jump-off point http://www.technicalinfo.net/papers/css.html html security

java - Get current case number -

java - Get current case number - i have simple switch case statement, , want current case int. for example: case 5: // code break; i want 5. ideas? usually within switch case need meet condition. can print status variable within switch case. int conditionvariable = 0; at point in execution conditionvariable set value in program. switch case execute, compare conditionvariable cases . switch (conditionvariable) { case 5: // prints case number logcat. log.d("tag", conditionvariable); break; . . . } java switch-statement

c# - Can VB.NET create inline blocks with new scope? -

c# - Can VB.NET create inline blocks with new scope? - this question has reply here: scope , how narrow using vb.net 4 answers in c#, 1 can create new scope placing braces around code. example: { foo fooa = new foo(); fooa.dosomething(); fooa.dosomethingelse(); } { // can't refer fooa in here. foo foob = new foo(); foob.dosomething(); foob.dosomethingelse(); } does vb.net have way create new scope without using reserved words? you can (nowhere near elegant c# code, same job): if true dim fooa new foo() fooa.dosomething() fooa.dosomethingelse() end if if true ' can't refer fooa in here. dim foob new foo() foob.dosomething() foob.dosomethingelse() end if i have question why want though...refactoring jumps out me c# .net vb.net scope c#

Mandrill- Attachments not sending attachment -

Mandrill- Attachments not sending attachment - i attempting send little rtf attachment through mandrill. have created next json , tried using api test page. attachment base of operations 64 encoded. api reports no error , email comes through no attachment. doing wrong? { "attachments": [ { "type": "application/rtf", "name": "test.rtf", "content": "e1xydgyxxgfuc2lcyw5zawnwzzeyntjczgvmzjbczgvmbgfuzziwntd7xgzvbnr0ymx7xgywxgzuawxczmnoyxjzzxqwienhbglicmk7fx0ncntcklxnzw5lcmf0b3igtxnmdgvkaxqgns40ms4yms4yntewo31cdmlld2tpbmq0xhvjmvxwyxjkxhnhmjawxhnsmjc2xhnsbxvsddfcbgfuzzlczjbcznmymib0aglziglzigegdgvzdcbzzw5kaw5nigzpbgvccgfydqp9dqoa" } ], "message": { "html": "<html>\r\n<body>test data</body>\r\n</html>\r\n", "subject": "cloud demo", "from_email": "jklovanc@hotmail.com", &

r - How to retrieve a slot coords of each spatialPpolygon object -

r - How to retrieve a slot coords of each spatialPpolygon object - i have spatialpolygons object in r; can not retrieve "coords" each spatialpolygon object here's r session: [[1]] object of class "polygon" slot "labpt": [1] 5.7828 20.5764 slot "area": [1] 0.16 slot "hole": [1] false slot "ringdir": [1] 1 slot "coords": x y [1,] 5.6828 20.7764 [2,] 5.7828 20.7764 [3,] 5.8828 20.7764 [4,] 5.9828 20.7764 [5,] 5.9828 20.3764 [6,] 5.8828 20.3764 [7,] 5.7828 20.3764 [8,] 5.6828 20.3764 [9,] 5.5828 20.3764 [10,] 5.5828 20.7764 [11,] 5.6828 20.7764 [[2]] object of class "polygon" slot "labpt": [1] 3.715865 35.160271 slot "area": [1] 39.68 slot "hole": [1] false slot "ringdir": [1] 1 slot "

php - How to enforce long syntax for array declaration in phpstorm? -

php - How to enforce long syntax for array declaration in phpstorm? - i quite used using short array syntax [] instead of longer 1 array() . now, forced server environment using longer one. phpstorm allows enforce shorter syntax arrays in code style > php > array declaration style > forcefulness short declaration style: now, want accomplish reverse. having automatically replaced preferred, help mark short declaration style error. from project settings > php take php language level 5.3 , mark short array syntax error. php arrays syntax phpstorm

android - How to capture onTouch events on two overlapping views? -

android - How to capture onTouch events on two overlapping views? - layout container relative layout contains 2 custom views: outerview1 , innerview2 outer view1 custom view, matching parent’s size (full screen) inner view2 custom view, laid on top of outerview1 overlapping it. on both outerview1 , innerview2, want capture these touch events onsingletapconfirmed() , onfling(). area both outerview1 , innerview2 overlapping, want command passed touch event methods of both views. i tried this: container class @override public boolean onintercepttouchevent(motionevent ev) { outerview1.ontouchevent(ev); innerview2.ontouchevent(ev); homecoming false; } outerview1 class @override public boolean ontouchevent(motionevent event) { gesture.ontouchevent(event); homecoming true; } gesture instance of gesturedetector.simpleongesturelistener log statements ondown(), onfling() , onsingletapconfirmed() method

SubQuery nHibernate without collection -

SubQuery nHibernate without collection - for example: tree treealias = null; var nonrottenapples = queryover.of<apple>() .where(a => !a.isrotten) .where(a => a.tree.id == treealias.id) .select(x => x.id); // <- optional return nhibernatesession.queryover(() => treealias) .where(t => t.id.isin(listoftreeid)) .withsubquery.whereexists(nonrottenapples) .list(); how subquery not collection in apple ? i'm researching @ various locations, not find results question. results collections. my interpretation of question you're trying query trees don't have rotten apples. i believe work: var rottentreeids = queryover.of<apple>() .where(apple => apple.isrotten) .select(a => a.tree.id); homecoming nhibernatesession.queryover<tree>() .where(t => t.id.isin(listoftreeid)) .withsubquery.w

c programming casting struct values -

c programming casting struct values - i trying cast int value in struct double. guessing screwing parenthesis somehow. wasn't able find useful in forum or in google. i added more info. struct start { int x; int y; double heuristic; }; struct shapes { int x [100]; int y [100]; double heuristic [100]; int has_visited [100]; int num_points; int *link; }; struct line { int x1 [100]; int y1 [100]; int x2 [100]; int y2 [100]; }; double addition(double x, double y) { homecoming x + y; } int main(int argc, char *argv[]) { int kk = 0; double x = 0; double y = 0; double z = 0; struct start start; struct end end; struct shapes shapes[100]; struct line edges; x = (double)start.x; y = (double)edges.x1[kk]; z = addition((double)start.x, (double)edges.x1[kk]) homecoming 0; } i tried running code bit of changes here , there , works me, except had comment out "(double)edges.x1[kk]" x1 not there in of

javascript - Filtering by two different categories -

javascript - Filtering by two different categories - i have list of people , activities. i have them filtered 2 categories, name , activity. made 2 select's , filled 1 people's names , 1 activities. <select class="filter people"> <option value="0">all people</option <option value="1">john</option> <option value="2">mary</option> <option value="3">dan</option> etc. </select> <select class="filter activities"> <option value="0">all activities</option <option value="1">football</option> <option value="2">basketball</option> <option value="3">painting</option> <option value="4">racing</option> etc. </select> sample of list structure. <div id="wrap"> <div class="item people3 activity2">dan:basketball&l

How to find in java in this statement line number? -

How to find in java in this statement line number? - this question has reply here: how can print line numbers log in java 17 answers i want find line number of code dynamically. how can done? public static void main(string[] args) { system.out.println("this line number : ????"); } you can line number getstacktrace()[] public static void main(string[] arg) { system.out.println("this line number : "+thread.currentthread().getstacktrace()[1].getlinenumber()); } java

Pass Path From c# to matlab -

Pass Path From c# to matlab - matlab ,c# expert trying pass path generated c# (apppath = path.getdirectoryname(application.executablepath); to dll created script in matlab contains functions it works when send numeric ,string values functions , let's function never works when seek send paths looks cd(path) in matlab function , not work ! the thing have 1 created dll function cd(path) work though created same mwarray version , same matlab version ! confused tried send mwarray , mwcell char nil worked i have no thought ! it looks matlab not path correctly or not execute cd(path) in right way anyway instead of alter matlab path , access directory of desired folder here how fopen(fullfile(path,filenam)); that how solved issue best regard c# matlab path send

javascript - Typeahead not recognized inside ng-view -

javascript - Typeahead not recognized inside ng-view - i have 2 files. 1 index.html, frame website, , other main.html holds template homepage. have next code right before scripts imported. <div class="container"> <div class="well" ng-view=""></div> <div class="footer"> <p translate="footer">well hello there mr. footer</p> </div> </div> all typeahead , controllers imported in scripts. defaults pulling main.html because of routed controller. issue when set next code index.html, typeahead works fine, as move main.html stops working. of javascript beingness ran files, shouldn't conflict of loads first... thoughts? <div ng-controller="employeecontroller"> <table> <center> <div id="the-basics"> <input type

jquery - JSON formatting for 3 layer nest -

jquery - JSON formatting for 3 layer nest - i trying accomplish jquery code automatically fills in select box name , id next select box (if logic correct). having issues structuring json file. i have next attributes requires 3 layer nested json: static element (first thing on html page) <select> <option value="first">this first</option> <option value="second">this second</option> <option value="third">this third</option> <option value="fourth">this fourth</option> <option value="fifth">this fifth</option> </select> so have 1 static element user has select first option { "first":[ "london"[ "id" = "london" "name" = "london uk" { "id" = "firstlondon", "name" = "first london&qu

javascript - Div height animation causes divs to change alignment in jQuery -

javascript - Div height animation causes divs to change alignment in jQuery - i'm trying animate height of 5 divs on click of button. although these divs increment in size animation causes divs align @ top rather bottom. if makes sense. i prefer animate while coming downwards top (so aligned top) if other way around, animation completes changes divs locations. class="snippet-code-js lang-js prettyprint-override"> $("button").click(function(){ $("#f").css("display", "inline"); $(".css").css("display", "inline"); $(".html").css("display", "inline"); $(".jquery").css("display", "inline"); $(".premiere").css("display", "inline"); $(".photoshop").css("display", "inline"); $(".css").animate({height:'300'}, 600); $(".html")

emacs - How can I solve make error, "make[1]: I: Command not found" -

emacs - How can I solve make error, "make[1]: I: Command not found" - i tried compile emacs-24.4 native windows mingw64-x86_64 packages , gnu create in cygwin x84_64. after finishing ./configure script, when doing make, got this: [ -r "src/config.in" ] || ( cd . && autoheader ) cd nt && create \ cc='x86_64-w64-mingw32-gcc -std=gnu99' cflags='-g3 -o2 -gdwarf-2' cppflags='-mtune=generic -i/usr/x86_64-w64-mingw32/sys-root/mingw/include/ -duse_crt_dll=1 -i /cygdrive/d/workspace/emacs-24.4/nt/inc' \ ldflags='' make='make' make[1]: entering directory '/cygdrive/d/workspace/emacs-24.4/nt' . -o coff -o emacs.res ./emacs.rc make[1]: i: command not found makefile:228: recipe target 'emacs.res' failed make[1]: [emacs.res] error 127 (ignored) x86_64-w64-mingw32-gcc -std=gnu99 -mtune=generic -i. -i. -mtune=generic -i/usr/x86_64-w64-mingw32/sys-root/mingw/incl

c# - How to add a custom time picker in a Windows Phone 8.1 app? -

c# - How to add a custom time picker in a Windows Phone 8.1 app? - i have implemented time input length of time in application using textbox , parsing string timespan object. //assign text box string value time span variable. timespan worktm = timespan.parseexact(wrkstring, @"hh\ \:\ mm\ \:\ ss\ \:\ fff", cultureinfo.invariantculture); but i'm wondering how can add together time picker command below image application. don't see available command in toolbox. is custom command utilize , how implemented? if you're making silverlight windows phone 8.1 app, need utilize timepicker command silverlight windows phone toolkit. read more timepicker , datepicker controls silverlight windows phone toolkit here. if you're making winrt windows phone 8.1 app, there's timepicker command included in sdk. (yaay!) comes downwards using this: (silverlight) <toolkit:timepicker value="{binding date}” /> or: (winrt) <ti

Regex Protection(Bypassing to XSS or Open Redirect) - Javascript -

Regex Protection(Bypassing to XSS or Open Redirect) - Javascript - anyone in universe can help me finding out function.what done regex string /^#~?!(?:\/?[\w\.-])+\/?(?:\?|$)/ when passed javascript statement this. (/^#~?!(?:\/?[\w\.-])+\/?(?:\?|$)/).test(location.hash)&&location.replace(location.hash.substr(location.hash.indexof('!')+1)); and possible bypass regex string may making xss attack or open redirect? edit :- ok iam going more accurate. goal break above regex match create xss or open redirect.(only education purpose,like crackme). so eg:- if used #!stackoverflow.com browser redirects current domain plus stackoverflow.com like domain.com/foo/#!stackoverflow.com it redirects domain.com/stackoverflow.com . so tried putting #!//stackoverflow.com regex match fails. is there anyway bypass create open redirect stackoverflow.com(any kinda character encodings or else). if else possible create xss in current context. thank you

javascript - Node - Wait request response within cycle For -

javascript - Node - Wait request response within cycle For - really, i've tried ways, fail find solution. as no english, , i'm using google translator, explain same thing several times in row. 1º seek loop wait until finished within 2º seek know city doing ok on external web request. , many cities, need break cycle 1 time check first city ok. 3º need go json , execute action while running , wait till finishes follow. out of cycle @ time. i've been testing several codes, nowadays here improve understanding. --------------------------------------------------------------------- var city = [ {'city':'madrid'}, {'city':'barcelona'}, {'city':'valencia'}, {'city':'malaga'} ]; var vbreak = 0; (i in city){ request('example.there-city.com/' + city[i].city ,function (error, response, read) { if (read == 'ok') { vbreak = 1} }); if (vbreak == 1){

Change username and password (if possible remotely) with, for example, Windows Powershell -

Change username and password (if possible remotely) with, for example, Windows Powershell - i'm trying find way alter username , password in windows 7 computer , friend in network research , testing in class. i've found using windows powershell it's possible, find websites script lines, write , customize them alter or create user accounts usernames , password , i'm not able. so question simple: how alter username , password in windows powershell remotely, example, sending script server client. regards, cristobal. no need powershell, simple batch file. execute next command prompt alter teh password: net user user_name new_password you have logged in administrator windows powershell passwords username

categories - Wordpress get_pages based on page category -

categories - Wordpress get_pages based on page category - i need get_pages or array of pages in wp based on 's category i know wp doesn't come categories on pages i'm using in functions.php categories on pages. add_action('admin_init', 'reg_tax'); function reg_tax() { register_taxonomy_for_object_type('category', 'page'); add_post_type_support('page', 'category'); } now need utilize these categories in get_pages or wp_query in pages category. <div class="productnav"> <ul> <?php $product_page_args = array( 'post_type' => 'page', 'order' => 'asc', 'orderby' => 'menu_order', 'child_of' => $post->id, 'category_name' => 'pi

android - detect iBeacon using altbeacon library -

android - detect iBeacon using altbeacon library - i developing project uses ibeacons library is code recognize beacon ? beaconmanager.startmonitoringbeaconsinregion(new region("d1b024cb-a02d-4650-9c6a-baeda8a31f0e", null, null, null)); i have uuid major , minor, how utilize them ? hope help public class rangingactivity extends activity implements beaconconsumer { protected static final string tag = "rangingactivity"; private static final string uuid = "xxxxxxxxxxxxxxxxxxxx"; private beaconmanager beaconmanager = beaconmanager.getinstanceforapplication(this); @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_ranging); beaconmanager.bind(this); } @override protected void ondestroy() { super.ondestroy(); beaconmanager.unbind(this); } @override public void onbeaconservi

asp.net mvc 5 - Trying to send datetime to controller via json -

asp.net mvc 5 - Trying to send datetime to controller via json - in model got datetime (fechanac) format can't json. public class persona { public int id { get; set; } [display(name = "nombre")] [required] public string nombre { get; set; } [display(name = "apellido")] [required] public string apellido { get; set; } [display(name = "fecha de nacimiento")] [required] [datatype(datatype.date)] public datetime fechanac { get; set; } [display(name = "lugar")] [required] public int idlugar { get; set; } } in controller of info of model, public jsonresult getpostdata(persona jsonpersona) { console.writeline(jsonpersona.tostring()); homecoming json(jsonpersona, "text/html", jsonrequestbehavior.allowget); } but can't date, tried format in javascript in different ways no success. format in iso format (from datepicker) @using mvcprueba2.models @model mvcpru

matlab - Simulink error: Cannot find implementation for block -

matlab - Simulink error: Cannot find implementation for block - i attempting create simple dds/nco used in fpga. have working dds in simulink. when seek convert hdl using hdl converter receive above error. problem block receive error not exist in design anymore. closing , reopening programme has done nil update that. error received when block not compatible hdl coder. other blocks indeed compatible. i using matlab r2014a if @ relevant thank you matlab simulink hdl hdl-coder

javascript - Dynamically insert nested controller -

javascript - Dynamically insert nested controller - i have simple asp.net mvc application contains ng-controller. using partial view inject within controller ng-controller used when needed. how can create work because not create binding properly. here's plunker simplified version of need. <body ng-app="myapp"> <div id='parent' ng-controller="myctrl"> <label>primitive</label> <input type="text" ng-model="name"> <label>object</label> <input type="text" ng-model="user.name"> <button onclick="addnested();">add nested controller</button> </div> </body> and javascript part: var app = angular.module("myapp", []); app.controller("myctrl", function($scope) { $scope.name = "parentname"; $scope.user = { name: "peter" }; }); function addnested() {

Facebook authentication via android app -

Facebook authentication via android app - i new android. developing application requires facebook login proceed. have followed tutorial - https://developers.facebook.com/docs/android/getting-started edit: using uilifecyclehelper, same thing happen, 1 time user authenticates application application closed. private session.statuscallback callback = new session.statuscallback() { @override public void call(session session, sessionstate state, exception exception) { if (session.isopened()) { log.w("vinit", "session started"); // create request /me api request.newmerequest(session, new request.graphusercallback() { // callback after graph api response user object @override public void oncompleted(graphuser user, response response) { if (user != null) { textview t = (textview) findviewbyid(r.id.textview1

audio - Recording from 2 microphones (simultaneously) into MATLAB -

audio - Recording from 2 microphones (simultaneously) into MATLAB - i have 2 microphones connected y-adapter cable connects microphone port on laptop. microphones distance apart, , goal find time delay between 2 signals. however, don't think i'm reading in sound correctly. understanding should able obtain 2 separate vectors representing sound recorded each microphone. when compare plots though looks weird. amplitude on 1 plot way off scale , cant visually observe delay. can tell me i'm doing wrong? here's code: rec1=audiorecorder(44100,16,1,1); rec2=audiorecorder(44100,16,1,2); record(rec1,5); record(rec2,5); y1=getaudiodata(rec1); y2=getaudiodata(rec2); plot(y1) figure; plot(y2) this assumes "microphone" input stereo, otherwise assumption misguided. myhardware=audiodevinfo; devid=myhardware.input(1).id stereo = 2 %check myhardware.input(1).name right input alter (1) until find right mic rec1=audiorecorder(44100,16,stereo,devid); record

c# - Hashtable new entries permanent loop and finding key with lowest value -

c# - Hashtable new entries permanent loop and finding key with lowest value - string v; int k; console.writeline("enterv"); v = console.readline(); console.writeline("enter k"); k = int.parse(console.readline()); ht.add(v, k); this code , have in function never ends, why that?? and also, i'm trying find lowest key in hash table, , professor gave illustration can't work. hashtable tabela=new hashtable(); string ime; int min=100000; foreach(string k in tabela) { if(tabela[k]<min){ min=tabela[k]; ime=k; } } how can compare keys properly? var minvalue = int32.maxvalue; string minkey = null; foreach (dictionaryentry item in ht) { if ((int) item.value < minvalue) { minvalue = (int) item.value; minkey = (string) item.key; } } c# .net hashtable

java - Mule hot deploy running out of PermGen -

java - Mule hot deploy running out of PermGen - i have mule instance running numerous rss connectors, , have service running within same mule context receives rss feed updates/deletes/additions. when feed changes, service triggers hot deploy touching mule config file. works fine. mule reloads context , picks changes. however, every time hot deploy, class loader reloads classes, duplicating initial permgen memory footprint every time. eventually, run out of permgen space, , mule crashes. doesn't matter how big create - every hot deploy demands more space. i'm monitoring in yourkit, fwiw. i found generic info making servers utilize shared libraries, instead of loading new ones in every context. assume what's happening each time hot deploy occurs, new mule context created, , mule reloads classes new context instead of using ones loaded. how can multiple hot deploys without running out of permgen? thanks! try adding "-xx:permsize=128m -xx:max

c# - how can i rotate image from database -

c# - how can i rotate image from database - i want rotate image stored within database possible ? can image database don't know how rotate it. string img = (request.querystring["cn"]); byte[] bytes = null; if (rbphoto1.checked == true) { if (img != null) { //string str = "select mem_contenttype, mem_photo tblcardrequestdetail2 mem_cardno = '" + request.querystring["cn"] + "'"; string str = "select mem_contenttype1, mem_photo1 tblphotoupload mem_cardno = '" + img + "'"; sqlcommand cmd = new sqlcommand(str); cmd.parameters.add("@1", sqldbtype.varchar).value = img; datatable dt = getdata(cmd); bytes = (byte[])dt.rows[0]["mem_photo1"]; response.outputstream.write(bytes, 0, bytes.length); response.buffer = true; response.charset = "";

check digit - What is the algorithm of generating the code on 100 USD banknote? -

check digit - What is the algorithm of generating the code on 100 USD banknote? - i designing primary key storing product. around find insight how design id using auto increment boring. 1 know code 'kb46279860i' on below banknote meaning? 100 usd picture i think code not using auto-increment algorithm check digit,etc. could 1 give me hints , thanks!! if you're not planning on showing user id auto-increment save processing time handled database directly. if planning on showing id user without showing 1 in database, consider using hashids, or guid or generating own unique random value check digit. can utilize luhn or damm's algorithm check digit. check-digit

move - slow down rectangle in SDL2/C -

move - slow down rectangle in SDL2/C - hallo seek have real gravity in programme smaller rectangle should slow downwards when dont press key. code tried out, nil happened(in aspect): #include <stdio.h> #include <sdl2/sdl.h> int main() { //request successful execute if(sdl_init(sdl_init_everything)!=0) { printf("fehler"); homecoming 1; } //create window 800x600 sdl_window *win; win = sdl_createwindow("test",100,100,800,600,sdl_window_shown); //create renderwindow vysnc enabled sdl_renderer *ren = sdl_createrenderer(win, -1, sdl_renderer_accelerated | sdl_renderer_presentvsync); if(ren==null) { printf("fehler"); sdl_quit(); homecoming 1; } //boolean info type not supported int gamerunning = 1; sdl_event event; const uint8 *keystate=sdl_getkeyboardstate(null); //create rectangle whole window sdl_rect rect={ 0,0,800,600 }; //smaller rectangle sdl_rect rect2={

java - Inner class constructor invocation -

java - Inner class constructor invocation - the jls says: the constructor of non-private inner fellow member class implicitly declares, as first formal parameter, variable representing enclosing instance of class. ok, if write following: class a: package org.gradle; public class extends b.inner{ public a(b b){ b.super(); //ok, invoke b.inner(b) } } class b: package org.gradle; public class b{ public class inner{ } } as said here, b.super() invoke b.inner(b) . but if write class b: package org.gradle; public class b { class inner{ public inner(b b){ system.out.println("inner(b)"); } } } class a: package org.gradle; public class extends b.inner{ public a(b b) { b.super(); //the constructor b.inner() undefined } } so, in latter illustration b.super() tries invoke b.inner() instead. why difference? it seek invoke b.inne

printing multiple pages in C# -

printing multiple pages in C# - i print 2 pages in application when utilize code behind, i'm in never ending loop. e.hasmorepages = true; e.graphics.drawstring("hello", new font("verdana", 12), new solidbrush(color.black), new point(10, 10)); e.graphics.drawstring("page 2", new font("verdana", 12), new solidbrush(color.black), new point(10, 2000)); if place e.hasmorepages = true; in comment print first page. can help me? e.hasmorepages has no effect in middle of print routine. in case, create global variable e.g. count = 1 , , then: if (count == 1) { e.graphics.drawstring("hello" + count, new font("verdana", 12), new solidbrush(color.black), new point(10, 10)); e.hasmorepages = true; } else { e.graphics.drawstring("hello again", new font("arial", 12, fontstyle.regular), brushes.black, 100, 100) e.hasmorepages = false; } count++; ps: haven't tried code mysel

python - adding words to stop_words list in TfidfVectorizer in sklearn -

python - adding words to stop_words list in TfidfVectorizer in sklearn - i want add together few more words stop_words in tfidfvectorizer. followed solution in adding words scikit-learn's countvectorizer's stop list . stop word list contains both 'english' stop words , stop words specified. still tfidfvectorizer not take list of stop words , can still see words in features list. below code from sklearn.feature_extraction import text my_stop_words = text.english_stop_words.union(my_words) vectorizer = tfidfvectorizer(analyzer=u'word',max_df=0.95,lowercase=true,stop_words=set(my_stop_words),max_features=15000) x= vectorizer.fit_transform(text) i have tried set stop_words in tfidfvectorizer stop_words=my_stop_words . still not work . please help. python scikit-learn classification stop-words text-classification

javascript - Multiple Select bug in Firefox -

javascript - Multiple Select bug in Firefox - i have specific problem multiple select values. <form id="form-to-submit"> <select multiple="true" name="sel" id="sel"> <option id="0_1" value="0">bacon</option> <option value="1">pickles</option> <option id="0_3" value="2">mushrooms</option> <option value="3">cheese</option> </select> </form> <button id="setvalues">set values</button> js: $("#setvalues").click(function() { $("#sel").find("option").removeattr("selected"); $("#0_1").attr("selected","selected"); $("#0_3").attr("selected","selected"); }); i've crated jsfiddle shows problem: when click on set values button, clea

mongodb - Meteor 1.0 - MinimongoError: can't append to array using string field name [-1] -

mongodb - Meteor 1.0 - MinimongoError: can't append to array using string field name [-1] - meteor 1.0 built mongodb v2.4, doesn't have $position api introduced in mongo 2.6. therefore, i'm unable add array item(s) origin of mongodb array such: { $push: { <field>: { $each: [ <value1>, <value2>, ... ], $position: 0 } } } i've tried adding items front end of mongodb array via workaround... collectionname.update( {_id: 'xjfb2bbsyj2mafu'}, {$set: {'field.-1': data} } ); ... works on server-side code , cannot interpreted minimongo: i20141109-23:32:42.382(-5)? error in oplog callback minimongoerror: can't append array using string field name [-1] i20141109-23:32:42.382(-5)? @ minimongoerror (packages/minimongo/minimongo.js:53) i20141109-23:32:42.383(-5)? @ findmodtarget (packages/minimongo/modify.js:133) i20141109-23:32:42.383(-5)? @ packages/minimongo/modify.js:56 i201

subquery - Conditional SQL Statement -

subquery - Conditional SQL Statement - i inquire if possible create sql statement if or similar structure. have 2 queries , combine them one. difference between 2 1 has additional , conditions on clause. tried doing select case, not successful. create parameter "test" take 1 or 2, , status should determine query run. here queries... query 1 select id,avg(b.vol) pvol (select var1 id, sum(vol) pvol table1 var1='xyz' , date_d>'10/28/2013' , date_d<'10/31/2013' , customer='market' , market='south' , project=0 grouping var1,date_d) b grouping id query 2 select id,avg(b.vol) pvol (select var1 id, sum(vol) pvol table1 var1='xyz' , date_d>'10/28/2013' , date_d<'10/31/2013' , project=0 grouping var1,date_d) b grouping id you create sproc accepts "test" parameter hope build if statement around. create procedure --sprocname ( @test int ) begin set nocount on if @t

spring - Block specific HTTP Get Requests in Tomcat -

spring - Block specific HTTP Get Requests in Tomcat - i have mapping url of "/" , controller @requestmapping(value = {"/index","/"}) public modelandview displayslideshow() { homecoming new modelandview("index"); } but because of mapping requests /... or /? or /.dfdhj serves homepage. read spring tries match best available url. is there way prevent such mapping ? spring http tomcat get

javascript - Angular ui router anchorscroll from another page -

javascript - Angular ui router anchorscroll from another page - i want go 1 page , able scroll id section, not working. the html is: //page one.html <a href="#/posts#my-tickets"><u>where can see scanned tickets?</u></a> //page-two.html <div id="my-tickets">some text</div> and controller: function($scope,$location,$anchorscroll) { $location.hash($location.hash()); $anchorscroll(); } javascript angularjs angular-ui-router

python - AWS EMR Spark "No Module named pyspark" -

python - AWS EMR Spark "No Module named pyspark" - i created spark cluster, ssh master, , launch shell: master=yarn-client ./spark/bin/pyspark when following: x = sc.textfile("s3://location/files.*") xt = x.map(lambda x: handlejson(x)) table= sqlctx.inferschema(xt) i next error: error python worker: /usr/bin/python: no module named pyspark pythonpath was: /mnt1/var/lib/hadoop/tmp/nm-local-dir/usercache/hadoop/filecache/11/spark-assembly-1.1.0-hadoop2.4.0.jar java.io.eofexception java.io.datainputstream.readint(datainputstream.java:392) org.apache.spark.api.python.pythonworkerfactory.startdaemon(pythonworkerfactory.scala:151) org.apache.spark.api.python.pythonworkerfactory.createthroughdaemon(pythonworkerfactory.scala:78) org.apache.spark.api.python.pythonworkerfactory.create(pythonworkerfactory.scala:54) org.apache.spark.sparkenv.createpythonworker(sparkenv.scala:97) org.apache.spark.api.python

javascript - Using the Jade engine on all .jade files regardless of location -

javascript - Using the Jade engine on all .jade files regardless of location - i'm using node , express framework website, instead of separate views folder, have site construction .jade files anywhere within static folder. what's simplest way of getting jade compile templates if end in .jade? have write middleware function regex \.jade$ ? how this? use glob. pattern '**/*.jade' https://www.npmjs.org/package/glob javascript node.js express jade

How to fix An error occurred: (400) Error refreshing the OAuth2 token, message: '{ "error" : "invalid_grant" }' using Google Drive PHP API -

How to fix An error occurred: (400) Error refreshing the OAuth2 token, message: '{ "error" : "invalid_grant" }' using Google Drive PHP API - i trying implement google drive api in project. stuck @ point regarding refreshing token. i expecting: an error occurred: (400) error refreshing oauth2 token, message: '{ "error" : "invalid_grant" }' error. my problem not allow me refresh token. here finish code: <?php session_start(); require_once('dbconn.php'); require('google-api-php-client/src/google_client.php'); require('google-api-php-client/src/contrib/google_driveservice.php'); require('google-api-php-client/src/contrib/google_oauth2service.php'); class apimethods extends dbconn { public $clientid = "<somestring>-589hmda0tneueutdo1ouhtuus2qoc0td.apps.googleusercontent.com"; public $clientsecret = "<somestring>"; public $redirecturl = &

sql - Get column names from my dataset -

sql - Get column names from my dataset - my code here loops through client , exports result excel document multiple sheets, depending on how many services/reports client has. want column names , print them out gridview. here total code run client , export excel file (which works fine). seem totally lost here , need help. var custname = convert.tostring(request.querystring["cusname"]); seek { dataset dt = new dataset(); sqlconnection connection = new sqlconnection("data source=ap;initial catalog=db_inf;user id=sa;password=*****;app=entityframework"); using (sqlcommand sqlcmd = new sqlcommand("info.dbo.sp_accounting_getall_services", connection)) { sqlcmd.commandtype = commandtype.storedprocedure; sqlcmd.parameters.addwithvalue("@customername", sqldbtype.nvarchar).value = custname; using (sqldata