Posts

Showing posts from April, 2012

javascript - Change Text on another Div -

good evening community, have problem code. html: <a href="aboutme.php"> <div class='aboutus'> <div id="mbubble"> stuff inside here </div> </div> </a> <div id='title'> <div class="thome"><p style="letter-spacing:10;">text before</p></div> <div class="tabout"><p style="letter-spacing:10;">text after</p></div> i want if hover on div "mbubble" class "thome" change it's text. tried making them visible / invisible. css: #mbubble:hover ~ .thome { visibility:hidden; } #mbubble:hover ~ .tabout { visibility:visible; } but it's sowhing no affect? can tell me how that? or @ least way that's working change text hovering? best regards, michael how this: $('#mbubble').hover(function () {

java - Should input listeners be synchronized? -

my sample code posted below shows 2 classes. 1 implements keylistener , other implements runnable , running in infinite loop sleeping every 20 ms. when key pressed keychar, in form of int, used index setting index of boolean array true or false, representing key pressed or not. @ same time process loop searching key array true or false values , setting true ones false printing out char. question whether or not need use synchronization using lock accessing chararray because used in 2 threads: process thread , key listener thread. sample code: import java.awt.component; import java.awt.event.keyevent; import java.awt.event.keylistener; public class input implements keylistener { public boolean[] chararray; public input(component component) { chararray = new boolean[127]; component.addkeylistener(this); } @override public void keypressed(keyevent e) { (possible synchronization lock?) int keychar = e.getkeychar(); if (keychar == 27 || keychar == 9 |

javascript - console.log method extraction from console -

considering console wasn't overriden , refers native object, console.log method (and possibly others) extracted console object with var log = obj.log = console.log; // instead of console.log.bind(console) log(...); obj.log(...); is 100% safe in terms of browser , node compatibility? a significant amount of js examples (maybe illustrative) bound console.log suggests may not. browsers differ in console implementations, appears webkit/blink-based browsers (chrome, opera 15+, safari, etc) ones uncomfortable extracted console methods. browser compatibility extracted methods have bound: var log = console.log.bind(console); node has own console implementation relies on this pre-binds methods . safe extract console methods in node applications, same applies electron's main process. nw.js replaces node console chromium's: node.js , chromium each has own implementation of settimeout , console. currently, console, use chromium's implementati

c# - Linq expression to filter an a list of entity's collection, and maintain list of entities -

lets have: public class foo { public long id { get; set; } public string name { get; set; } public icollection<bar> { get; set; } } public class bar { public long id { get; set; } public int age { get; set; } public virtual foo { get; set; } public long fooid { get; set; } } our data may this: (assume list<foo> ) // forget syntax, demonstrate data foo[0] = new foo{ id = 1, name = "a", bar = { collection of bars ages on 10 }}; foo[1] = new foo{ id = 2, name = "b", bar = { collection of bars ages on 20 }}; foo[2] = new foo{ id = 3, name = "c", bar = { collection of bars ages under 10 }}; now, lets wanted foo s bar s including bar age between 5-25. for this, work in reverse , bars, associated foos bars, , re-map bars foo. seems overly complicated should be. to more clear - all foos bars ages between 5 , 25 :) if want select foo 's , bar 's between age of 5 , 25: var results =

How to export Azure machine learning service results into Azure SQL DW? -

i have 3 problems relating azure machine learning service. appreciate if can give me directions or related reference. (1) regarding result of computation of machine learning, can export sql data warehouse in azure ? format ? can join result existed table in sql db ? exact process ? i have searched related information [deploy web-service], , found similar issue. however, little confused relationship between web-service , azure sql data warehouse. [deploy web-service] https://azure.microsoft.com/en-us/documentation/articles/machine-learning-walkthrough-5-publish-web-service/ (2) if need result in machine learning outer sources (ex: outer lpo service), how connect outer source ? (3) if need connect azure sql data warehouse outer sources, correct need set firewall , offer server address, id , pd , , can connect outer source ? anticipating response , feedback. let me try , answer questions. (1) in order write machine learning output azure sql

Why do I get a seg fault when in n>500? Coded in C -

in following piece of code wrote problem 28 in project euler. needs add numbers along 2 diagonals of expanding square of increasing numbers. results in seg fault when set num>500 . until limit works perfectly. in advance! #include <stdio.h> int main(){ int n, num=501; int array[num-1][num-1]; int p=((num+1)/2)-1; int count=25; int x; array[p][p]=1; array[p+1][p]=4; array[p+1][p+1]=3; array[p][p+1]=2; array[p-1][p+1]=9; array[p-1][p]=8; array[p-1][p-1]=7; array[p][p-1]=6; array[p+1][p-1]=5; int i=10; (n=2;((n*2)+1)<=num;n++){ for(x=0;x<n*2;x++){ array[p+(x-(n-1))][p+n]=i; i++; } count+=(i-1); for(x=0;x<n*2;x++){ array[p+n][p+(n-1)-x]=i; i++; } count+=(i-1); for(x=0;x<n*2;x++){ array[p+((n-1)-x)][p-n]=i; i++; } i--; count+=i; for(x=0;x<=n*2;x++){ array[p-n][p+(x-n)]=i; i++; }

java - Retrieving the text of a custom listview from textview -

i have following code displays menu if long pressed on listview: @override public void oncreatecontextmenu(contextmenu menu, view v, contextmenuinfo menuinfo) { if (v.getid()==r.id.lvfiles) { adapterview.adaptercontextmenuinfo info = (adapterview.adaptercontextmenuinfo)menuinfo; menu.setheadertitle("what do?"); string[] menuitems = getresources().getstringarray(r.array.menuselect); (int = 0; i<menuitems.length; i++) { menu.add(menu.none, i, i, menuitems[i]); } } } @override public boolean oncontextitemselected(menuitem item) { adapterview.adaptercontextmenuinfo info = (adapterview.adaptercontextmenuinfo)item.getmenuinfo(); int menuitemindex = item.getitemid(); string[] menuitems = getresources().getstringarray(r.array.menuselect); string menuitemname = menuitems[menuitemindex]; textview ck = (textview) mframe4.findviewbyid(r.id.txttitle); toast.maketext(getactivity(), stri

java - clear spaces and special chars from Array.toString() -

this question has answer here: remove non alphabetic characters string array in java 6 answers i trying take out spaces, commas , square brackets of string, after using arrays.tostring(). when output string still has characters: for(int c=0; c<10; c++){ temp[0] = a; temp[1] = b; temp[2] = c; string pass=arrays.tostring(temp); pass.replaceall("\\s+",""); system.out.println(pass); ... this it: string pass = arrays.tostring(temp); pass = pass.replaceall("[,\\s\\[\\]]", ""); system.out.println(pass);

javascript - How to "enhance" jQuery search with $(this)? -

i'm looping on children of div. depending on whether children odd or have different following operations. i want use jquery's $(this) current context , add query depending on state of being odd or even. if child want child of div (so child of child loop). how can this? my current method not work $("div.profile_result").children().each(function(a){ // way of adding child doesn't work if (a%2) console.log( $($(this) + " > a")) else console.log("info") }) $($(this) + " > a") trying concatenate object , string can't do. use $(this).find('a') instead

rabbitmq - Is there any api to get keystone notification events? -

the information found can view events through ceilometer or rabbitmq. nice if can events directly through apis. unfortunately, there no way notifications individual openstack services.

d3.js - How to redraw the svg filled with circles in D3? -

i'm following this zoom example . in case, don't know how redraw data svg. in example, svg initialized this chartbody.append("svg:path") .datum(data) .attr("class", "line") .attr("d", line); var line = d3.svg.line() .x(function (d) { return x(d.date); }) .y(function (d) { return y(d.value); }); and redrawn in function "zoomed" svg.select(".line") .attr("class", "line") .attr("d", line); while in case init: usersvg.selectall("circle") .data(usernodes.slice(1)) .enter().append("svg:circle") .on("click", function(d){ console.log(d.ind); }) .on("mousemove", function(d){ brushonuser(d.ind); }) .on("mouseout", function(){ brushonuser(); }) .attr("r", function(d) { return d.radius; }) .attr("cx", function(d, i) { return usernodesscalex(d.x)

sandbox - Sandboxing technologies in Linux: snappy vs flatpak comparison? -

so xdg-app has been renamed flatpak , can mention comparison list of things each solution provides/lacks, other snappy being implemented canonical , flatpak being implemented red hat? it still tell 1 better. they're still going through whole "my application better application" phase, both sides having "not invented here" problem. there good, bad , ugly thing going on right now. because they're addressing issue of cross platform packaging issues, , fact there more 1 competing standard, means both sides fighting best. of course brings better software , both sides throwing lot of money @ problem until 1 side beats other. bad because they're both @ beginning stages , claiming things aren't true yet. both systems aren't cross *nix platform yet testing phases haven't been completed enough form educated opinion. ugly because of old saying. have 100 standards? why have many standards? should make encompassing standard rule them

html - How do you style a text input so that there's an icon on the left without using background-image? -

Image
i'm trying create text input similar username , password input shown in pearson's testnav login (ignore yellow box). to make icon on left, use background-image property. wondering if possible achieve same effect without using images. i've gotten pretty close , there 2 problems. border right of icon box rounded, , if click icon doesn't focus input. tried making input box background transparent , putting icon behind it, chrome overrides background color if site in password manager. here's css/html of attempt: html: <div class="field"> <input type="text"> <div class="icon"> <i class="fa fa-user"></i> </div> </div> css: .field input { outline: none; border: 0px solid #fff; font-size: 14px; padding: 5px 5px 5px 44px; position: absolute; width: 260px; height: 40px; box-sizing: border-box; border: 1px solid #ccc; border-radiu

android - Added icons in manifest.json but got no icon in splash screen -

my demo not finished yet can find here: https://frp.im/dev/timedrops/target/ { "short_name": "timedrops", "name": "timedrops", "icons": [ { "src": "drop-128x128.png", "sizes": "128x128" }, { "src": "drop-96x96.png", "sizes": "96x96" } ], "start_url": "index.html", "display": "standalone", "orientation": "portrait", "background_color": "#3e4eb8", "background_color": "#3e4eb8" } i followed steps of creating progressive web apps , tried add splash screen first, failed display icon. checked https, still not working in https. went though examples , json right. why can't see icons? searched several posts , digged docs, seems need 192x192 icon... why doesn't throw warnings... https:

android - Making app compatible with tablets -

well have app have option read device sms , missed calls. not needed feature, present. problem have permissions: <uses-permission android:name="android.permission.read_contacts"> </uses-permission > <uses-permission android:name="android.permission.receive_sms"> </uses-permission > <uses-permission android:name="android.permission.read_sms"> </uses-permission > <uses-permission android:name="android.permission.read_phone_state"> </uses-permission > and i'm sure of them making app incompatible tablets, tried change to: <uses-feature android:name="android.permission.read_contacts" android:required="false"> </uses-feature> <uses-feature android:name="android.permission.receive_sms" android:required="false"> </uses-feature> <uses-feature android:name="android.permission.read_sms" android:required="false"

mongodb - No common protocol found when add shard in local network -

i'm trying build small cluster using mongodb sharding. tried in localhost , works perfect. when try on local network there 2 nodes, node1 , node2, not work. in both nodes, mongod started serve shard. in node1, config server , mongos started. listening 0.0.0.0 exclusively allocated ports. i can connect , things both nodes. when use mongo login mongos in node1, can add node1 mongod shard when try add node2, error occurs: mongos> sh.addshard("<ip of node2 in local network>") { "ok" : 0, "errmsg" : "no common protocol found.", "code" : 126 } i did searching few documentation error. mongo addshard "no common protocol found" errmsg 126 shows same error not seem helpful. couple of things check a) using same version of mongod on machines. b) using same kind of storageengine on machines.

javascript - Calling directive inside a function in AngularJS -

i have directive called "drill-down" want call inside function 1 below dont know how this $scope.drilldown = function() { code... if(success == 200) { call directive here } } now use directive in view this: <tr ng-repeat="d in data" class="child"> <td ng-click="drilldown()" drill-down></td> <td>d.name</td> <td>d.lastname</td> </tr> some great! directive code angular.module('headline.drilldown',[]) .directive('drilldown',drilldown); function drilldown() { var directive = { restrict: 'a', link: link }; return directive; function link(scope,element) { var table = $('.categories-table'); table.each(function() { var $table = $(this); $table.find('.parent').each(function(){ if($(this).nextuntil('.parent', ".child").length >= 0){

entity framework - EF5 generates SQL Server CE constraints with dot in name -

i building .net disconnected client-server application uses entity framework 5 (ef5) generate sql server ce 4.0 database pocos. application allows user perform bulk copy of data network sql server client's sql server ce database. (very) slow, due constraints , indexes created ef5. temporarily dropping constraints , indexes reduce 30-minute wait 1 minute or less. before starting bulk copy, application executes queries drop constraints , indexes sql server ce tables. however, commands fail, because ef5 created constraint names include table schema name, dot, , table name. dot in constraint name causing drop command fail, due parsing issue. for example, poco customer creates table dbo.customer primary key constraint pk_dbo.customer_id . database performs expected. however, upon executing non-query: alter table customer drop constraint pk_dbo.customer; sql server compact ado.net data provider returns error: there error parsing query. [ token line number = 1, to

c# - Using BitBlt to capture screenshot, how? -

i have run "bitblt" time time in searched, don´t how use it. from people say, seems fastest way capture screen windows show. however, can´t myself don´t got working. the thing have manage atleast, try method, this: gfxbmp.copyfromscreen(0,0,0,0 rc.size,copypixeloperation.captureblt); which guess uses it? (rc.size = size of window) sadly, doesn´t anything, black picture. if use sourcecopy however, works, normal method. i trying replace code, use bltbit, isn´t working either: public memorystream capturewindow(intptr hwnd, encoderparameters jpegparam) { nativemethods.rect rc; nativemethods.getwindowrect(hwnd, out rc); using (bitmap bmp = new bitmap(rc.width, rc.height, system.drawing.imaging.pixelformat.format32bppargb)) { using (graphics gfxbmp = graphics.fromimage(bmp)) { intptr hdcbitmap = gfxbmp.gethdc(); try { nativemethods

Rails Mysql to Postgresql Float -

i'm transferring database mysql postgresql. i have latitude , longitude column 1 of models: t.float :latitude t.float :longitude i'm using mysql2psql gem load mysql database postgres database locally. the problem have after transferred mysql database postgres have data such as: latitude: 40 longitude: -83 rather than: latitude: 40.xxxx longitude -83.xxxx please advise. mysql: + | field | type | null | key | default | | +------------------------+--------------+------+-----+---------+----------------+ | latitude | float | yes | | null | | | longitude | float | yes | | null |

.htaccess - PHP htaccess to nginx -

htaccess nginx getting errors i have tried online tools no http://www.anilcetin.com/convert-apache-htaccess-to-nginx/ , http://winginx.com/htaccess here doing .htaccess rewriterule ^(.*)$ /all_drivers.php?id=$1 [qsa] my nginx is (try 1) *** rewrite ^/(.*)$ /all_drivers.php?id=$1 ; (try 2) *** rewrite /(.*) /all_drivers.php?id=$1 ; this way page loading fine static files don't load ... /css.css or /js.js , index.php not loading showing all_drivers.php blank file . i have refered this: convert htaccess nginx , no far. @harinder: there must rewritecond based on you're applying rewiterule the reason why saying that, according rewriterule rewriterule ^(.*)$ /all_drivers.php?id=$1 [qsa] whatever comes request, sending all_drivers.php . and if desired rule, request, no matter send file only. also nice if give complete .htaccess code segment want translated. and please check if have configured php execution block correctly required fastcgi di

amazon web services - Restarting machines in a docker swarm on AWS -

i have created docker swarm of 5 vms on aws using docker-machine. stopped 1 vm using command docker-machine stop aws01 , tried docker-machine start aws01 but error error checking tls connection: error checking and/or regenerating certs: there error validating certificates host "5x.20x.23x.10x:2376": x509: certificate valid 5x.2x.17x.25x, not 5x.20x.23x.10x can attempt regenerate them using 'docker-machine regenerate-certs [name]'. advised trigger docker daemon restart stop running containers is stoping , starting container such big deal everytime this, need regenerate certs? is there low impact way of stoping , starting machines. this never happened me when using local virtualbox vm docker. started when created docker machine on aws. as can see since have 5 machines, starting , stopping big pain me because need regenerate certs machines everytime stop them? since aws can't keep machines running time.

api - DTLS 1.2 Master key derivation -

i implementing dtls 1.2 , using cipher tls_ecdhe_rsa_with_aes_128_gcm_sha256 i creating pre-master secret , master secret key using following steps 1- open algorithm provider using api bcryptopenalgorithmprovider 2- generate key pair using api bcryptgeneratekeypair 3- export public key using api bcryptexportkey 4- import other party public key using api bcryptimportkeypair 5- after generate secret agreement handle using private key , other party public key using api bcryptsecretagreement 6- secret key using api bcryptderivekey am missing because master key not correct. i guess depends on parameters passing bcryptderivekey. should specify tls 1.2 pseudorandom function in parameters based on sha256 , not on md5 , sha1 tls 1.1 / dtls 1.0.

ckan - How to restore a previously deleted group -

i created group, deleted it, , when want create again following error: the form contains invalid entries: name: group name exists in database digging around realized can rase outside ckan. pgadmin3 console have delete related records in member_revision, member, group_role , group table but doing break history in audit tables, , god knows else. is there politer way achieve it? the quickest (and dirtiest) way this, assuming group name my-group: update group_revision set state='active' name='my-group' , current=true; update group set state='active' name='my-group'; this should keep audit intact.

opengl - Is instancing faster on GPU? -

is there performance gain present when rendering instanced geometry in gpu-limited application? or draw calls? isn't better bake objects single vbo , render them single draw call? assuming objects static , vertex memory enough. if instance model small enough entirely fit within gpu's pre-t&l cache, can performance boost gpu. unless that's case, gpu going have read same mesh data each instance. 1 instance repeated 200 times have same bandwidth cost 200 separate meshes. isn't better bake objects single vbo , render them single draw call? no. because it's not gaining on-gpu performance, doesn't mean should ditch whole thing. if instancing appropriate you, have rendering same mesh. "bake objects" repeating same mesh data. once every instance intend draw. if don't save read-time bandwidth, it's still hugely wasteful in memory. don't discount importance of memory. wasting memory can lead runtime performance problems

openerp - Quotations approval odoo v9 -

all quotations must approved sales , technical heads , gm . 3 departments needs approve quotation. pls suggest solution. download sale_double_validation module git odoo v9.

quartz Scheduler with spring MVC without using maven -

i using tomcat version 7.0. requirement when tomcat starts up, start quartzscheduler schedule jobs @ regular interval. can 1 give me best example problem using contextlistener (this might clean approach start scheduler inside contextinitialized method , shutdown scheduler inside contextdestroyed method) or other methods . *note : without using maven you can implement servletcontextlistener (quartztestlistener) , add listener in web xml file below <listener> <listener-class>com.test.quartztestlistener</listener-class> </listener> wherein implement contextinitialized methods below: @override public void contextinitialized(servletcontextevent ctx) { jobdetail job = jobbuilder.newjob(quartzjob.class) .withidentity("testjobname", "test1").build(); try{ scheduler scheduler = ((stdschedulerfactory) ctx.getservletcontext().getattribute(quartzinitializerlistener.quartz_factory_key)).getschedul

html - Applying variable to element jquery -

i'm wondering if can in jquery. i'm using version 1.10: var myimage = $('#myimage'); what want assign image variable can use anywhere. want use during event handling: e.g. myimage.click(function () { alert('image clicked'); }); if above code incorrect, know appropriate code. yes can it. in fact, recommended assign variable selector not evaluated each time use it. performance reasons. finding element id (such in case $('#myimage'); ) fast imagine if have selector like $('ul > li.myclass:has(p) a:eq(2)') using variable speed things in such scenarios. i use $ sign in variable name like. var $varname = $('.selector') helps me better understand code , distinguish between regular variables , variables contain dom elements.

javascript - Changing properties in IE using JQuery; changes only applied when debugging -

i have simple script that's run @ load separate js file. setup this: var ddlperiodevan = $('[id$=ddlperiodevan]'); var ddlperiodetot = $('[id$=ddlperiodetot]'); chkperiodevantot = $('[id$=chkperiodevantot]').length > 0 ? $('[id$=chkperiodevantot]') : $('[id$=rbperiodevantot]'); var periodebereik = { van: 'ddlperiodevan', tot: 'ddlperiodetot', err: 'ddlperiode', chk: chkperiodevantot, label: 'periode' }; if (ddlperiodevan.length > 0 && ddlperiodetot.length > 0) { if (chkperiodevantot.length > 0) { chkperiodevantot.change(periodebereik, changedchecknummerbereik); if (chkperiodevantot.prop('checked')) { // checkbox aangevinkt, maak de waardevelden bewerkbaar ddlperiodevan.prop('disabled', false).prop('readonly', false).css('background-color', '#ffffff'); ddlperiodet

amazon web services - Cloudformation to automatically pick up the default instance profile -

i use cloudformation template deploy instance environment. want template pick default ec2 instance profile instance "arn:aws:iam::12345678910:role/ec2instanceprofile-instancerole-14f2a0atjnuo1" i use same template every aws accounts have. however, problem instance profile name different in every account. randomly generated suffix attached name (in example 14f2a0atjnuo1). how can workaround problem make template reusable in every account. please provide code if possible. "ec2instanceprofile" : { "description" : "the default instance profile", "type": "string", "constraintdescription" : "must name of existing defualt ec2 instance profile." }, "iaminstanceprofile": { "ref": "ec2instanceprofile" } get instance profile role name using below cloudformation. "instanceprofile" : { "type" : "aws::iam::instanceprofi

passing value from one page to another but it shows error message when it does query with this value in PHP and mySQL -

in php passed value through url 1 page other page, on other page use $_request variable value , get, when write sqlquery not get, if check value var_dump() method.. shows boolean(false).solve please page1: <strike> <select onchange="location=this.value"> <option value="adminviewcontact" active>view contact group</option> <?php while($row=mysql_fetch_array($result1)) { echo ' <option value="userviewcontactgroup.php? id='.$row['user_id'].' && var='.$row['rel_name'].' ">'.$row['rel_name'].'</option> '; } ?> </select> </strike> page2: <strike> <?php if(isset($_request['id']) && isset($_request['var'])) { $id= $_request['id'] ; $relation1= $_request['var'] ; } $query1 = "select * tbl_contact st_contact_id=$

c# - How to set a custom class as Unique into an Entity in Entity Framework -

working on wpf project using entity framework 6. my custom class includes 2 fields need unique (on top of id). 1 string type, other 1 custom type. the implementation of entity class s follows: public partial class myentity { [key] public int id { get; set; } [maxlength(100)] [index(isunique = true)] public string name{ get; set; } [maxlength(100)] [index(isunique = true)] public myclass myclass { get; set; } ... } then, when tray add new myentity via: context.savechanges(); i exception: message=unable create constant value of type 'ns.myclass '. primitive types or enumeration types supported in context. source=entityframework nb: other unique field (name) not generate exception if comment attribute of myclass declaration. is there no way set custom class unique entity?? thx in advance. in entity framework 6 have self. check soultion here: unique key constraints multiple columns in entity framework

vb.net - Visual studio Progressbar control: blue color -

Image
using progressbar control can use default green one. looking in windows 7 have noticed control, see image below. i found article: windows progressbar my question is, how use control in visual studio 2013 labelling blue progress bar? thanks edit: blue color, not red, yellow or green one. control called "meter". sorry not accessible stated: in windows vista, progressbars come in different flavors, common progressbar being green one. however, there red , yellow versions (there blue version, known meter, inaccessible). progressbar colors seem correspond specific progressbar states. can set these states using pbm_setstate [0x40f] message. states pbst_normal [0x0001], pbst_error [0x0002] , pbst_pause [0x0003]. but if interested possible access red , yellow color using following: declare auto function sendmessage lib "user32.dll" (byval hwnd intptr, byval msg integer, byval wparam integer, byval lparam integer) integer enum pr

django - How to write a view that that responds with the http request that the function is passed? -

urls.py from django.conf.urls import patterns, url testform import views urlpatterns = patterns('', url(r'^$', views.testhandler), ) views.py from django.http import httpresponse def testhandler(request): #return httpresponse(request) in views.py how return request testhandler passed? i have admit weirdest question have ever seen on so. anyway can view return request this: from django.http import httpresponse def testhandler(request): return httpresponse(request.__str__()) if want see bit nicer in browser, can try: from django.http import httpresponse def testhandler(request): return httpresponse('<br />'.join(request.__str__().split('\n'))) # convert \n <br />

multithreading - Difference between subprocess and thread -

what difference between subprocess , thread.i googled not able find suitable answer.the link answer provided above differentiates between process , thread want know difference between subprocess , thread.as subprocess process many differences same of process , thread want know there particular difference between subprocess , thread not between process , thread.

android - Returning push notification with each registered device's success status -

i sending multicast pushnotification . but, instead of getting notification sent each device or not, got total result "success":4,"failure":5 {"multicast_id":5822472722938760042,"success":4,"failure":5,"canonical_ids":0,"results":[{"message_id":"0:1464161022787436%f6854ff1f9fd7ecd"}]} i want know devices not receive notification. this happens when registered device ids invalid , mismatched. first cross check device ids used notifications.

c# - DateTime format in ASP.NET Web API when passing complex object as a Query string -

i have method in mycontroller derived apicontroller: public async task myaction([fromuri] mydto input) mydto class: public class mydto { public string myprop { get; set; } public datetime mydate { get; set; } } the request uri http://server/api/myaction?myprop=value&mydate=22/04/2015 so want set parsing format datetime action or controller. something this: public class mydto { public string myprop { get; set; } [dateformat("dd/mm/yyyy")] public datetime mydate { get; set; } } how can achieve this? help!

c# - Missing form validation in MVC application -

i have form containing check boxes, , know can make each 1 required enforce validation errors. looking for, error if none of boxes has been checked. how go achieving this? i looking error message like: "you must select @ least 1 property." i should clarify none of fields required individually, there should @ least 1 chosen option. edit clarification: my view looks this: @using (html.beginform("method", "controller", formmethod.post, new {id = "id"})) { @html.antiforgerytoken() @html.validationsummary(true, "", new { @class = "text-danger" }) <div class="form-group"> @html.labelfor(model => model.property1, htmlattributes: new { @class = "control-label col-md-4" }) <div class="col-md-8"> @html.checkboxfor(model => model.property1) </div> </div> <div class="form-group"> @html.label

java - Eclipse J2EE "alt+shitf+z" didn't show the template i write -

Image
i wrote template this: it can change abc abd = function("abc") . when select parameter , press alt + shift + z doesn't appear. when select statement , press alt + shift + z appears. please give me advises on steps need take in order use template when press alt + shift + z . code templates reduce typing time inserting code editor. each code template given short literal. typing literal editor window , press ctrl + space brings dialog box code template associated literal can selected. so in case use template type val (or template name valuereplace ) , template show in list

User roles vs. user permissions using apache shiro -

i trying model complex permission management system using apache shiro. english not being native tongue afraid might missing of subtleties of terms such "roles", "permissions", "rights" & "privileges". for example lets want create system manages resources such printers located inside buildings. db holds information of printer located in building. users of system should able reset printer or print it. its clear me users "super admins" , able reset , print printer ('printer:*:*')- guess people have "super admin role". but if should allowed reset printers in specific building ('building:a:*') ? "building admin" (prarametric) role? or permission on specific building? how model using apache shiro? n.b. when tagging q added user-roles tag , says:"a user role group of users share same privileges or permissions on system. use tag questions how user roles work in particular security fr

plsql - send mail with existing file as attachments using oracle procedure -

declare attachments shr_pkg_send_mail.array_attachments:=shr_pkg_send_mail.array_attachments(); b_input_file bfile:= bfilename('mount_dir', 'test02.txt'); c_output_file clob; begin --dbms_output.put_line(c_output_file); dbms_lob.open(b_input_file, dbms_lob.lob_readonly); -- dbms_output.put_line('1'); dbms_lob.createtemporary(lob_loc => c_output_file, cache => false); --dbms_output.put_line('2'); dbms_lob.open(c_output_file, dbms_lob.lob_readwrite); --dbms_output.put_line('3'); dbms_lob.loadfromfile(c_output_file, b_input_file, dbms_lob.lobmaxsize); --dbms_output.put_line('4'); dbms_lob.close(b_input_file); --dbms_output.put_line('5'); attachments.extend(1); attachments(1).attach_name := 'test02.txt'; attachments(1).data_type := 'text/plain'; attachments(1).attach_content := c_output_file; shr_pkg_send_mail.send_mail('ethicsandcomplianceitsupport_org@dl.mgd.novartis.com',&#

oracle - How to use to_number and nullif in sql-loader? -

i've had similar problem dates (combination of to_date , nullif) here : how use decode in sql-loader? and solved nicely. my problem numeric field in csv file can have these formats : 999,999,999.99 or dot '.' null values. this working : minquantity "to_number(:minquantity, '9999999999d999999', 'nls_numeric_characters='',.''')" or minquantity nullif minquantity = '.' but not working when i'm trying combine both : minquantity "to_number(:minquantity, '9999999999d999999', 'nls_numeric_characters='',.''') nullif :minquantity= '.'" here error log : record 1: rejected - error on table my_table, column minquantity. ora-00917: missing comma how can combine these ? your nullif condition should not inside double-quotes sql string; , needs come first. the documentation : the sql string appears after other specifica

rx java - about Schedulers.newThread() -

public static void main(string[] args) { list<integer> list = arrays.aslist(1,2,3,4,5,6,7); observable.from(list) .map(new func1<integer, string>() { @override public string call(integer integer) { return string.format("%d ",integer); } }).subscribeon(schedulers.newthread()) .observeon(schedulers.newthread()) .subscribe(new action1<string>() { @override public void call(string s) { system.out.print(s); } }); } here's test when use rxjava. print nothing.i don't know why.anybody can give me help? thanks. rxjava standard schedulers daemon threads. when main() method exits, jvm quits , daemon threads stopped. place thread.sleep(5000) @ end of main() method , you'll see output printed. alternatively, apply .toblocking() before .

Create db2 dataSource in WAS liberty profile -

i developing websphere 8.5 (for z/os), use liberty local development on windows machine. can't data source work. i created following entry in server.xml define data source. <library id="db2jcc2lib"> <fileset dir="c:\program files\ibm\sqllib\java"/><!--includes="db2jcc.jar db2jcc_license_cu.jar db2jcc_license_cisuz.jar"--> </library> <datasource id="xxdb" jndiname="jdbc/xxxx" type="javax.sql.connectionpooldatasource"> <jdbcdriver libraryref="db2jcc2lib" id="db2-driver" javax.sql.connectionpooldatasource="com.ibm.db2.jcc.db2connectionpooldatasource"/> <properties.db2.jcc drivertype="2" databasename="xxxx" portnumber="50000" user="xxxx" password="{aes}xxxx"/> </datasource> when application initializes following error message: [jcc][4038][12241][3.61.65] t2luw exception: s

c# - (db) Add another syntax in WHERE/SET(UPDATE) part? -

overview: code student can sign courses want read. he should accepted 1 course, not more ( this got problem with ). although student can search 3 courses @ same time priority selection 1-3. if courses full students queue-index, starting 1 , up. once there's free spot in course( that's syntax below being used, looping each free spot in course ), student queue-index 1 hit 0 , he's accepted course. cmd.commandtext = "update [register] set queueindex = queueindex - 1, accepted = iif(queueindex = 1, 1, 0) queueindex > 0 , courseid = @cid;"; however don't know how improve syntax , implement checker in syntax if student accepted in other courses. if is, should not accepted( and set queue-index 0 he's no longer in queue, , accepted still false ) , check next student instead. don't know how improve syntax. in db-table, i'm using courseid , studentid , accepted(bool) , s

javascript - Swiper JQuery if statement involving .hasClass and .toggleClass -

without writing novel of backstory, using swiper , i'm trying call .toggleclass on html element, whenever 1 of swiper slides has class of swiper-slide-active . can have text appear on single slides, instead of slides @ same time. here visual of i'm describing: studioyonis.com — if click caption @ bottom project information comes up, drag rtl, you'll notice project information second project visible short time. disappears (correctly) because of other code have, l not appear @ (until click caption on slide). i've been trying if statement single out active slide , set subsequent click function, not working , can't figure out life of me. can jquery, reason, not see swiper-slide-active when happens? if ($('.swiper-slide').hasclass('swiper-slide-active')) { $('.overlay-caption', this).toggleclass('overlay-caption-active'); $('.overlay-caption-box', this).toggleclass('overlay-caption-box-active'); }; here s

amazon web services - Maximum no.of connections that can be held by s3 -

i learning amazon web services. want know maximum number of connections(roughly) can held amazon s3 simultaneously without crashing... theoretically infinite. achieve this, use partitioning scheme explain here: http://docs.aws.amazon.com/amazons3/latest/dev/request-rate-perf-considerations.html basically partition buckets on different servers based on first few characters of filename. if random, scale indefinitely (they take more characters partition on). if prepend files file_ or (so s3 cannot partition files correctly because files have same starting characters), limit 300 / sec or 100 put/delete/post per second. see page in-depth explanation.

aem - cq 6.0 How i can allow upload svg files to dam -

i using cq 6.0. how can allow upload svg files dam. when trying, this . found there , mime type svg image/svg+xml. tried add type adobe cq scene7 asset mime type service (from /system/console/configmgr), didn't help. error the following file has invalid extension or name contains illegal characters or spaces: mysvg.svg the file name should contain alphanumeric characters , dashes , underscores. jpg, jpeg, gif, png, bmp, swf, flv, avi, mp3, mp4, mov, wmv, mpg, mkv, xml, xlsx, pdf, ics - valid extensions. upd 6/8/2016 forbidden overridden dialogutils.js the extension valid , file's name doesn't contains illegal characters. way found obtain message, correct file, adding spaces end of field (after text "mysvg.svg", in "mysvg.svg ") before uploading it.

7zip - python extract uncompressed data from 7z-file -

i have several csv-files, of compressed others not, in 7z archive. want read csv files , save content in database. however, whenever py7zlib attemts read data csv file not compressed, error data error during decompression . import os import py7zlib scr = r'y:\pathtoarchive' z7file = 'archivename.7z' open(os.path.join(scr,z7file),'rb') f: archive = py7zlib.archive7z(f) names = archive.filenames mem in names: obj = archive.getmember(mem) print obj.compressed # prints none uncompressed data try: data = obj.read() except exception er: print er # prints data error during decompression # whenever obj.compressed none the error happens in file "c:\anaconda\lib\site-packages\py7zlib.py", line 608, in read data = getattr(self, decoder)(coder, data, level) file "c:\anaconda\lib\site-packages\py7zlib.py", line 671, in _read_lzma retu

cron - Shedule Push Notification using gcm and php to 80k and above users -

first check database table finding unsent message has been posted different users. , if available following code , run using cron job every 5 min. select * `jkeio_community_gcmusers`; //contain gcm users $i=0; while($data_apps=mysql_fetch_array($data_app)) { $message1=$i.'you have new item in akhbar'; sendnotificationandroid($data_apps['gcm_regid'],$message1); //send function sending push notification android , sends message via curl method $i++; } after sending message i’ll set unsent flag sent using update query all thing ok in concern 100 or 200 users when users increase messages delivering on time should can please suggest me how can achieve that thanks in advance anand neema gcm allows send notification 1000 device @ time, suggest refactoring method sendnotificationandroid accept array of gcm registration ids instead. for example, first go through database rows , collect reg ids , append them array. once array size

c# - avalonDock : how to align the tabs to the top right? -

Image
i creating dockingmanager avalondock in xaml file , can't figure out way align tabs creats on top right. on top left side. like : i have seen : how set avalondock dockablepane right in wpf not find "resizingpanel" under "dockingmanager" does knows how ? here sample of xaml : <grid> <avalondock:dockingmanager x:name="dockingmanager" margin="0,10,0,-10" documentssource="{binding files}" grid.row="0" > <avalondock:dockingmanager.layoutitemtemplateselector> <panel:paneltemplateselector> <panel:paneltemplateselector.fileviewtemplate> <datatemplate> <view:shooting/> </datatemplate> </panel:paneltemplateselector.fileviewtemplate> </panel:paneltemplateselector>

Git manage one project on different remotes with differences -

i have project runs on 5 different hosts because each customer has it's own. logic of application same each applicaion, css differs bit depending on customers brand colors , stuff that. now manually manage upload of right css file right remote host. there way setup settings can set specific files specific git remote? so want achieve can this git push remote companyx git push remote companyy and git or knows files push specific remote. i don't think should handle git. manage different css different host, can add code in application define environment (x or y) , base css choose on that. like if env == companyx stylesheet = x.css; else stylesheet = y.css`. otherwise, can use different branches (one per host) , use complex git-hooks, or use more complex system git submodule, not recommend :)

c++ - hbase thrift2 TGet.columns not working -

i want retrieve column family1:qualifier1,but columns in row '123' tget get; tcolumn tcolumn; tcolumn.family="family1"; tcolumn.qualifier="qualifier1"; //i want column family1:qualifier1 get.row = "123"; get.columns.push_back(tcolumn); tresult result; std::cout<<"family:" << get.columns[0].family << " qualifier:" << get.columns[0].qualifier <<" get.columns size:" << get.columns.size() << std::endl; transport->open(); client.get(result, "mytable", get); transport->close(); int columnsize = result.columnvalues.size(); // got columns in th row if (columnsize > 0) { for(int = 0;i < columnsize ; ++i){ std::string columnname = result.columnvalues[i].qualifier; std::string columnvalue = result.columnvalues[i].value; std::cout << "columnname: " << columnname << std::endl; std::cout << "columnvalue:

electronics - Thermocouple signal amplification using INA126P -

Image
i'm trying interface thermocouple microcontroller. thermocouple produces low voltage, use ina126p instrumentation amplifier amplify voltage. i'm using +5v v+ , gnd v- , vref=2.5v. but in datasheet says input common mode voltage 1.5v 3.5v (from graph). tried add offset thermocouple input. i've done in 2 ways: using op-amp , using voltage divider. here schematics (sorry, hand-drawn): may know if circuits correct? either circuit should work. divider 1 better error standpoint because offset voltage (from divider) common mode input amplifier, cancelled. errors 2 op-amps , associated resistors random, , not cancelled. first circuit more accurate. don't need 10k resistor on input, 1k's same function. , 1k's 10k, if want save current. you can better parts ina part. have used ad620 chip in past results. believe has better offset specs, important spec in thermocouple amplifier. also, pay close attention voltage levels regard rails.

python - Ordering dictionary values on Jinja2 template -

i using jinja2 template render information report. creating table showing max, total, avg_size , avg_rate types of events occuring on system. my code creates new row after every 6 entries, , prints data looks correct on closer inspection it's not printing data in correct order because i'm using 'if' statements. is there away can make key2=='max_count' first print it's value, key2 == 'total' , etc. the order want: max_count, total, avg_size, avg_rate here part of code causing issue: {% key2, value2 in max_min_data[key].iteritems() %} {% if count == 6 %} </tr> <tr> {% set count = 0 %} {% endif %} {% if key2 == 'max_count'%} <td style="text-align: center; width:3.1in;">{{ '{0:,}'.format(value2['max']) }}</td> {% endif %} {% if key2 == 'total'%} <td style="text-align: center; width:3.1in;">{{'{0:,}'.format(value2[&#