Thursday 15 May 2014

javascript google maps only one function works at once, rest not -



javascript google maps only one function works at once, rest not -

at start want tell don't have experience javascript. found script , alter want. seek load google map on 2 diffrent views (i work on codeigniter) 1 map load. when go sec view map dont display. heres code:

header:

<body onload='mapastart()' onunload='gunload()'>

first view:

<div id="domeeting" style="width: 400px; height: 400px;"> </div> <input type="hidden" id="lat" name="lat"/><br /><br /><br /> <input type="hidden" id="lng" name="lng"/><br /><br />

second view:

<div id="rejestracja" style="width: 400px; height: 400px;"> <!-- tu będzie mapa --> </div> <input type="hidden" id="lat" name="lat"/><br /><br /><br /> <input type="hidden" id="lng" name="lng"/><br /><br />

footer:

<script src="//code.jquery.com/jquery-1.10.2.js"></script> <script src="//code.jquery.com/ui/1.11.0/jquery-ui.js"></script> <!-- google maps --> <!-- rejestracji --> <script type='text/javascript'> <!-- var mapa; var marker; function mapastart() { if(gbrowseriscompatible()) { mapa = new gmap2(document.getelementbyid("rejestracja" || "domeeting")); mapa.setcenter(new glatlng(52.348763181988076, 18.61083984375), 6, g_hybrid_map); mapa.addcontrol(new glargemapcontrol()); mapa.addcontrol(new gmaptypecontrol()); marker = new gmarker(mapa.getcenter(),{icon: marker, draggable: true}); mapa.addoverlay(marker); // zdarzenia dla markera gevent.addlistener(marker,'drag',uaktualnijwspolrzedne); gevent.addlistener(marker,'click',function() { marker.openinfowindowhtml(marker.opis); }); gevent.trigger(marker,'drag'); // zdarzenia dla mapy gevent.addlistener(mapa,'click',function(o,p) { if(p) { marker.setpoint(p); uaktualnijwspolrzedne(); } }); } } function uaktualnijwspolrzedne() { var input_lat = document.getelementbyid('lat'); var input_lng = document.getelementbyid('lng'); var punkt = marker.getlatlng(); input_lat.value = punkt.lat(); input_lng.value = punkt.lng(); } </script> <!-- api google maps --> <script src='http://maps.google.com/maps?file=api&amp;v=2.x&amp;sensor=false&amp;key=abqiaaa aska3kydm631cgf6rw_grbbrbrxpdm9jp6g1mf9ylmfwuiyzt2 br5ltrn1m4mp2hliyywcc1aqlxz3a&hl=pl' type='text/javascript'></script>

and notice when type @ first rejestracja here:

mapa = new gmap2(document.getelementbyid("rejestracja" || "domeeting"));

map load in view "rejestracja" id in sec view id "domeeting" not. if reverse element opposite situation

in javascript, || can used "or" operator, or can used homecoming first non "falsy" value. in code:

mapa = new gmap2(document.getelementbyid("rejestracja" || "domeeting"));

the function phone call document.getelementid retrieve "rejestracja" because first value in status returns truthy value. (truthy means not false, null, undefined, 0, empty string or nan).

i not sure how google maps api works, if cannot take 2 dom elements, need store each map in own variable:

var map1 = new gmap2(document.getelementbyid("rejestracja")); var map2 = new gmap2(document.getelementbyid("domeeting"));

or extract code own function , pass in each dom element.

update: here illustration of mean - work if mapa variable not used outside of function initialized.

function mapastart() { if(gbrowseriscompatible()) { var map1 = new gmap2(document.getelementbyid("domeeting")); var map2 = new gmap2(document.getelementbyid("rejestracja")); initializemap(map1); initializemap(map2); } } function initializemap (mapa) { mapa.setcenter(new glatlng(52.348763181988076, 18.61083984375), 6, g_hybrid_map); mapa.addcontrol(new glargemapcontrol()); mapa.addcontrol(new gmaptypecontrol()); // remainder of original mapastart function goes here }

i hope helps!

javascript google-maps-api-2

Titanium audio player stops playing mp3 after a moment -



Titanium audio player stops playing mp3 after a moment -

in titanium ios app i'm using ti sound player:

var mp3url = "http://www.noiseaddicts.com/samples/47.mp3"; var audioplayer = ti.media.createaudioplayer({ url: mp3url, allowbackground: true });

i borrowed boilerplate code , using unchanged, aside minor ui tweaks: http://docs.appcelerator.com/titanium/latest/#!/api/titanium.media.audioplayer

when click play button, begins play clip (i can hear it, , it's correct), automatically stops split-second later. can replicate 100% of time , happens. not double-clicking button or anything. quick single click.

my total source code (excluding of ui stuff) sound piece here: http://pastie.org/9624811

i using titanium sdk 3.4.0 ga, targeting iphone 4s (v. 8.0) xcode 6.0.1.

this gets logged in output:

[info] : state: starting (1) [info] : state: waiting_for_data (2) [info] : state: unknown (9) [info] : state: waiting_for_queue (3) [info] : state: stopping (6) [info] : state: stopped (7) [info] : state: initialized (0)

any ideas?

the audioplayer has problem playing specific mp3 file. found titanium ticket that's been open long time.

https://jira.appcelerator.org/browse/timob-4992

i tried sample mp3 site , worked perfectly:

http://www.stephaniequinn.com/samples.htm

titanium titanium-mobile appcelerator appcelerator-mobile

Realtime data exchange between Android Wearable and Handheld -



Realtime data exchange between Android Wearable and Handheld -

i working on simple app run on both wearable(samsung gear live) , handheld(moto g). want display info wearable's heart rate sensor, accelerometer , gyroscope on handheld. best way accomplish this. using dataapi, since updating info each second, allocating much memory, , killed os. here service runs on wearable

public class sensordatalistener extends service implements sensoreventlistener, connectioncallbacks, onconnectionfailedlistener { private static final string tag = sensordatalistener.class.getsimplename(); private static final int timeout_heart_rate = 1000000; private static final int timeout_accelerometer = 1000000; private static final int timeout_gyroscope = 1000000; private static final string path_sensor_data = "/sensor_data"; private static final string key_heart_rate = "heart_rate"; private static final string key_acc_x = "acc_x"; private static final string key_acc_y = "acc_y"; private static final string key_acc_z = "acc_z"; private static final string key_gyro_x = "gyro_x"; private static final string key_gyro_y = "gyro_y"; private static final string key_gyro_z = "gyro_z"; private sensormanager msensormanager; private sensor maccelerometer; private sensor mgyroscope; private sensor mheartrate; private int mcurheartrateval; private float[] mcuraccelerometerval = new float[3]; private float[] mcurgyroscopeval = new float[3]; private googleapiclient mgoogleapiclient; scheduledexecutorservice mupdatescheduler; scheduledexecutorservice scheduler; @override public void oncreate() { super.oncreate(); mgoogleapiclient = new googleapiclient.builder(this) .addapi(com.google.android.gms.wearable.wearable.api) .build(); mgoogleapiclient.connect(); msensormanager = ((sensormanager)getsystemservice(sensor_service)); mheartrate = msensormanager.getdefaultsensor(sensor.type_heart_rate); maccelerometer = msensormanager.getdefaultsensor(sensor.type_accelerometer); mgyroscope = msensormanager.getdefaultsensor(sensor.type_gyroscope); startdataupdated(); } private void startdataupdated() { scheduler = executors.newsinglethreadscheduledexecutor(); scheduler.scheduleatfixedrate (new runnable() { public void run() { updatedata(); } }, 5, 3, timeunit.seconds); } private void updatedata() { putdatamaprequest datamap = putdatamaprequest.create(path_sensor_data); datamap.getdatamap().putint(key_heart_rate, mcurheartrateval); datamap.getdatamap().putfloat(key_acc_x, mcuraccelerometerval[0]); datamap.getdatamap().putfloat(key_acc_y, mcuraccelerometerval[1]); datamap.getdatamap().putfloat(key_acc_z, mcuraccelerometerval[2]); datamap.getdatamap().putfloat(key_gyro_x, mcurgyroscopeval[0]); datamap.getdatamap().putfloat(key_gyro_y, mcurgyroscopeval[1]); datamap.getdatamap().putfloat(key_gyro_z, mcurgyroscopeval[2]); putdatarequest request = datamap.asputdatarequest(); wearable.dataapi.putdataitem(mgoogleapiclient, request); } @override public int onstartcommand(intent intent, int flags, int startid) { msensormanager.registerlistener(this, mheartrate, timeout_heart_rate); msensormanager.registerlistener(this, maccelerometer, timeout_accelerometer); msensormanager.registerlistener(this, mgyroscope, timeout_gyroscope); homecoming start_not_sticky; } @override public void ondestroy() { log.d(tag, "ondestroy"); mgoogleapiclient.disconnect(); scheduler.shutdown(); msensormanager.unregisterlistener(this); //mupdatescheduler.shutdownnow(); super.ondestroy(); } @override public void onsensorchanged(sensorevent event) { switch(event.sensor.gettype()) { case sensor.type_heart_rate: if(event.values[0] <= 0) // hr sensor beingness initialized return; mcurheartrateval = float.valueof(event.values[0]).intvalue(); break; case sensor.type_accelerometer: mcuraccelerometerval[0] = event.values[0]; mcuraccelerometerval[1] = event.values[1]; mcuraccelerometerval[2] = event.values[2]; break; case sensor.type_gyroscope: { mcurgyroscopeval[0] = event.values[0]; mcurgyroscopeval[1] = event.values[1]; mcurgyroscopeval[2] = event.values[2]; break; } } } @override public void onaccuracychanged(sensor sensor, int accuracy) {} @override public void onconnected(bundle bundle) { log.d(tag, "onconnected"); } @override public void onconnectionsuspended(int i) { log.d(tag, "onconnectionsuspended"); } @override public void onconnectionfailed(connectionresult connectionresult) { log.d(tag, "onconnectionfailed"); } @override public ibinder onbind(intent intent) { homecoming null; } }

try using message api instead of info api. create message containing info , send on other device : http://developer.android.com/reference/com/google/android/gms/wearable/messageapi.html

android-wear android-wear-data-api

compiler construction - Is there a limit to the number of arguments passed to a fortran function? -



compiler construction - Is there a limit to the number of arguments passed to a fortran function? -

i came across fortran 90 code 68 arguments passed function. upon searching web found limit of passing 256 bytes cuda fortran related stuff (http://www.pgroup.com/userforum/viewtopic.php?t=2235&sid=f241ca3fd406ef89d0ba08a361acd962).

so wonder: there limit number of arguments may passed function intel/visual/gnu fortran compilers?

i came across give-and-take of fortran 90 standards:

http://www.nag.co.uk/sc22wg5/guidelines_for_bindings-b.html

the relevant section in italics below:

3.4 statements

constraints on length of fortran statement impose upper limit on length of procedure call. although unlikely serious imposition, single fortran statement in free-form format subject upper limit of 5241 characters, including possible label (f90 sections 3.3.1, 3.3.1.4); in fixed-form format upper limit 1320 characters plus possible label (f90 section 3.3.2). these limits subject characters beingness of "default kind", in practice single-byte characters; double-byte characters, used illustration ideographic languages, limits processor-dependent of same order of size.

there no limit in fortran standard on maximum number of arguments procedure.

i have security tool developing in research analyzes binaries. knew c language has limits on number of arguments (31 in c90 standard, 127 in c99 standard), thought dimension vector hold 128 items pertaining incoming arguments. encountered fortran-derived binary had 290 arguments passed, led me discussion. binary spec cpu2006 benchmark suite, benchmark 481.wrf, see procedure named (in binary) "solve_interface_" sets 290 arguments on stack , calls "solve_em_" processes these arguments. can no uncertainty find fortran source code these procedures online. binary produced gnu compiler tools x86/linux/elf system.

function compiler-construction arguments fortran limit

Java: Hashtable stores multiple items with same hash in one bucket -



Java: Hashtable stores multiple items with same hash in one bucket -

problem description

while reading oracle documentation hashtable found "in case of "hash collision", single bucket stores multiple entries, must searched sequentially", seek find method homecoming me items sequentially, if have 2 items same hash, can't find in documentation. in order reproduce situation seek write simple code, can find below.

oracle documentation hashtable

an instance of hashtable has 2 parameters impact performance: initial capacity , load factor. capacity number of buckets in hash table, , initial capacity capacity @ time hash table created. note hash table open: in case of "hash collision", single bucket stores multiple entries, must searched sequentially. load factor measure of how total hash table allowed before capacity automatically increased. initial capacity , load factor parameters simply hints implementation. exact details when , whether rehash method invoked implementation-dependent.

simple code class key { public final int mid; public key(int id) { mid = id; } @override public int hashcode() { if(mid == 1 || mid == 2) { system.out.println("have same hashcode()"); homecoming 5673654; } homecoming super.hashcode(); } }; public class hashtabletest { public static void main(string... args) { hashtable<key, string> dict = new hashtable<key, string>(); dict.put(new key(1), "one"); dict.put(new key(2), "two"); system.out.println(dict.size()); // prints 2 system.out.println(dict.get(new key(1))); // prints null } };

in code above seek add together hashtable 2 items have same hashcode (anyway think have :) ), create key class , override it's hashcode method, useless can't item hashtable , think items not added sequentially.

questions how can simulate situation of stores multiple entries in 1 bucket? (in order more understand how work) how can access items in hashtable stored sequentially?

the hashtable (and hashmap) implement collision resolution storing multiple keys map same bucket number.

however, need override equals method in key. hashtable (or hashmap) find key exists in map, hash codes used find bucket, equals used distinguish distinct keys in same bucket. because aren't overriding equals, key inherits equals object, determines if 2 objects same object, not whether contents equal.

the equals method class object implements discriminating possible equivalence relation on objects; is, non-null reference values x , y, method returns true if , if x , y refer same object (x == y has value true).

note necessary override hashcode method whenever method overridden, maintain general contract hashcode method, states equal objects must have equal hash codes.

java hashtable

Update a sg to add port from existing sg using boto.authorize -



Update a sg to add port from existing sg using boto.authorize -

i trying update security grouping add together port other security group. ex: sg.authorize('tcp', 22, 22, sg-123456)

but getting below error

sg.authorize('sg-abcdef', 'tcp', 22, 22, 'sg-123456') file "/usr/local/lib/python2.7/site-packages/boto/ec2/securitygroup.py", line 187, in authorize src_group_owner_id = src_group.owner_id attributeerror: 'str' object has no attribute 'owner_id'

if want utilize authorize method of securitygroup object have pass in securitygroup object representing source security group. appear passing in string containing id of security group.

you utilize authorize_security_group method of ec2connection object. take string value source security group:

ec2.authorize_security_group(group_id='sg-abcdef', ip_protocol='tcp', from_port=22, to_port=22, src_security_group_group_id='sg-123456', src_security_group_owner_id='123456789012')

boto

javafx - resizable and movable rectangle -



javafx - resizable and movable rectangle -

with next code (thanks several posts here), draw rectangle, want resizable , movable. 2 anchors (the upper left , lower right) want, , lastly 1 (lower middle) moves rectangle, 2 first anchors not follow rectangle.

when create them move, listener of them, resizes rectangle.

package application; import javafx.application.application; import javafx.beans.property.doubleproperty; import javafx.beans.property.simpledoubleproperty; import javafx.beans.value.changelistener; import javafx.beans.value.observablevalue; import javafx.collections.fxcollections; import javafx.collections.observablelist; import javafx.event.eventhandler; import javafx.scene.cursor; import javafx.scene.group; import javafx.scene.scene; import javafx.scene.input.mouseevent; import javafx.scene.paint.color; import javafx.scene.shape.circle; import javafx.scene.shape.rectangle; import javafx.scene.shape.shape; import javafx.scene.shape.stroketype; import javafx.stage.stage; import javafx.stage.stagestyle; public class main extends application { private rectangle rectangle; private grouping group; private scene scene; private stage primarystage; private observablelist<double> coins; public static void main(string[] args) { application.launch(args); } @override public void start(stage primarystage) { grouping = new group(); rectangle = new rectangle(200,200,400,300); coins = fxcollections.observablearraylist(); //upperleft coins.add(rectangle.getx()); coins.add(rectangle.gety()); //lowerright coins.add(rectangle.getx() + rectangle.getwidth()); coins.add(rectangle.gety()+ rectangle.getheight()); //moving coins.add(rectangle.getx() + (rectangle.getwidth()/2)); coins.add(rectangle.gety()+ (rectangle.getheight())); group.getchildren().addall(createcontrolanchorsfor(coins)); group.getchildren().add(rectangle); scene = new scene(group,800,800); primarystage.setscene(scene); primarystage.show(); } //@return list of anchors can dragged around modify points in format [x1, y1, x2, y2...] private observablelist<anchor> createcontrolanchorsfor(final observablelist<double> points) { observablelist<anchor> anchors = fxcollections.observablearraylist(); //coin gauchehaut doubleproperty xproperty = new simpledoubleproperty(points.get(0)); doubleproperty yproperty = new simpledoubleproperty(points.get(1)); xproperty.addlistener(new changelistener<number>() { @override public void changed(observablevalue<? extends number> ov, number oldx, number x) { system.out.println(oldx + " et " + x); rectangle.setx((double) x); rectangle.setwidth((double) rectangle.getwidth() -((double) x- (double) oldx)); anchors.get(2).setcenterx((double) x + rectangle.getwidth()/2 ); } }); yproperty.addlistener(new changelistener<number>() { @override public void changed(observablevalue<? extends number> ov, number oldy, number y) { rectangle.sety((double) y); rectangle.setheight((double) rectangle.getheight() -((double) y- (double) oldy)); } }); anchors.add(new anchor(color.gold, xproperty, yproperty)); //coin droitebas doubleproperty xproperty2 = new simpledoubleproperty(points.get(2)); doubleproperty yproperty2 = new simpledoubleproperty(points.get(3)); xproperty2.addlistener(new changelistener<number>() { @override public void changed(observablevalue<? extends number> ov, number oldx, number x) { rectangle.setwidth((double) rectangle.getwidth() -((double) oldx- (double) x)); anchors.get(2).setcenterx((double) x - rectangle.getwidth()/2 ); } }); yproperty2.addlistener(new changelistener<number>() { @override public void changed(observablevalue<? extends number> ov, number oldy, number y) { rectangle.setheight((double) rectangle.getheight() -((double) oldy- (double) y)); anchors.get(2).setcentery((double) y); } }); anchors.add(new anchor(color.gold, xproperty2, yproperty2)); //moving doubleproperty xpropertym = new simpledoubleproperty(points.get(4)); doubleproperty ypropertym = new simpledoubleproperty(points.get(5)); xpropertym.addlistener(new changelistener<number>() { @override public void changed(observablevalue<? extends number> ov, number oldx, number x) { rectangle.setx((double) x - rectangle.getwidth()/2 ); //anchors.get(0).setcenterx((double) x- rectangle.getwidth()/2); //anchors.get(0).setvisible(false); } }); ypropertym.addlistener(new changelistener<number>() { @override public void changed(observablevalue<? extends number> ov, number oldy, number y) { rectangle.sety((double) y - rectangle.getheight() ); coins.set(1, (double) y); } }); anchors.add(new anchor(color.gold, xpropertym, ypropertym)); homecoming anchors; } //a draggable anchor displayed around point. class anchor extends circle { private final doubleproperty x, y; anchor(color color, doubleproperty x, doubleproperty y) { super(x.get(), y.get(), 20); setfill(color.derivecolor(1, 1, 1, 0.5)); setstroke(color); setstrokewidth(2); setstroketype(stroketype.outside); this.x = x; this.y = y; x.bind(centerxproperty()); y.bind(centeryproperty()); enabledrag(); } //make node movable dragging around mouse. private void enabledrag() { final delta dragdelta = new delta(); setonmousepressed(new eventhandler<mouseevent>() { @override public void handle(mouseevent mouseevent) { // record delta distance drag , drop operation. dragdelta.x = getcenterx() - mouseevent.getx(); dragdelta.y = getcentery() - mouseevent.gety(); getscene().setcursor(cursor.move); } }); setonmousereleased(new eventhandler<mouseevent>() { @override public void handle(mouseevent mouseevent) { getscene().setcursor(cursor.hand); } }); setonmousedragged(new eventhandler<mouseevent>() { @override public void handle(mouseevent mouseevent) { double newx = mouseevent.getx() + dragdelta.x; if (newx > 0 && newx < getscene().getwidth()) { setcenterx(newx); } double newy = mouseevent.gety() + dragdelta.y; if (newy > 0 && newy < getscene().getheight()) { setcentery(newy); } //recompute screen; group.getchildren().add(rectangle); scene = new scene(group,800,800);; primarystage.setscene(scene); } }); setonmouseentered(new eventhandler<mouseevent>() { @override public void handle(mouseevent mouseevent) { if (!mouseevent.isprimarybuttondown()) { getscene().setcursor(cursor.hand); } } }); setonmouseexited(new eventhandler<mouseevent>() { @override public void handle(mouseevent mouseevent) { if (!mouseevent.isprimarybuttondown()) { getscene().setcursor(cursor.default); } } }); } //records relative x , y co-ordinates. private class delta { double x, y; } } }

any idea, , should add together ?

since "handles" in same position relative rectangle, bind position position of rectangle. can accomplish

circle.centerxproperty().bind(...); circle.centeryproperty().bind(...);

where argument observablevalue<number>.

then in dragging handlers, move rectangle required (the computations complex not bad). since positions of circles bound, follow rectangle.

here's 1 possible implementation uses strategy:

import java.util.arrays; import javafx.application.application; import javafx.geometry.point2d; import javafx.scene.cursor; import javafx.scene.scene; import javafx.scene.layout.pane; import javafx.scene.paint.color; import javafx.scene.shape.circle; import javafx.scene.shape.rectangle; import javafx.stage.stage; public class draggingrectangle extends application { public static void main(string[] args) { application.launch(args); } @override public void start(stage primarystage) { pane root = new pane(); rectangle rect = createdraggablerectangle(200, 200, 400, 300); rect.setfill(color.navy); root.getchildren().add(rect); scene scene = new scene(root, 800, 800); primarystage.setscene(scene); primarystage.show(); } private rectangle createdraggablerectangle(double x, double y, double width, double height) { final double handleradius = 10 ; rectangle rect = new rectangle(x, y, width, height); // top left resize handle: circle resizehandlenw = new circle(handleradius, color.gold); // bind top left corner of rectangle: resizehandlenw.centerxproperty().bind(rect.xproperty()); resizehandlenw.centeryproperty().bind(rect.yproperty()); // bottom right resize handle: circle resizehandlese = new circle(handleradius, color.gold); // bind bottom right corner of rectangle: resizehandlese.centerxproperty().bind(rect.xproperty().add(rect.widthproperty())); resizehandlese.centeryproperty().bind(rect.yproperty().add(rect.heightproperty())); // move handle: circle movehandle = new circle(handleradius, color.gold); // bind bottom center of rectangle: movehandle.centerxproperty().bind(rect.xproperty().add(rect.widthproperty().divide(2))); movehandle.centeryproperty().bind(rect.yproperty().add(rect.heightproperty())); // forcefulness circles live in same parent rectangle: rect.parentproperty().addlistener((obs, oldparent, newparent) -> { (circle c : arrays.aslist(resizehandlenw, resizehandlese, movehandle)) { pane currentparent = (pane)c.getparent(); if (currentparent != null) { currentparent.getchildren().remove(c); } ((pane)newparent).getchildren().add(c); } }); wrapper<point2d> mouselocation = new wrapper<>(); setupdragging(resizehandlenw, mouselocation) ; setupdragging(resizehandlese, mouselocation) ; setupdragging(movehandle, mouselocation) ; resizehandlenw.setonmousedragged(event -> { if (mouselocation.value != null) { double deltax = event.getscenex() - mouselocation.value.getx(); double deltay = event.getsceney() - mouselocation.value.gety(); double newx = rect.getx() + deltax ; if (newx >= handleradius && newx <= rect.getx() + rect.getwidth() - handleradius) { rect.setx(newx); rect.setwidth(rect.getwidth() - deltax); } double newy = rect.gety() + deltay ; if (newy >= handleradius && newy <= rect.gety() + rect.getheight() - handleradius) { rect.sety(newy); rect.setheight(rect.getheight() - deltay); } mouselocation.value = new point2d(event.getscenex(), event.getsceney()); } }); resizehandlese.setonmousedragged(event -> { if (mouselocation.value != null) { double deltax = event.getscenex() - mouselocation.value.getx(); double deltay = event.getsceney() - mouselocation.value.gety(); double newmaxx = rect.getx() + rect.getwidth() + deltax ; if (newmaxx >= rect.getx() && newmaxx <= rect.getparent().getboundsinlocal().getwidth() - handleradius) { rect.setwidth(rect.getwidth() + deltax); } double newmaxy = rect.gety() + rect.getheight() + deltay ; if (newmaxy >= rect.gety() && newmaxy <= rect.getparent().getboundsinlocal().getheight() - handleradius) { rect.setheight(rect.getheight() + deltay); } mouselocation.value = new point2d(event.getscenex(), event.getsceney()); } }); movehandle.setonmousedragged(event -> { if (mouselocation.value != null) { double deltax = event.getscenex() - mouselocation.value.getx(); double deltay = event.getsceney() - mouselocation.value.gety(); double newx = rect.getx() + deltax ; double newmaxx = newx + rect.getwidth(); if (newx >= handleradius && newmaxx <= rect.getparent().getboundsinlocal().getwidth() - handleradius) { rect.setx(newx); } double newy = rect.gety() + deltay ; double newmaxy = newy + rect.getheight(); if (newy >= handleradius && newmaxy <= rect.getparent().getboundsinlocal().getheight() - handleradius) { rect.sety(newy); } mouselocation.value = new point2d(event.getscenex(), event.getsceney()); } }); homecoming rect ; } private void setupdragging(circle circle, wrapper<point2d> mouselocation) { circle.setondragdetected(event -> { circle.getparent().setcursor(cursor.closed_hand); mouselocation.value = new point2d(event.getscenex(), event.getsceney()); }); circle.setonmousereleased(event -> { circle.getparent().setcursor(cursor.default); mouselocation.value = null ; }); } static class wrapper<t> { t value ; } }

javafx anchor rectangles

Having issues making a simple script in powershell run windows media player in the background -



Having issues making a simple script in powershell run windows media player in the background -

i trying simple script want portion of script run in background. want run windows media player in background. brand new powershell , scripting in general, having whole day , half under belt. can help me out , explain in basic terms how start job works invoke-item. give thanks help can provide.

here original script. wanted launch powerpoint , have media player come little after got load. realize in powerpoint, using seek , learn. got work:

#call ssd $musicpath = "c:\powershell\windows_exclamation.wav" $powerpoint = "c:\powershell\ssd.ppsx" invoke-item $powerpoint start-sleep -s 3 invoke-item $musicpath

i wanted media player run in background. here script far:

#call ssd $musicpath = "c:\powershell\windows_exclamation.wav" $powerpoint = "c:\powershell\ssd.pptx" invoke-item $powerpoint start-sleep -s 3 start-job -scriptblock {invoke-item} $musicpath

should using invoke-command or lost in sauce here?

i'd utilize media.soundplayer object.

$musicpath = "c:\windows\media\windows exclamation.wav" function playwav($path){(new-object media.soundplayer "$path").play();} playwav -path "$musicpath"

powershell windows-media-player

Is the IMAP UID always numeric? -



Is the IMAP UID always numeric? -

is imap uid guaranteed numeric? i've read part in rfc3501 , says:

unique identifiers assigned in strictly ascending fashion in mailbox; each message added mailbox assigned higher uid message(s) added previously.

but uid has pre- or postfix? example, uid mail_14 , next msg mail_15?

answer: imap uid unique nonzero integer.

you might want read part in rfc3501 defines uid:

uniqueid = nz-number ; strictly ascending

page 91.

imap

How i can replace string in java for rewrite the sequence -



How i can replace string in java for rewrite the sequence -

hi trying practice in java, found difficulties on it. code:

import java.util.regex.; import java.util.;

public class mypracticestring { public static void main(string[] args) { string dnasequence; scanner in=new scanner(system.in); system.out.println("please input sequence of dna: "); string dnainput=in.nextline(); if (dnainput.matches("[atcg]+$")) { dnasequence=dnainput; int [] count=new int[4]; if (dnasequence!=null) { (int i=0; i<dnasequence.length(); i++) { switch(dnasequence.charat(i)) { case 'a': count[0]++; break; case 't': count[1]++; break; case 'c': count[2]++; break; case 'g': count[3]++; break; default: system.out.println("sorry have invalid type deoxyribonucleic acid sequence"); } } system.out.println("now : a"+count[0]); system.out.println("now : t"+count[1]); system.out.println("now : c"+count[2]); system.out.println("now : g"+count[3]); /* pattern p=pattern.compile("a"); matcher m=p.matcher(dnasequence); int j=0; while(m.find()) j++; system.out.println(j); */ } } else { system.out.println("the sequence should contain atcg"); } } }

let's input aaatattttgggcc , how can compressed a3tat4g3c2 , process should follow , how ii can decompress again. how can aaatattttgggcc 1 time again

you implement decompress own.

import java.util.scanner; public class compressdecompress { public static void main(string[] args) { scanner in=new scanner(system.in); system.out.println("please input sequence of dna: "); string dnainput=in.nextline(); system.out.println("enter e encrypt or come in d decrypt"); string function=in.nextline(); if("e".equalsignorecase(function)){ system.out.println(compress(dnainput) ); }else if("d".equalsignorecase(function)){ system.out.println(decompress(dnainput) ); }else{ system.out.println("invalid input"); } } private static string compress(string tocompress){ stringbuilder compressedsb = new stringbuilder(); char tempchar=' '; (int i=0,counter=1;i<tocompress.length();i++){ if(tempchar!=tocompress.charat(i)){ tempchar=tocompress.charat(i); compressedsb.append(tempchar); if(counter>1){ compressedsb.append(counter); counter=1; } }else{ counter++; } if (i==tocompress.length()-1){ compressedsb.append(counter); } } homecoming compressedsb.tostring(); } private static string decompress(string todecompress){ homecoming null; } }

and of course of study add together validation using regex or case 'atcg'

java string

javascript - Create a custom selected list -



javascript - Create a custom selected list -

well im adding database records dont way did , wanted create way easier user , better.

what did was: http://i.imgur.com/ayrpycn.jpg

and want is: http://i.imgur.com/aknbtto.jpg

well guess know how create divs geting images database , horizontal scroll bar dont know when select image id image appear on input create me.

help needed.

code have:

<select name="id_artigo" id="attribute119"> <?php { ?> <option value="<?php echo $row_artigos['id_artigo']?>" ><?php echo $row_artigos['id_artigo']?></option> <?php } while ($row_artigos = mysql_fetch_assoc($artigos)); ?> </select> <div id="editimg"><p><img src="images/artigos/1.png" id="main" /></p></div>

js:

$('#attribute119').change(function () { $('#main').attr('src', 'images/artigos/' + $('#attribute119 :selected').text() + '.png'); });

since don't want drop-down more, replace drop-down hidden field, hold id of item select:

<input type="hidden" name="id_artigo" />

(for testing utilize type="text" instead)

give each of images data-id-artigo attribute:

<img class="artigo_img" src="images/artigos/1.png" data-id-artigo="1">

when image clicked, update hidden id's value:

$('.artigo_img').on('click', function() { var idartigo = $(this).data('idartigo'); // artigo id `data-` attribute $('[name="id_artigo"]').val(idartigo); // update value of hidden field });

when form submitted, id_artigo equal selected item, before.

javascript php mysql select

php - Dynamic Array Name in Foreach Loop? -



php - Dynamic Array Name in Foreach Loop? -

i have page several links such grade.php?item=kindergarten, item values different. goal have detail pages each class.

on target page, detail page, i'm using foreach loop, can't work dynamically.

<?php foreach ($classprojects $grade => $item) { ?> <li><?php echo $item[image]; ?><a href="grade.php?item=<?php echo $grade; ?>"><?php echo $item[title]; ?></a><br /><p><?php echo $item[sentence]; ?></p><br /><a href="grade.php?item=<?php echo $grade; ?>">more &rsaquo;&rsaquo;</a></li> < } ?>

as long $classprojects used, details listed correctly, there different details depending on item name. have separate arrays each class. attempts @ making array name dynamic have not worked.... when able echo right string.... , alter it's type array.

perhaps i'm approaching wrong way? improve off modifying array include layer of depth, rather trying capture item value , have dynamically name array in foreach loop?

i utilize example. thanks!

@darylgill additional information:

the contents of array working (this 1 of 6 arrays set same way)

$kinderprojects = array(

array( title => "fall leaves", blurb => "our kinders have enjoyed learning difference between warm colors (yellow, orange, red) , cool colors (green, blue, violet) , putting knowledge utilize painting fall leaves in watercolor , oil pastel. reviewing utilize of visual fine art elements of line , shape.", image => "<img src='images/pic3.jpg' class='img-thumbnail pull-left' width='200' height='150' border='0'>" ), array( title => "francis", blurb => "francis knows stuff. big sis of frankie himself, runs show. don't miss margherita mondays!", image => "<img src='images/pic3.jpg' class='img-thumbnail pull-left' width='200' height='150' border='0'>" ), array( title => "carlos", blurb => "carlos epitome of phrase &ldquo;don't justice book it's cover&rdquo; &mdash; cannot find improve chef.", image => "<img src='images/pic3.jpg' class='img-thumbnail pull-left' width='200' height='150' border='0'>" ), ); your expected results

that selecting each link on prior page direct users detail page specific grade level (i.e., pull right array grade).

what info required expected results

the foreach loop on details page can't have hardwired pointer specific array, or 6 links go data. needs capture item value that's passed in url. thinking way create variable dynamically update array name in foreach loop.

<?php foreach ($classprojects $grade => $item) { ?>

if $classprojects dynamically update '$kinderprojects' when kindergarden link clicked, pull right info array.

you can request info based on parameter , assign array you're looping through.

for example:

$data_array_one = array( array( title => "fall leaves", blurb => "our kinders have enjoyed learning difference between warm colors (yellow, orange, red) , cool colors (green, blue, violet) , putting knowledge utilize painting fall leaves in watercolor , oil pastel. reviewing utilize of visual fine art elements of line , shape.", image => "<img src='images/pic3.jpg' class='img-thumbnail pull-left' width='200' height='150' border='0'>" ), array( title => "francis", blurb => "francis knows stuff. big sis of frankie himself, runs show. don't miss margherita mondays!", image => "<img src='images/pic3.jpg' class='img-thumbnail pull-left' width='200' height='150' border='0'>" ) ); $data_array_two = array( array( title => "fall leaves", blurb => "our kinders have enjoyed learning difference between warm colors (yellow, orange, red) , cool colors (green, blue, violet) , putting knowledge utilize painting fall leaves in watercolor , oil pastel. reviewing utilize of visual fine art elements of line , shape.", image => "<img src='images/pic3.jpg' class='img-thumbnail pull-left' width='200' height='150' border='0'>" ), array( title => "francis", blurb => "francis knows stuff. big sis of frankie himself, runs show. don't miss margherita mondays!", image => "<img src='images/pic3.jpg' class='img-thumbnail pull-left' width='200' height='150' border='0'>" ) ); switch ($_get['item']) { case 'kindergarten': $classproject = $data_array_one; break; case 'tiergarten': $classproject = $data_array_two; break; default: // define default info here $classproject = array(); break; } foreach ($classprojects $grade => $item) { echo '<li>'. $item['image'] .'<a href="grade.php?item='. $grade .'">'. $item['title'] .'</a><br /><p>'. $item['sentence'] .'</p><br /><a href="grade.php?item='. $grade .'">more &rsaquo;&rsaquo;</a></li>'; }

php arrays foreach

python - letter count up algorithm -



python - letter count up algorithm -

first have german, sorry mistakes. here problem:

i have copied algorithm:

letters = list("123456") current in xrange(10): = [i in letters] y in xrange(current): = [x+i in letters x in a] = a[startpoint:] password in a: print password

from reply this: python brute forcefulness algorithm , want utilize algorithm seek out password against amateur brute-force. know there tests in net want create own test.

i finished brute-force-programm, found out algorithm generates 3 letters. 3 letters worked this:

aa, ba, ca, da, ea, fa, usw.

after possibilitys 2 letters trys this:

aaa, baa, caa, daa, eaa, faa, usw.

but if finished 3 letters, begin 2 letters again! why?

i don't realy understand algorithm do, know infinite formula , called recursion formula. understand tryed out this:

letters = list("123456") = [x+i in letters y+x in letters y in letters]

but producing "can't assign operator" error in other forum reply. based on tried out this:

letters = list("123456") = [x+i in letters y+x x in letters y in letters]

but syntax error. whats wrong code? , means "cant assign opperator" error, assign value opperator?

if want products of set utilize itertools product

import itertools min_pw_len,max_pw_len = 4,5 letters = list("123456") my_password = "1122" my_len in range(min_pw_len,max_pw_len): guess in itertools.product(letters,repeat=my_len): if "".join(guess) == my_password: print "found:",guess

as actual question syntax error

a = [x+i in letters y+x x in letters y in letters] ^this problem ... cannot (im not exclusively sure trying do)

im guessign want like

a2 = (x+y x in letters y in letters) #note generator not list a3 = (x+y x in a2 y in letters) a4 = (x+y x in a3 y in letters) ...

python algorithm for-loop brute-force

Is nexus able to provide artifacts of not configured repositories? -



Is nexus able to provide artifacts of not configured repositories? -

i using nexus on our companies build server proxy. developers add together new dependencies projects without telling me. hence, list of proxy repositories not in sync required. result, jobs in our jenkins build server fail because of missing artificats. jenkins configured utilize nexus proxy repositories.

is possible tell nexus download artifacts original repository if not found in proxied ones?

i assume mean developers add together repository entries maven pom file farther dependencies and/or modify settings.xml.

on other hand ci server configured nexus mirrorof *.

there no automatic add-on of repositories based on setup. can 2 things imho

create scripts using nexus rest api

or educate developers tell add together proxy repos nexus

potentially can utilize maven enforcer rule disallow repositories in pom , set explicit message , allow them create proxy repositories in nexus. dont forget have them added grouping using on ci server.

nexus

model binding - Issues with Laravel 5's Route::bind() -



model binding - Issues with Laravel 5's Route::bind() -

i'm having little problem trying out laravel 5.

i followed whole tutorial in laracasts , tried same exact way there, changed name of model, table , controller.

at point route::bind() stopped working , because of that, when seek access route wild card, view come up, without data.

this routes.php

route::bind('singers', function($slug, $route){ homecoming app\singer::whereslug($slug)->first(); }); route::resource('singers', 'singercontroller', [ 'names' => [ 'index' => 'singers_index', 'show' => 'singers_show', 'edit' => 'singers_edit', 'update' => 'singers_update', 'create' => 'singers_create', 'store' => 'singers_store', 'destroy' => 'singers_destroy', ], ]);

these snippets of singercontroller

namespace app\http\controllers; utilize illuminate\routing\controller; utilize illuminate\http\request; utilize app\http\requests\createsingerrequest; utilize app\singer; class singercontroller extends controller { public $restful = true; public function __construct(singer $singer){ $this->singer = $singer; } public function index() { $singers = $this->singer->orderby('id', 'desc')->get(); homecoming view('singers.list',compact('singers')); } public function show(singer $singer){ homecoming view('singers.show', compact('singer')); } public function edit(singer $singer){ homecoming view('singers.edit', compact('singer')); } public function update(singer $singer, request $request){ $singer->fill($request->input()); $singer->save(); homecoming view('singers.show', compact('singer')); } public function create(){ homecoming view('singers.new'); } public function store(singer $singer, createsingerrequest $request){ $singer->create($request->all()); homecoming redirect()->route('singers_index'); } public function destroy(singer $singer){ $singer->delete(); homecoming redirect()->route('singers_index'); } }

now. reason seek bind variable 'singers' in routes.php, because in videos, , way, code in controller shorter. , working. , added destroy function , stopped working. said, can see views, tags, , other text in them, not info pass, except index function, since eloquent search in function itself.

now here's snippet of show.blade.php

<b>full name: </b> {{ $singer->name.' '.$singer->lastname }} <br> <b>age: </b> {{ $singer->age }} <br> <b>country: </b> {{ $singer->country }} <br> <br> <p> <b>bio: </b> {!! nl2br($singer->bio) !!} </p> {!! html::linkroute('singers_edit', 'update', [$singer->slug], ['class' => 'btn btn-primary']) !!} {!! form::open(['method'=>'delete', 'route'=>['singers_destroy', $singer->slug]]) !!} <div class="form-group"> {!! form::submit('delete', ['class'=>'btn btn-danger']) !!} </div> {!! form::close() !!}

my index view works fine, , other views forms, view i'm passing variables isn't working, whether pass doing this:

return view('singers.show',compact('singer'));

or this:

return view('singers.show')->with('singer',$singer);

so recap:

index -> fine. show -> won't show data. create -> works , new record saved. edit -> error comes because wildcard isn't sent controller.

edit

paths

index (get): /singers show (get): /singers/{singers} create (get): /singers/create store (post): /singers edit (get): /singers/{singers}/edit update (patch): /singers/{singers} destroy (delete): /singers/{singers}

keep in mind {singers} wildcard $singer->slug in each case, route::bind() function doesn't allow me phone call whatever want. , of course of study before first slash comes myserver/myproject/public

i've tested it.

singer model:

<?php namespace app; utilize illuminate\database\eloquent\model; class singer extends model { }

singercontroller - exact code provided (this file placed of course of study in app\http\controllers path.

in routes.php :

route::bind('singers', function($slug, $route){ homecoming app\singer::whereslug($slug)->first(); }); route::resource('singers', 'app\http\controllers\singercontroller', [ 'names' => [ 'index' => 'singers_index', 'show' => 'singers_show', 'edit' => 'singers_edit', 'update' => 'singers_update', 'create' => 'singers_create', 'store' => 'singers_store', 'destroy' => 'singers_destroy', ], ]);

as see i've added here total namespace path: 'app\http\controllers\singercontroller' , not singercontroller.

i'ce created simple singer table, fields id , slug - test (so have 2 columns) , added 2 records:

id slug 1 abc 2 def

views i've created:

list.blade.php:

@foreach ($singers $s) {{ $s->slug }}<br /> @endforeach

edit.blade.php , show.blade.php (exact same code):

{{ $singer->slug }} {{ $singer->id }}

now when run:

http://testpro/singers result:

def abc

as expected.

when run:

http://testpro/singers/abc/edit

i get:

abc 1

as expected.

and when run:

http://testpro/singers/def

i get:

def 2

as expected.

everything seems work fine here. create sure using way showed , should work without problem

laravel model-binding blade laravel-routing laravel-5

javascript - How do I get the key value when retrieving local storage -



javascript - How do I get the key value when retrieving local storage -

i using html5 , local storage set / retrieve key/value pairs.

to set value:

localstorage.setitem("003o000000btrxz", "myvalue");

then utilized function loop through stored items

for(var = 0; < localstorage.length; i++) { var obj = localstorage.getitem(localstorage.key(i)); alert(obj); }

the result "myvalue" , "003o000000btrxz".

what proper syntax this?

use localstorage.key(i) key:

for (var = 0; < localstorage.length; i++) { var key = localstorage.key(i); var value = localstorage.getitem(key); alert(key + ": " + value); }

javascript local-storage

html - SVG circle rendering as square on mobile -



html - SVG circle rendering as square on mobile -

i have svg circle within web page. it's rendering on desktop square on mobile browser. svg exported straight illustrator.

the js fiddle here is working on desktop and mobile intended.

<svg version="1.1" id="layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="250px" height="250px" viewbox="0 0 250 250" enable-background="new 0 0 250 250" xml:space="preserve"> <g> <circle id="circle" fill="#202020" stroke="#0a0a0a" stroke-width="4" cx="122" cy="125" r="100"/> <line id="hour0" fill="none" x1="122" y1="35" x2="122" y2="25"/> <line id="hour1" fill="none" x1="172" y1="38" x2="167" y2="47"/> <line id="hour2" x1="210" y1="75" x2="199" y2="80"/> <line id="hour3" fill="none" x1="212" y1="125" x2="222" y2="125"/> <line id="hour4" fill="none" x1="209" y1="175" x2="200" y2="170"/> <line id="hour5" fill="none" x1="172" y1="212" x2="167" y2="203"/> <line id="hour6" fill="none" x1="122" y1="215" x2="122" y2="225"/> <line id="hour7" fill="none" x1="72" y1="212" x2="77" y2="203"/> <line id="hour8" fill="none" x1="35" y1="175" x2="44" y2="170"/> <line id="hour9" fill="none" x1="22" y1="125" x2="32" y2="125"/> <line id="hour10" fill="none" x1="35" y1="75" x2="44" y2="80"/> <line id="hour11" fill="none" x1="72" y1="38" x2="77" y2="47"/> </g> <g> <line id="hourhand" fill="none" stroke="#ffffff" stroke-width="5" x1="122" y1="125" x2="122" y2="70"/> <line id="minutehand" fill="none" stroke="#ffffff" stroke-width="3" x1="122" y1="125" x2="122" y2="40"/> <line id="secondhand" fill="none" stroke="#823441" stroke-width="2" x1="122" y1="125" x2="122" y2="30"/> <circle id="bolt" fill="#ffffff" stroke="#202020" stroke-width="4" cx="122" cy="125" r="5.5"/> </g> </svg>

what impact svg on website cause render square on mobile devices?

after little expirmenting - setting svg "r" attribute 294 fixes on mobile. still want know why case...

html css svg

web services - Automate Suspended orchestrations to be resumed automatically -



web services - Automate Suspended orchestrations to be resumed automatically -

we have biztalk application sends xml files external applications using web-service.

biztalk calls web-services method passing xml file , destination application url parameters.

if external applications not able receive xml, or if there no response received web-service biztalk message gets suspended in biztalk.

presently situation manually go biztalk admin , resume each suspended message.

our clients want process automated all, want dashboard shows list of message details , button, on click suspended messages have resumed.

if doing within orchestration , catching connection error, add together delay shape configured 5 hours. or set retry interval 300 minutes , multiple retries on send port if makes sense. can using rule engine well.

web-services biztalk biztalk2006r2

timezone - EWS API - update a meeting -



timezone - EWS API - update a meeting -

i utilize ews managed api synchronize appointments exchange / exchange online. works good. unfortunately there problems appointments created in exchange meeting request. (ismeeting = true) if set time zone (starttimezone, endtimezone) , seek save, comes next error: "set action invalid property." other properties such start , end of appointment can changed , saved. appointments not meetings, time zone can changed , saved easily.

the code looks this:

appointment = appointment.bind(service, new itemid("<itemid>")) appointment.starttimezone = timezoneinfo.local 'problem appointment.endtimezone = timezoneinfo.local 'problem appointment.start = datetime.parse("22.10.2014 11:00:00") appointment.end = datetime.parse("22.10.2014 12:00:00") appointment.update(conflictresolutionmode.alwaysoverwrite, sendinvitationsorcancellationsmode.sendtonone) 'error

can tell me how alter time zone of meeting, or cause of error is?

thank you.

regards, torsten

exchange treates appointments & meetings in similar fashion internally. difference appointments doesnot have attendees. 1. in update, need utilize sendtoallandsavecopy instead sendtonone. 2. no need mention, ismeetin. instead utilize meeting.itemclass = "ipm.appointment"; 3. mention exchange version, requestserverversionvalue.version = exchangeversiontype.exchange2010_sp2; requuired default, has exchange 2007. 4. exchange 2010, need mention start & end time zones, timezonedefinitiontype tz = new timezonedefinitiontype(); tz.id = timezone.currenttimezone.standardname; meeting.starttimezone = tz; meeting.endtimezone = tz; note: code snippets working code useing ews proxy class

api timezone ews managed meeting

Android ProgressDialog in AsyncTask -



Android ProgressDialog in AsyncTask -

i can't create progressdialog run in asynctask :

private class upload extends asynctask<string, void, void> { progressdialog pd; protected void onpreexecute() { super.onpreexecute(); pd = new progressdialog(activity.this); pd.setmessage("message"); pd.setindeterminate(false); pd.setmax(100); pd.setprogressstyle(progressdialog.style_horizontal); pd.setcancelable(false); pd.show(); } @override protected void doinbackground(string... params) { ....... public void write(byte[] bts, int st, int end) throws ioexception { totalsent += end; progress = (int) ((totalsent / (float) contentlength) * 100); publishprogress("loaded "+progress+"%"); out.write(bts, st, end); } ....... } protected void onprogressupdate(string... progress) { log.d("andro_async", progress[0]); pd.setprogress(integer.parseint(progress[0])); } protected void onpostexecute(void result) { super.onpostexecute(result); if (pd != null) { pd.dismiss(); } }

progress dialog works, no progress on it. in logs see, progress counts properly. so, no problems in progress count.

for code above error, saying "the method publishprogress(void...) in type asynctask string,void,void not applicable arguments (string)".

it doesn't work no matter do. suppose, miss something. please help )

you trying parseint on string containing "loaded "+progress+"%". can't work. seek :

publishprogress(""+progress); // [...] protected void onprogressupdate(string... progress) { log.d("andro_async", "loaded " + progress[0] + "%"); pd.setprogress(integer.parseint(progress[0])); }

android android-asynctask progressdialog

javascript - how to assign a id to canvas in the three.js application -



javascript - how to assign a id to canvas in the three.js application -

i have created render object in three.js , connect domelment, shown followed

var renderer = new three.webglrenderer({ antialias: true }); renderer.setclearcolor( 0xaaaaaa, 1 ); renderer.setsize(window.innerwidth, window.innerheight); document.getelementbyid('webgl-container').appendchild(renderer.domelement);

so three.js automatically create canvas within webgl-container div, want give canvas id, how it

have tried :

renderer.domelement.id = 'youridname';

javascript three.js html5-canvas

HTML: href to index page with clean url -



HTML: href to index page with clean url -

i have button targets index.html, after click them, url above domainname.lt/index.html, want domainname.lt. should do? have no knowledge search. i'm using 'href' attribute.

thank in advance.

use total url or set variable global.

$globals['a'] = 'domainname.lt';

html url hyperlink indexing href

php - Apigility rest service - how to filter by a non unique column using db connected -



php - Apigility rest service - how to filter by a non unique column using db connected -

i have db-connected rest service, , managed far total collection database or single entity id.

i can't find proper guide explain how utilize get url parameters filter other fields, , how take illustration whether "like" or %%" or other operators matter.

this experience codeconnected services. ymmv..

retrieving url parameters - controller/resource class.

your controller needs retrieve them $this->getevent()

/** * fetch single entity id, query params */ public function fetch($entity_id) { // retrieve query parameters\ $queryparams = $this->getevent()->getqueryparams(); }

secondly , parameters approved on module.config.php create past validator/filter part of apigility. notice collection query whitelist

module.config.php within service's module folder

'servicename\\v1\\rest\\servicename\\controller' => array( ... 'entity_http_methods' => array( 0 => 'get', 1 => 'patch', 2 => 'put', 3 => 'delete', ), 'collection_http_methods' => array( 0 => 'get', 1 => 'post', ), 'collection_query_whitelist' => array( 0 => 'username', 1 => 'entity_provider', 2 => 'entity_type', 3 => 'entity_date_range', 4 => 'sort_by', 5 => 'sort_order' ), ...

php rest zend-framework2 apigility

c - What's the point of FcFini in the fontconfig library? -



c - What's the point of FcFini in the fontconfig library? -

the fontconfig library has function fcfini.

the docs say

fcfini [...]

frees info structures allocated previous calls fontconfig functions. fontconfig returns uninitialized state, requiring new phone call 1 of fcinit functions before other fontconfig function may called.

however, docs not why might want phone call it. free memory, cannot imagine fontconfig gobble vast amounts of memory. @ rate, unless can create sure i'll never phone call fontconfig again, can phone call fcfini @ end of program, releasing memory pointless. why bother?

incidentally, noticed cairo rendering library, uses fontconfig, calls fcfini in test code, never in production code. seems cairo authors don't see point of calling it... or wrong?

a typical reason getting valid output valgrind or purify. if have leaks @ exit, might want cut down in debug or test builds.

c resource-cleanup fontconfig

node.js - How to use less by "var less = require('less');" -



node.js - How to use less by "var less = require('less');" -

it's there utilize "less" this:

var less = require('less'); less.render('.class { width: (1 + 1) }', function (e, css) { console.log(css); });

in computer, said: "error: cannot find module 'less'".but had tried install "less"

"npm install less -g"

before utilize "require('less');"

relatively npm changed few things regarding global modules.

now, default, require(my_module) after installing globally not work, is, npm not check if my_module installed in global path.

what have 2 options:

if still want utilize global module, npm link less while beingness in project, create symbolic link less installed in global path. used in development, prodution advice not (as lose version control). install module locally npm install less in project folder. works both development , production, guessed, downloads less module again.

more on subject: https://www.npmjs.org/doc/cli/npm-link.html

node.js less

ajax - How to implement infinite scroll, endless pagination using the zinnia blog app from Django -



ajax - How to implement infinite scroll, endless pagination using the zinnia blog app from Django -

this first question here

i want implement infinite scrolling (or endless pagination ) on blog powered zinnia app django.

my blog construction same zinnia blog, haven't coded different it. tried using "django endless pagination" because it's documentation says can create twitter style pagination couldn't resolve set it's snippets of code.

i don't mind if can solved using django endless pagination or not.

my pip freeze looks this:

django==1.5.1 pillow==2.3.1 argparse==1.2.1 beautifulsoup4==4.3.2 django-blog-zinnia==0.13 django-endless-pagination==2.0 django-filebrowser==3.5.6 django-grappelli==2.4.10 django-mptt==0.6.0 django-tagging==0.3.2 django-tinymce==1.5.2 django-xmlrpc==0.1.5 easy-thumbnails==1.3 feedparser==5.1.3 pyparsing==2.0.1 pytz==2014.2 raven==4.2.1 wsgiref==0.1.2

i appreciate suggestions.

p.d: allow me know if need else give appropriate answer

you can in client side, using library : https://github.com/paulirish/infinite-scroll

works fine on http://fantomas.willbreak.it/ this:

$(document).ready(function () { $('.hfeed').infinitescroll({ navselector: '.paginator', nextselector: '.paginator .next a', itemselector: '.hentry', contentselector: '.hfeed aside', bufferpx: 1000, maxpage: 5, loading: { msgtext: '<p>chargement des articles suivants...</p>', finishedmsg: '', img: '/static/img/loader.gif', }, }, function (newelements) { $(newelements).find('pre').each(function (i, e) { hljs.highlightblock(e) }); }); });

ajax django pagination infinite-scroll zinnia

html - JavaScript code working only in Chrome but not in Firefox, IE, Opera and Safari -



html - JavaScript code working only in Chrome but not in Firefox, IE, Opera and Safari -

i'n new programming , tried in javascript , worked in chrome. fails work in ie, firefox, safari , opera. doing wrong code?

function hp(form) { var count1 = 0, count2 = 0, count3 = 0, count4 = 0, count5 = 0, count6 = 0, count7 = 0, count8 = 0, count9 = 0, count10 = 0; (var = 0; < 3; i++) { if (form.q1[i].checked == true) { count1++; } } if (count1 !== 1) { alert("please reply 1st question"); homecoming false; } (var = 0; < 3; i++) { if (form.q2[i].checked == true) { count2++; } } if (count2 !== 1) { alert("please reply 2nd question"); homecoming false; } (var = 0; < 3; i++) { if (form.q3[i].checked == true) { count3++; } } if (count3 !== 1) { alert("please reply 3rd question"); homecoming false; } (var = 0; < 3; i++) { if (form.q4[i].checked == true) { count4++; } } if (count4 !== 1) { alert("please reply 4th question"); homecoming false; } (var = 0; < 3; i++) { if (form.q5[i].checked == true) { count5++; } } if (count5 !== 1) { alert("please reply 5th question"); homecoming false; } (var = 0; < 3; i++) { if (form.q6[i].checked == true) { count6++; } } if (count6 !== 1) { alert("please reply 6th question"); homecoming false; } (var = 0; < 3; i++) { if (form.q7[i].checked == true) { count7++; } } if (count7 !== 1) { alert("please reply 7th question"); homecoming false; } (var = 0; < 3; i++) { if (form.q8[i].checked == true) { count8++; } } if (count8 !== 1) { alert("please reply 8th question"); homecoming false; } (var = 0; < 4; i++) { if (form.q9[i].checked == true) { count9++; } } if (count9 !== 1) { alert("please reply 9th question"); homecoming false; } (var = 0; < 3; i++) { if (form.q10[i].checked == true) { count10++; } } if (count10 !== 1) { alert("please reply 10th question"); homecoming false; } answer1 = (form.q1.value); answer2 = (form.q2.value); answer3 = (form.q3.value); answer4 = (form.q4.value); answer5 = (form.q5.value); answer6 = (form.q6.value); answer7 = (form.q7.value); answer8 = (form.q8.value); answer9 = (form.q9.value); answer10 = (form.q10.value); var = parseint(answer1); var b = parseint(answer2); var c = parseint(answer3); var d = parseint(answer4); var e = parseint(answer5); var f = parseint(answer6); var g = parseint(answer7); var h = parseint(answer8); var ii = parseint(answer9); var j = parseint(answer10); var c = + b + c + d + e + f + g + h + ii + j; //document.getelementbyid("result").innerhtml= "the selected values "+"</br>"+a+"</br>"+b+c+d+e+f+g+h+ii+j+"</br>"+c; if (c <= 20) { document.getelementbyid("total").innerhtml = "<h3>" + "abcd" + "</h3>" + "</br>" + "<img align='center' " + "src='images/img.png'>"; } else if ((c > 20) && (c <= 25)) { document.getelementbyid("total").innerhtml = "<h3>" + "abcd" + "</h3>" + "</br>" + "<img align='center' " + "src='images/img.png'>"; } else if ((c > 25) && (c <= 30)) { document.getelementbyid("total").innerhtml = "<h3>" + "abcd" + "</h3>" + "</br>" + "<img align='center' " + "src='images/img.png'>"; } else if ((c > 30) && (c <= 40)) { document.getelementbyid("total").innerhtml = "<h3>" + "abcd" + "</h3>" + "</br>" + "<img align='center' " + "src='images/img.png'>"; } else if ((c > 40) && (c <= 50)) { document.getelementbyid("total").innerhtml = "<h3>" + "abcd" + "</h3>" + "</br>" + "<img align='center' " + "src='images/img.png'>"; } else if ((c > 50) && (c <= 60)) { document.getelementbyid("total").innerhtml = "<h3>" + "abcd" + "</h3>" + "</br>" + "<img align='center' " + "src='images/img.png'>"; } else if ((c > 60) && (c <= 65)) { document.getelementbyid("total").innerhtml = "<h3>" + "abcd" + "</h3>" + "</br>" + "<img align='center' " + "src='images/img.png'>"; } else if ((c > 65) && (c <= 75)) { document.getelementbyid("total").innerhtml = "<h3>" + "abcd" + "</h3>" + "</br>" + "<img align='center' " + "src='images/img.png'>"; } else if ((c > 75) && (c <= 90)) { document.getelementbyid("total").innerhtml = "<h3>" + "abcd" + "</h3>" + "</br>" + "<img align='center' " + "src='images/img.png'>"; } c = 0; }

i tried code in local host , got desired output in google chrome. when tried same page in firefox , other browser, failed work. checkbox validation working fine. in advance

from personal experience, have noticed chrome more forgiving when comes little errors. unusual how not getting error in debug box @ all... but, place can see reading code define variables a,b,c... recommend placing comma after each. so, get:

var = parseint(answer1), b = parseint(answer2), c = parseint(answer3), d = parseint(answer4), e = parseint(answer5), f = parseint(answer6), g = parseint(answer7), h = parseint(answer8), ii = parseint(answer9), j = parseint(answer10);

then here think have error. have var c = ... 1 time again after defining c. so, seek removing var right there.

javascript html google-chrome firefox

sql - Which access method is appropriate for a table with two or more B-Tree Indexes -



sql - Which access method is appropriate for a table with two or more B-Tree Indexes -

consider client table below shown below. table contains 750 000 rows , unique b-tree index has been automatically created on primary key. in addition, suppose dba has created b-tree index on other_names + surname.

customer table

'#'customer_id

*surname

*other_names

*username

*address

.

.

.

question

a user executes query of form: select ... customer

where (surname = 'smith');

-identify of physical info access methods of oracle11g able utilize in situation.

-identify of these access methods oracle11g use; ,

-explain why access method more used compared other available access methods.

thank help!

sql oracle oracle11g

Javascript SDK in ASP.NET C# -



Javascript SDK in ASP.NET C# -

i building website in asp.net needs log in facebook button (and later google) integrated create account.

i have looked @ great sources http://www.aspdotnet-suresh.com/2012/04/aspnet-integrate-facebook-login.html , http://facebooksdk.net/docs/web/getting-started/

[1] however, examples never deal masterpages , content placeholders. when trying integrate them in content pages, errors because instance login button called

"fb:login-button scope="email" data-size="large" data-show-faces="false" data-auto-logout-link="true" onlogin="window.location='/main.aspx'">

log in facebook < fb:login-button>"

is not accepted without html tag

html xmlns:fb="http://www.facebook.com/2008/fbml">

which cannot place on content page anyways.

[2] also, want user create business relationship using facebook login. business relationship meant used instance parent can sign multiple children summer program, need application associate facebook login new/existing business relationship on application. tips on how handle appreciated.

[3] lastly, after user logs facebook, see them redirected page. however, in code-behind file page, cannot utilize facebook attributes written in javascript , since facebook button not element of toolbox, cannot create event handler that. instead, had write

onlogin="window.location='/main.aspx'

within tags of facebook button. not ideal because means everytime click facebook button, redirect me main.aspx. meaning if logged facebook already, , ran web site, click on "log out" , still access main.aspx page...

hope there's out there has been in same situation... or can help me! have been researching 12 hours straight , cannot anywhere :(

c# asp.net facebook login sdk

c# - How to catch property changing using Postsharp? -



c# - How to catch property changing using Postsharp? -

i have viewmodel tagged [notifypropertychanged]. properties of course of study bound on input controls, textboxes. need know, model's property changed because of input.

how can grab event?

if class decorated notifypropertychanged implements inotifypropertychanged directly, postsharp requires there method signature:

void onpropertychanged(string propertyname)

this method has raise propertychanged event explicitly. working illustration this:

[notifypropertychanged] public class osmodel : inotifypropertychanged { public int p1 { get; set; } public event propertychangedeventhandler propertychanged; protected virtual void onpropertychanged(string propertyname) { propertychanged(this, new propertychangedeventargs(propertyname)); } }

additional info found here.

c# mvvm postsharp

parsing - Adding users from CSV in Linux using BASH -



parsing - Adding users from CSV in Linux using BASH -

my csv file contains info needed firstname,lastname,userid. have 5 users need parse csv. in order create business relationship assign group(group1) , assign encrypted temporary passwords. i've nail wall, help awesome. thanks!

#!/bin/bash oldifs=$ifs ifs="," while read firstname lastname userid useradd -c "$firstname $lastname -d /home/$userid -g group1 -s /bin/bash $userid" done ifs=$oldifs

no users beingness added script execution.

this should help you.

#!/bin/bash oldifs=$ifs ifs="," while read firstname lastname userid useradd -c "${firstname} ${lastname}" -d /home/"${userid}" -g group1 -s /bin/bash "${userid}" done < file.csv

your script fine, have made few changes below

have quoted variables, prevent unwanted expansions. resetting ifs not necessary script runs in subshell. while needs file input, added it.

bash parsing csv user-accounts

linux - Mailx Configuration Without mailrc -



linux - Mailx Configuration Without mailrc -

i using mailx command in reddish hat, utilize command:

mailx -r 'boss@comp.com' -s 'email send' 'user@comp.com' < file_body

i don't have local configuration smtp server don't have user ~/mailrc mail service sent don't know way used...

i using postfix configuration in /etc/postfix , utilize commands mailq , on.

which configuration use?? utilize /etc/resolv.conf found smtp server? utilize route on /etc/sysconfig/network-scripts ????

your local scheme connecting isp's smtp server, or perchance straight mx comp.com.

linux smtp redhat postfix-mta mailx

scala - How and when exactly does a finally block execute? -



scala - How and when exactly does a finally block execute? -

consider next scala code (similar code examples work java)

val = seek "hello" grab { case e:exception => throw new exception("from catch") } println("done")

finally executes after "hello" returned. when executed? run after homecoming before assigned a? (it seems that) execute in same thread assignment?

a try block expression. finally runs part of evaluation of expression. look on right-hand side of assignment evaluated before assignment takes place. conclude finally block, part of evaluation, runs before assignment takes place.

yes, runs in same thread. have no concrete reference other knowing unfortunate language feature if did not (and rather hard implement anyways).

your utilize of word "returned" confusing. nil beingness "returned"; look beingness evaluated , resulting value beingness assigned something.

as details of look itself, scala language specification, section 6.22:

a seek look ...

try { b } e

... evaluates block b. if evaluation of b not cause exception thrown, look e evaluated.

if exception thrown during evaluation of e, evaluation of seek look aborted thrown exception. if no exception thrown during evaluation of e, result of b returned result of seek expression. if exception thrown during evaluation of b, block e evaluated. if exception e thrown during evaluation of e, evaluation of seek look aborted thrown exception. if no exception thrown during evaluation of e, original exception thrown in b re-thrown 1 time evaluation of e has completed. block b expected conform expected type of seek expression. look e expected conform type unit.

a seek expression:

try { b } grab e1 e2

is shorthand for

try { seek { b } grab e1 } e2

further details can found in section.

scala jvm

html - remove gap between input and button -



html - remove gap between input and button -

i'm trying set button right near text field.

here code thought create work

<input class="txt" type="text" name="name"> <button class="btn">submit</button> .txt { display: inline-block; width: 80%; outline: none; margin:0; } .btn { display: inline-block; width: 20%; margin:0; }

http://jsfiddle.net/rm9etsny/

however, there still gap between 2 elements. how can remove it?

thanks

you can set html content inline. remove space without having margin-left negative

<input class="txt" type="text" name="name"><button class="btn">submit</button>

also set them align in horizontal row, need consider giving less % input.

demo - http://jsfiddle.net/rahulb007/rm9etsny/5/

html css

ios - Auto layout - Collapsable views (vertically) -



ios - Auto layout - Collapsable views (vertically) -

i'd create "adding new credit card viewcontroller". don't want aggravate users of required fields presented @ once. action contains several steps. on each step view-controller reveals new subview (which contains 1 or more textfields) , collapses old 1 (the current text field after it's text validated).

i've created viewcontroller on storyboard. , placed of subviews 1 above other.

i've created of constraints on storyboard, each subviews' clips above subview etc'.

i.e:

nsmutablearray *constraints = [[nslayoutconstraint constraintswithvisualformat: @"v:|[titleview]-[subtitleview]-[amountview]-[cardnumview]-[cardsimagesview]-[mmyycvvview]-[billinginfoview]-[buttomview]|" options:nslayoutformatalignalltop | nslayoutformatalignallbottom metrics:nil views:variablebindings] mutablecopy];

each of these subviews contain height constraint.

in each step 1 of height constraints set 0 , 1 changed 0 required height.

i.e:

self.hgtcrtmmyycvv.constant = showfields? 50 : 0; self.hgtcrtbillinginfo.constant = showfields? 140 : 0; self.mmyycvvview.hidden = !showfields; self.billinginfoview.hidden = !showfields;

i got 2 issues:

without calling layoutifneeded initial layout valid did not alter after changing height constraints.

calling layoutifneeded did not clip bottom view lastly visible 1 - placed @ bottom of view if subviews appear @ once, since hidden gap created. changing height constraint of subviews applied on screen still gap stayed.

please advise.

calling "layoutifneeded" did not clip bottom view lastly visible 1 - placed @ bottom of view if subviews appear @ once

look @ constraints. have pinned bottom of bottom view bottom of superview! bottom must appear @ bottom of superview, since instructed do.

indeed, surprised constraints work @ all. have overdetermined them. if give every field height and pin top , bottom, every field, impossible satisfy constraints unless lucky. height of superview fixed, constraints have add together height.

i'm going suggest finish alternative approach, think find easier. instead of messing individual constants, plan right (not overdetermined) constraints each possible situation, , store constraints in properties. when want hide/reveal field, remove constraints , swap in set.

this solve layoutifneeded problem.

it happens have actual illustration showing how this. (it written in swift, i'm sure can compensate mentally.) in illustration code, have 3 rectangles; remove 1 rectangle , close gap between remaining two. preparation of 2 sets of constraints tedious elementary:

allow c1 = nslayoutconstraint.constraintswithvisualformat("h:|-(20)-[v(100)]", options: nil, metrics: nil, views: ["v":v1]) [nslayoutconstraint] allow c2 = nslayoutconstraint.constraintswithvisualformat("h:|-(20)-[v(100)]", options: nil, metrics: nil, views: ["v":v2]) [nslayoutconstraint] allow c3 = nslayoutconstraint.constraintswithvisualformat("h:|-(20)-[v(100)]", options: nil, metrics: nil, views: ["v":v3]) [nslayoutconstraint] allow c4 = nslayoutconstraint.constraintswithvisualformat("v:|-(100)-[v(20)]", options: nil, metrics: nil, views: ["v":v1]) [nslayoutconstraint] allow c5with = nslayoutconstraint.constraintswithvisualformat("v:[v1]-(20)-[v2(20)]-(20)-[v3(20)]", options: nil, metrics: nil, views: ["v1":v1, "v2":v2, "v3":v3]) [nslayoutconstraint] allow c5without = nslayoutconstraint.constraintswithvisualformat("v:[v1]-(20)-[v3(20)]", options: nil, metrics: nil, views: ["v1":v1, "v3":v3]) [nslayoutconstraint] self.constraintswith.extend(c1) self.constraintswith.extend(c2) self.constraintswith.extend(c3) self.constraintswith.extend(c4) self.constraintswith.extend(c5with) self.constraintswithout.extend(c1) self.constraintswithout.extend(c3) self.constraintswithout.extend(c4) self.constraintswithout.extend(c5without) nslayoutconstraint.activateconstraints(self.constraintswith)

but payoff comes when time swap middle view in or out of interface: it's trivial. remove or insert it, , remove constraints , insert finish new set of constraints appropriate situation, have prepared:

@ibaction func doswap(sender: anyobject) { if self.v2.superview != nil { self.v2.removefromsuperview() nslayoutconstraint.deactivateconstraints(self.constraintswith) nslayoutconstraint.activateconstraints(self.constraintswithout) } else { self.view.addsubview(v2) nslayoutconstraint.deactivateconstraints(self.constraintswithout) nslayoutconstraint.activateconstraints(self.constraintswith) } }

the preparation of multiple sets of constraints tedious can done rule, i.e. constraints can "machine-generated" in loop (writing left exercise you). swapping constraints in , out 1 time again according simple rule, since 1 set right particular set of fields wish show/hide. 1 time set much simpler , more maintainable doing now.

ios autolayout collapsable

c# - Searching for substrings in file.readlines() in python -



c# - Searching for substrings in file.readlines() in python -

just starting python, excuse me if sound utterly thick.

assuming next input: my_file content:

we love unicorns love beer love free (an in free beer)

i have expected next homecoming true:

# my_file = path valid file open(my_file) f: lines = f.readlines() if 'beer' in lines: print("found beer") # not happen

or used c#'s way, after i'll have matching lines:

// assuming i've done similar lines = open , read file var v = line in lines line.contains("beer") select line;

what pythonian equivalent fetching lines hold beer example?

you close, need check substring in each line, not in list of lines.

with open(my_file) f: line in f: if 'beer' in line: print("found beer")

as example,

lines = ['this line', 'this sec line', 'this 1 has beer']

this first case trying do

>>> 'beer' in lines false

this code showed above do

>>> line in lines: print('beer' in line) false false true

c# python string search

c# - How to get the value of selected item in a xlDropDown which is added programmatically to a Excel sheet cell -



c# - How to get the value of selected item in a xlDropDown which is added programmatically to a Excel sheet cell -

the next code shows way created drop downs programmatically. works fine. need value of specific dropdown of cell.

microsoft.office.interop.excel.dropdowns xldropdowns; microsoft.office.interop.excel.dropdown xldropdown; xldropdowns = ((microsoft.office.interop.excel.dropdowns)(sheet.dropdowns(type.missing))); xldropdown = xldropdowns.add((double)rag.left, (double)rag.top, (double)rag.width, double)rag.height, true); var dropdownlist = {"aaaa","bbbb","cccc","dddd"}; int x = 0; foreach (var item in dropdownlist) { x++; xldropdown.additem(item); }

this how tried xldropdown value. currentcell cell have drop down

columnval = currentcell.text; // didnt give output

or

var dd = (microsoft.office.interop.excel.dropdown)currentcell.dropdowns(type.missing);

i know 2nd 1 wrong, because cell range , drop downwards 2 different things. tried options, still couldnt find solution. please help me

more clearly, want access specific cell(currentcell), , xldropdown contains , value it

first need reference drop downwards you've added:

*assuming there's 1 drop down, below do

xldropdown = ((excel.dropdown)(xldropdowns.item(1)));

then need access .get_list() property of excel.dropdown while making sure has been selected.

example:

if (xldropdown.value > 0) { sht.get_range("a1").value = xldropdown.get_list(xldropdown.value); } else { throw new exception("nothing selected yet"); }

identifying dropdowns:

you each loop on xldropdowns collection , grab .name , .listindex of each xldropdown?

foreach (excel.dropdown xldd in xldropdowns) { messagebox.show(xldd.name + ", " + xldd.listindex); }

c# asp.net excel office-interop

Is it possible to access Uploadcare CDN over https? -



Is it possible to access Uploadcare CDN over https? -

i upload images using uploadcare widget embedded in ckeditor, pages https , browser warning because images received on plain http. tried manually replace http https in uploadcare url, doesn't seem work :(

yes! need use different base of operations domain name:

you can utilize https ucarecdn.com domain. feature experimental: https://ucarecdn.com/:uuid/ please note, not back upwards https www.ucarecdn.com domain http ucarecdn.com.

uploadcare

.net - C# ClickOnce installer - dynamic deployment path -



.net - C# ClickOnce installer - dynamic deployment path -

i've set clickonce installer auto updates machines on lan , working - great if have application deployment directory dynamic, , specific each machine (what we'd hope have database table machine name , deployment path).

is possible in clickonce? i.e. possible utilize different path manifest? i'm happy check updates after application start, rather before.

thanks!

c# .net clickonce

database - How to get memory usage by db number in redis without rdb file -



database - How to get memory usage by db number in redis without rdb file -

we looking tool usage amount of memory according redis db number, there tool can help?

we don't utilize rdb file, redis-rdb-tool seems not helpful.

thanks lot.

you can seek using antirez's sampler: https://github.com/antirez/redis-sampler

of course, means run many queries check random keys on each db, don't think have many options without rdb file. not fullscan too.

database memory redis

regex - Need regular expression for restricting special characters -



regex - Need regular expression for restricting special characters -

i need replace next special characters empty string.

™,®,',(tm),(r),é,�,’,–,â€

i using trim(regexp_replace(:desc, '(*[\\™®])', ' '))

but failing. tool sql loader.

thanks in advance

regex:

[™�®'’é–]|â€|\((?:tm|r)\)

replacement string:

empty string.

demo

regex oracle sql-loader

DateTimeFormatter in Mule DataMapper -



DateTimeFormatter in Mule DataMapper -

i using dataformat conversion within datamapper script in mule.

datetimeformatter = new java.text.simpledateformat("yyyy-mm-dd't'hh:mm:ss"); output.date_of_rate_float__c = (isnull(input.date_of_rate_float) ? null : datetimeformatter.format(input.date_of_rate_float));

when trying save mapping. getting below error

root exception stack trace: org.apache.commons.beanutils.conversionexception: dateconverter not back upwards default string 'date' conversion. @ org.apache.commons.beanutils.converters.datetimeconverter.todate(datetimeconverter.java:468)

but when remove datetimeformatter, not getting error. need utilize dateconversion, there other way resolve this.

thanks in advance.

you keeping date datatype string , trying format date. alter date datetype datetime , conversion.

mule mule-studio mule-el mule-component

nginx - Ghost not receiving any traffic -



nginx - Ghost not receiving any traffic -

i have ghost running on nginx in ec2 ubuntu instance. able run application , curl instance it's in.

however, cannot access internet, or outside instance. checked ec2 security groups , port 2368 (the port ghost uses) open. nginx configured so:

server { hear 80; server_name server.name.io; location / { proxy_pass http://54.xxx.xxx.xxx:2368; } }

where else should at?

you mention your ec2 security grouping allows port 2368 can more specific beingness allowed? inbound? outbound? sources?

also in case because using nginx proxy requests ghost want open port 80 on security grouping , not 2368. way forced utilize port 80 , total benefits of nginx.

you want create security this:

allow traffic on port 80 everywhere on internet allow traffic on port 22 everywhere (if lucky have static ip @ home alter more secure) allow outbound traffic anywhere on internet

nginx amazon-ec2 ghost-blog

Can't run Ionic on Android: class not found exception IonicKeyboard -



Can't run Ionic on Android: class not found exception IonicKeyboard -

after building , running android app closes.

viewing eclipse logcat shows class not found exception com.ionic.keyboard.ionickeyboard

i'm new ionic , don't know how create work. in advance

i had same problems. in case plugin was installed, had remove , add together again:

try in app-folder:

cordova plugin remove com.ionic.keyboard

and

cordova plugin add together com.ionic.keyboard

ionic-framework

sql - Oracle group by clause using nested function in the select statement -



sql - Oracle group by clause using nested function in the select statement -

i have query need find available seats of flight. ie: subtract number of bookings made flight capacity of plane assigned flight. have query working, showing 'available seats' column. want show 'flight number' column "not single-group grouping function" etc errors when seek add together column in display. think need bring together tables create select statement allow me print flight_number column, i'm not sure how that. point me in right direction. lot.

select sum(p.capacity - (count(b.passenger_id))) available_seats booking b, planes p b.date_of_flight = '16-oct-2014' , depart_city = 'sydney' , arrival_city = 'perth' , flight_number in (select flight_number scheduled_flights sf sf.airplane_serial = p.airplane_serial , b.date_of_flight = sf.date_of_flight ) grouping p.capacity ;

this result:

available_seats 1 237

which correct, like: flight_number available_seats 1 tf81 237 helping :-)

maybe need this?

select flight_number, p.capacity - count(b.passenger_id) available_seats booking b, planes p, scheduled_flights sf b.date_of_flight = '16-oct-2014' , depart_city = 'sydney' , arrival_city = 'perth' , flight_number = sf.flight_number , sf.airplane_serial = p.airplane_serial , b.date_of_flight = sf.date_of_flight grouping flight_number, p.capacity;

sql oracle