Posts

Showing posts from February, 2011

bash sorting in a loop error -

i trying sort bunch of files in bash loop numerically (option -n) according second column (option -k 2): for ch_perm in {0..99}; ch_set in {1..15}; sort -nk 2 $ch_perm.results.$ch_set > sortedbyscore2/$ch_perm.results.$ch_set ; done done but sort won't work correctly. know? in advance! this output get: for ch_perm in {0..99}; > ch_set in {1..15}; > display 1504 possibilities? (y or n) 11.results.21 13.results.35 15.results.49 3.results.61 5.results.74 7.results.88 [...] > -k 2 $ch_set.results.$ch_perm > sortedbyscore2/$ch_set.results.$ch_perm ; > done > done -bash: -k: command not found -bash: -k: command not found -bash: -k: command not found (many many times) you have used tabs indent script, confusing bash when paste terminal, , end triggering bash's autocomplete double tab. can see "sort" has been lost when happened. indent spaces, or put script in file , run there.

python - Regex to get consecutive capitalized words with one or more words doesn't work -

i'm trying consecutive capitalized words 1 or more looks doesn't work me. def extract(string): return re.findall('([a-z][a-z]*(?=\s[a-z])(?:\s+[a-z][a-z]*)*)', string) here's test case def test_extract_capitalize_words(self): keywords = extract('this new york , london') self.assertequals(['new york', 'london'], keywords) it captures new york , not london this match consecutive captitalized word or capitalized word followed end of line boundary. >>> import re >>> s = 'this new york , london' >>> re.findall(r'\b[a-z][a-z]*\b(?:(?:\s+[a-z][a-z]*\b)+|$)', s) ['new york', 'london']

sql - MLSLABEL Oracle datatype -

where can practically use type? what mlslabel oracle datatype? this theme old can have practical use of type? mlslabel : oracle pl/sql datatype mlslabel used store operating system label in binary format. used oracle label security (which earlier known trusted oracle mls rdbms). maximum precision mlslabel column 255 bytes; datatype code "105". http://psoug.org/definition/mlslabel.htm

.net - Accessing Host property from external assembly -

i'm importing external assembly of mine in t4 template using assembly processor directive. from within said assembly, i'm trying access host property. unfortunately can't seem able to. i tried getting host way: public class mytransformation : texttransformation { // ... public void somemethod() { object host = gettype().getproperty("host").getvalue(this); if (host != null) { // stuff } } } unfortunately, although reflection seems map property, returned value null . the calling template file has hostspecific property set true in template directive. what doing wrong?

javascript - Bootstrap row stays at 1px when inserting d3 -

i have been trying make responsive dashboard using d3. have previous experience haven't used bootstrap extensively before. posts have researched mentioned using bootstrap , viewbox make d3 svg's reactive. however, when tried found svg's didn't show up. bootstrap row remains @ 1px of height after have entered svg. more weird if hard-code svg height = 960 width = 500 (i.e. hard-coded in html) row still remains @ 1px. i've looked everywhere can't find wrong. great! <!doctype html> <meta charset="utf-8"> <head> <script src="js/d3.v3.min.js"></script> <script src="js/jquery-1.10.2.min.js"></script> <link rel="stylesheet" href="css/bootstrap.css"> <script src="js/bootstrap.js"></script> <link rel="stylesheet" href="css/mainindex.css"> <meta name="viewport" content="width=device-wi...

c# - Math Net numerics performance slow in asp.net application -

i'm computing heavy (100000) matrix computations(like multiply/add/substract). when in simple console application it's performance fine. but when place same code in simple asp.net web application , invoking process in button click,it's taking time. using .net 4.5 , vs 2013 both console app , asp.net web application. do need take care of anyother things?

bash - Finding multiple files recursively and renaming in linux -

i having files a_dbg.txt, b_dbg.txt ... in suse 10 system. want write bash shell script should rename these files removing "_dbg" them. google suggested me use rename command. executed command rename _dbg.txt .txt *dbg* on current_folder my actual current_folder contains below files. current_folder/a_dbg.txt current_folder/b_dbg.txt current_folder/xx/c_dbg.txt current_folder/yy/d_dbg.txt after executing rename command, current_folder/a.txt current_folder/b.txt current_folder/xx/c_dbg.txt current_folder/yy/d_dbg.txt its not doing recursively, how make command rename files in subdirectories. xx , yy having many subdirectories name unpredictable. , current_folder having other files also. you can use find find matching files recursively: $ find . -iname "*dbg*" -exec rename _dbg.txt .txt '{}' \; edit: '{}' , \; are? the -exec argument makes find execute rename every matching file found. '{}' replac...

mfc - Disable visual style for a single CButton -

Image
if create normal cbuttons this: i accidentally created older looking buttons when did following: class cclickbutton : public cbutton { afx_msg int oncreate (lpcreatestruct lpcs); declare_dynamic(cclickbutton); declare_message_map(); }; implement_dynamic(cclickbutton, cbutton); begin_message_map(cclickbutton, cbutton) on_wm_create() end_message_map() int cclickbutton::oncreate (lpcreatestruct lpcs) { return 0; } now create buttons in style. (because want add bitmap. , when using style, give visual feedback of getting 'pushed down'. new style tints background blue , hidden bitmap on top of button. alternative question be, if there easy way tint image when button gets pressed.) what proper way tell mfc create kind of buttons? omitting the oncreate message base class feels wrong me. , not sure if leads other side effects not aware of yet. i found information on how change visual style whole program. want change selected buttons. v...

html - Css code for center navigation menu is not working in firefox -

my css code following:- #nav { position: relative; display: block; margin: 0; background: #333; z-index: 1; border-bottom: 1px solid #666; font-weight: 600; font-family: helvetica, arial, sans-serif; font-size: 14px; -webkit-box-align: center; -webkit-box-pack: center; display: -webkit-box; } #desktop-nav .nav-item { display: block; padding: 0 20px; float: right; -webkit-transition: color 200ms linear; transition: color 200ms linear; } #desktop-nav .nav-item:hover, #desktop-nav .nav-item:active { opacity: 0.7; } and html code is:-- <div id="nav"> <nav id="desktop-nav"> <a class="nav-item" href="#1">github</a> <a class="nav-item" href="#2">about</a> <a class="nav-item" href="#3">community</a> ...

python - append vs. extend -

what's difference between list methods append() , extend() ? append : appends object @ end. x = [1, 2, 3] x.append([4, 5]) print (x) gives you: [1, 2, 3, [4, 5]] extend : extends list appending elements iterable. x = [1, 2, 3] x.extend([4, 5]) print (x) gives you: [1, 2, 3, 4, 5]

java - Light theme for search suggestions with toolbar -

Image
i've implemented recent search suggestions app , works fine. suggestions shown in dark theme , want in light theme. i did try lot suggestions available in stackoverflow , not find success. any highly appreciated.

theory - (r-1)'s complement or 9's complement -

i have been trying figure out whether 2 numbers wud same 9's complement value.. found general equation (r-1)'s complement text : (r^n) - (r^-m) - n r = radix or base; n= no of digits in integer part; m= no. of digits in fractional part , n=given value.. but when apply eqn find 9's complement of 2 numbers: 0.473 , 9.473 same result both i.e. 0.526 i.e. (10^0) - (10^-3) - 0.473 = 0.526; , (10^1) - (10^-3) - 9.473 = 0.526 is there solution since these 2 numbers cannot yield same result (it shud wrong)..?? the n , m values in formula not "no of digits in integer part" , "no. of digits in fractional part" in particular n value. these n , m numbers should chosen once work complement numbers , not changed, , set limits on numbers can work with: after choose n , m , can work numbers @ n digits in integer part , @ m digits in fractional part. so example if choose n=0 , can not process 9.473. able process both 0.473 , 9.473, should cho...

php - Mysql errors while sending contact form -

i errors warning: mysqli_close() expects 1 parameter, 0 given in /home1/ab61859/public_html/contact.php on line 143 and warning: cannot modify header information - headers sent (output started @ /home1/ab61859/public_html/contact.php:143) in /home1/ab61859/public_html/contact.php on line 144 my php code here http://pastebin.com/4kvr7bg1 i have no idea did wrong, please me thanks, itsmeromian in following code (which pastebin link above): foreach($form_data $name=>$value) { mysqli_query($db, "update $mysql_table set $name='".mysqli_real_escape_string($db, $value)."' id=$id") or die('failed update table!<br>'.mysqli_error($db)); } mysqli_close(); header('location: '.$success_url); exit; you need put connection or link handle generated during connection in mysqli_close() statement knows 1 close (i.e. can have more 1 open @ time). if change snippet use following line close error should go away. mys...

.net - How to write singles() to a file -

for debugging purposes need write array of single() new file don't find example. since trying debug something, don't want trust own instincts on how that. can show me? is correct way? afraid might have introduced error. public sub writesinglestofile(byval usingles() single, byval upath string) using fs new filestream(upath, filemode.create) using bw new binarywriter(fs) each no in usingles bw.write(no) next end using end using end sub you can use binarywriter.write method write singles public sub writesinglestofile(byval usingles() single, byval upath string) using writer io.binarywriter = new io.binarywriter(io.file.open(upath, io.filemode.create)) each uval single in usingles writer.write(uval) next end using end sub

Django Bootstrap form field won't resize -

Image
i using bootstrap display django forms having trouble getting them resize. 1 of forms text input area , want span of panel width. i've tried multiple things haven't been able resize it/make input area bigger. the html : <div class="container-fluid"> <div class="panel panel-default"> <div class="panel-heading"> <h4 class="text-center"> raw sql query </h4> </div> <form action="/interfaceapp/table_search/" method="post" class="form"> {% csrf_token %} <div class="panel-body text-center"> {% bootstrap_form rawsql %} </br> <div class="container-fluid"> <button type="submit" class="btn btn-primary center-block" value="submit" name="rawsql"> {% bootstrap_icon "fire" %} submit </button> <...

Why is my node.js etcd client getting html -

my etcd instance running locally , can perform , set using cli // set etcdctl set /services/myservice "{\"hostname\": \"127.0.0.1\", \"port\": 3000}" //get etcdctl services/myservice // results in -> {"hostname": "127.0.0.1", "port": 3000} but when use node-etc module var etcd = require('node-etcd'); var etcd = new etcd(['http://localhost:2379', 'http://localhost:4001']); etc.get('services/myservice', { wait: true}, function (err, value){ console.log(err, value); }); i value html (see below) instead of same result cli. working few weeks ago not sure if have i find when don't include hosts , use new etcd() internal html page references proxy issues: "the requested website blocked [insert company name] proxy due potential malicious activity or other security reasons." <!doctype html public "-//w3c//dtd html 4.01//en" "http://www....

hibernate auto increment id MySql using mapping file -

i running simple hibernate application using eclipse indigo,hibernate 3.6.4 , mysql 5.1.36. new hibernate.so please me. following code shows inserting data public void adduserdetails(string username, string password, string email, string phone, string city) { try { // 1. configuring hibernate configuration configuration = new configuration().configure(); // 2. create sessionfactory sessionfactory sessionfactory = configuration.buildsessionfactory(); // 3. session object session session = sessionfactory.opensession(); // 4. starting transaction transaction transaction = session.begintransaction(); user user = new user(); user.setusername(username); user.setpassword1(password); user.setemail(email); user.setcity(city); user.setphone(phone); session.save(user); transact...

unix - Use watch to copy new files in directory twice a second -

i have folder (foo) want check twice second. if there new file in folder want copy second folder (foo2). want use watch , cp. using tcsh. how this? this trying: touch lastchanged watch --interval=.5 'if [[ $(ls foo) ]] cp $; else echo "nothing new";fi this seems work me. open better answers. touch lastchecked watch --interval=.5 'if [[ $(find foo -newer lastchecked -ls -exec cp {} foo2 \; touch lastchecked; else echo "nothing new"; fi watch checks twice second. find looks files newer "lastchecked" file , copies files. then touch lastchecked. touching lastchecked allow cping when file has been updated.

docusignapi - Create an Envelope using template and documents -

i trying cover below scenario: suppose company has template contains signature fields , every envelope request add new set of documents along template appended @ bottom. so, sender not have define fields while sending envelope. please provide ideas how can achieve using rest api. thanks, akash yes able it. docusign has ability composite templates: https://www.docusign.com/developer-center/explore/features/templates here relevant discussion thread: adding documents envelopes using composite templates in docusign

regex - similar substring in other string PHP -

how check substrings in php prefix or postfix. example, have search string named $to_search follows: $to_search = "abcdef" and 3 cases check if substring in $to_search follows: $cases = ["abc def", "def", "deff", ... other values ...]; now have detect first 3 cases using substr() function. how can detect "abc def", "def", "deff" substring of "abcdef" in php. to find of cases either begin or end either beginning or ending of search string, don't know of way step through of possible beginning , ending combinations , check them. there's better way this, should it. $to_search = "abcdef"; $cases = ["abc def", "def", "deff", "otherabc", "noabcmatch", "nodefmatch"]; $matches = array(); $len = strlen($to_search); ($i=1; $i <= $len; $i++) { // beginning , end of search string of length $i $pre_post = ...

jquery - Consuming a RESTful service in Reactjs -

im starting reactjs , want make request restful service, here code, can me please? render: function() { $.ajax({ url: "http://rest-service.guides.spring.io/greeting" }).then(function(data) { $('.greeting-id').append(data.id); $('.greeting-content').append(data.content); return <div style="background-color: #ffffff"> <p class="greeting-id">the id </p> <p class="greeting-content">the content </p> </div>; } } i load jquery in html react, still cant make work, i'm missing important? or there better way this? dont want use thing, react , jquery, or more necesary? thank help. make request in componentdidmount method , use setstate method assign data returned restful service component's state. in render method can access through this.state.greetingid , this.state.greetingcontent properties: compone...

python - Numpy averaging a series -

numpy_frames_original frames in video. firstly, wanted find average of these frames , subtract each frame giving numpy_frames . problem trying tackle thought idea find average of of these frames, wrote code below: arr=np.zeros((height,width), np.float) in range(0, number_frames): imarr=np.array(numpy_frames_original[i,:,:].astype(float)) arr=arr+imarr/number_frames img_avg=np.array(np.round(arr),dtype=np.uint8) numpy_frames = np.array(np.absolute(np.round(np.array(numpy_frames_original.astype(float))-np.array(img_avg.astype(float)))), dtype=np.uint8) now have decided better not average of of frames, instead each frame subtract average of 100 frames closest it. i'm not sure how write code? for example frame 0 average frames 0 - 99 , subtract average. frame 3 average frames 0 - 99 , subtract, frames 62 average frames 12-112 , subtract. thanks i think need. import numpy # create fake data frame_count = 10 frame_width = 2 frame_height = 3 frames = n...

Java class parser -

i parsing class files in jar via objectweb asm ( http://forge.ow2.org/projects/asm/ ). idea parse , store (and use later) public/protected methods , fields in each class file. working expected. dont list of methods, declared interface , inherited superclasses , superinterfaces. there smart parser available give me above list? i load class file , use java.lang.class object need. loading classes might fail because of dependencies. rather parse , info. the data want not there. inherited members implicit: have names of class , interfaces can looked for, , need parse corresponding class files.

javascript - Meteor SimpleSchema + Methods : clicking too fast throw an error -

first, have schema: rides = new mongo.collection('rides'); rides.attachschema( new simpleschema({ name:{type:string}, 'passengers.$._id': { type: string, autovalue: function(){ if(this.isupdate && this.operator !== '$pull') return this.userid; else this.unset(); } }, 'passengers.$.validate':{type:boolean}, ); server side, have these methods: meteor.methods({ leaveride: function(_id){ check(_id, string); rides.update(_id, { $pull:{passengers:{ _id:this.userid }} }); }, joinride: function(_id){ check(_id, string); rides.update(_id, { $addtoset: {passengers: {validate:true}} }); } }); and finally, 2 buttons join , leave call: template.ride.events({ 'click .join': ...

trigonometry - R: Strange trig function behavior -

as matlab user transitioning r, have ran across problem of applying trigonometric functions degrees. in matlab there trig functions both radians , degrees (e.g. cos , cosd, respectively). r seems include functions radians, requiring me create own (see below) cosd<-function(degrees) { radians<-cos(degrees*pi/180) return(radians) } unfortunately function not work of time. results shown below. > cosd(90) [1] 6.123234e-17 > cosd(180) [1] -1 > cosd(270) [1] -1.836970e-16 > cosd(360) [1] 1 i'd understand causing , how fix this. thanks! this floating point arithmetic: > all.equal(cosd(90), 0) [1] true > all.equal(cosd(270), 0) [1] true if meant "does not work properly"? this faq: http://cran.r-project.org/doc/faq/r-faq.html#why-doesn_0027t-r-think-these-numbers-are-equal_003f

matlab - How to load data with .out filename using importdata? -

i have .out files have strange format strings numerical data. if try import these .out files using importdata , empty double. however, can import these files using importdata if rename files .dat. there way of telling matlab read .out files if .dat files? here example: optimizer metric ( 0.0000%): 0.4728620 0.00000000e+00 1.51265733e-03 2.37895687e-04 65 0.00000000e+00 1.42127093e-03 8.50384026e-04 129 0.00000000e+00 9.70161923e-04 1.53099383e-03 22 0.00000000e+00 7.77171709e-18 3.28125000e-03 173 0.00000000e+00 -9.78525388e-04 1.54419205e-03 36 0.00000000e+00 -1.44808737e-03 8.66429008e-04 88 0.00000000e+00 -1.60526901e-03 2.52460729e-04 141 optimizer metric ( -0.0300%): 0.4790671 -3.00000000e-02 1.48622036e-03 2.02852233e-04 142 -3.00000000e-02 1.30349178e-03 6.76857256e-04 85 -3.00000000e-02 8.47690479e-04 1.16095956e-03 ...

c# - WPF bind boolean value to image display -

Image
i trying display either red or green icon in several grids based upon value of boolean variable set machine states(off/on). converter best way accomplish this? having troubles binding variables image field on grid. cannot seem fire off booltoimageconverter class? thank guidance. using booltoimageconverter. when using code, check resources , paths them. (images, converters, models (for models , converters check namespaces)). demo: in demo, changed property name flag , , booltoimageconverter read property , created bitmapimage. app.xaml: <application x:class="wpfapplication1.app" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:conv="clr-namespace:converters" startupuri="mainwindow.xaml"> <application.resources> <resourcedictionary> <conv:booltoimageconverter x:key=...

asp.net mvc 5 - LINQ: .Select infinite loop -

i getting appears infinite loop in either linq or somehow jquery. it keeps calling controller method on , over. here's controller method: public actionresult index() { // todo: decide properties determine need user action (the 'where(s)') var viewmodel = new prioritytasksviewmodel { bayoptions = _bayoptionrepository.getbayoptions() .where(x => x.isactive && !x.sitevisibilityflagsoverride).tolist() .select(x => new prioritytasksbayoptionsviewmodel() { bayguid = x.bayguid, baynumber = x.baynumber, propertyid = x.propertyid }) .tolist(), properties = _propertyrepository.getproperties() .where(x => !x.sitevisibilityflagsoverride).tolist() .select(x => new prioritytaskspropertiesviewmodel() { ...

c# - start processes with a delay -

how can start 5 different processes, each own delay without holding other ones while waiting delay finish? can not use async or await foreach(string process1 in _processlist) { // random delay process.start(process1); } you start every process different thread. foreach (string process1 in _processlist) { thread t = new thread(() => { thread.sleep(/*random number*/ 5); process.start(process1); }); t.start(); } that way each process have random timer before start , no process delayed start of other process. if starting thread totaly impossible in situation, suggest wrapping process .bat , in batch file add sleep delay way process called in time , sleep delay respected.

javascript - AngularJS how to change ng-model binding to another element -

how dynamically rebind elements ng-model (change ng-model subject) for example have <input type="text" ng-model="info"> <input type="text"> but after user interactions want modify <input type="text" ng-model="info"> <input type="text" ng-model="info"> or other variables. ideas how dynamically? then make array. in controller $scope.info = []; in html dynamically <input type="text" ng-model="info[$index]">

c# - How to pass a hidden variable value to href onclick function -

i have hidden variable stores id. in view have href tag calling function with need send id paramater. my hidden variable: <input type="hidden" id="cid" value="@model.cid"> < href="#!" onclick="opendlg('@item.name', 'here want hidden variable value'") >/<a> please help

javascript - How do I check if a file exists (by name) in Google Drive? -

using google apps script, i'm trying check if file exists in google drive, given name ( nomedb ). everywhere except in trash. var habds = driveapp.getfilesbyname(nomedb); if(!habds.next()){ logger.log('it not exist'); } now, driveapp.getfilesbyname returns fileiterator, object. if object size zero, or doesn't exist, should solve problem, right? instead of using .next(), use .hasnext() function. think run problems .next() trying grab file doesnt exist. other code looks fine! not 100% sure if .getfilesbyname() method returns empty fileiterator or null when no files found, if having issues test changing if statement conditions to (!hasbds.hasnext() || habds == null)

php - How to use xhgui with MAMP for wordpress? -

i quite new apache , php. have wordpress running locally (macos) mamp. i use xhgui ( https://github.com/perftools/xhgui ) works fine. instance, profiles when put auto_prepend_file = "/path/to/xhgui/external/header.php" global php.ini. but mamp seems use own php.ini (as indicated phpinfo). added same line there. still, xhgui not profile it. what doing wrong? ps: running "php -s 0:8080 -t webroot/" , not through vhost via mamp, since not work. can cause problem? edit: vhost <virtualhost *:8888> php_admin_value auto_prepend_file "/users/me/desktop/xhgui/external/header.php" documentroot "/users/me/documents/path/to/wordpress" servername localhost </virtualhost> i had same problem , solved exporting varibale. in case, ran following command in console: export php_ini_scan_dir=/library/application\ support/appsolute/mamp\ pro/conf

Stop Tables Expanding? HTML Table Rows and Data -

Image
might basic question. have table, instance 2x2. has height , width set. when enter lot of text one, shrink box next it. though theres loads of room! want both rows (boxes) stay same size! thanks! <table style="height: 190px; width: 896px;"> <tbody> <tr> <td> <p style="text-align: center;">&nbsp;co-ordsport nl</p> <p style="text-align: center;">&nbsp;</p> <p style="text-align: center;">solvayweg 15a</p> <p style="text-align: center;">6049 cp herten, netherlands</p> <p style="text-align: center;">+31 (0)475 772719</p> </td> <td> <p style="text-align: center;">&nbsp;co-ordsport de</p> <p style="text-align: center;">&...

javascript - How to include the variable in a JQuery when using FOR loops -

if have loop involves me going through element in html jquery. how so? example: if (fieldtype =='date') { (i=0;1<4;i++) { $('#aor_conditions_value\\[0\\]\\[i\\]').val(); //do more stuff } } the problem is 'i' in jquery not being acknowledged. need make for(var = 0; < 4; i++){ you left out var meant i < 4 not 1 < 4 return true .

Bound jQuery range slider to input field -

i'm trying bound input field jquery slider range option. tried demo listed in jquery's website, changing select field input, not working. main idea handle search requests , whenever user edits input field reflect slider too. possible? here current code: jquery(function($) { $( "#adv-slider-price-range" ).slider({ range: true, min: 0, max: 100000, values: [ 0, 100000 ], slide: function( event, ui ) { $( "#advc-amount-price" ).val( ui.values[ 0 ] + " , " + ui.values[ 1 ]); } }); $( "#advc-amount-price" ).val( $( "#adv-slider-price-range" ).slider( "values", 0 ) + " , " + $( "#adv-slider-price-range" ).slider( "values", 1 ) ); }); <input type="text" name="pricerange" id="advc-amount-price" /> <div id="adv-slider-price-range"></div...

Android to WCF: Streaming multi part image and Json string -

android wcf: streaming multi part image , json string i want create wcf-restful web service method,in need upload image(multipart-form data) along other information (in json format). web service accessed android , iphone application send image , json information as i want wcf server side , android code, me i'm trying upload image , text wcf service. create service save upload images: rest client code protected void button2_click(object sender, eventargs e) { if (fileupload1.hasfile) { memorystream mstream = new memorystream(); bitmap bmppostedimage = new bitmap(fileupload1.postedfile.inputstream); bmppostedimage.save(mstream, system.drawing.imaging.imageformat.jpeg); byte[] imagearray = mstream.toarray(); mstream.close(); vehiclechecklisttransaction objattachmentrequestdto = new vehiclechecklisttransaction(); ...

php - Wordpress (WooCommerce?) forces https (when it shouldn't) -

i'm experiencing strange issue on woocommerce installation company has taken over. it's not built , unfortunately it's pretty crappy built i'm not sure what's going on in there. it started "force" https connections, far know nothing has changed in nether code nor admin. running git on server , nothing has changed in working tree, , searched uploads folder suspicious files no results. it's unlikely kind of malware. site not set https/ssl of course trigger timeout. i checked database , both home_url , site_url set "http://...". woocommerce option "force ssl" set false. running plugin "better wp security/ithemes security" offers "force ssl"-option 1 set false too. i tried setting both constants force_ssl_admin , force_ssl_login false in wp-config.php - still no luck. tried using .htaccess rewrite rules didn't either. it seems connected request header; https: 1 (tested $ curl -i -h"https: 1...

java - Detecting Memory and CPU consumption of a particluar app -

i want detect memory , cpu consumption of particular app in android (programmatically), can 1 me it. have tried top method, want alternative it. any appreciated, :) if wan trace memory usage in app there activitymanager.getmemoryinfo() api. cpu usage can traced using cpustatscollector api. for more informative memory usage overview, outside app, can use adb shell dumpsys meminfo <package_name|pid> [-d] more specific memory usage statistics. example, there the command com.google.android.apps.maps process: adb shell dumpsys meminfo com.google.android.apps.maps -d which gives following output: ** meminfo in pid 18227 [com.google.android.apps.maps] ** pss private private swapped heap heap heap total dirty clean dirty size alloc free ------ ------ ------ ------ ------ ------ ------ native heap 10468 10408 0 0 20480 14462 6017 dalvik hea...

swift - saving background color of tableview cell -

i did research little confused how solve problem. have tableview cells have button in it. when user clicks button background of cell changes. save background color when user starts app color selected. believe best way nsuserdefaults not 100% sure. if thats case set dictionary this? if can steer me in right direction appreciate it. the first thing save color in data model , because otherwise colors become messed user scrolls , cells reused. cellforrowatindexpath: must rewritten assign correct background color every cell asked for. the second thing think how color saved. example, if it's choice between 2 known colors, can save number. if color, of course need actual color value. finally, yes, can save data model or part of in user defaults. color cannot saved in user defaults until archive nsdata (not hard).

How to install Hyper-V on Windows 7 Home Premium -

for installing haxm (to use android studio), need hyper-v. normally shall restart hyper-v option in control panel - windows feature on/off, don´t have hyper-v option, apparently cause have windows 7 home premium. (i have enabled "visualization" in bios). cannot find solution on how install hyper-v. please advise me how solve problem? hyper-v never part of windows 7. part of server 2008 r2 , microsoft added first client windows versions in windows 8 . here need pro or enterprise edition.

javascript - Cyrillic characters in MessageBox class of Sencha Touch -

i working different languages sencha touch framework, , translating messagebox buttons different languages, have added , working russian having problems, instead of appears correct translation appears "???" doesn´t detect correctly translation special characters. clue? yes, working utf8 charset, have solved issue receiving labels backend here code: var language = 'ru', //sent backend overwriting = ext.messagebox.yesno; switch (language) { case "ru" : var b = ext.messagebox; ext.apply(b, { yes: {text: 'russian text yes', itemid: 'yes', ui: 'action'}, no: {text:'russian text no', itemid: 'no'} }); ext.apply(b, { yesno: [b.no, b.yes] }); overwriting = b.yesno; break; }

javascript - How to retrieve values in select tag within the radio button using jquery? -

i have following html radio tags. basiclly, has 3 radio button , user can pick 1 , want jquery code pick value checked radio. there 3 radio button, 1 day, 1 n/a , 1 time. , once user click time, can selected time between 12:00 20:00 in tag. i know using .val() extract value other 2 options, figuring out how extract values on times when time radio button selected. i using meteor framework project, guess jquery question. html <tr> <td>monday</td> <td><input type="radio" name="mon" value="all">all day</td> <td> <input type="radio" name="mon" value="time">between <select name="firsttime"> <option>time</option> <option value="12">12:00</option> <option value="13">13:00</option> <option value="14">14:00</...

sdk - LibreOffice OpenOffice Container Window caption text java, C++ -

i working libreoffice sdk. testing open writer , inserting text in it. have not found way accessing window title bar caption using sdk. public class documentloader { public static void main(string args[]) { if ( args.length < 1 ) { system.out.println( "usage: java -jar documentloader.jar \"<url|path>\"" ); system.out.println( "\ne.g.:" ); system.out.println( "java -jar documentloader.jar \"private:factory/swriter\"" ); system.exit(1); } com.sun.star.uno.xcomponentcontext xcontext = null; try { // remote office component context xcontext = com.sun.star.comp.helper.bootstrap.bootstrap(); system.out.println("connected running office ..."); // remote office service manager com.sun.star.lang.xmulticomponentfactory xmcf = ...

jquery - Repeated data is being displayed on calendar -

i using fullcalendar js plugin , fetching data in form of json( in codeigniter ). data displaying fine on "month view" when click on "week view" redundant entry gets appeared. happening because have used "datetime" datatype ? because if change "date" not happen. please tell me , should if want display other values "title" on calendar. code snippet - $('#calendar').fullcalendar({ selectable: true, header: { left: 'prev,next today', center: 'title', right: 'month,agendaweek' }, events : "<?php echo base_url()?>secure/fetch_calendar_details", }); please me , in advance.

ruby on rails - ActiveRecord::HasManyThroughCantAssociateThroughHasOneOrManyReflection with these associations -

i have these models: familytree # == schema information # # table name: family_trees # # id :integer not null, primary key # name :string(255) # user_id :integer class familytree < activerecord::base attr_accessible :name belongs_to :user has_many :memberships, dependent: :destroy has_many :active_members, through: :memberships, source: :user, dependent: :destroy has_many :passive_members, through: :memberships, source: :member, dependent: :destroy has_many :nodes, dependent: :destroy has_many :members, through: :memberships, dependent: :destroy end membership # == schema information # # table name: memberships # # id :integer not null, primary key # family_tree_id :integer # user_id :integer # member_id :integer class membership < activerecord::base belongs_to :family_tree belongs_to :user belongs_to :member end member # == schema inform...