Posts

Showing posts from April, 2010

html - bootstrap grid for mobile layout -

i have following markup <div class="container"> <div class="row"> <div class="col-sm-8"> content </div> <div class="col-sm-4"> sidebar </div> </div> <div class="row"> <div class="col-sm-8"> content </div> <div class="col-sm-4"> sidebar </div> </div> </div> how can have content section sit on top of sidebar mobile view? example above markup ill following in mobile view (stack) <div class="col-sm-8"> content </div> <div class="col-sm-4"> siderbar </div> <div class="col-sm-8"> content </div> <div class="col-sm-4"> siderbar </div> but want achieve following mobile view <div class="col-sm-8> content </div> <div class="col-sm-8"> ...

excel - Autofill in vba with value con a specific cell -

i'm trying macro autofill cells value cell (i have count if on cell) current code have, haven't gotten work: sub idontknowwhatimdoing() dim nim integer dim nom integer nom = 6 nim = nom + cells("c2").value activesheet.range(cells(6, 1), cells(6, 4)).select selection.autofill destination:=activesheet.range(cells(6, 1), _ cells(6, 4)).select, type:=xlfilldefault activesheet.range(cells(nim, 1), cells(nim, 4)).select end sub one reason getting error cell("c2").value . can't (afaik) use cell() that, instead use range("c2").value . cells() uses cells([column],[row]) . so, if want use cells() (which can helpful later on in looping), range("c2") same range(cells(3,2),cells(3,2)) . also, it's idea reduce/negate use of .select : sub idontknowwhatimdoing() dim nim integer dim nom integer nom = 6 nim = nom + range("c2").value ...

intermittent openssl error with nginx on ubuntu 14.04 -

i got intermittent ssl handshake errors nginx: 2015/08/23 08:46:53 [info] 38013#0: *14817 ssl_do_handshake() failed (ssl: error:1408f119:ssl routines:ssl3_get_record:decryption failed or bad record mac) while ssl handshaking, client: 10.203.128.125, server: 0.0.0.0:5989 2015/08/23 09:24:15 [info] 38013#0: *27818 peer closed connection in ssl handshake while ssl handshaking, client: 10.203.128.125, server: 0.0.0.0:5989 the error rate pretty low, 1 out of 10000 (based on error , request in last 24 ours) i upgraded nginx , openssl latest version 14.04. dpkg -l | egrep "ssl|nginx" ii libflac8:amd64 1.3.0-2 amd64 free lossless audio codec - runtime c library ii libgnutls-openssl27:amd64 2.12.23-12ubuntu2.1 amd64 gnu tls library - openssl wrapper ii libssl-dev:amd64 1.0.1f-1ubuntu2.15 amd64 secure sockets layer toolkit - development files i...

objective c - iOS: update object of NSMutableArray in for loop -

i need update / add key -> value pair in nsmutablearray. i add key fix value if key isn't set already. i tried following - app crashing @ addobject "mutating method sent immutable object" error: nsuserdefaults *defaults = [nsuserdefaults standarduserdefaults]; nsmutablearray *bookmarks = [defaults mutablearrayvalueforkey:@"bookmarks"]; (id bookmark in bookmarks) { if ([bookmark objectforkey:@"type"] == null){ [bookmark addobject:@"old" forkey:@"type"]; } } [[nsuserdefaults standarduserdefaults] synchronize]; try this: nsuserdefaults *defaults = [nsuserdefaults standarduserdefaults]; //saving nsmutablearray *bookmarkssaving = [nsmutablearray new]; [bookmarkssaving addobject:[[nsmutabledictionary alloc] initwithobjects:@[@"red"] forkeys:@[@"color"]]]; [bookmarkssaving addobject:[[nsmutabledictionary alloc] initwithobjects:@[@"yellow...

linux - telnet refused on specific port on AWS instances -

i'm tryign telnet 1 linux env (10.205.116.141) 10.205.117.246 on port 7199 keep getting connection refused. did chkconfig iptables off on both servers , make sure iptables if stopped well. what else should looking at? [root@ip-10-205-116-141 bin]# telnet 10.205.117.246 7199 trying 10.205.117.246... telnet: connect address 10.205.117.246: connection refused trace route seems working well... [root@ip-10-205-116-141 bin]# traceroute 10.205.117.246 -p 7199 traceroute 10.205.117.246 (10.205.117.246), 30 hops max, 60 byte packets 1 ip-10-205-117-246.xyz.cxcvs.com (10.205.117.246) 0.416 ms 0.440 ms 0.444 ms also, i'm on aws vpc don't public ips provisioned use... checked security group , looks ports open well edit: here netstat well, same on both nodes: [ec2-user@ip-10-205-116-141 ~]$ netstat -an | grep listen tcp 0 0 127.0.0.1:46626 0.0.0.0:* listen tcp 0 0 127.0.0.1:9160 0.0.0.0:* ...

Printing to a file via Python -

hopefully easy fix. i'm trying edit 1 field of file use import, when run following code leaves file blank , 0kb. advise i'm doing wrong? import re #import regex can use commands name = raw_input("enter filename:") #prompt file name, press enter open test.nhi if len(name) < 1 : name = "test.nhi" count = 0 fhand = open(name, 'w+') line in fhand: words = line.split(',') #obtain individual words using split words[34] = re.sub(r'\d', "", words[34]) #remove non-numeric chars string using regex if len(words[34]) < 1 : continue # if 34th field blank go next line elif len(words[34]) == 2 : "{0:0>3}".format([words[34]]) #add leading zeroes depending on length of field elif len(words[34]) == 3 : "{0:0>2}".format([words[34]]) elif len(words[34]) == 4 : "{0:0>1}".format([words[34]]) fhand.write(words) #write line fhand.close() # close file after loop ends i h...

c++ - How to specify linux binary's rpath in cmake -

i have cmakelists.txt file contains such line of code: link_directories(dir_a dir_b dir_c) when build executable , perform readelf -d on it, see rpath dir_a, dir_b dir_c. what can cmake if want create executable empty rpath? executable paths, not specified in link_directories line? the executable not supposed "installed". from cmake-documentation can read that: you can use variable cmake_skip_rpath have cmake not adding rpath binary ever and that set_target_properties -functions rpaths can controlled individually on per-target base.

osx - Binding an NSTableView to an array of strings in Swift -

i'm showing contents of array of strings nstableview via binding through array controller. i have "nsstring" in class name in attributes inspector array controller , in model key path of array controller's binding inspector have path array. , have column of table bound in value section array controller without model key path specified (it's array of strings). as result, array's strings displayed fine in table. can't edit of rows: 2015-06-17 15:48:44.285 projectname[9043:123132] uncaught exception raised 2015-06-17 15:48:44.285 projectname[9043:123132] error setting value key path of object 5 (from bound object <nstablecolumn: 0x618000082d50> identifier: (null)): [<swift._nscontiguousstring 0x608000045d60> setvalue:forundefinedkey:]: class not key value coding-compliant key . "five" fifth string in array trying edit. , can see there gap in "path of" because model key path empty column's values. so someh...

r - Filling in NAs with corresponding row values in another column -

i using rstudio. have simple data frame looks following: df <- id tad tnom 1 0 0 1 0.3 na 1 0.6 0.5 1 1 na i want code fills in na tnom corresponding row value in tad column. the result should be: df <- id tad tnom 1 0 0 1 0.3 0.3 1 0.6 0.5 1 1 1 example: df <- data.frame(id=c(1,1,1,1), tad=c(0,0.3,0.6,1), tnom=c(0,na,0.5,na)) df # id tad tnom # 1 1 0.0 0.0 # 2 1 0.3 na # 3 1 0.6 0.5 # 4 1 1.0 na using ifelse(condition,true,false) df$tnom<-ifelse(is.na(df$tnom),df$tad,df$tnom) or using with(data, expression) df$tnom<-with(df,ifelse(is.na(tnom),tad,tnom)) or reassigning values based on is.na() df$tnom[is.na(df$tnom)] <- df$tad[is.na(df$tnom)] all 3 gives: df # id tad tnom # 1 1 0.0 0.0 # 2 1 0.3 0.3 # 3 1 0.6 0.5 # 4 1 1.0 1.0

c# - StackOverFlowException when setting property -

this question has answer here: why property set throw stackoverflow exception? 2 answers i'm trying using conditional statement check if value equals prior setting using setter . returned stackoverflowexception error. using .cs file execute code general practice. using system; using system.collections.generic; using system.linq; using system.text; using system.threading.tasks; namespace job_classes { class workers { public string name { { return name; } set { if (name.compareto("admin") == 0 || name.compareto("admin") == -1) //just trying out comparison input. { console.writeline("invalid name."); //to see if invalid input not "admin" fails. } else { ...

jquery - Cycle Through Javascript Vars -

~~~solved~~~ thanks community rewrote question maker automatically make array , can confirm after doing , referencing array works perfectly! ~~~end solution~~~ i again sure simple solution after hours of coding can't find! lol. javascript follows: function startgame() { var x = 999; var qquesnum = 1; var qquesval = ('q' + qquesnum + 'question'); (var qgs=1; qgs <= tq; qgs++) { $("body").append('<div id="q' + (qgs) + '" class="question" style="z-index: ' + x + ';"><h2 class="questionnum">question ' + (qgs) + '</h2><br /><p class="question' + (qgs) + '"></p><input type="button" onclick="cycleremove()" value="done" class="removebutton"></div>'); x = (x-1); qquesnum = (qquesnum + 1); }; $('.file').toggle(); $('.question').toggle(...

ios - UIView.animateWithDuration does not work when called from delegate? -

i using following function move self.view specified x axis: func shiftmaincontainer(#targetposition: cgfloat, completion: ((bool) -> void)! = nil) { uiview.animatewithduration(0.5, delay: 0, usingspringwithdamping: 0.8, initialspringvelocity: 0.5, options: uiviewanimationoptions.curveeaseinout, animations: { self.view.frame.origin.x = 300 println("view should shift") }, completion: completion) } when call function @ibaction button in same view, works, when call using delegate method sub-view, nothing happens. know delegate works because println prints text should, view isn't shifted in first scenario. does calling subview delegate make difference? can point me in right direction? i've been banging head on wall better part of day now. update:- manage reproduce problem in new blank project. check out here: https://github.com/eugeneteh/delegateanimatetest in case works fine me when added self.view.layoutifneeded()...

css - Having a banner on top of an image in Microsoft Outlook -

Image
i want have banner on top of image (overlapped on top of image) when sending image via email. this: this haml code: %table.inline-block{align:'left'} %tbody %tr %td.w30{width: '15'} %td#wrap - if cat.present? .banner updated price = image_tag("#{cat.photos}") and these related css files: #wrap { position:relative; width: 195px; height: 165px; } .banner { position: absolute; width: 100%; height: 30px; line-height: 30px; background: #05c3de; color:white } the problem microsoft outlook not understand css position: 'absolute' or position: 'relative', , puts banner on top of image (not overlapped) so changed haml code below: %table.inline-block{align:'left'} %tbody %tr %td.w30{width: '15'} %td#wrap - if cat.present? <!--[if mso]> ...

Keeping last part of field only in logstash -

how can trim last part of key in logstash? i have urls formatted in form of http://aaa.bbb/get?a=1&b=2 , putting them 'request' , splitting field based on '?&' save parameters. i care specific api call, , not host or protocol. filter(s) can chain keep part after final '/'? i've read bit on patterns haven't stumbled upon how reference last part of split field. grok { match => [ "message", "%{timestamp_iso8601:timestamp} %{notspace:loadbalancer} %{ip:client_ip}:%{number:client_port:int} %{ip:backend_ip}:%{number:backend_port:int} %{number:request_processing_time:float} %{number:backend_processing_time:float} %{number:response_processing_time:float} %{number:elb_status_code:int} %{number:backend_status_code:int} %{number:received_bytes:int} %{number:sent_bytes:int} %{qs:request}" ] } date { match => [ "timestamp", "iso8601" ] } kv { ...

javascript - Displaying created record Id in controller of Angularjs -

hi writing values database returns id of saved record. factory has following return { postnewr: $resource('/api/newrec', {}, {create: {method: 'post'}}) } in controller have newr_factory.postnewr.create(recorddata, function(data){ alert(data.id); }); everything works fine. can see in browser developer tools in response returning id of newly created value i.e 22. in alert box undefined.' please let me know how can display value of id in alert box. you have use $promise returned this: newr_factory.postnewr.create(recorddata).$promise.then(function(data) { alert(data.id); }); alternatively, , more "angular", like: var new_record = new newr_factory.postnewr(recorddata); new_record.$save(function(data) { alert(data.id); });

php - Symfony project not working on Google App Engine Launcher -

i'm following instructions here in order deploy symfony project in google app engine, hello world example not working in local computer using google app engine launcher neither in cloud (it working in localhost xampp). the app.yaml file is: # copyright 2015 google inc. rights reserved. application: myprojectid version: 1 runtime: php55 api_version: 1 threadsafe: true handlers: - url: /clear_cache script: clear_cache.php login: admin - url: /.* script: web/app.php env_variables: cache_dir: "gs://#default#/symfony/cache" log_dir: "gs://#default#/symfony/log" the config_prod.yml file is: # copyright 2015 google inc. rights reserved. imports: - { resource: config.yml } #framework: # validation: # cache: apc doctrine: dbal: driver: pdo_mysql host: null port: null dbname: hello user: root password: null unix_socket: /cloudsql/myprojectid:helloworldinstance ch...

command line - how to read registry values for the particular user -

do have read registry value particular user using command prompt in windows? if have read before specify user name please me how may value using command-line command. trying read date , time format value registry getting different format different users. if know users's sid can query registry specific user settings. following sshortdate date format value user sid: 123 reg query "hkey_users\123\control panel\international" /v sshortdate to sid specific user can use wmic list of name, sid pairs users of system: wmic useraccount name,sid

perl - How to handle File::Find on Windows with long paths -

i've been trying use perl's file:find recursively find files on windows system drive. unfortunately errors out during execution long file path. know how handle in way such script can continue running , let me know paths had skip. can count files until encounters path doesn't like, @ point stops. what basing off: http://www.perlmonks.org/?node_id=217166 found following article, similar problem, unable apply it: http://www.perlmonks.org/?node_id=933849 #/usr/bin/perl use strict; use file::find; $superfilecount = 0; # first try find(\&print_name_if_dir, no_chdir=>1, "."); # second try eval { find(\&print_name, no_chdir=>1, ".") }; warn $@ if $@; # end of second try sub print_name { $superfilecount++; } print "all files found: $superfilecount \n"; first run: can't cd ../../../../../../../../../.. ./users/username/appdata/roaming/ macromedia/flash player/#sharedobjects/8z5rpfsr/foxnewsplayer-a.akamai...

Display Array value in php -

$_request['assignment_site_id']; its output is array ( [47] => 15 ) 47 become dynamically. changed time time like array ( [34] => 16 ) i want 15 or 16. how can value. use loop print out value of associative array entry. foreach ($array $key => &$value){ echo "element $key $value"; } this output "element 47 15"; if trying find do, print out value of array entry.

How to pass int from jquery to c# code block in a view -

i use jquery id of clicked image, , able id. want use id call image again database using c# code block. jquery code: $(document).on('click', '.thisimage', function () { alert(this.id); }); this code using call again image: int id = // image of clicked image should passed on int id's value. using (the_factory.models.the_factorydbcontext db = new the_factory.models.the_factorydbcontext()) { if (db.treasures.firstordefault(treasure => treasure.treasureid == id).itemimage != null) { byte[] chosenimage = db.treasures.firstordefault(treasure => treasure.treasureid == id).itemimage; string imagesource = ""; string imagebase = convert.tobase64string(chosenimage); imagesource = string.format("data:image/gif;base64,{0}", imagebase); <img id="thisimage" src="@imagesource" width="100" height="100" /> } }

Why do I get error on flurry when trying to compile to release on Android? -

when tried compile release using ./gradlew assemblerelease , got these error. didn't signed yet, according http://developer.android.com/tools/building/building-cmdline.html , can signed later. warning: com.flurry.sdk.hn: can't find referenced class com.google.android.gms.ads.identifier.advertisingidclient warning: com.flurry.sdk.hn: can't find referenced class com.google.android.gms.ads.identifier.advertisingidclient$info warning: com.flurry.sdk.hn: can't find referenced class com.google.android.gms.ads.identifier.advertisingidclient warning: com.flurry.sdk.hn: can't find referenced class com.google.android.gms.ads.identifier.advertisingidclient$info warning: com.flurry.sdk.hn: can't find referenced class com.google.android.gms.ads.identifier.advertisingidclient$info warning: com.flurry.sdk.hn: can't find referenced class com.google.android.gms.ads.identifier.advertisingidclient$info warning: com.flurry.sdk.hn: can't find referenced class com.googl...

java - Gradle build multiple .war files with different properties file -

we developing new web application scratch using spring boot , relevant dependencies , built using gradle. our project has 5 stages of testing, each stage executing on different server , end different configuration on each server. the above scenario common situation , practice followed in earlier projects save "properties" file directly under server's classpath same .war file can deployed on multiple servers , still have different configuration based on server/environment. now, obvious disadvantage above setup - such setup cannot shared other developers through version controller. , further cant use power of "process resources" task in gradle introduce dynamic properties during build process. now, if pull .properties file within project setup, can version control it, sharing becomes easier , can introduce dynamic properties through gradle. disadvantage being might have prepare multiple .war files after updating .properties file. there 2 questions ha...

(codeigniter/Neo4j) PHP : namespace and autoloader -

as i'm trying install neo4jphp library in codeigniter (v2.2.x), i'm having annoying issues regarding namespaces. i've been searching 4 hours without success. in short, there libraries directory in neo4jphp must copied. in 'libraries/', there directory 'everyman/neo4j/', contains neo4j php classes. also, in same 'libraries' directory, there class autoloader function, aims @ loading neo4j classes (which in 'everyman/neo4j/'). inside of 'libraries' - libraries/ |-- everyman/ |-- neo4j/ |-- client.php |-- some_other_classes.php |-- neo4j.php then, somewhere in code, in global namespace, try instantiate class client : $client = new client(); but error class 'client' not found . in class client, following namespace specified : everyman\neo4j . i'm must admit found 2 workarounds issue : from calling code, use qualified name : new everyman\neo4...

mysql - SQL hour averaging in 24hours -

hi i'm trying sql query based on hourly averaging in 24hours temperature sample table below. how can so? let me know if think high frequencies tables architecture face difficulties in future too. appreciate helps. thank you. _id node_id modality timestamp value ------- ------- ----------- ------------ ------ 4930376 2002 temperature 24/8/15 6:25 30 4930377 2403 temperature 24/8/15 6:24 30 4930378 2004 temperature 24/8/15 6:21 30 4930379 2203 temperature 24/8/15 6:26 29 4930380 2211 temperature 24/8/15 6:21 29 4930381 2401 temperature 24/8/15 6:25 33 4930382 2411 temperature 24/8/15 6:24 30 4930383 2101 temperature 24/8/15 6:22 31 4930384 2201 temperature 24/8/15 6:27 30 4930385 2111 temperature 24/8/15 6:30 36 4930386 2113 temperature 24/8/15 6:27 35 4934082 3200 temperature 24/8/15 10:28 33 4934083 2402 temperature 24/8/15 10:30 32 4934084 2213 temperature 24/8/15 10:30 33 49340...

arrays - Combined display of EditText for Query with JSON Result to be able to scroll it -

need advice on how define screen able scroll result of json , attached : package com.lm.vciwhereabout; import java.util.arraylist; import org.apache.http.namevaluepair; import org.apache.http.message.basicnamevaluepair; import org.json.jsonarray; import org.json.jsonexception; import org.json.jsonobject; import android.app.activity; import android.app.listactivity; import android.content.intent; import android.os.bundle; import android.os.strictmode; import android.util.log; import android.view.view; import android.widget.adapterview; import android.widget.arrayadapter; import android.widget.button; import android.widget.edittext; import android.widget.listadapter; import android.widget.listview; import android.widget.simpleadapter; import android.widget.textview; import android.widget.adapterview.onitemclicklistener; public class querynameentry3 extends listactivity { edittext username; // take username input user button submit; textview tv; ...

UILabel.attributedText not show up on iPhone 4 + iOS 7.0.3 -

got iphone 4 in field , strange problem, uilabel not show text. tested on iphone 4s + ios 7 simulator, works fine. code: nsmutableattributedstring *attributestring = [[nsmutableattributedstring alloc] initwithstring:[collabel.text copy]]; [attributestring addattribute:nsunderlinestyleattributename value:[nsnumber numberwithint:1] range:(nsrange){0,[attributestring length]}]; collabel.text = nil; collabel.attributedtext = [attributestring copy]; collabel.font = [uifont boldsystemfontofsize:12]; i have checked. showing on iphone 4, there may else. clean build , delete device , run again

java - Giving fairness in execution for threads -

consider situation thread has list of strings {string1,string2} , thread b has {string3, string4}. both threads trying execute block of code, lets public void critcalcodemethod(){ .... .... } when thread , b in action, suppose thread c has {string1,string5} , thread d has {string3, string 6} trying access same critcalcodemethod() code, should put in fairness queue , should allowed execute in order in arrived. in other words, thread , b can execute in parallel since dont have common strings. thread c should executed first right after thread finishes. thread d should executed first right after thread b. if other threads thread e value {string1, string7} should allowed after thread c. please suggest locking mechanism achieve in java reentrantlock has optional fairness parameter can used implement logic. however, depending on strings are, come , how you're using them there may more suitable ways handle concurrency ( guava 's striped comes mind)....

Android: Make custom seekbar opaque -

hi can tell me why seekbar's background , progress have opacity , can't removed have set alpha 1.0. below progress_drawable.xml <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@android:id/background"> <shape> <corners android:radius="5dip" /> <gradient android:alpha="1.0" android:startcolor="#000000" android:endcolor="#000000"/> </shape> </item> <item android:id="@android:id/secondaryprogress"> <clip> <shape> <corners android:radius="5dip" /> <gradient android:alpha="1.0" android:startcolor="#000000" android:endcolor="#000000" /> </shape> </clip> </item> <item android:id=...

Can JMeter master be used as a load generator? -

can jmeter master used load generator instance in distributed testing framework? since mention host ips, work mention localhost , generate load master? thanks, madhav if launching jmeter ui start instances - 127.0.0.1 (localhost) available. both jmeter documentation pages source of information. https://jmeter.apache.org/usermanual/jmeter_distributed_testing_step_by_step.pdf http://jmeter.apache.org/usermanual/remote-test.html

elasticsearch - How to create parallel dates graph in kibana 4 -

Image
i have graph in kibana 4 this: but want graph in below format: how can in kibana 4? pointers? thanks in advance! not available (yet?). see this issue .

java - Best way to convert Locale properties names to normal names -

i reading list of file property file names bundle. need replace file contents in following format {en_gb==my name} i using replaceall method replace following characters "{en_gb" , "}" can have number of = symbols , string "en_" may end gb or au or us etc. what best way replace these? string s = "{en_gb==kt!hibio}"; system.out.println(s.replaceall("[{\\w}]", "")); you can use string s = "{en_gb==pm!name}"; system.out.println(s.replaceall("\\{\\w+=+([^}]+)}", "$1")); see ideone demo the regex matches \\{ - literal { \\w+ - 1 or more alphanumerics or underscore =+ - 1 or more equal signs ([^}]+) - matches , captures group 1 one or more characters other } } - closing brace when substring matched, matched text replaced text captured group 1 $1 . your solution not work because regex have matching 1 character either { or non-word character ( \w ) , li...

java - Print Name Near Detected Face in Opencv? -

i need print name/text near face detected face rectangle below code detect face. can suggest me method that? websource.retrieve(frame); graphics g = jpanel2.getgraphics(); matofrect facedetections = new matofrect(); facedetector.detectmultiscale(frame, facedetections); rect rectcrop = null; (rect rect : facedetections.toarray()) { system.out.println("ttt"); core.rectangle(frame, new point(rect.x, rect.y), new point(rect.x + rect.width, rect.y + rect.height), new scalar(0, 255,0)); rectcrop = new rect(rect.x, rect.y,125, 150); //facedetector.detectmultiscale(frame, facedetections); int fcz= facedetections.toarray().length; system.out.println("fcz="+fcz); system.out.println(string.format("detected %s faces", facedetections.toarray().length)); } i used core.puttext , worked below code core.puttext(frame,"name", new point(rect.x + rect.width, rect.y + rect.height),core.font_hershey_plain,10...

javascript - Java script doesn't run inside the html file in ionic frame -

i have form used users input. want js run in header check validation. my html code: <ion-view view-title="{{chat.name}}"> <ion-content class="padding"> <head> <meta charset="utf-8"> <link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/pepper-grinder/jquery-ui.css" media="screen" rel="stylesheet" type="text/css"> <script> function validateform(objform) { if (objform.make.selectedindex == 0) { alert("please select request"); returnstatus = 0; }; var x = document.forms["request"]["description"].value; if (x == null || x == "") { alert("please fill out description"); return false; } } </script> </head> <body> <h2>service request</h2> <br></br> <div ...

java.lang.IllegalStateException when clicking on Android Device Monitor -

after launching android studio , clicking on android device monitor icon there error log. output of log that: !session 2015-08-25 09:32:26.463 ----------------------------------------------- eclipse.buildid=unknown java.version=1.7.0_79 java.vendor=oracle corporation bootloader constants: os=win32, arch=x86_64, ws=win32, nl=en_us command-line arguments: -os win32 -ws win32 -arch x86_64 !entry org.eclipse.osgi 4 0 2015-08-25 09:32:27.209 !message application error !stack 1 java.lang.illegalstateexception: unable acquire application service. ensure org.eclipse.core.runtime bundle resolved , started (see config.ini). @ org.eclipse.core.runtime.internal.adaptor.eclipseapplauncher.start(eclipseapplauncher.java:74) @ org.eclipse.core.runtime.adaptor.eclipsestarter.run(eclipsestarter.java:353) @ org.eclipse.core.runtime.adaptor.eclipsestarter.run(eclipsestarter.java:180) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccesso...

jquery - Transform type navbar -

don't know best way explain i'll give example here " http://www.worldinmylens.com/ " i'm trying replicate same idea aside nav bar in terms of transition in. i'm not sure how go properly $(document).ready(function() { $('.handle').on('click', function() { $('.navbar').toggleclass('showing'); }); }); body { margin: 0; padding: 0; } .container { position: relative; width: 90%; margin: 20px auto; perspective: 500px; } .navbar { position: absolute; left: 0px; width: 180px; padding: 20px 10px; color: white; background: #333; opacity: 1; box-sizing: border-box; transition: 0.5s ease-in; transform-origin: left center; } .handle { position: absolute; top: 200px; left: 40px; cursor: pointer; } .showing { opacity: 0; transform: rotatex(0deg) rotatey(90deg) rotatez(0deg); } <script src="https://code.jquery.com/jquery-1.10.2.js...

mongodb - mongod run with nohup exits when there is no open connection -

i running mongod on nohup as nohup mongod -dbpath /data/db > log/nohup.log & server runs time closes following log 2015-08-24t20:23:12.076+0000 network [conn74] end connection 127.0.0.1:51016 (0 connections open) 2015-08-24t20:23:57.112+0000 network [initandlisten] connection accepted 127.0.0.1:51019 #75 (1 connection open) 2015-08-24t20:23:57.118+0000 network [conn75] end connection 127.0.0.1:51019 (0 connections open) 2015-08-24t20:24:56.026+0000 control [signalprocessingthread] got signal 1 (hangup), terminate after current cmd ends 2015-08-24t20:24:56.026+0000 control [signalprocessingthread] exiting 2015-08-24t20:24:56.026+0000 network [signalprocessingthread] shutdown: going close listening sockets... 2015-08-24t20:24:56.026+0000 network [signalprocessingthread] closing listening socket: 5 2015-08-24t20:24:56.026+0000 network [signalprocessingthread] closing listening socket: 6 2015-08-24t20:24:56.026+0000 network [signalprocessingthread] removing sock...

Is it possible define one-to-many relation in Sql Server and just define and use one side of this relation in entity code first -

if defined one-to-many relation foreign-key constraints in sql server, possible define , use in code-first class definitions in 1 side? example suppose have library , book classes. each library can has many books each book belong 1 library. public class book { public book() { } public int bookid { get; set; } public string bookname { get; set; } public virtual library library { get; set; } } public class library { public library() { } public int libraryid { get; set; } public virtual icollection<book> books { get; set; } } if want use relation book side,can don't define below line in library class definition? public virtual icollection<book> books { get; set; } sure, can this: modelbuilder.entity<book>() .hasrequired(b => b.library) // or: hasoptional .withmany() .map(m => m.mapkey("libraryid")) in case, database ta...

php - Install Yii2 advanced template in ubuntu -

i set project on localhost , on staging server. but want move project on ubuntu server. i tried when try locate project giving me the requested url <project_name>/admin/site/login not found on server. here main.php file: <?php use \yii\web\request; $params = array_merge( require(__dir__ . '/../../common/config/params.php'), require(__dir__ . '/../../common/config/params-local.php'), require(__dir__ . '/params.php'), require(__dir__ . '/params-local.php') ); include(__dir__ . '/constants.php'); include(__dir__ . '/print_arr_helper.php'); $siteurl = 'http://**ipaddress**/<project_name>/'; return [ 'id' => 'app-backend', 'basepath' => dirname(__dir__), 'controllernamespace' => 'backend\controllers', 'bootstrap' => ['log'], 'modules'...

How to finish multiple activities at once in android? -

i have activity flows activity -> activity b -> activity c -> activity d. when user on activity d , click button called exit, application should go activity b , finish activities c , d. how can that? note : activity b , activity d same class different instance in androidmanifest.xml , set android:nohistory true activity b, c , d. set false activity (actually, default false). demo: <activity android:name=".xx.xx.activitya" android:nohistory="false" android:screenorientation="nosensor"> </activity> <activity android:name=".xx.xx.activityb" android:nohistory="true" android:screenorientation="nosensor"> </activity> <activity android:name=".xx.xx.activityc" android:nohistory="true" android:screenorientation="nosensor"> </activity> <activity android:name=".xx.xx.activityd" android:...

observable - How can I send event for all mounted tags? -

riot.js 2.2 by guides on official site of riot.js have call like tag.trigger('event_name') where tag instance of listener. but must trigger event tags? has riot.js implementation issue or have resolve manually(by keeping listeners instances)? riot has no implementation of keeping references event listeners. so, if want execute trigger on them directly, you'll have implement yourself. however, recommend use solution notifying multiple event listeners. if want let know multiple tags event has occured, can use shared observable , handle events on observable. see this question . way, don't need keep refereneces event listeners, instead, event listeners need keep reference single observable ('event aggregator'). you can try riotcontrol shared observable.

How to apply lock on particular column in ruby on rails? -

how apply lock on particular field same number not generate again. i have created algoritham in create string using year+000..+integer number example : "20150001","20150002","20150003" etc. the problem when multiple user request number @ time same number generated. following function call def get_algo_number(model_name,prefix) <br> year = get_year if model_name.count > 0 last_number = model_name.last.number if last_number[2..5].to_i > year.to_i return create_number(year,prefix) else # if letest generated number exist generate new number return last_number.next end else return create_number(year,prefix) end end please if have solution regarding apply lock. thanks yes, resolved problem using multi-threading.

How to reload part of main view after submit using ajax -

i'm new mvc. how can refresh part of main view after submit action in 1 of partial views. i'm trying make adding comments. didn't use ajax until good. want after create new comment in partialview "create" appers in partialview getcommentsbyticket...i hope enough explanation... @model helpdeskapp.models.ticket @{ viewbag.title = "details"; } @*<h2>details</h2>*@ <div class="panel panel-green"> <div class="panel-heading"> ticket </div> <div class="panel-body"> <div> @*<h4>ticket</h4> <hr />*@ <dl class="dl-horizontal"> <dt> @html.displaynamefor(model => model.ticketid) </dt> <dd> @html.displayfor(model => model.ticketid) </dd> <dt> @html.displaynamef...

php - can't find multiple values in SQL -

i have db full of players , trying create page register them specific tournament. tournament director search players username (which "firstname.lastname"). the problem i'm experiencing when run loop echo each $players[$x] gives id first matching db record, , repeats number once each match. rather returning id 7, 11, 26 return 7, 7, 7. please can explain why? i have written following code in .php file: session_start(); if (isset($_post['newsearch']) === true && empty($_post['newsearch'] === false)){ require 'dbconnect.php'; $term = $_post['newsearch']; $terms = "%" . $term . "%"; $query = ("select playerid players username '$terms'"); $run_query = mysqli_query($dbcon, $query); $search = mysqli_fetch_assoc($run_query); $players = array (); do{ //get data players table $playerid = $search['playerid']; array_push ($players, $playerid); } while ($db...

gcc - Memory leaks using SDL-1.2 , C -

i'm having trouble locating directly , indirectly memory leaks since origin in of sdl libraries seems, use here. still reachable memory, understood, sort of bug in old sdl, if there's magic way clear i'll glad know. ==19215== heap summary: ==19215== in use @ exit: 34,164 bytes in 447 blocks ==19215== total heap usage: 5,994 allocs, 5,547 frees, 4,200,660 bytes allocated ==19215== ==19215== 1 bytes in 1 blocks lost in loss record 1 of 102 ==19215== @ 0x4c2ab80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==19215== 0x6338a0e: _xlcdefaultmapmodifiers (in /usr/lib/x86_64-linux-gnu/libx11.so.6.3.0) ==19215== 0x6338df5: xsetlocalemodifiers (in /usr/lib/x86_64-linux-gnu/libx11.so.6.3.0) ==19215== 0x4e75613: ??? (in /usr/lib/x86_64-linux-gnu/libsdl-1.2.so.0.11.4) ==19215== 0x4e76374: ??? (in /usr/lib/x86_64-linux-gnu/libsdl-1.2.so.0.11.4) ==19215== 0x4e66c9a: sdl_videoinit (in /usr/lib/x86_64-linux-gnu/libsdl-1.2.so.0.11.4) ==19215=...