Posts

Showing posts from May, 2012

Using Google Chrome as bundled runtime for HTML app? -

i have html application run offline, , want end way open app exe file on windows. have tried visual studio, app not run in webbrowser component. i pretty sure have read can use chrome (or kind of chrome version of chrome) "bundled runtime", have hard time finding it. exist? using chrome engine (instead of "web views" based on internet explorer) make sure application run nice on computers has not updated windows or browsers while. you must thinking of cef: chromium embedded framework .

iOS framework/bundle with replaceable assets -

i trying make ios framework basic ui-controls. want users re-skin theme of controls therefore loading assets, storyboards , xibb files asset bundle. i using image.xcassets assets. bundle generation changes assets.car i want assets replaceable within bundle users re-skin. proper way achieve that? resources / images assets added app bundle. cannot add in bundle framework @ runtime ( user cannot change skin bundle ) you can achieve 2 ways at launch, check whether image files exist in documents directory. if not, copy bundle images document folder. check name of images why loading bundle after check local / documents folder same copy of image , use new skin of user wish .

php - Admin that create simple users using FOSUserBundle -

i'm trying learn symfony creating simple project. began creatin dashboard admin. this administrator have right create type of users called "proprietaire", once "proprieraire" connected can create type of users "simple user". i tried manage login admin using fosuserbundle , done. the problem how create "proprietaire" type user using form admin page? , how same creating "simple" type user "proprietaire" page ? i have 3 roles : role_admin, role_prop , role_simple my security.yml file : # app/config/security.yml security: encoders: fos\userbundle\model\userinterface: bcrypt role_hierarchy: role_prop: role_user role_admin: role_prop providers: fos_userbundle: id: fos_user.user_provider.username firewalls: main: pattern: ^/ form_login: provider: fos_userbundle csrf_token_generator: security.csrf.token_manager # if

How to unserialise the PHP SESSION serialised value? -

i stored php session values dynamodb, following serialized structure getting on_session_write() function using session_set_save_handler(), id|s:26:"rj4n98n6371vpgj8h5s10lmoh2";matt|n;smartyvalidate|a:1:{s:7:"default";a:4:{s:16:"registered_funcs";a:2:{s:8:"criteria";a:0:{}s:9:"transform";a:0:{}}s:10:"validators";a:0:{}s:8:"is_error";b:0;s:7:"is_init";b:1;}}language_id|i:1;language|s:3:"eng"; i tried php serialize() , unserialize() functions it's not working. so, how can un-serialize value? i need output format per $_session printed value. the documentation says session_set_save_handler : while data looks similar serialize() please note different format speficied in session.serialize_handler ini setting. the setting session.serialize_handler defaults php , means php using internal session_encode() , session_decode() functions. session_decode() decodes serial

javascript - jQuery.each on div in partial view always returning 1 -

in mvc index page, each element in viewmodel, renders via partial view. i need run small script on each of these partial views , trying use jquery.each() however, cannot seem iterate $get returning 1, not actual number of elements in $get . index.cshtml @model ienumerable<viewmodels.dummyvm> @{ viewbag.title = "index"; } <h2>index</h2> <div> @for (int = 1; <= 10; i++) { @html.partial("pv", i); } </div> @section scripts { <script type="text/javascript"> $(function () { alert($("#logentry").length); }) </script> } pv.cshtml @model int <div id="logentry"> log entry : @(model) </div> for simplified test above, once page has .ready() iterates through , dumps console i'm getting log entry : 0 id should unique in same document use classes instead : @model int <div class="lo

bluetooth - get eaaccessory macaddress in swift -

i have bt 2.0 device certified. i can send/recv data bt device eaaccessory input/output stream. but went device's mac address there ios9 eaaccessory header https://github.com/javisoto/ios9-runtime-headers/blob/master/frameworks/externalaccessory.framework/eaaccessory.h (id)macaddress; how can call method ?? this app not need submit apple store. try value with: let mac = myaccessory.valueforkey("macaddress") print("mac address is: \(mac)")

jquery - ajax response a django form using HttpResponse -

my ajax function has response django form. in views.py code, .. .. dictionary={'userform':userform,'info_form':info_form} return httpresponse(dictionary) but when alert on console.log response like.. userforminfo_form . can not parse in json type @ both client n sever side. how httpresponse form object. when trying json.dump, gives me error that, json object not serializable. thanx! you can use from django.core import serializers , can parse data coming database , create dict , and pass dict httpresponse `userform = serializers.serialize('json', userform)` `dictionary={'userform':userform}` `httpresponse(json.dumps(dictionary),content_type="application/json"`) if it's doesn't work have parse data , create list follows array=[] in data; array.append(a) dictionary={'userform':array} httpresponse(json.dumps(dictionary),content_type="application/json")

javascript - 2 Forms on the page with JS validation - one throws email validation error -

i've added 2 forms on 1 page of wordpress website: 1 mobile display , 1 in sidebar desktop computers (bigger screens). i've done , can't seem figure out why doesn't work time. what happens desktop form throws validation error on email field, when entering valid email. only doesn't work email field on desktop form, validation works on other input fields (name, ..) - , on mobile form well. i'm using simple java script validate forms, both forms use same function validating email address. form validation triggered submit button , form fields have different id's. if i'm not displaying mobile form, desktop email validation works fine?!? now code (just key elements question): html-form on page <form class="formmob"> <label for="fullname">full name</label> <input type="text" id="fullname-mob" name="fullname" type="text"> <div class="

shell script that notes timestamps and runs a command every 15min and sends the result to a .txt -

doin experiment on tor , messuring performance of network. need script notes timestamps , runs command "proxychains iperf3 -c "ip address" , send result .txt . need run every 15min 24/7. it´s getting annoying stay awake. thansk ! you can start following: touch mylogfile.txt while true proxychains iperf3 -c "ip address" >> mylogfile.txt sleep 900 done if want run without crontab

javascript - Save user input in Array -

i true beginner in html/js/jquery. i trying save user input array, later want write information array xml file. my problem form consists of multiple jobs have same input fields. this short example of first job: <form> <table class="wrapper"> <tr> <td style="text-align: left">first digit: <div> <input id="fdigit" type="text" name="job1[]" /></td> <td style="text-align: left">system: <div> <input id="system" type="text" name="job1[]" /></td> <td style="text-align: left">sap modul: <div> <input id="sapmodul" type="text" name="job1[]" /></td> </tr> <tr> <td style="text-align: left">country: <div> &

regex - a decimal without an integer part -

i use following expression match decimal number \d+[.,]?\d+ i trying make digits before decimal separator optional, thought following should do \d+?[.,]?\d+ but did not, can 1 please explain why? as trying make match of following examples 44 44.44 44,44 .44 ,44 i trying make digits before decimal separator optiona just use * quantifier first \d , set ? quantifier character class: \d*[.,]?\d+ see regex demo the reason expression not work \d+? requires @ least 1 digit match.

java - JTable filtering by an exact match to a String -

i want filter jtable string. filter this: pattern.quote(textfield.gettext()); but, when filter on "g" lines of jtable entry "kg". want rows entry "g". looked @ how use tables: sorting , filtering , still don't see how. another example: rowfilter#regexfilter(...) (java platform se 8) the returned filter uses matcher.find() test inclusion. test exact matches use characters '^' , '$' match beginning , end of string respectively. example, "^foo$" includes rows string "foo" , not, example, "food". see pattern complete description of supported regular-expression constructs. import java.awt.*; import java.awt.event.*; import java.util.regex.*; import javax.swing.*; import javax.swing.table.*; public class jtablefilterdemo2 { public jcomponent makeui() { string[] columnnames = {"item"}; object[][] data = {{"g"}, {"kg"}, {"xg"}, {"y&q

ios - Swift : How to change language inside app? -

i using localize-swift library ( link ) localize application , works fine .strings files. problem have localize language right left , have localize via interface builder storyboard can make view controllers right in rtl format. question how set storyboard user selected language in real time ? for example have 2 storyboard files : 1- ... /projectname/base.lproj/main.storyboard 2- ... /projectname/fa-ir.lproj/main.storyboard how switch between them in real time ? i know can change in schemes , device language want real time , dont want users restart device. thanks found answer : nsuserdefaults.standarduserdefaults().setobject(["language identifier"], forkey: "applelanguages") nsuserdefaults.standarduserdefaults().synchronize() unfortunately user must restart app! if find solution not restart application please inform me.

java - Simplest way to add an image in Javafx? -

i don't understand how add simple image. imported , followed said on page: http://www.java2s.com/code/java/javafx/loadajpgimagewithimageanduseimageviewtodisplay.htm javafx code import javafx.application.application; import javafx.scene.group; import javafx.scene.scene; import javafx.scene.image.image; import javafx.scene.image.imageview; import javafx.scene.layout.vbox; import javafx.stage.stage; public class test extends application { @override public void start(stage stage) { stage.settitle("html"); stage.setwidth(500); stage.setheight(500); scene scene = new scene(new group()); vbox root = new vbox(); final imageview selectedimage = new imageview(); image image1 = new image(test.class.getresourceasstream("c:\\users\\user\\desktop\\x.jpg")); selectedimage.setimage(image1); root.getchildren().addall(selectedimage); scene.setroot(root); stage.s

scala - Types MapColumn, SetColumn, JsonColumn needs owner and record. What actually are these values? -

for example, have type mapcolumn[owner <: com.websudos.phantom.dsl.cassandratable[owner, record], record, k, v] = com.websudos.phantom.column.mapcolumn[owner, record, k, v] k , v obvious, owner , record? should input there? the whole power of phantom ability map around data model , give type safe results, or had in mind when wrote it. owner type param type of table written user , needed can stuff like: select.where(_.id eqs id) looks pretty simple, trick without refined type param through compiler can "memorize" columns have arbitrarily defined inside table, never able "know" in dsl code columns user writes. so dsl has know final type of table create extending cassandratable . case class myrecord(id: uuid, name: string) class mytable extends cassandratable[mytable, myrecord] { object id extends uuidcolumn(this) partitionkey[uuid] // mytable owner , myrecord record. object mapcolumn extends mapcolumn[mytable, myrecord, strin

javascript - Node.js classes as modules -

i trying make application more object orientated. want create following class (object): in file media.js //media object var media = function (file, targetdirectory) { this.file = file; this.targetdir = targetdirectory; this.filename = this.getname(); }; media.prototype.isvideo = function () { return this.file.mimetype.indexof('video') >= 0; }; media.prototype.isaudio = function () { return this.file.mimetype.indexof('audio') >= 0; }; media.prototype.getname = function () { return this.file.originalname.substr(0, this.file.originalname.indexof('.')) }; i wish use object in serveral places of application im not quite sure how include it. idea or should use modules instead? you can export media object follows in media.js module.exports = media; then require media.js when need it const media = require('pathtofile/media.js') media.isaudio(a, b);

4gl - SAS %INCLUDE Statement - proceed even if an error -

i have code tells me went wrong in file a.sas filename myfile email to=&e_mail. subject= "error" type="text/plain"; %macro errmail; %if &syserr ne 0 %then %do; data _null_;

javascript - timer is not triggering after one minute using jquery or give some other solution to trigger function after every 1 min? -

var settimer; var istimeset = false; if (!istimeset) { settimer = $('#hdn_timertime').val(); istimeset = true; } initialtimer(); function initialtimer() { var customminutes = 60 * parseint(settimer), display = $('#time'); starttimer(customminutes, display); } function starttimer(duration, display) { var timer = duration, minutes, seconds; setinterval(function () { minutes = parseint(timer / 60, 10) seconds = parseint(timer % 60, 10); minutes = minutes < 10 ? "0" + minutes : minutes; seconds = seconds < 10 ? "0" + seconds : seconds; display.text(minutes + ":" + seconds); if (--timer < 0) { timer = duration; $('#outputmeters').val(json.stringify(listitem)); // _hardmeter.updatemeterdata(); _hardmeter.tempupdatemeterdataconfirmation(); } }, 1000); } this c

R Leaps Package: Regsubsets - coef "Reordr" Fortran error -

i'm using r leaps package obtain fit data: (my dataframe df contains y variable , 41 predictor variables) require(leaps) n=3 regsubsets(y ~ ., data = df, nbest=1, nvmax=n+1,force.in="x", method = 'exhaustive')-> regfit coef(regfit,id = n) when run code more once (the first time works fine) following error when run coef command: error in .fortran("reordr", np = as.integer(object$np), nrbar = as.integer(object$nrbar), : "reordr" not resolved current namespace (leaps) any why happening appreciated. a. i had build package source inserting (package = 'leaps') argument reordr function in leaps.r file. works fine every time. the solution related to: r: error message --- package error: "functionname" not resolved current namespace

java - Update Javascript source from backbean JSF -

i have javscript in xhtml file <script src="test1.js"></script> now have couple of other javascripts well. themes. i want give users flexibility change them (javascript name) frmo drop-down box . i tried way <script src="#{testbean.jsname}</script> since going ajax update have update section , updated with <h:panelgrid id="jsname"> <script src="#{testbean.jsname}</script> </h:panelgrid> this not inside form . when try <p:commandbutton value="generate" actionlistener="#{tbean.generategraph}" update="jsname"></p:commandbutton> it doesn't work says couldn't find jsname . i put gride inside form wont throw error script name still remain same. does have better idea or other way achieve it? if try update component inside form have use absolute id of panelgrid otherwise primefaces try update id jsname inside form. when want use

ns2 - Segmentation fault for the DSR protocol -

i have been trying find out why segmentation fault occurs couldn't following code can help set val(chan) channel/wirelesschannel ; set val(prop) propagation/tworayground ; set val(netif) phy/wirelessphy ; set val(mac) mac/802_11 ; set val(ifq) queue/droptail/priqueue ; set val(ll) ll ; set val(ant) antenna/omniantenna ; set val(ifqlen) 60 ; set val(nn) 20 ; set val(rp) dsr ; set val(x) 900 ; set val(y) 900 ; set val(stop) 800 ; set ns [new simulator] set tracefd [open testdsr.tr w] set namtrace [open testdsr.nam w] set windowvstime2 [open win.tr w] $ns trace-all $tracefd $ns namtrace-all-wireless $namtrace $v

Generate random linearly independent polynomials on MATLAB -

i create set of k random linearly independent polynomials of m-th order on matlab. came across this question on stackoverflow not sure of linear independence; , not looking make binary mentioned in referred question. i tried using: p = rand(k,m); will give me k random linearly independent polynomials of m-th order? you can use numerical properties of orthogonal decomposition matrices linear independence. m = 10; f = rand(m); f = f + f'; [q,~] = qr(f); p = q'*diag(rand(1,m))*q;

android - OutOfMemoryError - DiskBasedCache crash -

i started receiving crash : non-fatal exception: java.lang.outofmemoryerror failed allocate 2037654060 byte allocation 33554336 free bytes , 170mb until oom raw com.android.volley.toolbox.diskbasedcache.streamtobytes (diskbasedcache.java:322) com.android.volley.toolbox.diskbasedcache.readstring (diskbasedcache.java:532) com.android.volley.cachedispatcher.run (cachedispatcher.java:84) my parsenetworkresponse: @override protected response<t> parsenetworkresponse(networkresponse response) { try { string json = new string( response.data, httpheaderparser.parsecharset(response.headers)); return response.success( gson.fromjson(json, class), httpheaderparser.parsecacheheaders(response)); i've tried adding setshouldcache(false); parsenetworkresponse callback method doesn't solve issue. in manifest add android:largeheap="true" , read these http://android-developers.blogspot.in/2009/01/avoiding-memory-leaks.htm

java - Spring Batch property placeholder endline -

i facing problem while trying store end line separator in java properties file in order import xml configuration file. with following xml : <bean id="foowriter" class="org.springframework.batch.item.file.flatfileitemwriter"> <property name="resource" value="file:${myjob.file.output}" /> <property name="lineseparator" value="${myjob.file.lineseparator}" /> </bean> the following property entry : myjob.file.lineseparator = &#10; gives : foo &#10; bar myjob.file.lineseparator = \n gives : foobar(nothing) myjob.file.lineseparator = \\n gives : foo\nbar myjob.file.lineseparator = '\n' or "\n" gives : foo' or foo" 'bar or "bar it seems it's working quotes remains. any solution externalize endline separator ? it work me spring 4 , a properties file containing lineseparator=\n spring configuration &

javascript - Apply zoom pan and axis rescale in d3 -

i have created scattered chart in d3. it's working fine have requirement add zooming , axis rescaling chart. since pretty new d3 not able it.i have seen example able apply zooming, panning etc code in chart. here code- var margin = { top: 35, right: 10, bottom: 40, left: 80 }, width = width - margin.left - margin.right, height = height - margin.top - margin.bottom; var xvalue = function(d){ return d[measurearray[1]]; }, x = d3.scale.linear() .range([0, width*.98]), xmap = function(d,i) { return x(xvalue(d)); }, make_x_axis = function() { return d3.svg.gridaxis() .scale(x) .orient("bottom") }, xaxis = d3.svg.axis() .scale(x) .orient("bottom") .tickformat(function(d) { return d; }); var yvalue = function(d){ return d[measurearray[0]]; }, y = d3.scale.linear() .range([height*

java - WebServices - How can i catch ConnectException? -

i have 2 servers (primary , secondary) , corresponding clients. both using same wsdl contract (so can't change operations) because want server fault tolerant . doing verify primary server , running pinging secondary. when primary server doesn't answer know server down. main problem when try ping disconnected server sends: javax.xml.ws.webserviceexception: java.net.connectexception: connection refused how can catch exception if never thrown in body of function? or there way verify if server up? here code: secondary server private void isalive(){ string alive = null; try { client client = new client(uddiurl, wsname); while(true){ try { alive = client.ping("alive"); } catch (connectexception e1) { system.out.println("primary server down"); } try { thread.sleep(2000);

python - Can someone help me make my program case unsensitive? -

this code far, right case sensitive. tried making string lowercase (using .lower) without success. can help? file=open("numbertext.txt","w") my_string= input("enter sentence. ") splitted = my_string.split() d = {} l=[] i,j in enumerate(splitted): if j in d: l.append(d[j]) else: d[j]=i l.append(i) print(l) file.write(str(l)) [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 4, 11, 5, 6] file=open("newfile.txt","w") file.close the function lower returns converted string , doesn't convert string self. should use lower here: splitted = my_string.lower().split() optimization code: d = {} l=[] i,j in enumerate(splitted): l.append(d.setdefault(j, i)) open("numbertext.txt","w") f: f.write(str(l))

Import maven project created in intellij to eclipse -

i trying import maven project project created in intellij idea .the problem folder structure messed , not per maven structure. missing here? if have not same maven standard directory layout , can setting custom paths source folders pom.xml code below or fix manually based on standard maven structure. seems intellij idea project have lot of custom configuration .idea files <sourcedirectory>${project.basedir}/src/main/java</sourcedirectory> <testsourcedirectory>${project.basedir}/src/test/java</testsourcedirectory> <resources> <resource> <directory>${project.basedir}/src/main/resources</directory> </resource> </resources> <testresources> <testresource> <directory>${project.basedir}/src/test/resources</directory> </testresource> </testresources>

android - ArrayList Length gets 0 in Singleton -

i using singleton fetching data web service , storing resulting data object in arraylist. looks this: public class datahelper { private static datahelper instance = null; private list<customclass> data = null; protected datahelper() { data = new arraylist<>(); } public synchronized static datahelper getinstance() { if(instance == null) { instance = new datahelper(); } return instance; } public void fetchdata(){ backendlessdataquery query = new backendlessdataquery(); queryoptions options = new queryoptions(); options.setsortby(arrays.aslist("street")); query.setqueryoptions(options); customclass.findasync(query, new asynccallback<backendlesscollection<customclass>>() { @override public void handleresponse(backendlesscollection<customclass> response) { int size = response.getcurrentpage().size(); if (size > 0) { adddata(response.ge

php - Deploy Simple Symfony application to Azure : Slow? -

Image
last week, tried deploy simple symfony app on azure. choose plan app service b2 (2cores / 3.5go ram). php version : 5.6. first took forever complete composer install. (i tried go on s3, little faster not different). tried optimize php config, opcache, realpath_cache_size...etc (xdebug disabled). tried enable wincache, no real improvment. so app deployed, slow usable. simple php app/console (in dev mode) takes ~23secondes. seems recreate cache everytime. on local unix environnment (similar specs), takes 6seconds when cache cold , 500ms when dev cache warm. i think main problem filesystem issue, because remove dev cache folder takes 16 seconds. on local unix environnment, similar specs, takes ~200ms remove same folder. like said tried s3 plan small improvment not enough explain slowness. 1 thing weird, it's if rerun command php app/console after finished, command takes 5seconds run (much better). if rerun 5seconds after finished, takes 23seconds. i tried these solut

broadcastreceiver - Which is the better way to define permission in android? -

i want start activity on_boot_completed. facing 1 strange problem. if specify boot permission outside of receiver tag, outside of application tag. activity gets started. following <uses-sdk android:minsdkversion="8" android:targetsdkversion="16" /> <uses-permission android:name="android.permission.receive_boot_completed" /> <application android:allowbackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/apptheme" > <activity android:name="com.example.broadcaststaticdemo.mainactivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </intent-filter> </activity> &

java - Using class annotations or static properties -

i’m new java , wondering best practices here. say have generic class (e.g. car ), , inherited classes ( honda , subaru ) share properties. public abstract class car { public static short id; } public class honda extends car { public static final short id = 1; } public class subaru extends car { public static final short id = 2; } doesn’t break dry principle? using annotation then? @retention(retentionpolicy.runtime) @target(elementtype.type) public @interface id { public short value(); } public abstract class car { } @id(1) public class honda extends car { } @id(2) public class subaru extends car { } it of course bit question of taste. not recommend you. annotations metainformation mark fields, methods , classes. id (or nbseats) rather field annotation. i prefer in case: public abstract class car { protected static short id; public static short getid() { return id; } } class honda extends car { static { id = 1; } }

javascript - Loading different css to IE -

so i'm trying load different css stylesheet if ie detected. my code: <head> <!-- other scripts , stylesheets --> <!--[if ie]> <link href='css/index_ie.css' rel='stylesheet' type='text/css'> <![endif]--> <!--[if !ie]> <link href='css/index.css' rel='stylesheet' type='text/css'> <![endif]--> <script> (function() { if (typeof activexobject === "undefined") { var s = document.createelement('link'); s.href = "css/index.css"; s.rel = "stylesheet"; s.type = "type/css"; document.documentelement.appendchild(s); } else { var s = document.createelement('link'); s.href = "css/index_ie.css"; s.rel = "stylesheet"; s.type = "type/css"; document.documentelement.appendchild(s); } })(); </script> <

css - How to make a div scroll able when window height is reached -

i have developed template using bootstrap, following fiddle represents layout expected, want yellow area scroll able when content inside reaches window height, while right red panel remains fixed. html <div class="header"> header </div> <div class="content"> <div class="left-panel"> <div class="dummy-content"> results </div> <div class="dummy-content"> results </div> <div class="dummy-content"> results </div> <div class="dummy-content"> results </div> <div class="dummy-content"> results </div> <div class="dummy-content"> results </div> <div class="dummy-content"> results </div> </div> <div class=&quo

c# - Millions of rows in the database, only so much needed -

problem summary: c# (mvc), entity framework 5.0 , oracle. i have couple of million rows in view joins 2 tables. i need populate dropdownlists filter-posibilities. the options in these dropdownlists should reflect actual contents of view column, distinct. i want update dropdownlists whenever select something, new options reflect filtered content, preventing choosing give 0 results. its slow. question: whats right way of getting these dropdownlists populated? now more detail. -- goal of page -- the user presented dropownlists filter data in grid below. grid represents view (see "database") results filtered. each dropdownlist represents filter column of view. once selected, rest of page updates. other dropdownlists contain posible values corresponding columns complies filter applied in first dropdownlist. once user has selected couple of filters, he/she presses search button , grid below dropdownlists updates. -- database -- i have view selects colum

php - safest way to process POST actions -

this way i'm handling post submit actions: <form action="process.php" method="post"> //several form fields <input type="submit" name="ok" value="save" /> then on processing page have this: if(isset($_post['ok']) && $_post['ok']=="save") { //process action, , possibly save database } now i'm fearing malicious person might this(from script on website) <form action="http://www.mysite.com/process.php" method="post"> //he can "view source" on site, view fields i'm having , put them //then put submit button <input type="submit" name="ok" value="save" /> of course see in hot soup. can do, or safest way of handling , processing post submit actions? there 2 potential problems here. stopping mallory making malicious requests bob's website authenticate user (with oauth, username ,

c++ cli - How to return System::String handle from function? -

how return system::string handle function? should use gcnew or not? example, 1 of 2 code examples below correct? system::string ^managedoptimizer::getlogsolutionevolution() { return gcnew system::string(myconstcharpointer); } or one: system::string ^managedoptimizer::getlogsolutionevolution() { return system::string(myconstcharpointer); } thanks string reference type , if immutable. must use "gcnew" version... see also: string

tortoisesvn - Tortoise SVN use different accounts access different paths -

in repo, there different accounts control privileges different folders, , there public account has read-only privilege aceess whole repo. for example the repo path is: svn://foo.bar/trunk/ svn://foo.bar/trunk/projecta/ and public account pub has read-only privilege access svn://foo.bar/trunk/ . my working account staffa has full priviege of svn://foo.bar/trunk/projecta/ has no priviege of svn://foo.bar/trunk/ . my local repo has been checkouted @ d:\worksapce\ svn://foo.bar/trunk/ . problem i can use pub checkout/update svn://foo.bar/trunk/ i cannot use staffa checkout/update svn://foo.bar/trunk/ except projecta folder i can use staffa commit on svn://foo.bar/trunk/projecta/ the admin of code refuesed add read-pnly privilege staffa trunk path. linux's alias may solve problem, i'm working on windows. , tortoise svn helpful while solving conflicts , comparing history. every time ci/up, must type corresponding account , password in tortoise

How to resolve ClassNotFoundException in Android Studio -

i have migrated project eclipse android studio. earlier working perfectly, when started working on again not able launch application. showing me same error. haven't changed on application level, still getting same result. here log getting fatal exception: main process: com.example.android, pid: 6977 java.lang.runtimeexception: unable instantiate application com.example.android.mobapplication: java.lang.classnotfoundexception: didn't find class "com.example.android.mobapplication" on path: dexpathlist[[zip file "/data/app/com.example.android-1/base.apk"],nativelibrarydirectories=[/vendor/lib, /system/lib]] @ android.app.loadedapk.makeapplication(loadedapk.java:601) @ android.app.activitythread.handlebindapplication(activitythread.java:4919) @ android.app.activitythread.access$1500(activitythread.java:144) @ android.app.activitythread$h.handlemessage(activitythread.java:1424) @ android.os.handler.dispatchmessage(handler.java:102) @ android.os.looper.loop

python - Select uppercase table name on postgreSQL is not working -

this question has answer here: postgres case sensitivity 1 answer i'm using psycopg2 on windows7 , python3.4.4. i'd data tables of uppercase name, couldn't figure out. can me? always retuturn relation "table" not exist want make "table" uppercase. here's code import psycopg2 class kindofcoupons: def get_coupons(self, cur, names): coupons = {} name in names: coupons[name] = cur.execute("select * \"" + name + "\" ;") return coupons def connect_redshift(self): conn = psycopg2.connect("dbname=dbname host=host user=user password=password port=000") return conn.cursor() def get_coupon_used_type(self): cur = self.connect_redshift() names = ["table", "table_b", "table_c"] coupons = se

c# - Verify CheckBox Checked in foreach -

i needed verify if exists checkbox unchecked in form. have verification in btnsend_onclick event. if exists 1 checkbox unchecked, enable label message error. if have other rows, , it's checked, how it's foreach, don't show mesage error! how build verification, in c#, verifies if exists checkbox unchecked , shows message user , stops foreach? i'm clear? my cs: protected void btnsend_onclick(object sender, eventargs e) { foreach (gridviewrow row in gridview.rows) { checkbox check = (checkbox)row.findcontrol("checkbox1"); checkbox check2 = (checkbox)row.findcontrol("checkbox2"); if (check.checked == false && check2.checked == false) { lblerrorcheck.visible = true; } else { } } } my page: <body> <form id="form1" runat="server"> <div> <div class="control-group error"> <asp:label

ruby - How to implement multi device Login in rails 3? -

i'm using clearance(1.3.0) gem rails(3.2.18) , ruby(2.0). want implement multi device login & maintain devise token push notification. when logout 1 device, should not affect other login. clearance supports single remember token each user. continue using clearance , add multiple user tokens can signed out individually, need override quite bit of clearance. there open discussion adding feature clearance 2.0: https://github.com/thoughtbot/clearance/issues/675

c++ - Python 3.5 on Windows10 - unable to install cx_freeze - 'cxfreeze-postinstall' does not exist -

i'm trying install cx_freeze on python, , doesn't seem work. i've tried both through pip in command line (python -m pip install cx_freeze) , through pycharm community add packages. at first gave notorious unable find vcvarsall.bat - installed visual studios latest c++ compilers. now gives error message - cxfreeze-postinstall not exist: enter image description here please me! well, tried installing win32 version - , worked... have no idea why, since computer 64bit os 64bit processor, , i've installed 64bit version of stuff until now. update: well, cx_freeze installs, still can't manage executable file. think maybe module/package not compatible python 3.5 - later try on 3.4 , see if works. update_2.0: works great on python 3.4 - guess there's problem package compatibility python 3.5

textillate.js - pause between slides -

i have simple textillate box 5 slides. how can set pause between slides ? my code: $('.textslide').textillate({ loop: true, mindisplaytime: 4000, initialdelay: 1500, ineffects: ['fadeinleft'], outeffects: ['fadeout'], in: { effect: 'fadeinleft', sync: true, delay: 500 }, out: { effect: 'fadeoutright', sync: true, delay: 500 }, type: 'char', autostart: true })

iphone - how to set cornerRadius for only top-left and top-right corner of a UIView? -

is there way set cornerradius top-left , top-right corner of uiview ? edit: i tried following, end not seeing view anymore. wrong code below? uiview *view = [[uiview alloc] initwithframe:frame]; calayer *layer = [calayer layer]; uibezierpath *shadowpath = [uibezierpath bezierpathwithroundedrect:frame byroundingcorners:(uirectcornertopleft|uirectcornertopright) cornerradii:cgsizemake(3.0, 3.0)]; layer.shadowpath = shadowpath.cgpath; view.layer.mask = layer; pay attention fact if have layout constraints attached it, must refresh follows: override public func layoutsubviews() { super.layoutsubviews() roundcorners(corners: [.bottomleft, .bottomright], radius: uiflashlabel.cornerradius) } if don't won't show up.

javascript - Access handlebars properties from script tag -

in handlebars template, can access handlebar parameter inside script tag like <script> var alist = {{list}} </script> the template called express response.render('template', {list: [1, 2, 3]}) express back-end framework, won't able render front-end templates (that is, templates within <script> tags) express. to use handlebars template express, can use package express-handlebars ; documentation package take step-by-step through setup process.

html - How to Hide the Native Mouseover a Title Element? -

i have designed table whereby want display tooltips when hover on item. this mean. http://i.stack.imgur.com/snsmc.png however, problem having title displays twice! once using style created , once default browser behavior <a title=""> element... how can solve this? edit: have attached image, can see talking about. you can make own , store title attribute's data in there , use new attribute display data , yes remove title attribute. ok let's explain it, see have used title property's text of tabs hyperlinks show popup. suggesting make property, named data-popup , remove title attribute , change script , make use of data-popup property. sorry ""attribute"" :p .

jmeter - How to share a huge process among threads -

Image
i have un deployment process large number of apis. i list of apis querying restservice returns json response { "count" : 10000 ,[ {api_id:"1" , api_name:"xyz"},{api_id:"2",api_name:"abc"},....,{api_id:"999",api_name:"uuf"}]} for each api id need perform common undeploy .. now single thread hole process taking long time. i want increase threads hence processing time reduced. currently thread group shown below click see image run process expected , want share big task among threads , when thread-1 doing undeploy of api_id 3 thread-2 should not try undeploy same api_id 3 .since threads trying access same data , try same process getting errors. now looking solution doesn't have overriding issues , want share process. i thought of sharing among threads (1000/no of threads = chunck) , each thread start index 0 chunck , chunk+1 2*chunck ...etc unsure of implementation. thanks. given h

Can I disable asyncronous validation with redux form on form submit? -

this question specific redux-form. i using asyncronous validation field don't want re-validate on form submit validation expensive. i've looked @ github issue https://github.com/erikras/redux-form/issues/681 , suggestion memoize async validation function. don't want go server this, there way access store inside asyncvalidate? from redux-form code, looks should possible check fields async errors inside handlesubmit function, rather calling asyncvalidate() . added configuration option redux-form? v6.0.0-alpha.8 , released yesterday, introduced shouldasyncvalidate() config parameter addresses specific issue.