Posts

Showing posts from July, 2013

javascript - add multiple classes on ng-click in ng-repeat to a selected row -

i'm trying add classes selected div in ng-repeat . if this: <div ng-class="{'selecte':isselected,'normal':'!isselected'}" ng-repeat="oneayah in ayahs" ng-click="selectparticular(oneayah)"> {{oneayah.text}} </div> it changes class of divs within ng-repeat . (isselect bool toggles every time div clicked.) your second ngclass param ( normal ) checking string isselected since quoted it, not bool: ng-class="{'selecte':isselected,'normal':!isselected}" ^^^remove quotes around me

c# - Creating a Web Application which supports multiple Backend -

i need create web based database application in asp.net , c# work across database providers sql server, mysql etc. if client has sql server small change in program should make web application work sql server, if client has mysql should work mysql. is there tools available ? or should want follow programming procedures or methods achieve it? so guide me achieve above scenario. to maintain independence of external systems (such database), you'll want architect solution speak interface. can use several techniques, including dependency injection, decide implementation use @ runtime. to keep simple here, though, let's use factory. first thing decide database should do. simple example - we'll store or retrieve integer. first let's define interface. i'm leaving out async stuff simplicity - you'd want when talking db. public interface idatabase{ void store(int value); int get(); } so we've got our calling code can use refer type...

php - get images files with different parts in names -

hi guys have problem images different parts in names, let me explain more. in directory have many pictures format in name : 1-[1-9].jpg or 2-[1-9].jpg or ... example names can 1-5.jpg or 1-14.jpg or 2-3.jpg dont know true way files!! this example want: function get_data($url) { $ch = curl_init(); $timeout = 5; curl_setopt($ch, curlopt_url, $url); curl_setopt($ch, curlopt_useragent, "mozilla/4.0 (compatible; msie 8.0; windows nt 6.0)"); curl_setopt($ch, curlopt_returntransfer, 1); curl_setopt($ch, curlopt_ssl_verifyhost,false); curl_setopt($ch, curlopt_ssl_verifypeer,false); curl_setopt($ch, curlopt_maxredirs, 10); curl_setopt($ch, curlopt_followlocation, 1); curl_setopt($ch, curlopt_connecttimeout, $timeout); $data = curl_exec($ch); curl_close($ch); return $data; } $diff = [1-9]; $html = get_data('http://mysite.info/screenshots/1-' . $diff. '.jpeg' ); ...

multithreading - Python Multiprocessing Queue: Reading queue from another module -

i have issue reading multiprocessing queue function reading queue being called module. below class containing function start thread runs function_to_get_data . class resides in own file, call one.py. function_to_get_data in file, two.py , infinite loop puts data queue (code snippet further down). contains function read queue. queue q defined globally @ beginning. import multiprocessing 2 import function_to_get_data q = multiprocessing.queue() class poller: def startpoller(self): pollerthread = multiprocessing.process(target=module_to_get_data,args=(q,)) pollerthread.start() def getpoller(self): if q.empty(): print "queue empty" else: pollresqueue = q.get() q.put(pollresqueue) return pollresqueue if __name__ == "__main__": startpoll = poller() startpoll.startpoller() below snippet function_to_get_data : def module_to_get_data(q): while 1: #...

javascript - How JQuery Ajax works? -

i trying send data jquery ajax generic handler calculates , returns result. ajax request made inside for loop @ jquery end. code looks this: function send(handler, ids) { var url = "http://" + window.location.host + "/handlers/" + handler + ".ashx"; var i; (i = 0; < 10; i++) { var cur = $('.' + ids[i]); $.ajax({ url: url, type: "post", data: json.stringify({ data: cur }), datatype: "json", cache: false, beforesend: //my before send code, success: //my success code, error: //my error code }); } alert('done!'); } i placed 3 breakpoint in visual studio 2012 @ line: $.ajax({ this alert('done!'); and third breakpoint @ first line in generic handler. now, when try execute code, ajax works nicely in async way. but, when reaches first...

r - How to add axis labels to a simple.scatterplot (UsingR) -

Image
the package usingr has great out of box plotting tools. however, using simple.scatterplot function can't figure out how add axis labels. library(usingr) simple.scatterplot(iris$sepal.length, iris$sepal.width, xlab='hello axis') error in plot.default(x, y, xlim = xrange, ylim = yrange, xlab = "x", : formal argument "xlab" matched multiple actual arguments the graph can of course produced without using xlab arg, , tried using mtext command, label ends in middle of page. mtext(side=1, text='hello axis') i tried editing function without success either: mysimple.scatterplot <- function (x, y) { def.par <- par(no.readonly = true) n <- length(x) xhist <- hist(x, sqrt(n), plot = false) yhist <- hist(y, sqrt(n), plot = false) top <- max(c(xhist$counts, yhist$counts)) xrange <- c(min(x), max(x)) yrange <- c(min(y), max(y)) nf <- layout(matrix(c(2, 0, 1, 3), 2, 2, true), c(3, 1), ...

sql - Run Cron PHP script Every Minute Except 5 Minutes Out Of Day -

right have cron running php script every minute of every day. looking have skip 5 minutes out of day allocate downtime truncate sql table associated , perform other routine maintenance. how might go this? this skips last 5 minutes of last hour of day. first entry runs every minute first 23 hours of each day. second entry runs on first 55 minutes of 24th hour of day. * 0-22 * * * <command> 0-54 23 * * * <command>

lua decrypted function get Error -

i'm new in lua try use base64 encoder/decoder functions when try print data after using bdc( decrypted function )it give errors function bdc(data) data = string.gsub(data, '[^'..b..'=]', '') return (data:gsub('.', function(x) if (x == '=') return '' end local r,f='',(b:find(x)-1) i=6,1,-1 r=r..(f%2^i-f%2^(i-1)>0 , '1' or '0') end return r; end):gsub('%d%d%d?%d?%d?%d?%d?%d?', function(x) if (#x ~= 8) return '' end local c=0 i=1,8 c=c+(x:sub(i,i)=='1' , 2^(8-i) or 0) end return string.char(c) end)) end print(bdc('njagotygmdmgnjygndagnjugmdegnkmgmdygnjugmdegnkmgmdugnjugmdegnkmgmdggnjugmdegnkmgmdk=')) error lua: data.lua:3: attempt concatenate global 'b' (a nil value) stack traceback: data.lua:3: in function 'bdc' data.lua:16: in main chunk [c]: ? please tell er...

javascript - Sending data to the server from one field -

there form in field <input type = "text" class = "form-control" id = "fio"> i need send separate name, surname, lastname. json: name: 'username', surname: 'usersurname', lastname: 'userlastname' can tell me how it? separate fields first name, surname clear, can name: $ ('# name'). val (), surname: $ ('# surname'). val (), lastname: $ ('# lastname'). val (), but 1 field send data? <input type="text" id="fio" /> <input type="text" id="lastname" /> function senddata() { $.ajax({ type: 'post', url: '@url.action("names")', data: { surname : $("#fio").val() }, success: function (data) { // } }); } public actionresult names(string surname) { // }

Convert a php array to something similar in C# and send it via cURL/HttpWebRequest -

hi new c# , first question posted here. accustomed php, need c# solution. trying build array similar following in c# later converted json , sent via curl or guess httpwebrequest in c#. best solution? $member_data = array( "email" => $email, "fields" => array( "first_name" => $first_name, "last_name" => $last_name ), "group_ids" => $groups ); this curl converting httpwebrequest $ch = curl_init(); curl_setopt($ch, curlopt_userpwd, $public_api_key . ":" . $private_api_key); curl_setopt($ch, curlopt_url, $url); curl_setopt($ch, curlopt_post, count($member_data)); curl_setopt($ch, curlopt_postfields, json_encode($member_data)); curl_setopt($ch, curlopt_httpheader, array('content-type: application/json')); curl_setopt($ch, curlopt_returntransfer, true); curl_setopt($ch, curlopt_ssl_verifypeer, false); $head = curl_exec($ch); $http_code = curl_getinfo($ch, curlinfo_http_code); curl_c...

Symfony ORM Integrity constraint issue -

i working towards following setup; an article has many comments a comment has 1 article at minute successful in not allowing user insert comment database linked article_id not exist... the problem comes when try print out table via inner join. receiving error: notice: undefined index: article here code in controller $repository = $this->getdoctrine()->getrepository('appbundle:article'); $query = $repository->createquerybuilder('a') ->innerjoin('a.comments','c') ->where('a.title :phrase') ->setparameter(':phrase','hello') ->getquery(); and here entity classes - appreciated. article entity <?php namespace appbundle\entity; use doctrine\orm\mapping orm; use symfony\component\validator\constraints assert; /** * @orm\entity * @orm\table(name="article") */ class article { /** * @orm\column(type="integer") * @orm\id *...

android - How can I solve these errors: acAppName=/system/bin/surfaceflinger and org.json.JSONObject cannot be converted to JSONArray? -

i'm running api rest application mobile device and, apparently, doesn't have error because doesn't close or kill process automaticaly. run without retrieving me information , shows me 2 erros in log console. here 1 of problems saw in log console: acappname=/system/bin/surfaceflinger . 06-04 16:49:21.527 17600-17600/com.example.user.project v/phonewindow﹕ decorview setvisiblity: visibility = 0 ,parent =viewroot{420a1478 com.example.user.project/com.example.user.project.mainactivity,ident = 0}, =com.android.internal.policy.impl.phonewindow$decorview{4205a608 v.e..... r.....id 0,0-0,0} 06-04 16:49:21.527 17600-17600/com.example.user.project d/activitythread﹕ act-launch_activity handled : 0 / activityrecord{4204b3c0 token=android.os.binderproxy@4204aa68 {com.example.user.project/com.example.user.project.mainactivity}} 06-04 16:49:21.590 17600-17600/com.example.user.project e/﹕ appname=com.example.user.project, acappname=/system/bin/surfaceflinger 06-0...

git - Get authors of methods, like codelens -

need authors of methods list. i've tried comparing methods name patches content using libgit2sharp, it's long, there many commits. wanted quickly, somehow code lens. i'm trying own vs plugin, may there easyer ways. thanks. take @ git blame filename output. seems libgit2sharp supports this. can run specific method if know line numbers method starts , ends e.g. running git blame -l 1,10 filename see last changing lines 1-10 in file.

ruby - Practical reasons to use procs? -

i learning ruby , understand concepts of blocks, procs puzzling me. can illustrate practical use-cases benefit using procs, beginner understand? the canonical example command pattern, e.g., map strings procs: the command arrives , dispatched associated proc via map.

ElasticSearch: Migrate from 0.20.5 to 1.5.2 - single node - suggested steps? -

we have been sooooo happy our es rig, haven't thought upgrade it... need to. we run 0.20 on centos. single, stand alone es system. we see code related changes 0.9 1.x, , have under control. what best steps rig current? (we set 2nd server alongside, if makes process cleaner.) you're still running 0.20, wow!! if you're happy performance , capabilities of 0.20, you'll uber-delighted 1.5.2, sure! before jumping upgrade, make sure check breaking changes pages. lot of things changed in 1.0 version , need make sure current assets (queries, client-side code, etc) adapted first. note starting es 1.2, dynamic scripting disabled default if used dynamic scripts you'll need take account , include script.disable_dynamic: false in configuration, 0.20 far away might not have care that. then, if check official upgrade guide , you'll see jumping many versions in 1 step, you'll need go through cluster restart, since have single node means service unav...

mysql - Insert items into an SQL table using a loop in PHP (Fixed) -

$loopcounter = 0; while ( $loopcounter < $amount ) { $sql = "insert bookings values (null, '$firstname', '$lastname', '$email', $enrolamount, '$location', $price)"; $loopcounter += 1; mysqli_query( $dbc, $sql ); } so have loop try insert items sql table, when ever try inserts 1 item table. please help! you have tinyint primary key has reached limit denoted by auto_increment=127 in comment. per docs here maximum value tinyint 127. you should run alter table bookings change column bookings_id bookings_id unsigned int(10) not null auto_increment primary key; and ok.

ember.js - ember-cli assets not loading rails 4 -

i have page requesting 'assets/ember/scalus-services.js'. these assets did not exist, since assets built ember cli md5 fingerprint i.e - 'ember/assets/scalus-services-000aaa111222eee333333111222eee33.js' hence received: failed load resource: server responded status of 404 (not found) when using asset helpers asset_path, path resolved 1 of 3 ways it looks in manifest-.json (loaded memory rails.application.assets) under 'assets' object. assets object path pass helper 'ember/scalus-services.js' key , fingerprinted file name value. value includes cloudfront prepended path (which set in brocfile.js) , rails asset path ('assets/') if file not found in manifest file, search asset paths in rails file if isn't found in rails asset paths, path served is the problem though servers had manifest file correct entries in 'public/assets'. yet served path is. this leads me believe bug sprockets or perhaps deploy process. howeve...

gulp-protractor reports skipped tests as failed -

running out of box 'protractor' command runs entire e2e directory expected. tests have disabled reported skipped. however, i'm using gulp-protractor handle e2e now. when run gulp protractor, disabled tests reported failed. i can't seem figure out problem is. this code controlling gulp e2e tasks. 'use strict'; var gulp = require('gulp'), load = require('gulp-load-plugins')(), browsersync = require('browser-sync'), paths = gulp.paths; //starts protractor function runprotractor(done) { gulp.src(paths.e2e + '/**/**/*.js') .pipe(load.protractor.protractor( { configfile: 'protractor.conf.js' } )) .on('error', function (e) { // make sure failed tests cause gulp exit non-zero throw e; }) .on('end', function () { // close browser sync server browsersync.exit(); done(); }); } //starts local, selenium, , starts protra...

Adding method/function to jquery ui slider -

i trying add function/method jquery ui slider can play adding handle slider with. have slider right now: var initialvalues = [180, 435, 1080, 1320]; // gives me 4 slider handles updatevalue = function (ui) { var hours = math.floor(ui.value / 60); var minutes = ui.value - (hours * 60); if (hours.length == 1) hours = '0' + hours; if (minutes.length == 1) minutes = '0' + minutes; if (minutes == 0) minutes = '00'; if (hours >= 12) { if (hours == 12) { hours = hours; minutes = minutes + " pm"; } else { hours = hours - 12; minutes = minutes + " pm"; } } else { hours = hours; minutes = minutes + " am"; } if (hours == 0) { hours = 12; minutes = minutes; } $(ui.handle).attr('data-value', hours + ':' + minutes); }; $(".pct-slider").slider({ min: 0, max: 1440, step: 15, range: false, values: initialvalues, create: function (event, ui) { $.ea...

ios - How to check the content availability of a URL -

i'm creating app has uitableview . when user selects 1 row, transitions content page has image slider , content. there can minimum of 0 , maximum of 4 images per item. when loading inner page, i'm checking image availability using method: func validateurl (stringurl : nsstring) -> bool { let url = nsurl(string: stringurl string) if (nsdata(contentsofurl: url!) == nil){ return false } else{ return true } } it's simple method proper output , works, takes lot of time , because of have load images twice (one method , second time display them). is there better way this? i add method code catch data received from nsdata(contentsofurl: url!) for example map url key , data object. way, display picture first check map , if it's not there download it

unit testing - Test flat file content and format in Java -

i have send flat file external system. sample file content given below: start 20150602 header 100.00usd product test1 50.00usd product test2 50.00usd footer 002 this file should follow below guidelines: first line - starts start, space, today's date in yyyymmdd header line - starts header, space, total amount of first, second, third etc products 2 decimal points, currency first product - starts product, space, product name left aligned total 25 characters, amount 2 decimal points, currency more products similar first product, number of products dynamic footer - starts footer, space, total number of products 3 digits this format has been given external system vendor in excel. can of suggest better testing strategy in these case? there tools test file content , format? in situations this, prefer explore options starting simple approach, based on elementary java features. here, each line may described regular expression: s...

php - Make HTACCESS to not be applied for some subfolders -

i using htaccess application. <ifmodule mod_rewrite.c> rewriteengine on rewritebase / rewriterule ^index\.php$ - [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . /index.php [l] </ifmodule> any url type in browser, if respective file doesn't exist, open index.php. the problem have many applications installed on same domain. for example, root contains index.php file , htaccess above. i have also, /store, contains index.php file , htaccess above, too, when access /store/something opens index.php of root (not correct /store/index.php how can solve problem (how make htaccess of root not override htaccess of /store)? thanks! you can have skip directory rule skip directories: <ifmodule mod_rewrite.c> rewriteengine on rewritebase / # skip index.php , directories rewriterule ^(store/|site1/|site2/|index\.php$) - [nc,l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . ...

MySQL match against with 2 fields -

i have problem match() against() in mysql. cant match 2 columfields against each other, if use procedure, thats clear. now problem: have query search double entries (only technnical data): select t1.acid,t2.acid, t1.brand, t2.modelnamerough,t1.modelnamedetail, t2.modelnamedetail,......... ref_web_tb t1 join ref_web_tb t2 on t1.brand = t2.brand , t1.modelnamerough = t2.modelnamerough , t1.bodytype ....(alot of other things compare) , (t1.acid < t2.acid) but thats not enough. there field called "modelnamedetail" locks like: "1.9 tdi comfort variant dpf" or "1.9 tdi comfortline variant dpf" (only line in comfort different, both of cars have different prices , on, same technical data) so have match t1.modelname against t2.modelname , use score check if name same. (otherwhise loooooot of data check if there double entry, because there alot of cars same technical data in same roughmodel) the procedure match() against() no problem, this: (jus...

python - dataframe or sqlctx (sqlcontext) generated "Trying to call a package" error -

i using spark 1.3.1. in pyspark, have created dataframe rdd , registered schema, : datalen=sqlctx.createdataframe(myrdd, ["id", "size"]) datalen.registertemptable("tbl") at point fine can make "select" query "tbl", example "select size tbl id='abc'". then in python function, define : def getsize(id): total=sqlctx.sql("select size tbl id='" + id + "'") return total.take(1)[0].size at point still no problem, can getsize("ab") , return value. the problem occurred when invoked getsize within rdd, have rdd named data of (key, value) list, when do data.map(lambda x: (x[0], getsize("ab")) this generated error is py4j.protocol.py4jerror: trying call package any idea? spark doesn't support nested actions or transformations , sqlcontext not accessible outside driver. you're doing here cannot work. not clear want here simple...

Suspicious pointer-to-pointer conversion (area too small) in C -

uint8_t *buf; uint16_t *ptr = (uint16_t *)buf; i feel above code correct "suspicious pointer-to-pointer conversion (area small)" lint warning. knows how solve warning? imho, don't cast pointer @ all. changes way (representation) variable (and corresponding memory) accessed, problematic. if have to , cast value instead.

objective c - ReactiveCocoa merge that completes when input signal completes -

in reactivecocoa, there mechanism similar merge: completes when of signals being merged complete? i found workaround involves concatenating input signal [racsignal return:foo] , adding take:1 after merge, seems rather long-winded. there simpler way? not built-in reactivecoca. should define in helper category on racsignal , long-windedness hidden behind nice method abstraction. here's (untested) example using materialize , give signal of signal events don't need append onto input signals: + (racsignal *)sheepishmerge:(nsarray *)signals { racsequence *completions = [signals.rac_sequence map:^(racsignal *signal) { return [[signal materialize] filter:^(racevent *event) { return event.eventtype == raceventtypecompleted; }]; }]; racsignal *firstcompletion = [[racsignal merge:completions] take:1]; return [[racsignal merge:signals] takeuntil:firstcompletion]; }

asp.net web api - web api FromUri and FromBody attributes misunderstanding -

i found example in google: public string getvalue([fromuri]book b, [fromuri]author a) { return b.name + " ("+a.authorname+")"; } public string postvalue([frombody]person p) { return p.firstname; } i can't understand point of [fromuri] attribute if http method send data part of url respectively, what's point of [frombody] attribute use in http post method? thank in advance. this article explain why [fromuri] necessary , how workaround not need write anymore. web api try eagerly bind non-primitive , non-string covnertible types body of request. while in many cases that’s right, semantically, doesn’t make sense , head requests, since in accordance http specification, these body-less requests. the [frombody] usei force web api read simple type request body. in sample, person complex type, attribute not necessary. worth yet, cannot use 2 parameters frombody , said here .

java - How to test methods with similar arguments in Mockito -

i'm writing junit test using mockito accepts same arguments, different sub-arguments in 1 of arguments. example: import org.junit.before; import org.junit.beforeclass; import org.junit.test; import org.mockito.mock; import org.mockito.mockito; import org.mockito.mockitoannotations; public class samplemockito { @mock private widget widget; private static machine machine; @beforeclass public static void init() { machine = new machine(); } @before public void setup() { mockitoannotations.initmocks(this); mockito.when(widget.doaction(mockito.eq("setting 1"), mockito.any(values.class))).thenreturn("action 1 done."); mockito.when(widget.doaction(mockito.eq("setting 1"), mockito.any(values.class))).thenreturn("action 2 done."); mockito.when(widget.doaction(mockito.eq("setting 2"), mockito.any(values.class))).thenreturn("action 3 done."); mockito.when(widget.doacti...

Python: Array(Matrix) to Pandas DataFrame -

i stuck trying convert array pandas dataframe. my output array looks this: [[1,2,4,n],[1,2,3,n]] example output: [[0.04376367614879647, 0.04376367614879649, 0.043763676148796504, 0.043763676148796504, 0.043763676148796504, 0.043763676148796504, 0.043763676148796504, 0.043763676148796504, 0.08096280087527355, 0.043763676148796504, 0.043763676148796504, 0.043763676148796504, 0.043763676148796504, 0.043763676148796504, 0.043763676148796504, 0.043763676148796504, 0.043763676148796504, 0.043763676148796504, 0.043763676148796504, 0.04376367614879651, 0.043763676148796504, 0.043763676148796504], [0.04376367614879647, 0.04376367614879649, 0.043763676148796504, 0.043763676148796504, 0.043763676148796504, 0.043763676148796504, 0.043763676148796504, 0.043763676148796504, 0.08096280087527355, 0.043763676148796504, 0.043763676148796504, 0.043763676148796504, 0.043763676148796504, 0.043763676148796504, 0.043763676148796504, 0.043763676148796504, 0.043763676148796504, 0.043763676148796504...

html - Forcing DIV to have the same margin on all sides -

Image
i've spent 3 or 4 hours trying understand how "symmetric" div inside html page has not scrollable. the div must have same margins window on sides , must contain img size should scale according window size maintaining it's ratio. at following link can find best i've been able do. as can see div has right margins on left, top , right size not on bottom one! why not? there wrong div style? <div style="margin: 50px;"> i hope it's quite clear, thank help! :) edit: since on jsfiddle doesn't appear should i've uploaded image on browser: edit 2: link last working solution, thank help, in particular dcardoso . :) you should add body , html tags (doesn't work in jsfiddle) , remove 'overflow: hidden': position: relative; height: 100%; and div tag (remove 'margin:50px'): box-sizing: border-box; /*this allows div padding included in height , width size */ height: 100%; padding:50px;

dataframe - R: Transform 2 columns into a data frame based on counting column values -

i trying reshape 2 columns of data frame new data frame. both columns have text values. need count each combination of values , put them in data frame. below example of 2 columns need use: 2 columns data frame: col1 col2 z b z b z c x c z d x desired output show count of each combination: z x 1 0 b 2 0 c 1 1 d 0 1 thank you you can use table on dataset table(df1) # col2 #col1 x z # 0 1 # b 0 2 # c 1 1 # d 1 0 if need output 'data.frame' as.data.frame.matrix(table(df1))

ios - How do I add multiple in app purchases in Swift Spritekit? -

i have in app purchase unlock level 2 , works how add in app purchase unlock level 3? have make new functions , add code level3? im not sure how this. thanks! func unlocklevel() { if skpaymentqueue.canmakepayments() { var productid:nsset = nsset(object: "unlockleveltwo") var productsrequest:skproductsrequest = skproductsrequest(productidentifiers: productid set<nsobject>) productsrequest.delegate = self productsrequest.start() println("fetching products...") } else { println("can't make purchases") } } func buyproduct(product: skproduct) { println("sending payment request apple"); var payment = skpayment(product: product) skpaymentqueue.defaultqueue().addpayment(payment); } func productsrequest(request: skproductsrequest!, didreceiveresponse response: skproductsresponse!) { var count : int = response.products.count if (count>0) { v...

java - How to get WEKA Classification Path of ADTree -

i'm using weka implementation of trees decision trees. (i using gui test how program works, question oriented both towards how in gui or via java api) i have put training data , have learned model. have sample test running. while predictions accurate, can't seem find way print path test has gone through. interested in knowing variables have caused tree come conclusion. if not possible, recommend me library decision trees (adtrees trick) return path every classified test sample. use j48 (c4.5 decision tree) in weka. outputs generated tree correct , incorrect instance count each node.

ToolbarManager help Visual Studio C# -

Image
i can't figure out toolbar part called or how rid of it: it rather unsightly , know can removed. can please shed light on problem? it called overflow. can try read article : http://www.wpf-tutorial.com/common-interface-controls/toolbar-control/

javascript - Angular ng-repeat like parameters binding -

is possible bind angular ng-repeat parameters this: ng-repeat="[bind_this]" furthermore, i'd able bind in kind of scenario: <input type="text" ng-model="customselected" placeholder="custom template" typeahead="state state.name state in stateswithflags | filter:{name:$viewvalue}" typeahead-template-url="customtemplate.html" class="form-control"> would become <input type="text" ng-model="customselected" placeholder="custom template" typeahead="[bind_this]" typeahead-template-url="customtemplate.html" class="form-control"> thanks what request not possible without workaround. docs : the expression indicating how enumerate collection. these formats supported: variable in expression – variable user defined loop variable , expression scope expression giving collection enumerate. for example: album in ...

javascript - How to stop Server-Sent Events -

hello have javascript code listens php code via server-sent events, working response sent server trough loop , when loop ends server-sent events stops few seconds after script again listening. how can end server-sent events when loop server side ends too? thanks. js : var sse=new eventsource("data.php"); sse.onmessage=function(event){ document.getelementbyid("map").innerhtml+=event.data; }; php: <?php header('content-type: text/event-stream'); //indicates server aware of server sent events header('cache-control: no-cache');//disable caching of response $coordinates = [ [ "20:11", 33.5731235, -7.6433045 ], [ "20:11", 33.5731054, -7.6432876 ], [ "20:11", 33.5731644, -7.6433304 ] ]; foreach($coordinates $c){ echo "data: ".json_encode($c)."\n\n"; ob_g...

css3 - Tablet Emulators, CSS Mobile Media Tags -

i using code: @media (min-device-width: 400px) , (max-device-width: 1020px) { .gform_wrapper.two-column_wrapper ul.gform_fields.gform_column {float:none !important;} } when view website on actual tablet, code seems work fine. however, when view site on tablet emulator website, doesn't work. am doing wrong syntax ? as far understand emulator not treated "device", therefor media query not apply it. emulator opening website in iframe, simple min/max-width query apply.

html - How to centre font-awesome icons within <a> tag and disable link colour -

i want centre font-awesome within tag , disable blu colour far have not succeed in aim. in addition wish have icon bit larger maximum size supported in font-awesome 5x. could please me out these issues thanks to reproduce problem please visit link below https://jsfiddle.net/z0vvpddf/ html <div class="col-sm-4 portfolio-item "> <a href="<c:url value='/'></c:url>" class="portfolio-link" data-toggle="modal"> <span class="caption"> <span class="caption-content"> <i>wall</i> </span> </span> <i class="fa fa-home fa-5x"></i> </a> </div> css: #portfolio .portfolio-item { right: 0; margin: 0 0 15px; } #portfolio .portfolio-item .portfolio-link { display: block; position: relative; margin: 0 au...

Disappear debug code in release code C++ -

this question has answer here: debug macros in c++ 9 answers my basic aim, heading suggests, debug code removed in release code, when expending before compilation. now, using _debug (or custom name) macro guard debug line works fine. but, don't want write per-processor guard every function / operation call writing in c++ debug file. edit: response, if can create macro function guards while expending : dbg_print(fname,msg)\ #ifdef _debug\ fprintf(fname, msg)\ #endif . please suggest me clean , single liner way-out. thanks , happy coding pre processor instruction way it, can clean code , avoid ifdef debug put everywhere in code if wrap debug calls in common method has body ifdefined, there isn't way without macro or preprocessor checks.

.net - Will user validate if AD password expired? -

can user validated valid username , password if his/her password expired? (suppose ad password policy 90 days expiration) basically, behaviour of membership.validateuser method if user's password expired? and work on both local iis hosted server iis? vsts2010, asp.net 4.0 , c# 4.0, iis7, winodws 7, windows sever 008 r2 in experience, user has expired password cannot bind ad on ldap: [ldap: error code 49 - 80090308: ldaperr: dsid-0c0903c8, comment: acceptsecuritycontext error, data 773, v2580] the purpose of membership.validateuser check if user able authenticate server, in above case not possible.

MySQL - Select with WHERE on LEFT Join table -

i making select 3 tables, cases, calculactions , positions. positions need devide results 1 more parameter , repairmethod. code below looks fine, , actualy display me results without repair method filter. current code , results of text looks like: select c.vin, c.case_id, c.axrmrs_id, c.date_created, cl.totalcosts, cl.laborhours, cl.calculationdate, cl.laborcosts, group_concat(distinct po.text) text axnmrs_cases c left join axnmrs_calculations cl on c.case_id = cl.case_id left join axnmrs_positions po on c.case_id = po.case_id c.vin='u5yff24128l064909' group c.vin, c.case_id, c.axrmrs_id result (just partt text) ------------------------------- | id | text | ------------------------------- | 2 | text1,text2,text3 | ------------------------------- | 3 | text4,text5,text6 | ------------------------------- how should looks like: -------------...

jQuery ui drop (move) elements between tabs -

i want realize moving elements between tabs using jquery ui. if want drop element tab - droppable block (.elements) doesn't catch hover event (outline doesn't want apply), dropping works correctly. $( "#tabs" ).tabs(); $('.elements').children().draggable({ appendto: 'body', opacity: 0.9, helper: "clone", zindex: 1000, cursorat: { left: 50, top: 20 }, }); // drop needle element $('.elements').droppable({ accept: '.element', tolerance: 'pointer', activeclass: "can-drop", hoverclass: "drop-here", drop: function( event, ui ) { alert('drop'); } }); // drop $('.ui-tabs-nav').children().droppable({ accept: '.element', tolerance: 'pointer', over: function( event, ui ) { $("#tabs").tabs("option", "active", 1); } }) you can see my example on jsfiddle . ca...

java - Convert Page<Entity> to PageDTO<EntityDTO> -

i using spring data jpa. my controller looks following @requestmapping(value = "/pages/{pagenumber}", method = requestmethod.get, consumes = mediatype.application_json_value, produces = mediatype.application_json_value) public responseentity<page<user>> paginateduser(@pathvariable final integer pagenumber) { final pagerequest request = new pagerequest(pagenumber - 1, default_page_size, sort.direction.desc, "starttime"); return new responseentity<>(userrepository.findall(request), httpstatus.ok); } now decided send instead of page object, pagedto object restrict things sending.is there way can convert page pagedto using java 8. i saw page derived iterable guess can following not sure how put pagedto , userdto. streamsupport.stream(userrepository.findall(request).spliterator(),false) is there effecient java 8 way this. i came solution @requestmapping(value = "/pages/{pagenumber}", me...

How to do downcasting in nhibernate inheritance -

i have 2 classes manager , employee , , 2 tables them in database. manager class inherits employee class . want convert employee manager. there way can in nhibernate ? public class employee { public virtual string name { get; set; } } public class manager : employee { public virtual string cabinnumber { get; set; } } and want convert employee id employeeid manager , save in database: var employee = repository.get<domainmodel.models.sadhak>(employeeid); domainmodel.models.manager manager = (domainmodel.models.manager) employee; manager.cabinnumber = "a65"; session.delete(employee); session.saveorupdate(manager); there no way in nhibernate, assumes once have created entity, of type.

wordpress - web.com/post/post-title redirects to web.com/post-title -

i'm having complain of seo guy because post url not this web.com/blog/post-title but this web.com/post-title and web.com/blog/post-title redirects web.com/post-title how restore normal behavior? looks being treated page work posts in web.com/blog go settings -> permalink choose custom structure , fill value /blog/%postname%/

Can R assign values to variables inside loop parenthesis? -

where x set inside parenthesis i <- 2 for(x <- in x:10) { print(x) } this should print 2,3,4,5,6,7,8,9,10 can done? essentially trying convert javascript code r var j = ; var found = false; var counter = 0; var x = 0; var truth = false; var strength = 2; (j = strength;(j < 80)&&(found == false); j++) { price = low(-j); //p=25 x = j + 1; //x=3 truth = true; (x = (j + 1); ((x - j) <= strength)&&(truth); x++) { if (price > low(-x)) truth = false; } x = j - 1; (x = (j - 1);((j - x) <= strength)&&(truth); x--) { if (price >= low(-x)) truth = false; } if (truth) counter++; if (counter >= 1) found = true; } if (found) swinglow = price; else swinglow = -1; the code iterates through time series , finds fractal patterns in financial data. http://www.timingthemarket.com/uploads/3/0/9/1/...

python - importing an external Class and creating an object , accessing the functions of the object -

in main.py have put from carnum import * vehicleid =0 vehicleid = carnum() print ("object created") here carnum class class carnum: def __init__(self): speedlist = [] but when run getting 'module' object not callable thank in advance hope guys can me out import can used import modules, may contain classes functions , other stuff, , not import classes. in python can put multiple classes in same file, main program . example can put in main.py (which module), following: class carnum(object): def __init__(self): # initialize attribute self.speedlist = [] myobject = carnum() print("object created") i left out part: vehicleid =0 vehicleid = carnum() vehicleid = vehicleid + 1 since me doesn't make sense. you can put cardnum class separate module (i.e: cardnum.py ) , import in main module (i.e: main.py ) using: from cardnum import cardnum

openlayers 3 - Modify interaction - How to get the segment which has been hovered -

i using openlayers-3 modify interaction edit vector layers. when polygon/polyline being edited, if mouse close line segment, small circle drawn , dragging creates new vertex or moves existing vertex, depending on over segment hovering. now, difficult understand if hovering on existing vertex, or on middle of segment. have thought 2 solutions problem: highlight segment hovering different style can see edges. when hovering on vertex, style small circle different style. is there way achieve of two? it can done changing interaction condition like: var selectpointermove_highlight = new ol.interaction.select({ condition: ol.events.condition.pointermove }); map.addinteraction(selectpointermove_highlight); i have online example .

Java JDBC-ODBC cannot load driver for Excel -

import java.sql.connection; import java.sql.drivermanager; public class connectionexample { public static void main(string args[]) { try { class.forname("sun.jdbc.odbc.jdbcodbcdriver"); } catch (exception e) { system.out.println("jdbc-odbc driver failed load."); return; } try { connection con = drivermanager.getconnection("jdbc:odbc:abcdefg", "", ""); con.close(); } catch (exception e) { system.out.println(e); } } } this code prints "jdbc-odbc driver failed load." i can't understand problem is.. follow these steps: go c:\windows\syswow64\odbcad32.exe system dsn tab - add -> microsoft excel driver (*xls, *xlsx, *xlsm, *xlsb) give data source name abcdefg select workbook -> go myfile excel path , add -> ok and run code... mistake? the jdbc-odbc bridge obsolete , has been removed java 8. if need manipulate excel docum...

wordpress - Google app engine behind the scenes? -

can please me in understanding how google app engine works wordpress? i have deployed project uses wordpress - media files, , plugins work, uploaded db correct paths - want understand when press deploy, project deploy? if want modify file in installation on google, how do that? sum up, how work behind scenes?

How use itext to change existing pdf pagesize? -

i have pdf, beyond current page, there content not being displayed. want change pagesize of content can displayed. there way itext? public pdfreader changepdfpagesize(string inpdf,string outpdf,float vertical,float horizontal) { try { pdfreader reader = new pdfreader(inpdf); pdfstamper stamper = new pdfstamper(reader, new fileoutputstream(outpdf)); (int curpagenum = 1; curpagenum <= reader.getnumberofpages(); ++curpagenum) { pdfdictionary pagedict = reader.getpagen(curpagenum); pdfarray mediabox = pagedict.getasarray(pdfname.mediabox); mediabox.set(0, new pdfnumber(mediabox.getasnumber(0).intvalue()-horizontal));//left add mediabox.set(1, new pdfnumber(mediabox.getasnumber(1).intvalue()-vertical));//down mediabox.set(2, new pdfnumber(mediabox.getasnumber(2).intvalue()+horizontal));//right mediabox.set(3, new pdfnumber(mediabox.getasnumber(3).intvalue()+vertical));...

html - Input text & button with span inline -

we must display input-field , button inner span on same line. button resp. inner span must have width:auto , input text must fill remaining width. fiddle: http://jsfiddle.net/1xfxpm55/ html: <div class="wrapper"> <input type="text"> <button> <span>auswählen</span> </button> </div> css: .wrapper { width:100%; display: table; } input { display: table-cell; width: 100%; float: left; } button { display: table-cell; width: auto; } thanks hints put button in div small width: * { box-sizing:border-box; } *:before, *:after { box-sizing:border-box; } .c1 { display: table-cell; padding-right:10px; } input{ width:100%; } .c2 { display: table-cell; padding-left:10px; width:1% } <div class="wrapper"> <div class="c1"> <input type="text"> </div>...

regex - Regular Expression to Match North American Phone Numbers Not Working -

^(\(\d{3}\)|^\d{3}[.-]?)?\d{3}[.-]?\d{4}$ the above regular expression have created matching north-american phone number , without parenthesis in code. not working, don't seem find issue. (180)-555-5555 --> not matching 180-555-5555 --> matching some 1 me understand why not matching? '\(\d{3}\)' used capture parenthesis. you may try this, ^(\(\d{3}\)|\d{3})?([.-]?)\d{3}\2\d{4}$ demo

sql - (Oracle) convert date string to datetime -

how convert date string following format datetime when running select statement? 2015-06-04t02:58:00.134+08:00 it stored in column data type varchar2 (100 byte). thanks! it stored in column data type varchar2(100 byte). first of all, should never ever store date/timstamp string . database design flaw. anyway, convert timestamp timezone . for example, sql> select to_timestamp_tz('2015-06-04t02:58:00.134+08:00', 2 'yyyy-mm-dd"t"hh24:mi:ss.ff tzh:tzm') 3 @ time zone '+8:00' tm_stamp 4 dual; tm_stamp ----------------------------------------------------------------- 04-jun-15 02.58.00.134000000 +08:00 sql>

objective c - How to customize GIDSignInButton login Image in new Google+ iOS SDK? -

in order connect google plus in ios app i'm using gidsigninbutton latest google plus sdk ios. i want use own image , label login button. problem don't see anywhere how customize it. able in previous sdk versions. any solutions???? it's not possible customize sign in button same way in older sdks. older sdks contained image replace. new sdk not. having said that, not have use gidsigninbutton sign in user. if want use custom image, use custom uibutton , call [[gidsignin sharedinstance] signin] on touch.

android - ImageView Is Not Touchable in a View Class When tried to draw on it -

imageview not touchable in view class when tried draw on ... problem when try draw on imageview m not able draw on ... tried lot .. not able ..... declared iv.setontouchlistener(this); still not touchable .. appreciated , thanks! public class brushview extends view implements ontouchlistener { private paint brush = new paint(); private path path = new path(); public layoutparams params; imageview iv; public brushview(context context) { super(context); brush.setantialias(true); brush.setcolor(color.blue); brush.setstyle(paint.style.stroke); brush.setstrokejoin(paint.join.round); brush.setstrokewidth(15f); iv = new imageview(context); iv.setontouchlistener(this); iv.setbackgroundresource(r.drawable.ic_launcher); params = new layoutparams(layoutparams.match_parent, layoutparams.match_parent); ...