Posts

Showing posts from May, 2010

.net - Cancel a .C# Net BackgroundWorker blocked on I/O operation -

i'm required use framework 3.5. want test whether file on computer named bob exists. i'm using backgroundworker , file.exists(filename). if bob offline call block tens of seconds. abort() , interrupt() have no effect while worker waiting call file.exists() return. i'd interrupt file.exists() immediately. can suggest way doesn't involve p/invoke? thanks. to clarify, need periodically check see whether file available. can't know whether remote computer configured respond pings. i'm running standard user, not admin. have no access remote system administrators. it looks framework 4.0 or 4.5 has async capability i'm restricted 3.5. editing add test program: // first call file.exists waits @ least 20 seconds first time // remote computer taken off line. demonstrate, set testfile name // of file on remote computer , start program. disable // remote computer's network connection. each time disable test // program pauses. in test local computer run

matlab - Calculate precision and recall on WANG database -

i have made cbir system in matlab , have used similarity measurement euclidean distance. using each query image retrieve top 20 images. i have used wang dataset testing system. contains 10 classes(like african people, buses, roses etc.) each containing 100 images.(1000 images in total). my method: 1. using correlogram, co-occurence matrix(ccm) , difference between pixel scan pattern(dbpsp) constructing vector(64+196+28=288 dimensions respectively). each of 1000 db image have vector constructed beforehand. now query image comes , construct it's vector too(228 dimensions again). i use euclidean distance similarity , sort db image vectors in descending order of euclid distance. top 20 results shown. in 20 can have tp or fp. for single query image can calculate precision , recall , plot pr-curve using link . how can same whole class? my approach: each image belonging class find top 20 images , it's respective tp(true positives) , fp (false positive).

parallel processing - rfsrc() command in randomForestSRC package R not using multi core functionality -

i using r (for windows 7, 32 -bit) doing text classification using randomforests . due large dataset, looked internet speeding model-building , came across randomforestsrc package. i have followed steps in installation manual package, yet during execution of rfsrc() command, 1 of logical cores used r (same randomforest() ), maximum cpu utilization being 25%. have used following command per manual. options(mc.cores=detectcores()-1, rf.cores = detectcores()-1) i using windows 7 professional 32 bit service pack 1, on intel i3 2120 cpu 4 logical cores. throw light on missing? other efficient way use randomforest multicore utilization helpful! the problem randomforestsrc uses mclapply function parallel execution, mclapply doesn't support parallel execution on windows. randomforestsrc can use openmp multithreaded parallel execution, isn't built binary distribution cran, have build package source openmp support enabled. i think 2 options are: build rando

Where can I find the Android Studio templates for Activity and gradle script? -

i using new appcompat v22.1 , , change templates used android studio. currently, android studio templates create activities extend actionbaractivity has been deprecated in v22.1. switch appcompatactivity without changing code each time. is possible change them without waiting next android studio update? yes can done: activity templates located here: [android_studio_dir]\plugins\android\lib\templates\activities find template want change open \xxxactivity\root\src\app_package\xxxactivity.java.ftl , find , replace import of actionbaractivity , actionbaractivity appcompatactivity .

html - PHP query also show results for ID 75 -

i have following query. reason it's not showing results user under id: 75, me of course. select if(friends.sender = 75, friends.recipient, friends.sender) id, users.firstname, users.lastname, feed.date, feed.time, feed.text, feed.userid, feed.ip friends join users on (users.id = if(friends.sender = 75, friends.recipient, friends.sender)) join feed on (users.id = feed.userid) friends.sender = 75 or friends.recipient = 75 , friends.status = 1 order feed.date desc, feed.time desc taking little bit of guess @ you're attempting accomplish, assuming want return list of users , friends, should work: select distinct users.id, users.firstname, users.lastname, feed.date, feed.time, feed.text, feed.userid, feed.ip users join friends on users.id in (friends.sender, friends.recipient) join feed on (users.id = feed.userid) 75 in (friends.sender,friends.recipient) , friends.status = 1 order feed.date desc, feed.time desc condensed sql fidd

javascript - Whitelist a set of properties from a multidimensional json array and delete the rest -

for examples sake i'll use github api response data input. https://api.github.com/users/unsalted/repos i have list of properties want keep, rest want discard because want keep output i'm generating considerably more compact. how can achieve goal without doing this: (var = tagged.length - 1; >= 0; i--) { delete tagged[i].private; delete tagged[i].owner.gravatar_id; delete tagged[i].owner.url; delete tagged[i].owner.followers_url; delete tagged[i].owners.following_url; delete tagged[i].gravatar_id; delete tagged[i].private; delete tagged[i].private; delete tagged[i].private; delete tagged[i].private; delete tagged[i].private; delete tagged[i].private; delete tagged[i].private; delete tagged[i].private; delete tagged[i].private; delete tagged[i].private; delete tagged[i].private; del

javascript - jqplot error with multiple pie charts on external js file -

i using jquery pie chart/donut display data on several pages. there 1 chart each page, has different data. my plan put coding each of pie charts external js file referenced on each page in page template. however, when script jqplot donut chart on linked js file gets chart doesn't have matching id on page, none of scripts following charts work. this means first chart listed in script works. other pages not displaying charts, there script above doesn't have matching id on page. for example, chart 1 , chart 2 both have coding in js file, code chart 1 first, code chart 2 second. on page 1, pie chart 1 displays has id on page pie chart 1. however, on page 2, there no matching element pie chart 1, , script throws error , doesn't code pie chart 2, not displayed in matching element on page 2. usually when similar, if code doesn't have matching id on page code ignored. there seems in jqplot causes error if code not matched element. this seems basic implementation

python - Pygame how do I create duplicates of a sprite class then put them in a group? -

hello i'm trying randomly spawn copies of pipes class display them screen. set random number generator has 1/3 chance 1. if gets 1 made random number generator choose number betweeen 0 , 600(the width of screen) x coordinate of new sprite. display sprite screen using random x coordinate , predefined y coordinate. class pipes(pygame.sprite.sprite): def __init__(self, x): pygame.sprite.sprite.__init__(self) self.img = pygame.image.load('c:\\users\\ben\\documents\\sprite.png').convert() self.imx = 0 self.imgy = 375 self.setdisplay = pygame.display.get_surface() def playerrect(self): self.x = self.imgx self.y = self.imgy self.rect = pygame.draw.rect(setdisplay, pygame.color(0, 0, 255), pygame.rect(se

Java interface - Return on method call -

i've been struggling couple of days trying understand how code below works. i have: abstract class: public abstract class screen { protected final game game; public screen(game game) { this.game = game; } public abstract void update(float deltatime); public abstract void paint(float deltatime); public abstract void pause(); public abstract void resume(); public abstract void dispose(); public abstract void backbutton(); } and interface: public interface game { public void setscreen(screen screen); public screen getinitscreen(); } i understood interface methods have no body because what classes can do, not how . then, when call method below class extends screen abstract class: game.getinitscreen(); what method return? new screen? there nothing on screen class...no canvas, no surfaceview...what's point of such call? because, @ run-time, there class provides concrete implementation of screen . cl

Can't use SNI filter on HTTPS server with Grizzly 2.3.19 -

i'm trying client sni app, integration test i'm using grizzly server test sni being passed. i'm using filter per docs . filter never called. the documentation doesn't show complete example. mechanism i've found add filters seems ignored. old method used in 2.2 not public anymore. the following code: private tcpniotransport createmockservertransport() { final sslengineconfigurator sslserverengineconfig = new sslengineconfigurator(createsslcontextconfigurator().createsslcontext(), false, false, false); return tcpniotransportbuilder.newinstance().setprocessor(getfilters()).build(); } private filterchain getfilters() { snifilter snifilter = getsnifilter(); final filterchain chain = filterchainbuilder.stateless() .add(new transportfilter()) .add(snifilter) .add(new stringfilter()) .add(new basefilter() { @override public nextaction handleread(final filterchainconte

rest - How can I authorize API access with just a Phone number and SMS Pin? -

i'm creating backend has rest api consumed mobile app. because app mobile we're not using email , password create account/login instead phone number , receive pin number sms message confirm own number. after confirm user pin number, how should go authenticating future api requests? my first thought create token , return app. second thought use oauth i'm getting confused method work phone number/sms login method (2/3 leg, grants, etc..). don't understand how might work when using oauth our own apps (as opposed oauth provider). token seems easier route. if use token, bad use same token until user logged out? (over https). i'm assuming it's worth work make them expire little longer avg. user session. unfortunately doesn't seem turn key solution works phone numbers. i'm using meteor expecting roll own node modules (by exposing connect on meteor server). any appreciated! have considered using twitter's digits? comes fabric package p

difference between files view and project view in netbeans 8 -

Image
i cannot find difference between views (files vs. projects). in ide give me exavtly same, submenus. might difference. use netbeans 8.0.2 php can make screenshot , post ? the differences should visible.

javascript - Adjusting height of iframes in jQuery Masonry (YouTube embeds) -

total noob here, trying put jquery masonry page youtube video embedded. problem is, height of video not adjusting, , can't figure out how proportions right. i've looked @ following links, can't figure out how incorporate these ideas code. jquery - how dynamically adjust height of iframe? adjust height of iframe when new content loaded my entire block of code below. you'll notice div adjusts fine image, fails adjust appropriately embedded youtube video. where going wrong? appreciated... <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> <title>article title</title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script> <style> body { font: 1em/1.67 arial, sans-serif; margin: 0; background: #e9e9e9; } img, iframe { max-width: 100%; height: auto; display: bloc

Grails 3.0 application.yml configuration for hyphenated URLs -

how configure hyphenated urls in new grails 3.0 application.yml file? the following configuration not seem sticking: grails-app/config/application.yml grails: web: url: converter: "hyphenated" my test controller is: grails-app/controllers/bookauthorscontroller.groovy class bookauthorscontroller { def index() { } } and view at: grails-app/views/bookauthors/index.gsp this page (with undesirable camel case url) displays ok: http://localhost:8080/bookauthors this page should display results in page not found (404) error: http://localhost:8080/book-authors

javascript - how to use variable on bonsai.js? -

var star = document.getelementbyid("star"); var color = "#ef6360"; bonsai.run(star, { code: function() { new star(30, 30, 20, 5, 0.7).attr({ fillcolor: color }).addto(stage); } }); it doesn't work, it'll work if remove variable , directly use string, fillcolor:"#ef6360" . why? as far know, cannot access variables inside code because context has limited access browser per documentation here (read first note) . this docs exactly. note : runner context has limited access browser functionality (e.g. no dom access) because in cases bonsai code executed in worker. therefore limited use provided bonsai api , normal js functions provided worker ( see functions available workers on mdn details ). if want pass initial data runner context can read @ bottom of page or if want dynamically manipulate dom through bonsai should have @ communication overview . if there way access window scope insi

linux - Cannot connect to host by SSH -

cannot connect host ssh. i using following shell script use ssh . host_list="c15-0330-14.ad.mtu.edu" ssh "$host_list" but says : name or service not knownname c15-0330-14.ad.mtu.edu . i tried ssh c15-0330-14.ad.mtu.edu . works. also, if have several hosts, how can invoke them 1 one? the error message should be ssh: not resolve hostname c15-0330-14.ad.mtu.edu: name or service not known except dos line endings in script cause carriage return stored @ end of value of host_list . carriage return, when printed part of error message, causes cursor return beginning of line, resulting in error message see. notice how 2 halves line (the carriage return precedes colon): ssh: not resolve hostname c15-0330-14.ad.mtu.edu : name or service not known results in error of : name or service not knownname c15-0330-14.ad.mtu.edu

javascript - focusing on google maps api according to latitude and longitude -

i got code of drawing polylines in google maps here want focus on map according latitude , longitude, added line -> map.setcenter(new google.maps.latlng(-122.5868225097656,45.56117947133065)); polyline didn't appear because latitude , longitude outside screen , line added (map.setcenter) didn't change here code: <!doctype html> <html> <head> <meta name="viewport" content="initial-scale=1.0, user-scalable=no"> <meta charset="utf-8"> <title>simple polylines</title> <style> html, body, #map-canvas { height: 100%; margin: 0px; padding: 0px } </style> <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&signed_in=true"></script> <script> function initialize() { var mapoptions = { zoom: 3, center: new google.maps.latlng(0, -180), maptypeid: google.maps.maptypeid.terr

nvd3.js - How to access toi NVD3 binding data -

i'm new using nvd3 , try can't find right way it, i'll try clear. need make little change nv.models.linechart. i need add button , when click it, remove last element data , update chart. try creating button inside library example: nv.models.linechart = function () { d3.select("body") .append("button") .attr('type','button') .text("test").on("click",function(){ //code here ... // need access data binding svg here there way nvd3? }); //============================================================ // public variables default settings //------------------------------------------------------------ //... }

excel - Vlookup varying column index number -

i trying change column index number of vlookup showing colnum-14 me @ cell looking at. is there missed out? aware of match/index formula, have use vlookup . my code: dim colnum integer colnum = 15 16 sheets("sheet1").cells(8, colnum + 1).formula = "=iferror(vlookup(" & sheets("sheet1").cells(8, 3).address(false, true) & ",'sheet2'!" & range(cells(3, 2), cells(20, 10)).address & "," & "colnum-14" & ",false), ""na"")" next colnum you embedding string "colnum-14" rather variable colnum lookup column. try sheets("sheet1").cells(8, colnum + 1).formula = "=iferror(vlookup(" & sheets("sheet1").cells(8, 3).address(false, true) & ",'sheet2'!" & range(cells(3, 2), cells(20, 10)).address & "," & colnum & ",false), ""na"")"

CCString deprecated in Cocos2D-x -

it seems ccstring deprecated in cocos2d-x v3.5. should use instead? also, reason deprecation? short answer: use std::string instead. the entire codebase moving toward using standard library (stl, std:: namespace) makes sense new c++11 features. you can continue use ccstring anywhere using ccarray , ccdictionary. these deprecated, of course, should move using std::string. valuemap, , valuevector replacements ccarray , ccdictionary based on stl std::map , std::vector , contain value objects. value can hold std::string, int, float, bool, valuemap/valuevector allow nested containers.

how to give the value selected from menu button as input to os.system in python gui -

the below python gui code trying select values drop down menu buttons(graph , density) , trying pass them command line arguments os.system command in readfile() function shown below having problem in passing values have selected drop down menu os.system command. import os import tkinter tk def buttonclicked(btn): density= btn def graphselected(graphbtn): graph=graphbtn def readfile(): os.system( 'python c:desktop/python/abc.py graph density') root = tk.tk() root.title("dense module enumeration") btnlist=[0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0] btnmenu = tk.menubutton(root, text='density') contentmenu = tk.menu(btnmenu) btnmenu.config(menu=contentmenu) btn in btnlist: contentmenu.add_command(label=btn, command = lambda btn=btn: buttonclicked(btn)) btnmenu.pack() graph_list=['graph1.txt','graph2.txt','graph3.txt','graph.txt'] btnmenu = tk.menubutton(root, text='graph') contentmen

sorting - breaking ties in dataframe (dplyr, data.table, base r) -

thanks response far. i've spent few more hours on problem , think it's best reframe question. no longer think dplyr work. here issue. constrain: require access column name programmatically (use of dplyr creates problems). preferred, not essential: solution without dataframe copy. code set up: set.seed(11) n <- 12 <- sample(letters, n, replace=false) b <- c( rep(c("aa"), 4), rep(c("ba"), 4),rep(c("ca"), 4)) c <- sample(4:10, n, replace=true) df <- as.data.frame(cbind(a,b,c)) dt <- as.data.table(df) rank_tb <- dt[order(b,c,a)] output: b c 1: e aa 4 2: m aa 5 3: b aa 6 4: o aa 7 5: ba 5 6: d ba 6 7: p ba 7 8: u ba 9 9: q ca 5 10: v ca 5 11: j ca 8 12: x ca 9 rank_tb gets me half way there, note grouping on column "b" preserved, dataframe sorted on column "c" group , ties broken column "a" -> see row 9 , 10. like, in end, following addition: b c rank 1: e

javascript - MEAN.io application not starting -

i trying teach myself how use mean stack , working through docs mean.io site. @ point run following commands: $ npm install -g mean-cli $ mean init <myapp> $ cd <myapp> && npm install and these run fine. when next step either run gulp or node server and nothing happens. if run gulp after gets part says finished 'development' after 6.15 μs in logs hangs there. if run node server hangs , nothing else happens. in either case see nothing @ http://localhost:3000/ is common sticking point people?

css - Navbar collapse navigation not functioning -

i hoping can me figure out why collapse in bootstrap navbar isn't working. have seen bootstrap examples, should work. when view page on mobile device or shrink window, nav links collapse should, button expand not show up. <nav class="navbar"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse"> <span class="sr-only">toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a href="#" class="pull-left"><img src="/images/logo.png"></a> </div> <div class="navbar-collapse collapse"> <div class="navbar-right"

ruby on rails - How can I allow Devise users to log in when they're outside my default scope? -

i have rails 4 app uses devise 3.4 authentication, i've customized ability ban users (using simple boolean column users.banned , default false). user model has default_scope returns non-banned users. here's problem - still want banned users able log in , though can't after logging in. (they see page saying "you've been banned"). seems default_scope tripping devise. when log in or call e.g. authenticate_user! , devise tries find current user using 1 of basic activerecord methods find or find_by , can't because lie outside default scope. devise concludes user doesn't exist, , login fails. how can make devise ignore default scope? after long time digging around in devise , warden source code, found solution. short answer: add user class: def self.serialize_from_session(key, salt) record = to_adapter.klass.unscoped.find(key[0]) record if record && record.authenticatable_salt == salt end (note i've tested activ

Fetch XMPP Open Fire Private Chat History and Message Archiving in Android -

i working on xmpp open fire able send , receive message in private chat , in room , able chat history of room chat not able message history of private chat , wants achieve message archiving in private chat , room chat android. private messaging archives in xmpp private chat history not stored default on xmpp servers. private messages not yet delivered client stored "offline messages" , if enabled on server. client reconnects, these automatically delivered , purged. client receive them normal messages, except contain timestamp of initial transmission . for more persistent approach, there xep-0136: message archiving never used, or better (and easier implement) xep-0313: message archive management . server support xep-0313 for openfire , there a patch attached of-862 has been merged in september 2015 , part of 4.0 release. there support in ejabberd , prosody, if take recent enough version. in either case need enable archiving account on server . cli

c++ - Image not showing up in SDL -

when run shows black screen, , if put sdl_geterror() @ end prints blank line..... any ideas on how fix this? #include <sdl2/sdl.h> #include <sdl2/sdl_image.h> #include <iostream> class character { public: sdl_rect src, cur; public: sdl_texture *image; void setsrc(int x, int y, int w, int h) { src.x = x; src.y = y; src.w = w; src.h = h; } void setcur(int x, int y, int w, int h) { src.x = x; src.y = y; src.w = w; src.h = h; } }; int main(int argc, char* argv[]) { bool in = true; character p1, p2, ball; sdl_window *window = 0; sdl_renderer *renderer = 0; sdl_surface *screen, *imageloader; sdl_init(sdl_init_video); window = sdl_createwindow("pong",sdl_windowpos_centered,sdl_windowpos_centered, 800, 600, sdl_window_shown); renderer = sdl_createrenderer(window, -1, 0); p1.setsrc(0, 0, 100, 500); p1.setcur(0, 0, 100, 500); imageloader = img_load("/home/donaldo/documents/games/images/player.bmp");

Optimizing MySQL Left join query between 3 tables to reduce execution time -

i have following query: select region.id, region.world_id, min_x, min_y, min_z, max_x, max_y, max_z, version, mint_version minecraft_worldguard.region left join minecraft_worldguard.region_cuboid on region.id = region_cuboid.region_id , region.world_id = region_cuboid.world_id left join minecraft_srvr.lot_version on id=lot region.world_id = 10 , region_cuboid.world_id=10; the mysql slow query log tells me takes more 5 seconds execute, returns 2300 rows examines 15'404'545 rows return it. the 3 tables each have bout 6500 rows unique keys on id , lot fields keys on world_id fields. tried minimize amount of rows examined filtering both cuboid , world id , double on world_id, did not seem help. any idea how can optimize query? here sqlfiddle indexes of current status. mysql can't use index in case because joined fields has different data types: `lot` varchar(20) collate utf8_unicode_ci not null `id` varchar(128) collate utf8_bin not null

c# - Open new tab on button click? -

i want open new tab on button click, button clicked exist on iframe. i use code-- string tempabc = "javascript:window.open('reportviewer.aspx?reporttype=" + rptnew + "&billno=" + billno + "&mail=" + "mail" + "&ccmail=" + ccmail + "&subject=" + txtsubject.text + "&mailbody=" + txtmailbody.text + "')"; clientscript.registerstartupscript(this.gettype(), "script", tempabc, true); but should't show result. then can use code- response.redirect("reportviewer.aspx?reporttype=" + rptnew + "&billno=" + billno + "&mail=" + "mail" + "&ccmail=" + ccmail + "&subject=" + txtsubject.text + "&mailbody=" + txtmailbody.text + "'"); it open next page on same iframe. what can do. in .aspx page can use tags. <body> <form id="form1" runat=&qu

r - How to put legend right next to heatmap.2 color key -

Image
i have following data frame: dat <- structure(list(go = structure(c(1l, 1l, 1l, 2l, 2l, 2l, 2l, 2l, 2l, 2l, 3l, 3l, 3l, 4l, 5l, 5l, 5l, 5l, 5l, 5l), .label = c("apoptotic process", "metabolic process", "negative regulation of apoptotic process", "positive regulation of apoptotic process", "signal transduction" ), class = "factor"), probegene = structure(c(14l, 15l, 2l, 12l, 7l, 11l, 16l, 8l, 19l, 13l, 3l, 1l, 18l, 4l, 10l, 5l, 9l, 17l, 20l, 6l), .label = c("1416787_at acvr1", "1418835_at phlda1", "1419282_at ccl12", "1423240_at src", "1424896_at gpr85", "1434186_at lpar4", "1434670_at kif5a", "1440374_at pde1c", "1440681_at chrna7", "1440803_x_at tacr3", "1442017_at loc101056574", "1448815_at ogg1", "1448821_at tyr", "1451338_at nisch", "1454721_at arel1", "

actionscript 3 - I have a piece of server-client code, however this bit is in AS3 and I'm working in C#. Can someone help me translate it? -

i've been working on converting old server flash game can use starting point new server-client system, hit stopping point can't figure out. can @ code , possibly translate c#? var dists:array = []; for(a=0;a<deltas.length;a++) { dists.push({offset:math.abs(deltas[a]-avg), time:deltas[a], tostring:function(){ return "offset:" + this.offset + ", time: " + this.time } }) } as note, these numbers doubles - aside int in loop. , further clarification, dists i've translated double list array, might wrong. have far: list<double> dist = new list<double>(); (int = 0; < deltas.count; i++) { dist.add(math.abs(deltas[i] - average)); } from information given, work out... void main() { dictionary<int, double> deltas = new dictionary<int, double>(); int avg = 0; list<item> dists =

excel - Formula for row artificial shift -

i've been doing weeks no avail, i'll give context it'd easier understand: have several sets of warehouse materiel codes sorted smallest largest time need delivered workshop processing , amount of pallets required @ each specific time frame, here how looks: mat. code time pallets 65504606 07:30:00 2 65504606 10:30:00 1 65504606 13:30:00 2 65504606 16:30:00 1 65504606 19:30:00 2 65504606 22:30:00 1 65504606 01:30:00 2 65504606 04:30:00 1 i'm matching data worksheet containing information on each individual pallet stored, need shift values in time column specific pallet delivered on time, here's i'd like: mat. code location time cell shift 65504606 91-04-03/1 7 30 0 65504606 76-13-03/1 7 30 -1 65504606 97-19-03/1 10 30 -1 65504606 97-16-03/3 13 30 -1 65504606 76-19-02/1 13 30 -2 65504606 97-18-03/1 16 30 -2 65504606

php - Laravel 5 error message attributes -

is there way add additional attributes laravel error messages? witherrors method seems allow setting either string message or messagebag (which comes validator) response errors can accessed in templates (from session). is there way somehow customise messages? being able add/set attributes (like color, priority, source, icon etc.) message , retrieve them in template allow me "decide" how present it. i guess 1 way using named message bags, that's not convenient. in fact way "group" messages , have walk through every possible group in template anyway. any ideas? thank you validation error messages key-value pairs "standard" properties cannot applied easily. it possible customize error messages text. if using form request validation use function messages() sometimes adding custom variables view, example myerror know display differently.

.net - Azure Web Apps or Cloud Service for hosting WCF Integration Service -

i need deploy .net wcf integration service azure platform should low maintenance after deploy. service uses sql databases , need access form of storage blobs. my question web app sufficient or need cloud service? note: i'm bit confused on difference between azure web apps , web sites. documentation refers web sites (which understand) in azure portal see cloud services, vm's , web apps . assume when documentation refers web sites old naming web apps? i have been experimenting myself. had deployed wcf service has similar requirements yours (blob access etc.) using cloud service. this worked well, billing perspective billed compute hours entire time service running because understand runs within it's own vm. i have followed blog article http://genuinebasil.com/blog/wcf-service-over-azure-web-site/ i converted cloud service web app , me, has been functionally identical cloud service deployment.

apk - Unable to update android studio lint settings -

i using android studio 1.1.0. want disable specific lint checks 'incomplete translation'. so, went file -> settings... -> inspections -> android lint , unchecked 'incomplete translation' item, pressed apply & ok buttons. now, generating signed apk still throws lint errors related missing translations. further on, disabled entire android lint item see if generation of signed apk skips lint error checking or not. result still got same lint errors missing translations whereas expecting no lint error checking per updated settings. bug android studio or doing wrong here? note don't want disable lint error checking entirely, can adding following lines under build.gradle: lintoptions { checkreleasebuilds false } i want turn off few lint checks settings dialog. as per official doc http://tools.android.com/tips/lint/suppressing-lint-warnings " to suppress error, open issue in editor , run quickfix/intentions action (ctrl/cmd f1) ,

Embedded Widget Yotpo bigcommerce -

Image
can me why embedded widget don't appear on yotpo app? im using bigcommerce platform. try uninstalling , installing on , on results still same. disable built in reviews. deselect product reviews checkbox save. to install yotpo social reviews widget: log in bigcommerce admin page. click settings. click design in store setup column. click edit html/css. click productdetails.html under other template files-panels. add following code after last line of file. <script type="text/javascript"> //<![cdata[ var div = document.createelement("div"); div.setattribute('class', 'yotpo yotpo-main-widget'); div.setattribute('data-product-id', "%%global_productid%%"); div.setattribute('data-name', "%%global_productname%%"); div.setattribute('data-url', document.url); div.setattribute('data-description', ""); div.setattribute('data-image-url', "%%global_thu

matrix - convert Point3D To Screen2D get wrong result in three.js -

i use function in three.js 69 function point3dtoscreen2d(point3d,camera){ var p = point3d.clone(); var vector = p.project(camera); vector.x = (vector.x + 1) / 2 * window.innerwidth; vector.y = -(vector.y - 1) / 2 * window.innerheight; return vector; } it works fine when keep scene still. when rotate scene made mistake , return wrong position in screen. it occurs when rotate how 180 degrees.it shoudn't have position in screen showed. i set position var tmpv=point3dtoscreen2d(new three.vector3(-67,1033,-2500),camera); in update , show css3d.and when rotate 180 degrees less 360 , point shows in screen again.obviously it's wrong position can telled scene , haven't rotate 360 degrees. i know little matrix ,so don't know how project works. here source of project in three.js: project: function () { var matrix; return function ( camera ) { if ( matrix === undefined ) matrix = new three.matrix4();

c++ - File descriptor set and selection understanding - unexpected behaviour -

i have third party library kind of shared memory (between processes) implementation preset number of memory buffers. processes divided reading , writing . this library gives file-descriptor each process. i wanted test functionality, using code sample (single process divided reading , writing functionality) provided library. code sample worked, wanted understand file descriptors , how work. this basic code sample (reduced , commented me) (uses 4 shared buffers ): int fd1, fd2; // 2 file descriptors, fd1 writing , fd2 reading sharedmemory_getdescriptor(&fd1, options1); // options1 tells library fd1 used writing data sharedmemory_getdescriptor(&fd2, options2); // options2 tells library fd2 used reading data fd_set readset, writeset; // fd_sets later select commands // empty sets fd_zero(&readset); fd_zero(&writeset); // find out whether writer may write fd_set(fd1, &writeset); fd_set(fd2, &readset); // why has 1 set?? // test sets "ready r

ios - why isn't the CBPeripheralManagerDelegate method calling? -

why isn't cbperipheralmanagerdelegate method callinga although have initialized class var bluetoothmanager = cbperipheralmanager(delegate: self, queue: nil, options: nil) and added bluetooth framework in bundle. import uikit import corebluetooth class appsettingsviewcontroller: uiviewcontroller { override func viewdidload() { super.viewdidload() var bluetoothmanager = cbperipheralmanager(delegate: self, queue: nil, options: nil) } override func didreceivememorywarning() { super.didreceivememorywarning() // dispose of resources can recreated. } } extension appsettingsviewcontroller : cbperipheralmanagerdelegate{ func peripheralmanagerdidupdatestate(peripheral: cbperipheralmanager!) { if peripheral.state == cbperipheralmanagerstate.poweredon{ println("broadcasting") }else if peripheral.state == cbperipheralmanagerstate.poweredoff{ println("no bluetoo

How can I clear all the AngularJS $scope and $rootScope values within a single function? -

i need clear $scope values while performing operations. for eg: if click "signout" button redirect "signin" page, $scope or $rootscope values in session should cleared. how can achieve this? you can following: $rootscope = $rootscope.$new(true); $scope = $scope.$new(true); the function $new creating new scope inheriting variables parent. true prevents inheritance. but not correct approach, because if use thing above, should bootstrap controllers functions manually , recreating tree of scopes. this might useful though, idea store initialized data stored in variables , then, when assigned copied displayed variables. the correct solution clear manually every property in each scope on logout event this: logout event: $rootscope.$emit("logout"); catching event: $rootscope.$on("logout", function(){ $rootscope.mydata = undefined; }); or suggested in comments, use service , cleaned.

python - How to run Pip commands from CMD -

as understand, python 2.7.9 comes pip installed, when try execute pip command cmd (windows) following error: 'pip' not recognized internal or external command, operable program or batch file. when type python following, suggests has been installed correctly: python 2.7.9 (default, dec 10 2014, 12:24:55) [msc v.1500 32 bit (intel)] on win32 type "help", "copyright", "credits" or "license" more information. i did need add environmental variables python part working on cmd: add environment variable path : "c:\python27\" define system variable pythonpath : "c:\python27\" i cannot find pip folder within python directory, there folder called "ensurepip" in c:\python27\lib\ . does know how can pip commands start working in cmd? little side note new python didn't figure out theirself: this should automatic when installing python, in case, note run python using python