Posts

Showing posts from March, 2013

Should I create an Index for a large insert operation in mysql? -

lets have following table 8 billion columns: subject text, predicate text, object text , want create table count different text values this: create table nodes (id bigint unsigned primary key auto increment, val text, count bigint unsigned); insert nodes(val,count) select subject, count(*) count triples group subject would index on subject predicate , object increase or decrease speed of insertion? a general rule of thumb: indices typically decrease write speeds, while increasing read speeds.

swift - Failable convenience initializer with optional parameters -

i'm looking best way structure class failable convenience initializer optional parameters. current code: class member: nsobject { var uid: string let avatarurl: nsurl let created: nsdate let email: string let name: string let provider: string var posts = [post]() var comments = [comment]() // initialize member raw data init(uid: string, avatarurl: nsurl, created: nsdate, email: string, name: string, provider: string){ self.uid = uid self.avatarurl = avatarurl self.created = created self.email = email self.name = name self.provider = provider super.init() } convenience init?(snapshot: fdatasnapshot){ if let uid = snapshot.key { if let avatarurlstring = snapshot.value["avatarurl"] as? string { if let avatarurl = nsurl(string: avatarurlstring) { if let membercreated = snapshot.value["created"] as? ...

javascript - loasJSONArray is not defined in Processing.Js -

i've made processing program wich work nice. wanted put on website processing.js. i've used code in demo load pde file script(src='/javascripts/lib/processing.min.js') canvas(data-processing-sources="processing/paris_tree_viz.pde") but when launch page, got following error: uncaught referenceerror: loadjsonarray not defined here setup void in processing pde file, wich contain loadjsonarray method: void setup() { size(1000, 1000); background(255, 255, 255, 1); colormode(rgb); data = loadjsonarray("http://opendata.paris.fr/explore/dataset/les-arbres/download/?format=json&timezone=europe/berlin"); trees = filterbyspecie(data); } how can make program work ? googling error got me duplicate: how access json data in processing.js according duplicate, processing.js not have loadjsonarray function. , processing.js reference seems confirm this: http://processingjs.org/reference/ that suggest you're running sket...

How can I remove a single overlay in Openlayers 3.3.0? -

i creating overlays in mapping application need refresh every 5 seconds. having difficulties removing stale overlay map using code below. map.removeoverlay method not seem working correctly. stacking of overlays visibly apparent after few iterations. using map.getoverlays().clear() removes stale overlay, however, removes overlays not desired. assistance appreciated. window.setinterval(function() { $.ajaxsetup({ mimetype: "text/plain" }); $.getjson('json/data.json', function(data) { $.each(data.item, function(key, val) { var storename = this.name; var storelocation = this.location; var storelatitude = this.latitude; var storelongitude = this.longitude; $.each(val.tasks, function(i, j){ var taskname = this.name; var taskstate = this.state; if (taskstate == "open") { var taskgeometry = ol.proj.transform([storelongitude,storelatitude], ...

string - How to add empty space using batch script? -

is there way loop text file add empty space in front of each line? commit.txt commit c9bee merge: 7db author: tom date: fri mar 13 author: tim output.txt commit c9bee merge: 7db author: tom date: fri mar 13 author: tim here's 1 solution: for /f "delims=" %i in (file) @echo %i note must double percents if use in script (as opposed interactive usage).

.net - ClickOnce Install Error: Unable to install this application because an application with the same identity is already installed -

i seeing following error message when trying install application using clickonce. unable install application because application same identity installed. install application, either modify manifest version application or uninstall preexisting application. i error when trying install production version , have qa version installed same version number. use different product name 2 environments, not see why there conflict. now, weird part. if take copy of iis directory hosting application, , run exact same set of mage commands, except time use "qa2" name parameter, can install second copy of application. 1 called qa , other qa2. else them identical, yet, still cannot install production version has different name. need avoid error?

system center - SCOM: How to display custom perf counters from Services -

i have number of windows services written in .net/c# , each of these have custom performance counters added via system.diagnostics.countercreationdata , system.diagnostics.countercreationdatacollection classes. in system center 2012 have dashboard each of these services in want display/graph values custom counters. however, see standard performance counters same services , can not find custom counters anywhere. counters visible via perfmon scom not see them. possible want, , how? thanks have tried starting console via command prompt? use /clearcache when calling exe allow perf data reload.

Purging an Oracle Advanced Queue in C# -

i developing windows service uses oracle advanced queue control it. command objects placed on queue , service dequeue , attempt carry out task. in order control service developed small command application. application put commands on queue able purge queue calling dbms_aqadm.purge_queue_table whenever button pushed. have tried 2 ways. first tried: using (oracleconnection conn = new oracleconnection(configurationmanager.connectionstrings["connectionstring"].connectionstring)) { conn.open(); oraclecommand cmd = conn.createcommand(); cmd.commandtype = commandtype.storedprocedure; cmd.commandtext = "dbms_aqadm.purge_queue_table"; cmd.parameters.add("queue_table", "prismpro_q_tab"); cmd.parameters.add("purge_condition", dbnull.value); cmd.parameters.add("purge_options", dbnull.value); cmd.executenonquery(); conn.close(); } and following error: ora-06550: line 1, column 7: pls-00306...

html - Can i make Asp.Net Menu Dynamic Items show outside parent DIV without using position: absolute? -

i'm having problem dynamic items of menu inside container div while need make them show outside without need use absolute asp.net menu the main point asp.net menu clipped rest of dynamic part of menu not shown user because hidden inside i hope understand code , suggest solutions problem effort <!-- language: lang-html --> <!doctype html> <html xmlns="http://www.w3.org/1999/xhtml" dir="rtl"> <head runat="server"> <link href="stylesheet/mainstylesheet.css" rel="stylesheet" /> <link href="content/themes/base/all.css" rel="stylesheet" /> <link href="content/themes/smoothness/jquery-ui.smoothness.css" rel="stylesheet" /> <link href="stylesheet/jquery-ui-timepicker-addon.css" rel="stylesheet" /> <script sr...

ios - Get Facebook Profile picture at Sign-up for Parse backend (Swift) -

i'm creating application parse backend service. users should able sign-up , login via facebook. i did in following (works absolutely fine). @ibaction func registerwithfacebook(sender: uibutton) { let permissions:[string] = ["user_about_me","user_relationships", "public_profile"] pffacebookutils.loginwithpermissions(permissions, { (user: pfuser!, error: nserror!) -> void in if user == nil { nslog("uh oh. user cancelled facebook login.") } else if user.isnew { nslog("user signed , logged in through facebook!") self.loaddata() self.performseguewithidentifier("initialtomain", sender: self) } else { nslog("user logged in through facebook!") self.performseguewithidentifier("initialtomain", sender: self) } }) } func loaddata(){ let request:fbrequest = fbrequest.requestform...

string - call __str__ inside a class? python 3.X -

im trying develop elevator simulator. when lift move floor , want able display how many customers waiting , in lift, floor ect. (one string) when call self.__str__() inside while loop , goes in doesn't return string screen. can give out bit thanks you should not calling __str__ directly. should called str(object) or let automatically convert. also returns readable string representing object. not print it. want do. print(self.__str__()) or just print(self)

parse.com - "Reset Password" for facebook authenticated user in parse -

when user authenticates facebook account , tries run "reset password" operation, gets email , can reset password (which doesn't make sense because not have password). i guess bug in "reset password" operation, make sure, did happen else? technically there password... , app can allow user authenticated via fb set username , password properties user object, giving them multiple avenues logging in. fair point can identify scenario , prompt user log in via facebook.

Entity framework Not Found after updating to Visual Studio 2013 update 4 -

four days ago updated vs2013.3 vs2013.4 , entity framework broke. the error occurs after compeleting ef dialogue , adding table. diagram displays , error output: metadata file 'c:\program files (x86)\microsoft visual studio 11.0\common7\ide\extensions\microsoft\entity framework tools\nuget packages..\ide\entityframework.dll' not found d:\users\allen\documents\visual studio 2013\projects\webapplication8\webapplication8\models\model1.tt 1 1 webapplication8 there no such folder on c drive, smallish ssd. install can on d. i've played registry setting , system environment variables vs120comntools , nothing seems work. i've uninstalled , reinstalled ef, , vs2013. i'd appreciate assistance. thanks

ASP.NET help inserting data into normalized SQL tables best practice -

hi have common situation of inserting client order sql database. have created order header , order detail tables in db , trying insert single header record , multiple detail lines corresponding header record (the pk , fk constraint headerid). currently, insert header record, query db last created headerid , use id insert detail lines looping through grid example. i know stupid way inserting records normalized tables , there sql call made, seems unnecessary. therefore, know of better solution problem. i found using entity framework solves problem, without making effort search last insert headerid , insertingit detail table. if relationships defined in entity framework, framework takes care of process. example: using (var rep = new repo()){ header hd = new header(); hd.name = "some name"; detail dt = new detail(); dt.itemname = "some item name"; hd.details.add(dt); rep.headers.add(hd); rep.savechanges(); } so...

python - urllib does not handle # character properly -

i have url looks follows: http://me:me1234#@localhost:8080/ when run urlparse on url, instead of netlocpath returning me:me1234#@localhost:8080 returns me:me1234 . from six.moves.urllib import parse o=parse.urlparse('http://me:me1234#@localhost:8080/') print o parseresult(scheme='http', netloc='me:me1234', path='', params='', query='', fragment='@localhost:8080/') any idea how why failing parse #? think pretty standard url. it's fragment . need to encode first: from six.moves.urllib import parse o=parse.urlparse('http://me:me1234%23@localhost:8080/') print o this should work needs.

json - Can't read a String from URL using NSData -

i'm using nsdata(contentsofurl) constructor load data url (server returns json in .txt file). date loads fine, can't create nsstring(date:) out of it. can save data using nsfilemanager.createfileatpath() , it's correct, nsstring created out of data nil, can't create json using swiftyjson. if execute same query in browser download filename.txt.js. web-sniffer shows header: "content-disposition: attachment; filename="f.txt"". try let str = nsstring(data: data, encoding: uint)

jquery - Send select row data to classic asp, javascript -

here have far: $("#job_list tr").click(function(){ $(this).toggleclass('selected'); }); http://jsfiddle.net/0kk0yupb/2/ how post selected row data (id) test.asp page? you can use disabled attribute eliminate inputs not have parent .selected class before form submission. based on fiddle, have @ : http://jsfiddle.net/60utpttd/

linux - Unbound variable during url printing in bash/shell -

i have 2 variables want use derive 3rd variable: export region_name=phx export phx_url=https://www.google.com i trying following: echo "$((${region_name}_url))" and following error: -sh: https://www.google.com: syntax error in expression (error token "://www.google.com") all trying derive environment variable other 1 not work simple that. think has escaped , not find online. thanks in advance help. $((...)) arithmetic expansion. didn't mean that. try normal variable expansion (with indirection) instead. region_name=phx phx_url=https://www.google.com r_var=${region_name}_url echo "${!r_var}"

python - Raspberry Pi Camera Transparent Image Overlay -

is possible overlay transparent (png or gif) image on pi camera preview? i found code makes white background import picamera pil import image time import sleep picamera.picamera() camera: camera.start_preview() # load arbitrarily sized image img = image.open('lol.gif') # create image padded required size # mode 'rgb' pad = image.new('rgb', ( ((img.size[0] + 31) // 32) * 32, ((img.size[1] + 15) // 16) * 16, )) # paste original image padded 1 pad.paste(img, (0, 0)) # add overlay padded image source, # original image's dimensions o = camera.add_overlay(pad.tostring(), size=img.size) # default, overlay in layer 0, beneath # preview (which defaults layer 2). here make # new overlay semi-transparent, move above # preview o.alpha = 255 o.layer = 3 # wait indefinitely until user terminates script while true: sleep(1) change 'rgb' 'rgba' i don't have conditions test it, guess fix problem.

Excel DataValidation List exclude value in range -

can think of clever way can exclude value in data validation list? currently using dropdown(a1) generate dependant dropdown(a2) using in data validation list source =indirect(left(a1,5)&"list") the first 5 chars in first dropdown values makes part of named range second dropdown however in these dependent lists there values want ignore contain words "do not use" i cant remove them named ranges not show them in second dropdown if possible i know named ranges can made of multiple ranges i'm not sure if possible dynamically generate array formula in source box using 1 named range (i need keep named range including "xxx not use" other things , id rather not create multiple named ranges sames lists if possible "xxx not use" may change able use in future , "do not use" removed value)

asp.net mvc - MVC Checkbox returns "false" or ",false" -

i'm using <li><%= html.checkbox("ispublic", false) %></li> checkbox. creates <input id="ispublic" name="ispublic" type="checkbox" value=""><input name="ispublic" type="hidden" value="false"> . i can't return true value. when checked, , submitted fromcollection, it's value ",false" still gets interpreted false. without checkbox can have controller method public jsonresult creatething(mything thing) , correctly places fields. checkbox i'll have manually set every field formcollection unless can checkbox automatically interpreted correctly. i appreciate assistance.

ios - Travis builds failing - Reason: The run destination iPad 2 is not valid for Testing the scheme 'UIKitPlus-Example' -

i'm having trouble cocoapods running travis ci. seems install correctly, xcodebuild script fails $ set -o pipefail && xcodebuild test -workspace example/uikitplus.xcworkspace -scheme uikitplus-example -sdk iphonesimulator only_active_arch=no | xcpretty -c xcodebuild: error: failed build workspace uikitplus scheme uikitplus-example. reason: run destination ipad 2 not valid testing scheme 'uikitplus-example'. command "set -o pipefail && xcodebuild test -workspace example/uikitplus.xcworkspace -scheme uikitplus-example -sdk iphonesimulator only_active_arch=no | xcpretty -c" exited 70. https://travis-ci.org/jamierevans/uikitplus/builds/54649639 i'm not sure why failing, because can run tests on ipad 2 simulator, using scheme, without issues. is travis issue or travis script wrong? i've managed build adding destination xcodebuild command line, e.g. -destination "platform=ios simulator,name=iphone 6"

Flip clock mockup animation jquery css -

this fiddle: http://jsfiddle.net/trickitty/sw4k090f/1/ . current.addclass("before") .removeclass("active") .prev("li") .addclass("active") .one('webkitanimationend oanimationend msanimationend animationend', function (e) { $(this).removeclass('before'); }); a new number coming backend , have change counter flip. there 2 flip ul-s, 1 every digit of number. in every ul there 2 li-s, 1 old digit , 1 new one. new 1 loaded in li, won't see @ first. idea flip animation back/new li become visible doing adding/removing before class, changes z-index. can't figure out how right, though. maybe missing fundamental here.. the original code @ codepen written ademilter, can't use more 2 links @ point. i copied here: http://jsfiddle.net/trickitty/a4mch0x2/ , flip doesn't work, don't know why. my question how wrong code , why fiddle not work...

Input stream into c program -

i have file following values: 12,23 2 90 i have linked list structure has function add values it: add_value(int x). my end goal direct file cprog , have values (ints) added structure. file | cprog but can't figure out how read each digit, add linked list, , move onto next digit , add too? thanks int x, status; while((status=scanf("%d", &x))!=eof){ if(status == 1) add_value(x); else fgetc(stdin);//drop 1 character }

unreal engine4 - Change character model for Third Person Shooter game -

i'm having little problem. when start unreal engine, can select type of game. selected third person shooter game basic stuff..(or similar). that's not problem.. problem changing character model.. want have own character model(no need animations now) instead of base one.. well, can put character scene can't "stick" character model main camera.. that.. (i know post not coding) could me please? there must way that. first, have create new pawn has character model want attached it. then, have change default pawn class in world settings spawn when game starts.

ios - Create different instance of buttons in view controller for tableview -

i have created uitableview has cells uiviewcontroller opens when click on one. have vote button on uiviewcontroller want toggle between "yes" , "no" each time user clicks on it. when click table cell, vote button, uitableview , click on same cell again defaults "yes". how keep reverting "yes" having each cell open different instance of button being either "yes" or "no"? when push view controller, or in prepareforsegue, set initial value vote value in selected cell. assuming understood question want voting controller reflect current value in cell. in viewwillappear of voting controller, set voting button/view value set on push. this should mean controller comes same value cell had last time.

java - Why use getResourceAsStream when loading images? -

let's i'm creating jar file , have icon in asset folder included in jar. so before using, stage.geticons().add(icon); in code there particular advantage or disadvantage having icon image icon = new image("assets/icon.png"); vs. image icon = new image(getclass().getresourceasstream("assets/icon.png")); both seem work fine, i'm looking pinpoint should gravitate towards , why. there's related topic here compares loading styles web applications. javafx.scene.image(string) calls validateurl , additional processing of string value, including checking current thread s contextclassloader resource. the advantage of using class#getresourceasstring you've made decisions class, (slightly) faster, less ambiguous , easier diagnose should have issues (as control source mechanism image itself) , aren't leaving decision making code don't control (and since validateurl private static , can't change)

Shorthand For Loop in PHP -

i have three-rows code: echo '<div>'; ($i=1; $i<=4; $i++) echo $i; echo '</div>'; is there syntax or function let me rewrite above code in 1 row, example: echo '<div>'.(for...).'</div>'; //error thanks while readability personal opinion, there "common" methods, guidelines, , coding standards used lot of developers. and while don't need adhere them, or company work for, of these "ways" common sense regardless of personal choice. even if there way it, why want to? how far want go mixing things supposed readability? echo , loop different things, , should remain separate. answer in answer question, no, not possible because php needs differentiate between different "things" - functions, echo statements, variable declaration , usage, etc. things can "mix" things php allows together, having variable in function parenthesis ( function($somevar) ). ...

Replace multiple pixels value in an image with a certain value Matlab -

i have image 640x480 img , , want replace pixels having values not in list or array x=[1, 2, 3, 4, 5] value 10 , pixel in img doesn't have of values in x replaced 10 . know how replace 1 value using img(img~=1)=10 or multiple values using img(img~=1 & img~=2 & img~=3 & img~=4 & img~=5)=10 when tried img(img~=x)=10 gave error saying matrix dimensions must agree . if please advise. you can achieve combination of permute , bsxfun . can create 3d column vector consists of elements of [1,2,3,4,5] , use bsxfun not equals method ( @ne ) on image (assuming grayscale) create 3d matrix of 5 slices. each slice tell whether locations in image do not match element in x . first slice give locations don't match x = 1 , second slice give locations don't match x = 2 , , on. once finish this, can use all call operating on third dimension consolidate pixel locations not equal of 1, 2, 3, 4 or 5. last step take logical map, tells locations none ...

google maps - Titanium Alloy - How to run procedure after screen created -

i'm trying update current location on map view. current location in controller: var updatecurrentlocation = function updatecurrentlocation(e){ ti.api.info("update current location on map"); $.map.setlocation({ latitude: e.coords.latitude, longitude: e.coords.longitude, latitudedelta: 1, longitudedelta: 1 }); } but problem @ time code run, map view has not been created yet, cannot update current location. can 1 suggest technique solve problem? thank you! are not creating map in same controller? if place code after map code, obvious assume have thought of that. why not set coords current user coords when create map? worst case scenario, can use settimer(, timer ms) call function after set amount of time if wanted call updatecurrentlocation function after 500 milliseconds. not ideal.

objective c - Does the mac 2D Quartz support multichannel (CMYK+spot colors) -

i found quartz 2d supports standard color spaces(cmyk, rgb...). want deal images printing. support multichannel color space? thanks in advance. no, doesn't. there few third party solutions might want take @ though. example: pdflib debenu none of them free, unfortunately.

apache spark - How to get a certain element of an RDD? -

if have rdd[(k, v)] , key, how element of rdd key? i can filter rdd key, there more efficient way? on pairrdd, can use lookup(key) api. returns values associated provided key.

Use sed to change an entry of a configuration file -

i want change following line in /etc/security/limits.conf from #* soft core 0 to * soft core unlimited to enable core dump. i tried use following sed command did nothing: sed -e "s/^\#\*\([ ]+soft[ ]+core\)[0-9][0-9]*$/\*\1 unlimited/" limits.conf where did wrong? mechanics of sed there variety of issues: you don't need backslash in front of # , nor in front of * in replacement text. don't harm, not necessary. you need allow spaces between core , number. you didn't allow blanks , tabs in file. you didn't allow trailing white space on line (which might not matter). you didn't explicitly enable extended regular expressions, , did use old-style \(…\) capturing notation, means + has no special meaning. you didn't modify file in place -i option (which fine while you're getting sed command correct). you should able use (gnu sed ): sed -r -e "s/^#\...

DAX: How to count rows with correlations to another row? -

being new dax, having trouble formulating question , solution related counting rows question-answer pairs. the general scenario tabular bi model models surveys having question , answer pairing 1 question may have 1 n response options. fact table's key data respondent, response. table references 'question answer' table holding answer details of answer salient data. table in turn references question table holds information question. i trying solve query of form, how many people answered question x, did not answer question y? in other words, of people answering question 1, how many did not answer question 12? when question not answered, there no row question response in fact table. i have been trying create measure fact table, survey response, , believe requires calculate() operations. video @ http://msbiacademy.com/?p=3491 has promising leads, can't quite on hump, in part because creates duplicate table product subcategory , not sure if through importing tabl...

javascript - Prevent Gravity Forms submitting -

i'm trying prevent gravity forms (wordpress) form being submitted , pass field values simplest javascript instead. somehow doesn't work. i've tryed: jquery(document).ready(function() { $("#gform_1").submit(function(event) { // gform_1 - id of form alert('fired!'); return false; }); }); but it's not getting triggered - form still gets submitted , can see confirmation message. can tell me, what's wrong? just clear: don't want see entries in database, don't want form being removed , see confirmation message etc (that's why i'm not using hooks gform_post_submission). want use form data in script. possible , how? in advance! edit: got sorted out: script inside post, had use "jquery("#gform_1")" instead of "$("#gform_1")".

php - How can I create a custom email when a user registers to my wordpress site? -

in sender name box , emails user gets when register says wordpress. want messages company name. when user resets password, says wordpress in sender names area... how can fix this use wp_mail_from_name hook. placed code in functions.php in theme folder. eg: add_filter( 'wp_mail_from_name', function( $name ) { return 'company name'; });

In Kentico, how can I export files from the database? -

in kentico, how can export files correct filenames table 'blobtable'? using example: declare @sql varchar(500) set @sql = 'bcp "select * [esc_mcms].dbo.[blobtable] [blobid]=4" queryout c:\temp\blob\04.pdf -t -f c:\temp\blob\testblob_all.fmt -s ' + @@servername exec master.dbo.xp_cmdshell @sql i wrote script generate commands executed extract of files stored blobs: select 'set @sql = ''bcp "select * [esc_mcms].dbo.[blobtable] [blobid]="'+convert(varchar,[blobid])+' queryout c:\temp\blob\out\'+noderesource.name+'.'+blobfileext+' -t -f c:\temp\blob\testblob_all.fmt -s '' + @@servername exec master.dbo.xp_cmdshell @sql' sql [blobtable], noderesource, node blobid=resourceblobid , node.id=noderesource.id , noderesource.name != '_content'

java - Why does my ParsePush not sending from an Android client when attaching a URI? -

i have following notification code working: private void sendnotification(parseuser user) { parsepush push = new parsepush(); parsequery<parseinstallation> query = parseinstallation.getquery(); query.whereequalto("user", user); push.setquery(query); push.setmessage("notification!"); push.sendinbackground(); } however, when try attach uri notification, not send (the receiver not , there no entry in push console), no errors logged, or thrown when debug it. private void sendnotification(parseuser user, string uri) { parsepush push = new parsepush(); parsequery<parseinstallation> query = parseinstallation.getquery(); query.whereequalto("user", user); push.setquery(query); jsonobject data = new jsonobject(); try { data.put("alert", "notification!"); data.put("uri", uri); } catch (jsonexception e) { log.w("sendnotification", "sendnotification failed"); ...

uitableview - iOS UILabel width doesn't fit inside table cell -

Image
i'm new ios development. have issue when trying put labels inside uitableviewcell. text keeps going out of cell. add needed constraints doesn't work. here setup , code: title label attributes: number of lines-0, line breaks-word wrap viewdidload(): self.tableview.estimatedrowheight = 68.0; self.tableview.rowheight = uitableviewautomaticdimension; cellforrowatindexpath(): uilabel *titlelabel = (uilabel*)[cell viewwithtag:100]; titlelabel.text = @"why long text out of cell? quick brown fox jumps on lazy dog. quick brown fox jumps on lazy dog. quick brown fox jumps on lazy dog. quick brown fox jumps on lazy dog. quick brown fox jumps on lazy dog."; i'm using xcode 6.2 , ios 8.2. thanks help. screenshot: cell prototype: title label constraints: you need 2 things in order keep text inside label boundries , in cell. if width of label fixed in case cell's height depends on height of label(which derived it's content). have pr...

admob - Android apps and typical practices -

i have paid app on google play, have google account (developer console) , linked wallet merchant account. i want release free version of app ads. need sign admod. i'm new admob , tried find recommended / typical practices on how set up, couldn't find useful. hence have few questions: shall using same google account have set admob, or separate account better? pros , cons? how admob payout works? have linked wallet account make transfer account or totally independent? thanks it if choose same account google play developer account, wallet, , admob. admob not pay wallet. admob has different forms of payment (depending on location): checks, electronic funds transfer (eft), wire transfer, western union quick cash, eft via single euro payments area (sepa), , rapida. check the admob center additional details

interpolate linear array to non linear array using python numpy or scipy -

i have arrays: a linear one; x = array([ 0. , 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1. , 1.1, 1.2, 1.3, 1.4]) and corresponding result non-linear one; y = array([ 13.07, 13.7 , 14.35, 14.92, 15.5 , 16.05, 16.56, 17.12, 17.62, 18.08, 18.55, 19.02, 19.45, 19.88, 20.25]) now : want convert y linearly spaced array , find corresponding interpolated values of x . i.e. find x when y = array([ 13. , 13.5, 14. , 14.5, 15. , 15.5, 16. , 16.5, 17. , 17.5, 18. , 18.5, 19. , 19.5, 20. ]) thanks in advance. i use following method using interp function in numpy: ynew = np.linspace(np.min(y), np.max(y), len(y)) xnew = np.interp(ynew, y, x) i.e. exchanging x , y in np.interp function. is correct ? or break down condition. unless i'm missing something, case calls simple invocation of numpy.interp . want predict x y reverse of how people variable definitions, other wrinkle, need is: import numpy np x = np....

c++ - How to use array address to reverse an array? -

i understand array address code found in book made me nut.i understand recursive function did not one.here code: int main(){ const int arraysize = 5; int a[arraysize] = { 32, 27, 64, 18, 95}; cout << "the values in reverse array are:" << endl; somefunction(a, arraysize); cout << endl; cin.get(); return 0; } void somefunction(int b[], int size) { if (size > 0) { somefunction(&b[1], size - 1); cout << b[0] << " "; } } i got code in exercise.my question how reversing array?i happy if explain bit more.thanks here pseudo-code shows how recusive calls somefunction made, , in order: somefunction( { 32, 27, 64, 18, 95} , 5) somefunction( { 27, 64, 18, 95}, 4) somefunction( { 64, 18, 95}, 3) somefunction( { 18, 95}, 2) somefunction( { 95}, 1) somefunction( { }, 0) somefunction({ }, 0) return without doing because there nothing left in array. somefunction print first element b[0] of ...

javascript - hide vertical scroll in scrollable table -

i have implemented scrollable table pinned column , vertical , horizontal scrolling enabled. want hide vertical scroll appears besides pinned column. here plunker link . html looks this: <div class="col-md-12"> <div class="col-md-3" style="padding:0;"> <table class="table" style="margin-bottom:0;"> <thead> <tr> <th>fixed</th> </tr> </thead> </table> <div style="height:100px; overflow-y:auto" id="fixed" on-scroll=""> <table class="table" style="margin-bottom:0"> <tbody> <tr data-ng-repeat="data in [1,2,3,4]"> <td>data data data data data data data data</td> </tr> </tbody> </table> ...

symfony - Cant override blocks in included twig template -

please me understand right way use template inheritance in twig. i have template base.html.twig other templates extend. contains html, head, body, etc. tags , few blocks. i move < head > section base.html.twig template own file head.html.twig . if use include directive title block in section no longer gets overridden extending templates. i determined work around setting title variable in extending template , passing in include statement. have pages need bits of javascript loaded in < head > section, have add variables indicate of load... obviously horrible kludge. right way this? edit: @ suggestion of @goto tried replacing include embed. code looks like: {# base.html.twig #} <!doctype html> <html> {% embed 'appbundle::head.html.twig' %} {% block title %}my company name{% endblock %} {% endembed %} <body> {% block content %}{% endblock %} </body> </html> {# head.html.twig #} <head> <title>{% blo...

php - mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean means what and how can it be fixed? -

i trying output(show) values database later hands dirty on it. i wrote custom code mysqli each time run page gives me error mesage saying : warning: mysqli_num_rows() expects parameter 1 mysqli_result, boolean given in c:\xampp\htdocs\christembassy\controlscript.php on line 30 the line 30 on code : if(mysqli_num_rows($result) > 0) and whole code: <?php //setting connection variables $hostname = "localhost"; $username= "root"; $password =""; $db= "cemembers"; //opening connection go database $mysqli_db = mysqli_connect($hostname, $username, $password, $db); //check connection if(mysqli_connect_errno()) { printf("connect failed: %s\n", mysqli_connect_errno()); exit(); } $sql = "select fristname, lastname, occupation users"; $result = mysqli_query($mysqli_db, $sql); if(mysqli_num_rows($result) > 0) { // output data of each row while($row = mysqli_fetch_assoc($result)) { ...

itext - iReport Hindi spelling mistake after pdf generation -

i added mangal.ttf in ireport , exported jar file required folders.i change properties such as: 'pdf font name depricated': mangal checked pdf embedded 'pdf encoding':identity-h (unicode horizontal writing) for example: after generating pdf दिनांक becomes daniank(in hindi) please help ireport uses itext generate pdf , itext doesn't support (yet, change) indic languages.

sql - How to use page-cursor concept in cobol? -

i have database of large details displayed in single cics map. thought of using page-cursor concept in fethcing every few rows , display in cics map. dont know syntax page-cursor in cobol. can me providing snippets? you can set curson , use "optimize x rows" hint on declare curson statemen db2. somewhere around 20 rows 3270 screen.

android - E/ExternalAccountType﹕ Unsupported attribute readOnly -

in android when creating directory in sdcard error displaying.please me how solve problem. package com.example.aaaaa; import android.app.activity; import android.os.bundle; import android.os.environment; import android.view.menu; import android.view.menuitem; import java.io.file; public class mainactivity extends activity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); file mydir = new file(environment.getexternalstoragedirectory()+"/mnt/sdcard/mydir/"); mydir.mkdir(); } } to create directory, use file mydirectory = new file(environment.getexternalstoragedirectory(), "dirname"); if(!mydirectory.exists()) { mydirectory.mkdirs(); } dont forget add permission: <uses-permission android:name="android.permission.write_external_storage"/>

sorting - Optimized algorithm in finding the visible building -

Image
i have problem in finding number of buildings visible , provided heights of buildings 3,5,1,8,5, 9,7,4. buildings in single row , user stands in front of building height 3. the simplest of solutions perform search identify buildings taller ones in front of them. start create array , load building heights [array1] create array same length first , initialize array slots '0' [array2] declare , initialize variables currenthighestbuilding = 0, y = 0 for each item in array1 loop if array1[x] > currenthighestbuilding currenthighestbuilding = array1[x] array2[y] = currenthighestbuilding y = y + 1 end if end loop print array2 contents (all non-zero values visible buildings) end out of curiosity, question require consider angle of view well? assume not, because there no information provided regarding distance of viewer , buildings. assumptions: assume buildings of same width, aligned in straight line, spaced @ equal intervals , user standing dea...

ios - leftbarbuttonitem does not show up in the navigation bar -

i've been developing ios app , have been having issues using image left bar button item in navigation bar. have attempted in following ways: uiimage *backbuttonimage = [uiimage imagenamed:@"backbuttoncb"]; cgrect buttonframe = cgrectmake(0, 0, backbuttonimage.size.width, backbuttonimage.size.height); uibutton *backbutton = [[uibutton alloc] initwithframe:buttonframe]; [backbutton setimage:backbuttonimage forstate:uicontrolstatenormal]; uibarbuttonitem *backbarbuttonitem= [[uibarbuttonitem alloc] initwithcustomview: backbutton]; self.navigationitem.leftbarbuttonitem = backbarbuttonitem; the bar button never seems display while running app. i proceeded try other method follows. self.navigationitem.leftbarbuttonitem = [[uibarbuttonitem alloc] initwithimage:[uiimage imagenamed:@"backbuttoncb"] style:uibarbuttonitemstyleplain target:nil action:@selector(methodname)]; this method worked. however, image displayed tinted blue , did not meant to. changing t...

vb.net - Is this program efficient -

i've put small calculator application works quite well, despite being novice vb.net know program isn't efficient should be. idea upon inputting numbers textbox , pressing mathematical operator, textbox reset , continue equation, storing past values entered. dim input1 double dim numfunction double 'numerical functions (null = 0, add = 1, subtract = 2, divide = 3, multiply = 4) private sub btnadd_click(sender object, e routedeventargs) handles btnadd.click if txtnum.text = "" msgbox("please enter number") else numfunction = 1 input1 = input1 + txtnum.text txtnum.text = "" end if end sub private sub btnequal_click(sender object, e routedeventargs) handles btnequal.click if txtnum.text = "" msgbox("please enter final number") end if if numfunction = 1 txtnum.text = txtnum.text + input1 input1 = 0 end if end sub could point me in ri...

android xml SOAP response -

i have following soap response returned .net soap server. (<?xml version="1.0" encoding="utf-8"?> <soap:envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema"> <soap:body> <getcategoriesimfollowing_withtokenresponse xmlns="http://tempuri.org/"> <getcategoriesimfollowing_withtokenresult>8,9,10,11,12,2</getcategoriesimfollowing_withtokenresult> </getcategoriesimfollowing_withtokenresponse> </soap:body> </soap:envelope>). i need parse in order integers (8,9,10,11,12,2) what easiest way these numbers ? thanks in advance. i found need in link http://www.whatsoniphone.com/blog/android-app-development-parsing-web-service-response-part-1/# thank you.

git - kdiff3 not available as c:/Program -

i need here ) i started use conemu powershell git , recommended install kdiff3 merge procedure i install kdiff3-64bit-setup_0.9.98-2 version , make changes in ginconfig [merge] tool = kdiff3 [mergetool "kdiff3"] path = "c:/program files/kdiff3/kdiff3.exe" [diff] tool = kdiff3 guitool = kdiff3 [difftool "kdiff3"] path = "c:/program files/kdiff3/kdiff3.exe" but when try merge branches got error the merge tool kdiff3 not available 'c:/program' d:\vs_projects\tsagent [master +9 ~9 -6 !4 | +72 ~0 -0 !5 !]> git mergetool merging: tsagent.data/espioprovider.cs tsagent/models/offers/savestatuspostmodel.cs tsagent/tsagent.csproj tsagent/tsagent.csproj.user tsagent/web.config normal merge conflict 'tsagent.data/espioprovider.cs': {local}: modified file {remote}: modified file hit return start merge resolution tool (kdiff3): merge tool kdiff3 not available 'c:/program' i tried reinstall kdiff ...

soapui - 'testrunner.bat' is not recognized as an internal or external command, operable program or batch file -

'testrunner.bat' not recognized internal or external command, operable program or batch file. i'm seeing error while run tests using "launch testrunner" option in sopaui pro this error thrown cmd.exe due testrunner.bat not found. normally when execute launch testrunner option soapui, executes follow command in soapui_home\bin : cmd.exe /c testrunner.bat <arguments> since testrunner.bat located in directory command must works, maybe there error in environment. check if testrunner.bat exists located in soapui_home\bin directory. alternatively can try adding soapui_home\bin directory in environment path in order execute testrunner.bat every location, doing you'll solve problem. hope helps,

c# - MVC OutOfMemoryException-Handling -

i have mvc application searchs in database lists of entries. there many can´t show them in browser want show top100 , if needed export of them in csv file open them in excel. that works quite in cases have problem there more entries system can handle , outofmemoryexception. my problem want show user of program there many entries , can´t open them in file method has return value of filestreamresult. how can show user explanation of error in view/browser? or know better solution handle outofmemoryexception? here method throws exetption. happens in fourth line "artikel.tolist();": public filestreamresult downloadcsv(string agracd, string agrcd) { using (var entities = new rs2_xentestentities()) { var artikel = select(entities, agracd, agrcd); var artikelliste = artikel.tolist(); memorystream output = new memorystream(); streamwriter writer = new streamwriter(output, encoding.utf8); writ...

how does one get csharp-sqlite to throw exceptions for duplicates or foreign key constraint violations -

i making use of csharp-sqlite. in sqlite database have uniqueness , foreign key constraints. when write "duplicate" table exception not raised , way found check exception use following: var error = sqlitecommand.getlasterror(); i hoping able following: var sqlstring = "some insert sql"; var command = sqlitecommand(sqlstring); command.parameters.add(... parameter...); using (var sqlconnection = new sqliteconnection(connectionstring)) { try { command.executenonquery(); } catch (exception ex) { exception } { sqlconnection.close(); } } the "catch" block never hit, though var error = sqlitecommand.getlasterror(); does return description of error expecting. have idea how solve this, or standard practice using csharp-sqlite library?

batch scripting with date function -

have task assigned me know how other languages, windows batch/cmd requirement has me little baffled. i had requirement should write batch script copy set of excel files c: drive e: drive , in d: drive should place 7 days files based on file name date . a_20120101.xls a_20120102.xls b_20120103.xls in d: drive there should last 7 days files . when ever 8th day files comes day1 files should deleted right there should 7 days files. thanks in advance.... i wrote 15 years ago such purpose: @echo off if %1!==! ( echo deletes files except newest 7 echo syntax: %0 ^<directory^> exit/b ) if not exist %1 echo directory %1 not exist! & exit /b 1 pushd %1 /f "tokens=1,2 delims=:" %%a in ('dir/o-d/b/a-d ^|findstr /n .') ( if %%a gtr 7 "del %%b" ) popd run care though!

css - 2 div with fixed and liquid height in absolute positioned div -

http://jsfiddle.net/u0398kc1/2/ html <div class="infopanel"> <div class="header">header</div> <div class="content"> start<br/>c<br/>c<br/>c<br/>c<br/>c<br/>c<br/>c<br/>c<br/>c<br/>c<br/>c<br/>c<br/>c<br/>c<br/>c<br/>c<br/>c<br/>c<br/>c<br/>c<br/>c<br/>c<br/>c<br/>c<br/>c<br/>c<br/>c<br/>c<br/>c<br/>c<br/>c<br/>c<br/>c<br/>c<br/>c<br/>c<br/>c<br/>c<br/>c<br/>c<br/>c<br/>c<br/>c<br/>c<br/>c<br/>c<br/>c<br/>c<br/>c<br/>c<br/>c<br/>c<br/>c<br/>c<br/>c<br/>c<br/>c<br/>c<br/>end<br/> </div> </div> css .infopanel { height: 100%; over...

rspec before(:each) hook - conditionally apply -

i have following in rails_helper.rb : rspec.configure |config| # ... config.before(:each, type: :controller) # end end i want define directories, something applicable (in case files under spec/controllers/api directory). any chance achieve that? you can use more specialized name rspec filter : rspec.configure |config| # ... config.before(:each, :subtype => :controllers_api) # end end and in rspec examples in spec/controllers/api , add metadata: rspec.describe "something", :subtype => :controllers_api end this something should run on examples having :subtype => :controllers_api metadata. did not use :type because there may other behavior defined it.

c# - How to work with cached Entity Framework data -

i'm working entity framework , have following scenario manage, because lot happens behind scenes, i'm not entirely sure best route be, , googling hasn't provided necessary answers far. i have 100 products in product/supplier style database. there 10 tables used multiple times on each page - due widgets etc. i cache results (these 100 products), plus other core entities, in order carry out approx 80% of queries need. however, time time need access extended data. let's product features - appear on product page - accessed needed rather permanently cached. here thoughts out loud, appreciate comments , advice. the easy, worst answer put them in cache along original entity. although data wouldn't unwieldly, have significant impact on cached data size. 100 products x 10 features - becomes 1000. become inefficient quickly? i query cached object product need, reattach database. i'm unsure of mechanics behind given i'm starting cached entity, , prett...

javascript - Experimenting with babeljs+amd getting undefined for module -

i'm experimenting babel.js alongside requirejs. require given, can't drop sadly :( found in babeljs docs there's --modules amd cli flag transpiles es6 code amd defines. far good. made quick example "application" test out. here's structure: . |-- build.sh |-- index.html |-- js | |-- assets | | |-- asseta.es6 | | |-- asseta.js | | |-- bootstrap.es6 | | `-- bootstrap.js | `-- main.js `-- node_modules index.html <body> <p>hello world! html5 boilerplate.</p> <script type="text/javascript" src="node_modules/requirejs/require.js" data-main="js/main.js"></script> </body> main.js (function() { require.config({ baseurl: "js/assets" }); require(["bootstrap"], function(bootstrap) { bootstrap.ready(function(sum) { console.log(sum(1,2,3)); }); }); }()); bootstrap.es6 import asseta 'asseta'; console.log(asseta...

arrays - PHP for loop duplicating on page refresh -

i have 2d array displaying in loop. code here: foreach($products $id => $product) { echo "<tr> <td style='border-bottom:1px solid #000000;'><a href='./index.php?view_product=$id'>" . $product['book_code'] . "</a></td> <td style='border-bottom:1px solid #000000;'>$" . $product['title'] . "</td> <td style='border-bottom:1px solid #000000;'>" . $product['author'] . "</td> </tr>"; } echo "</table>"; } i have 2 items in 2d array (eventually there 20). when load page table correctly displays 2 items, #1 & #2. if refresh page #1&#2 still there duplicated underneath table looks like #1 #2 #1 #2 and occurs again , again on every refresh. how can reset everytime new page opened? table has 26 items , growing , become difficult test...