Posts

Showing posts from April, 2014

android - how to set repeating time in setExact() function of alarm manager -

everyone here saying use setexact api level 19 , higher couldn't find how set repeating time in repeated again @ specified time. so please tell me how set repeating time in setexact method? here code calendar calendar2,calendar,cal,cal2; calendar = new gregoriancalendar(); calendar2 = new gregoriancalendar(); calendar2.settimeinmillis(system.currenttimemillis()); calendar.settimeinmillis(system.currenttimemillis()); cal = new gregoriancalendar(); cal2 = new gregoriancalendar(); cal.add(calendar.day_of_year, calendar.get(calendar.day_of_year)); cal.set(calendar.hour_of_day, 10); cal.set(calendar.minute, 0); cal.set(calendar.second, calendar.get(calendar.second)); cal.set(calendar.millisecond, calendar.get(calendar.millisecond)); cal.set(calendar.date, calendar.get(calendar.date)); cal.set(calendar.month, calendar.get(calendar.month)); alarmmanager alar...

nginx 502 Bad Gateway after rails deploy -

i deploying rails app nginx , unicorn , getting 502 bad getway. can me solve this? thank much my nginx error log (/var/log/nginx/error.log) shows: 2015/05/14 00:26:22 [crit] 24642#0: *13 connect() unix:/tmp/unicorn.easysign.sock failed (2: no such file or directory) while connecting upstream, client: 89.100.32.54, server: localhost, request: "get /easysign http/1.1", upstream: "http://unix:/tmp/unicorn.easysign.sock:/500.html", host: "mysite.com" /etc/nginx/conf.d/default.conf: upstream app { # path unicorn sock file, defined server unix:/tmp/unicorn.easysign.sock fail_timeout=0; } server { listen 80; server_name localhost; root /var/www/mysite.com/public_html/easysign; try_files $uri/index.html $uri @app; location @app { proxy_pass http://app; proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for; proxy_set_header host $http_host; proxy_redirect off; } error_...

OpenCV SVM Train -

i using svm.train command (with appropriate parameters defined) opencv. next, instead of using svm.predict, want use algorithm classification purpose. possible? can access support vectors generated while training? if so, how ? yes can. save support vectors after training in xml file. looks this: clasificador = new cvsvm(trainingdata, classes, new mat(), new mat(), params); clasificador.save(xml); now can define own classificador. guess did it. on write method should this clasificador.load( new file( xml ).getabsolutepath() );

css - HTML5 Not Highlighting Invalid Inputs Due To box-shadow -

i have form inputs following bootstrap class - form-control . use html5 form validation on form. problem is, red highlight on invalid inputs don't appear because of inclusion of box-shadow , border-color styles. how can make them appear styles applied? of styles applied own css , bootstrap's css. try use css pseudo selectors: input:required:invalid, input:focus:invalid, textarea:required:invalid, textarea:focus:invalid ... if necessary have specify more powerful css selectors .form-control

c# - Azure RoleEntryPoint not called? -

i've deployed solution azure cloudservice using sdk version 2.6. solution running fine , want configure iis settings roleentrypoint (like keeping threadpool running). whatever do, seems roleentrypoint never called. trying trace information, throwing exceptions, returning "false" in onstart(). deploy package, cloudservice instances restart , fine. this simple class: using system; using system.diagnostics; using system.linq; using elmah; using microsoft.web.administration; using microsoft.windowsazure.diagnostics; using microsoft.windowsazure.serviceruntime; using telerik.sitefinity.cloud.windowsazure; namespace sitefinitywebapp { public class azurewebrole : roleentrypoint { public override void run() { trace.writeline("entering run method"); trace.traceinformation("run"); base.run(); } public override bool onstart() { return false; trace.writeline("entering onstart method...

java - Maven does not run integration tests using failsafe-plugin -

i know question asked more once. cannot make maven run integration tests using failsafe-plugin. when execute mvn failsafe:integration-test failsafe:verify runs integration tests. when execute mvn verify integration tests not running. pom.xml <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <groupid>com.bahadirakin</groupid> <artifactid>integration-tests</artifactid> <version>1.0-snapshot</version> <packaging>jar</packaging> <name>integration-tests</name> <url>http://maven.apache.org</url> <properties> <project.build.sourceencoding>utf-8</project.build.sourceencoding> </properties> <build> <plugins> <plugi...

java - Using @SuppressWarnings within method generates compile error -

i have following code block: final map<string, double> map; if (cond) { int currency = 44; @suppresswarnings("unchecked") map = (map<string, double>)objecta.get(); }else { map= ....} get() method of objecta returns raw hashmap (i know nice use generics there , problem solved, cannot change code class). if remove @suppresswarnings("unchecked") line, typesafety warning. when add supress warning in line right bellow assignment, following error : map cannot resoved type! could explain me why? the compiler thinks @suppresswarnings("unchecked") expression , there's no terminal operator ; . however, if add it, expression invalid. you have annotate method or use annotation before variable definition: @suppresswarnings("unchecked") public void method() { @suppresswarnings("unchecked") final map<stri...

iphone - How to show google map in ios8 with current location all annotation pin -

Image
i have show google map in ios8.0. able open google map but map not coming clearly. please check screenshot . have given permission in info.plist , written corresponding code... please check below... self.mlocationmanager = [[cllocationmanager alloc] init]; self.mlocationmanager.delegate = self; self.mlocationmanager.desiredaccuracy=kcllocationaccuracybest; self.mlocationmanager.distancefilter = kdistancefivehundredmeters; if ([self.mlocationmanager respondstoselector:@selector(requestwheninuseauthorization)]) { [self.mlocationmanager requestwheninuseauthorization]; } if ([self.mlocationmanager respondstoselector:@selector(requestalwaysauthorization)]) { [self.mlocationmanager requestalwaysauthorization]; } [self.mlocationmanager startupdatinglocation]; and want show current location , annotation showing on map on map rect. how it? info.plist nslocationalwaysusagedescription location required find out nslocationwheninuseusagedescription location r...

ios - Change font in Container Views UIViewController -

i have container view within uiviewcontroller (1). how change font of label in uiview programatically in uiviewcontroller (2) generated container view? view.transform = cgaffinetransformmakescale(1.3, 1.3);

angularjs - Spring security CSRF CORS -

problem statement: have restful apis csrf protected using spring security. also, these apis accessed different origin/domain angular web ui . don't need spring authentication authentication handled siteminder. approach: followed link from dave syer csrf protection : the login page: angular js , spring security part ii working except 1 issue (below). issue : code work fine when angular html client accessing restful apis on same origin/domain; when try access same apis different origin, getting error 403 - access forbidden - csrf token error. approach tried far extending example: added cors filter - enabling cross origin requests restful web service response.setheader("access-control-allow-origin", "*"); response.setheader("access-control-allow-methods", "post, get, options, delete"); response.setheader("access-control-max-age", "3600"); response.setheader("access-control-allow-headers", "x-r...

c# - How to get ranged by index with LINQ allow to take previous or next items? -

for example want take next 3 items this private ienumerable<t> indexrange<t>(ilist<t> source, int start, int end) { return source.skip(start).take(end); } but need able take previous 3 items if need it. how possible? example: indexrange(source, 15, 12); your code wrong. should be: return source.skip(start).take(end - start + 1); to you're asking be: return source.skip(math.min(start, end)).take(math.abs(end - start) + 1); note code assumes both start , end inclusive.

python - How to import a class from ndb.Model? -

i'm working google app engine , want use ndb model in .py file couldn't import it. here main.py; from google.appengine.ext import ndb class user(ndb.model): username = ndb.stringproperty() created_date = ndb.datetimeproperty(auto_now=true) follower_list = ndb.stringproperty(repeated=true) and code cron.py file: from google.appengine.ext import ndb save_user = user.query().filter(user.username == username) but i'm getting: importerror: no module named user how can import user class? when create model you're instantiating class , assigning variable named user . in python variables bound module declared in, , there no implicit globals, if want use in module need import it: from google.appengine.ext import ndb import main save_user = main.user.query().filter(main.user.username == username) however best practice create models in models.py file, , import anytime need them. btw, error hints you're trying import user e...

c# - Change system date programmatically -

how can change local system's date & time programmatically c#? here found answer. i have reposted here improve clarity. define structure: [structlayout(layoutkind.sequential)] public struct systemtime { public short wyear; public short wmonth; public short wdayofweek; public short wday; public short whour; public short wminute; public short wsecond; public short wmilliseconds; } add following extern method class: [dllimport("kernel32.dll", setlasterror = true)] public static extern bool setsystemtime(ref systemtime st); then call method instance of struct this: systemtime st = new systemtime(); st.wyear = 2009; // must short st.wmonth = 1; st.wday = 1; st.whour = 0; st.wminute = 0; st.wsecond = 0; setsystemtime(ref st); // invoke method.

How to get some part of string php? -

my string 1/2/3/33/34 . now want 3/33/34 part, i getting many string in string 1/2/ common n want string after 1/2/ string echo substr('1/2/3/33/34',4); that takes out 1/2/ (first 4 letters of string) fiddle

angularjs - Is it safe to write an angular app for an admin portal? -

precondition: server side routes ajax data calls middlewared authentication. because client side can altered, how can stop user seeing admin dashboard , because routes secure page loading not , see admin dashboard looks like. thanks

asp.net core - TagHelper for passing route values as part of a link with this format /users/edit/10 -

i need pass id resource part of url. there way can have link formatted /users/edit/10 using tag helper? i've seen following example on question, gives me user/edit?id=10&foo=bar. not looking for. :( <a asp-action="edit" asp-route-id="10" asp-route-foo="bar">edit</a> below actual function trying reach: [httpget] [route("[controller]/edit/{blogid:int}")] public iactionresult blogedit(int blogid) { blog blog = _blogrepo.getbyid(blogid); blogeditviewmodel blogeditviewmodel = new blogeditviewmodel { title = blog.title, body = blog.body, id = blog.id }; viewbag.title = "edit blog"; return view(blogeditviewmodel); } i tried using tag below, it's still generating incorrect link. <a asp-controller="blog" asp-action="blogedit" asp-route-blogid="11">edit blog 11</a> the above link generates path below. http://loc...

Can't build Android platform in Cordova 5.0.0 with build.bat: Command failed with exit code 8 -

my enviroment windows 7 + visual studio 2013 develop hybrid mobile app, after upgrade cordova 5.0.0, i've upgrade sdk newly version, , eliminable command failed exit code 2, deploy device , build android, got compile error: error 1 e:\@project\mobile\apps\blankproject\blankproject\bld\debug\platforms\android\cordova\build.bat: command failed exit code 8 e:\@project\mobile\apps\blankproject\blankproject\mdavscli 1 1 blankproject it seen command failed exit code 2 become 8, missed else? ============================================================ edited: the reason why have tested below: 1.) upgrade c:\program files (x86)\microsoft visual studio 12.0\common7\ide\extensions\0d2pwvj3.s0k\packages\vs-mda\package.json >> cordova version 4.3.0 5.0.0, error happed. 2.) reverse step 1 cordova version 5.0.0 4.3.0, , normal. so, cordova 5.0.0 visual studio 2013 means me should not work. finally find using visual studio cordova! i've migrated vis...

php - Advanced Search Conditions drop-down sql query -

i want modify standard search form php script (idoc script) adding 3 drop down menus choose , display result result according condition such brand, category ,file type , search term. i have tried add condition "and" / "or" on query if value of drop down empty (not selected),no result displayed or garbaged. i want obtain search result can select 3 conditions before if needed reduce number of id sql database , these conditions, able find specific keyword name, tag , description tab. can give me feedback on how fix search query reducing/choosing amount of id generating result when one, two, 3 or none drop-down input specified ! normally can found solutions on web or on website cannot see how time. this form. <form name="sform" id="sform" action="{$baseurl}/{$langpage0}/{$langpage54}.html" method="get"> <div class="form"> <table> <tr> <t...

android - How do I attatch text information to a specific date using Calender View -

i added calender view black activity. <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" android:paddingbottom="@dimen/activity_vertical_margin" tools:context=".homepage"> <calendarview android:id="@+id/calender_view" android:onclick="hourslog" android:layout_width="match_parent" android:layout_height="match_parent"> </calendarview> what want able select date calender , enter numbers (hours logged) tied specific date kind of how reminder functions. i know have create new activity , intent i'm lost how ca...

android - How to retrieve data from SQLite and display in TextView only one at a time when clicked on button -

i have stored data in sqlite. need retrieve data sqlite , should display on text view when click on button. , when again click on button should other text view , should show in text view. using code can display text view. when click on button displaying every thing sqlite, need 1 text view @ time. public void display(view v) { //use cursor keep data //cursor can keep data of data type cursor c=db.rawquery("select * mytable", null); tv.settext(""); if(c!=null && c.getcount()>0) { //move cursor first position c.movetofirst(); //fetch data 1 one { //we can use c.getstring(0) here //or can data using column index string name=c.getstring(c.getcolumnindex("name")); string surname=c.getstring(1); //display on text view tv.append(name+surname+"\n"); //move next position until end of data }while(c.movetonext()); } } modify code below cursor c = null; ...

c - LibPCap & Packet Drops - Linux -

my app uses libpcap capture udp packets various sources. app has heavy computational work (ballpark ~2 seconds)... during time app not 'reading' libpcap. leading packet drops, i'm struggling understand why. kernel not dropping packets & think socket buffers should large enough. the interface receiving ~1000 packets per second. max packet size ~600 bytes. let's call 1mb/s (overestimate). i've set libpcap buffer size 4mib (passing libpcap bytes) , snapshot length ~600 bytes. i've modified os params (centos7): /proc/sys/net/core/netdev_max_backlog: 10000 /proc/sys/net/core/optmem_max: 8388608 /proc/sys/net/core/rmem_default: 8388608 /proc/sys/net/core/rmem_max: 8388608 result netstat -i: iface mtu rx-ok rx-err rx-drp rx-ovr eno2 1500 558672786 0 0 0 i've tried making of these values larger number of dropped packets doesn't appear reduce. something might worth mentioning... have tcpdump ru...

go - Using the Set() method of an image.Image or *image.RGBA -

i doing practice go image package free time summer. package main import ( "os" "image" "image/png" "image/color" "log" "fmt" "reflect" ) func main(){ file , err := os.openfile("c:/sources/go3x3.png", os.o_rdwr, os.filemode(0777)) if err != nil { log.fatal(err) } img , err := png.decode(file) if err != nil { log.fatal(err) } img.at(0,0).rgba() fmt.println("type:", reflect.typeof(img)) m := image.newrgba(image.rect(0, 0, 640, 480)) fmt.println("type:", reflect.typeof(m)) m.set(5, 5, color.rgba{255, 0, 0, 255}) img.set(0, 0, color.rgba{136, 0, 21, 255}) } the problem here when run img.set commented out result type: *image.rgba type: *image.rgba but when it's uncommented error saying img.set undefined (type image.image has no field or method set) i'm assuming i'm ...

matrix - R getting mean for every nth row -

is there more elegant way of getting mean current prior nth row? example, x=replicate(3, rnorm(20)) what want mean of column 2 each row + 2 rows prior. way 1) create empty column 2) loop through each row , values prior 2 rows, mean it, store in new column. it's tedious i'm wondering if there cleaner, faster method? in advance. ahdee try filter - doing rolling mean. filter(x[,2], rep(1/3,3), sides=1)

laravel - Recursing nested array in blade template -

i attempting loop out menu in laravel. i passing nested array main blade template categories-management.blade.php . view::make('categories-management')->with('categories', $categories); where $categories is array (size=3) 'business resources' => array (size=7) 'operations' => array (size=4) 'resource_type_id' => int 1 27 => array (size=3) 'id' => int 27 'name' => string 'design & development' (length=20) 'children' => array (size=2) ... truncated ... i kicking of menu inside of categories-management.blade.php this: @include('/includes/category-menu-item', array('categories', $categories)) inside includes/category-menu-item have following loop: @if(is_array($categories)) <ul> @foreach($categories $key => $value...

r - Combining vector and binary search in data.table -

sometimes, have keyed data.table i'd subset according key and unkeyed column. what's simplest/fastest way this? what feels natural error: dt <- data.table(id = 1:100, var = rnorm(100), key = "id") dt[.(seq(1, 100, 2)) & var > 0, ] the next cleanest thing chain: dt[.(seq(1, 100, 2))][var > 0, ] and of course can ditch using binary search @ (i think avoided): dt[id %in% seq(1, 100, 2) & var > 0, ] is there approach i'm missing? also, particular reason why first error? syntax seems clear enough me. as of writing, native way do: dt[.(seq(1, 100, 2)) & var > 0, j] #some expression j is following: dt[.(seq(1, 100, 2)), .sd[var > 0, j]] the more work data.table , more natural is, still looks bit unintuitive. c'est la vie.

amazon web services - Impose time limit to popen/fgets in PHP -

i want impose time limit process reading using fgets opened popen in php. i have next code: $handle = popen("tail -f -n 30 /tmp/pushlog.txt 2>&1", "r"); while(!feof($handle)) { $buffer = fgets($handle); echo "data: ".$buffer."\n"; @ob_flush(); flush(); } pclose($handle); i tried without success: set_time_limit(60); ignore_user_abort(false); the process follow: the browser send request waiting answer in html5 server side events format. the request received aws load balancer , forwarded ec2 instances. the answer last 30 lines of file the browser receive in 30 messages , connection persisted. if tail command sends new line returned else fgets wait undefined time until new line returned tail command. aws load balancer after 60 seconds of network inactivity (no new lines in 60 seconds) closes connection browser. connection ec2 instance not closed. the browser detect connection closed , opens new connectio...

python - Installed Flask in a virtualenv yet "command not found" -

installed virtualenv, activated it, pip installed flask, , yet, when try run script or see if recognised, command not found. (project)gabriel@debian:~/project$ pip list flask (0.10.1) itsdangerous (0.24) jinja2 (2.7.3) markupsafe (0.23) pip (1.5.6) setuptools (5.5.1) werkzeug (0.10.4) (project)gabriel@debian:~/project$ flask -bash: flask: command not found (project)gabriel@debian:~/project$ flask -bash: flask: command not found (project)gabriel@debian:~/project$ </3 also tried: (project)gabriel@debian:~/project$ python -m flask pi.py /home/gabriel/project/bin/python: no module named flask.__main__; 'flask' package , cannot directly executed (project)gabriel@debian:~/project$ flask 0.10 has no flask command, added in 0.11. if pi.py has smarts run app, such if it's using flask-script, command you're looking is: $ python pi.py you can install flask-cli flask command in 0.10 if can't upgrade 0.11.

ios - Parse query finds two objects when there is only one -

i have following code find objects in custom class. reason finding 2 of same object (self.addedarray2's count 2, on parse data table online, there one). see why finding same object twice? self.array2 = [[nsmutablearray alloc] init]; self.addedarray2 = [[nsmutablearray alloc] init]; pfquery *query = [pfquery querywithclassname:@"friends"]; [query wherekey:@"user" containsstring:[[pfuser currentuser] objectforkey:@"username"]]; [query findobjectsinbackgroundwithblock:^(nsarray *objects, nserror *error) { (friends *currentfriend in objects) { self.relation = currentfriend.friendsrelation; self.addedrelation = currentfriend.addedrelation; self.query = [_relation query]; [[_relation query] findobjectsinbackgroundwithblock:^(nsarray *objects, nserror *error) { [self.array2 addobjectsfromarray:objects]; [[_addedrelation query] findobjectsinbackgrou...

jquery - Which is he most secure method of passing values to Ajax -

what secure method of passing values through jquery ajax function? i serialising whole form, secure or there better ways of doing it? this ajax call using function login() { jquery.ajax({ type: "post", url: "ajax/index_login.php", data: $('#login').serialize(), cache: false, success: function(response) { if(response == 'valid'){ document.location.href = '/main_menu.php'; }else{ $('#index_error').html('incorrect username or password'); } } }); } i want make sure values can't intercepted in way via url or via browser passed server. there isn't can secure front-end form. can add kinds of validation, users can disable javascript, modify form attributes in dom, etc. should validate data on server, , make sure looks rea...

c# - Use EF changetracker to manually get set of changes? -

if load entity, make changes, , go save it, ef generates update statement. this must mean @ point (presumably change tracker) navigating loaded object hierarchy , generating list of (entity, property, value) changed. unrelated bit of infrastructure need diff object graphs in similar fashion. i'm thinking should able reuse same mechanism. so that's question - can this? can query changes particular entity or entire object graph? how? you use context's dbchangetracker returns ienumerable<dbentityentry> . loop on these comparing currentvalues originalvalues. original values values last query db. foreach (dbentityentry entity in changetracker.entries().where(e => e.state == entitystate.modified) { foreach (var propname in entity.currentvalues.propertynames) { var current = entity.currentvalues[propname]; var original = entity.originalvalues[propname]; } }

debugging - Break on variable value change in Android Studio 1.1.0? -

i know set breakpoint @ every line code changes variable, there option such right-clicking variable (to "add watches") stop when variable changes value? i think c++ has option. see this. and eclipse? see this. is implemented in as? you can break on value changes of variables in android studio 1.1.0. android studio calls them 'java field watchpoints'. from breakpoints windows, (run -> "view breakpoints...") or ctrl+shift+f8 , can add "java field watchpoints" plus in top left corner, , select class , variable.

unity3d - Animating particles based on their speed -

using legacy particle system, possible - instead of animating particles on lifetime - animate them on speed range? i'm trying shape of particle changed goes faster, "stretch" option won't work because stretching them won't good, think option have use uv animation.

php - how to inject a service in to a command that uses another service inside? -

i kind of new symfony2. i have service controller called curlcontroller, controller have called mycontroller uses curl controller service create curl requests. use $this->getcontainer()->get('cont.my') call it. now want add symfony command vars command line , passes mycontroller, wrote mycontroller service (cont.my) , call command using $this->container->get('cont.my') . it works command , in mycontroller functions, problem service inside doesnt work more. what doing wrong? the error receive : php fatal error: call member function get() on non-object service.yml: services: utils.curl: class: project\commonbundle\controller\utilscurlcontroller cont.my: class: project\serverbundle\controller\mycontroller mycommand : class mycommand extends containerawarecommand{ protected function configure(){ $this->setname('mycommand:execute') ->setdescription('create pull request'); } /** * {@inher...

php - Insert multiple checkboxes into table column -

i have table documents , part of docs being assigned category. table doc_list looks this: create table `doc_list` ( `doc_id` int(11) not null, `doc_title` varchar(50) not null, `doc_content` text not null, `doc_created` datetime not null, `doc_updated` timestamp not null default current_timestamp, `user_id` int(11) not null, `cat_no` int(11) not null ) engine=innodb default charset=utf16 auto_increment=122 ; i having manually assign cat_no (which category id) want apart of doc form submission: <form action="actions/newdocadd.php" method="post" id="rtf" name=""> <input type="text" name="doc_title" id="doc_title" required="required" placeholder="document title"/><br /> <?php try{ $results = $dbh->query("select * cat_list order cat_title asc "); }catch(exception $e) { echo $e-...

php - Is there a way to display column relationships with a third column? -

so have these tables in database: fish (id, f.name, image, cooking_type_id) cooking_type (id, name, thumbnail) if display list of fishes, how display correct thumbnails type_id? i'm having troubles finding right information. right i'm stuck query: $query = "select `f.name`, `image`, `type_id` fish"; $result = $mysqli->query($query); $mysqli->set_charset("utf8"); while($row = mysqli_fetch_array($result)){ echo '<div class="row" style="background-color:#fff;">'; echo '<div class="col-sm-2">'; echo '<div class="listphoto">'; echo $row['image']; echo '</div></div>'; echo '<div class="col-sm-2">'; echo '<div class="listtext"><h3>'; echo $row['f.name']; echo '</a>...

FireBase rule newData with uid -

Image
how can use unique id of new data in rule newdata? data structure: i want disallow write users 1 sendername in ban_users, cannot newdata sendername: newdata('sendername').val(); //not working newdata('$message_id/sendername').val(); //also not working("$message_id": {}) to disallow writes messages/main/$id , try following write rule: !root.child('chat/ban_users').haschild(newdata.child('sendername').val())

visualsvn server - Visual SVN "post-commit hook failed (exit code 1)" -

i trying write svn post-commit hook update remote working copy when commit made specific branch. should pretty simple getting cleanup warning. here hook "%visualsvn_server%bin\svnlook.exe" dirs-changed %1 -r %2 | findstr "branches/dev" if %errorlevel% equ 0 ( "%visualsvn_server%bin\svn.exe" update c:\temp\dev2 ) and failing following: post-commit hook failed (exit code 1) output: svn: e155004: run 'svn cleanup' remove locks (type 'svn cleanup' details) svn: e155004: working copy 'c:\temp\dev2' locked svn: e200031: sqlite: attempt write readonly database (s8) svn: e200031: additional errors: svn: e200031: sqlite: attempt write readonly database (s8) but there no locks nor clean up--i'm not touching 'dev2' working copy. running vsvn version 2.7.6, subversion 1.8 on windows server 2k8 r2 i have tried permissions changes , hard coding own svn credentials. edit: tried using full path visualsvn's svn ...

reactjs - Render React elements on different points -

how can render 2 react elements share props in 2 different part of page? i need because don't want render every part of page react, elements in <header /> share props <footer /> example: <body> <headerreactelement /> tons of html code <footerreactelement /> </body> thanks when instantiate header/footer element, pass in props. there's no reason not reuse exact same props. if data change, props should have callback function header , footer can listen , force re-render. //example listen changes componentwillmount: function(){ this.callback = (function(){ this.forceupdate(); }).bind(this); this.props.on('change',this.callback); },

How add parameters to a location redirect in Ruby -

we have redirect in our conf.erb file looks like: location /primary/api/umpco/airplay/ { rewrite /primary/api/umpco/airplay/(.*) <%= @primary_config['umpcoairplay']['url'] %>/$1 permanent; } how modify take variable "umpco". along these lines not of syntax: location /primary/api/<% somevar />/airplay/ { rewrite /primary/api/<% somevar />/airplay/(.*) <%= @primary_config['<% somevar />airplay']['url'] %>/$1 permanent; } you this: location /primary/api/<%= somevar %>/airplay/ { rewrite /primary/api/<%= somevar %>/airplay/(.*) <%= @primary_config["#{somevar}airplay"]["url"] %>/$1 permanent; } if somevar "umpco" third line equivalent this: <%= @primary_config["umpcoairplay"]["url"] %>/$1 permanent; this assumes @primary_config hash has "umpcoairplay" key.

python - How does one identify the time consuming tasks in a SimPy simulation? -

i speed simpy simulation (if possible), i'm not sure best way insert timers see taking long. is there way this? i recommend using runsnakerun (or guess snakeviz in py3x), uses cprofile(there directions on runsnakerun's webpage) basically run program python -m cprofile -o profile.dump my_main.py then can nice visual view of profile runsnake (or snakeviz if using py3) python runsnakerun.py profile.dump (note running in profile mode slow down code more ... identify slow parts)

Customize content in Share using Swift -

i trying make share button game. know, ones when click popup menu comes options. wondering how make different options different things. wondering how make "save camera roll" option. ill post code below. @ibaction func share(sender: uibutton) { let firstactivity = "yes! scored \(scorenumber) in dotcha! #dotcha @snowcapps_dev https://itunes.apple.com/us/app/dotcha!/id977870313?ls=1&mt=8" let activityviewcontroller : uiactivityviewcontroller = uiactivityviewcontroller(activityitems: [firstactivity], applicationactivities: il) self.presentviewcontroller(activityviewcontroller, animated: true, completion: nil) } if want customize text twitter, facebook, mail, etc, can inherit class uiactivityitemprovider in following way : class customprovider : uiactivityitemprovider { var facebookmessage : string! var twittermessage : string! var emailmessage : string! init(placeholderitem: anyobject, facebookmessage : ...

encryption - How to read a public key from a pem file using BIO from openssl? -

i'm using openssl library , want read public key .pem file bio. tried this, rsa variable remains uninitialized : rsa *rsa = rsa_new(); bio *keybio = null; keybio = bio_new(bio_s_file()); bio_read_filename(keybio, "public.pem"); // , tried instead of last 2 lines: // keybio = bio_new_file("public.rem", "r"); rsa = pem_read_bio_rsa_pubkey(keybio, &rsa, null, null); when debug application shows me this: rsa { padding = ???, n = ??? , ...} rsa->n <unable read memory> , on rsa fields. my file valid , key generated respecting pkcs#1 format. parsed asn1 parser. your code looks fine. try input: -----begin public key----- miibijanbgkqhkig9w0baqefaaocaq8amiibcgkcaqea1ihyytavz9pqrxpcyo7j m0dtiijnuvw3colqqkhq+wysttn1cwm2zytw0fsfldpotobnxfwkf9wykiyhs2uu d8viu+t/fvlcadyttzqdc5aobwlsuhp0xqqthmnuejga4fprmkusl8s5/cuafnrv nvsxa3jcn3kyrt9q1qbn+xboqn+h7gpqu3icmg7l1r/cwisq/wwubq+ney0tmvz5 lm6ais+gcv0uejvm6un6gdbcohk02xuplyhkb...

loopbackjs - Remote method for updating all records -

i try make custom endpoint, adds bonus all employee. , retorns employee records, endpoint. /employees/bonus as understand; should make remote method this: common/models/employee.js employee.bonus = function(cb){ // logic comes here cb(null,"") } employee.remotemethod( 'bonus',{} ) this makes endpoint, how can request employees, loop them through , increase salary property? query employee model, apply filter if need, loop through results. employee.find( filter, function(err,employees) { if(err){ console.log(err); } employees.foreach( function(employee){ fnincsalary(employee.salary); //do employee instance } ); } ); http://docs.strongloop.com/display/public/lb/querying+data

ios - How to use UITableView to display 2 UILabels and a grid of images, also auto update the Cell height -

i need build uitableview display list of posts, , each post contain 3 sections. title (uilabel 1 line of text) content (uilabel multi lines of texts) grid of images (number of images vary each row) i have followed this post . i able add title , content, , autolayout works need to. however, cannot add grid of images. i have create custom cell view class autosizecell.h/autosizecell.m in above post. have created modal class have 3 properties (title, content , nsmutablearray of image names need display in grid) however, seems cannot pass images names autosizecell.m , cannot display image grid. @implementation autosizecellcontents -(id)init { self = [super init]; if (self) { self.images = [[nsmutablearray alloc] init]; } return self; } @end controller: -(void)configurecell:(autosizecell *)cell atindexpath:(nsindexpath *)indexpath { // configure cell indexpath cell.category.text = [self getcategoryatindexpath:indexpath]; cell.past...

Static initialization in java 7 -

i have code initializes class as: private static myclass myobj = new myclass(); and using myobj in code below. works fine if java 6 used . when use java 7, nullpointerexception thrown. java.lang.nullpointerexception exception in thread "main" java.lang.exceptionininitializererror as work around, put null check myobj before using , made work. but still confused if there changes in java 7 implementation made static initialization fail? edit : found similar issue faced openam . we'll need more code sample , exception stacktrace diagnostic. pure speculation, know in java 7, changed class initialization little bit https://docs.oracle.com/javase/specs/jls/se7/html/jls-12.html#jls-12.4.2 for each class or interface c, there unique initialization lock lc. mapping c lc left discretion of java virtual machine implementation. procedure initializing c follows: synchronize on initialization lock, lc, c. involves waiting until current thre...

twitter bootstrap - Tabs not working in Single Page Application with AngularJS -

i have "edit" view need display tabs separate different information needed. found site discusses creation of directive catch tab changing. first directive , not working. when click on second tab, takes me default view. not sure have implemented incorrectly. web page - <ul class="nav nav-tabs"> <li class="active"><a showtab="" href="#home">home</a></li> <li><a showtab="" href="#menu1">menu 1</a></li> <li><a showtab="" href="#menu2">menu 2</a></li> <li><a showtab="" href="#menu3">menu 3</a></li> </ul> <div class="tab-content"> <div id="home" class="tab-pane fade in active"> <h3>home</h3> <p>lorem ipsum dolor sit amet, consectetur adipisicing elit, sed eiusmod tempor ...

html - Overflow Scroll in the table with rows as dropdown -

i have table 1 row each column dropdown many option in it. i want have overflow-y scroll. tried putting style not happening. <table id="displaytable" border="5" rules=rows frame=hsides class='border'><tr> <th>value</th> <th>in</th> <th>out</th> </tr> <tr><td> <c:foreach items="${abc}" var="user"> <option value="${user.name}">${user.name}</option><br> </c:foreach> </td> <td> <c:foreach items="${abc}" var="user"> <c:if test="${not fn:containsignorecase(user.name, 'in')}"> <option>x</option><br> </c:if> </c:foreach> <...

jquery - how to get the width of bootsrap modal -

how can display image in modal (filling whole modal). modal-size has 3 states: 900 600 and filling whole page for third 1 want know width. possible? tried .width() method (returns nothing) tryto use width:100% in style of <img>

linux - Get URL from XML node with xmllint, add new line -

i extracting url's xml file command: xmllint --xpath '//root/item/photo/text()' xml_2015-05-13-20\:39.xml it works, output mass text of url's: http://1.jpghttp://2.jpghttp://3.jpghttp://4.jpghttp://5.jpghttp://6.jpg it possible add \n new line character after each match? xml: <root> <item> <photo>http://1.jpg</photo> </item> <item> <photo>http://2.jpg</photo> </item> </root> here possible way whit xidel: xidel -e "//root/item/photo/text()" -q ./my.xml > ./processed_xml

java - Replace a substring by a changing replacement string -

i'm trying write small program detect comments in code file, , tag them index-tag, meaning tag increasing value. example input: method int foo (int y) { int temp; // first comment temp = 63; // second comment // third comment } should change to: method int foo (int y) { int temp; <tag_0>// first comment</tag> temp = 63; <tag_1>// second comment</tag> <tag_2>// third comment</tag> } i tried following code: string prefix, suffix; string pattern = "(//.*)"; pattern r = pattern.compile(pattern); matcher m = r.matcher(filetext); int = 0; suffix = "</tag>"; while (m.find()) { prefix = "<tag_" + + ">"; system.out.println(m.replaceall(prefix + m.group() + suffix)); i++; } the output above code is: method int foo (int y) { int temp; <tag_0>// first comment</tag> temp = 63; <ta...

Connecting to COM object in ColdFusion -

i trying connect sage 100 com object coldfusion. coldfusion on 1 machine , sage , other com object on another. how set credentials coldfusion can gain access com object on sage machine. code have currently: <cfobject action="connect" class="pvxcom.exe" name="sageconnection" context="remote" server="\\sage"> update comments: i using coldfusion 9 , error message receiving is: an exception occurred when instantiating com object. cause of exception that: coldfusion.runtime.com.comobjectinstantiationexception: exception occurred when instantiating com object. you running 64-bit version of coldfusion not support com objects. think goes down 64-bit os not playing com objects either. anyway, if com object required think need install 32-bit version of coldfusion , perhaps on 32-bit version of operating system. i believe goes coldfusion 8 days (the first coldfusion version included 64-bit option)...

javascript - Adwords Conversion Tracking in PHP Form -

i have html page contact form. if fills form, see "thanks" message on same page. html code page is <form id="contact" method="post" action="demo"> <div class="row-fluid"> <div class="span6"> <input type="text" required placeholder="first name" name="firstname" /> </div> <div class="span6"> <input type="text" required placeholder="last name" name="lastname" /> </div> </div> <div class="row-fluid"> ...