Posts

Showing posts from March, 2015

email - PHP PDO send e-mail code only sends if text-only - need to send HTML -

i'm making code (1) moves records 1 table (in same database), (2) sends contents of table 1 pre-determined e-mail, , (3) delete contents of table 1 - simulating "add cart" feature. my problem code below successful in sending e-mail if $headers not sent on mail(). however, need send table contents html or @ least allow different records. if chance e-mail isn't sent, delete part of code isn't executed either. doing wrong? thanks in advance! modified code (that works if don't send $headers ) <?php include '../config/database.php'; date_default_timezone_set('cet'); $date = date('y-m-d h:i:s'); $query = "insert claims_archive (t20pctid, total_amount, user_id, sent) select t20pctid, total_amount, user_id, @date cart t20pctid '%sony%'"; $stmt = $con->prepare($query); if ($stmt->execute()) { $query = "select t.t20pctid, t.main_artist, t.track_title, t.original_album,

javascript - d3 v4 + react + es6 + crossfilter: Selection.exit().remove() not working -

i'm using crossfilter.js , d3.js v4 es6 style react in attempt make dimensional charts context brushing. essentially, took this example , converted es6. the problem have selection.exit().remove() not working such on each redraw, more , more circles appended svg g element. redraws triggered when brush created. checked running selection.exit() .attr('class', d => { console.log('anything'); return 'anything'; }) .remove(); but nothing outputted i'm thinking data selection not valid. here context: componentdidmount() { const el = reactdom.finddomnode(this); // mounted svg element const svg = d3.select(el) .attr('width', 300) .attr('height', 500); const g = svg.append('g') .attr('transform', 'translate(32,32)'); let circles = g.append('g') .selectall('circle'); const brushgroup = g.append('g') .attr('class', 'brush&#

java - How to access Sqllite DB installed in android from web portal through USB -

we have android app , web portal developed in java client, sqllite db installed in android app. want offline sync , in order connecting android device pc through usb . possible access sqllite db installed in android device web portal? i appreciate answer. i dont think can directly access usb database stored in apllications private memory not in sdcard,but can export database via code in app (just viewing purpose) , upload file server public class exportdb { final static string sample_db_name = "yourdatabase"; public static void exportdb(context context){ file sd = environment.getexternalstoragedirectory(); file data = environment.getdatadirectory(); filechannel source=null; filechannel destination=null; string currentdbpath = "/data/"+ "your.package.name" +"/databases/"+sample_db_name; string backupdbpath = sample_db_name; file currentdb = new file(data, currentdbpath

VSTS NuGet Packager error: "Path cannot be null." -

while moving vsts online builds, i'm running following error during nuget packager step in package artifacts nuget package based on nuspec file in project. 2016-07-28t04:24:41.7652305z ##[error]path cannot null. 2016-07-28t04:24:41.7652305z ##[error]parameter name: path my nuget packager step's path variable looks this: *\projectname1.nuspec;*\projectname2.nuspec; i checked in nuget.exe 3.4.4 solution in .nuget folder along nuget.config. then, in advanced settings, specified nuget.exe used entering following path "path nuget.exe" $(build.sourcesdirectory)\.nuget\nuget.exe this didn't seem help. prior this, other steps working correctly , projects compiling without issues. also, when run nuget.exe pack command locally these .nuspec files, packages created successfully. any input appreciated. thank you. after frustration , endless hours, have found solution. just update nuget packager step's path: *\projectname1.nuspec;*\proje

php - Best ways learn basic web security -

i'm 16 , lot of web design people. front end design apart occasional bit of php when handling forms. while know how manage basic sterilisation , validation, learn more intricate things user management , login systems. know way around js, mysql , php, etc... don't feel confident securing such systems. know there not 1 solve guide web security, wondering if knows helpful guides, resources, etc.... also, somewhere start. what want learn about: setting , acquiring ssl certificates handling ssl certificates building secure login systems using cookies security purposes general php security sql security my end goal able build sites users who's basic info can securely store (no payment details) in sql database. want able create user sign login , editing system. have created before not ssl. question how learn ssl? could someone... - direct me guide. - direct me examples. - point me in right direction. (examples big post) said quite broad question sorry (as ha

Maya Python: Accessing outer function variable from inner function -

i want write ui window using python, following code, function running correctly, there problem, when choose item in textscrolllist, should call inner function 'update()' , highlight corresponding object in scene. however, object cannot chosen correctly , shows error message this: "object 'alertwindow|formlayout164|textscrolllist27' not found." i think happens because inner function update() cannot access variable tsl in outer function, know how can revise code? def alertwindow(): if(cmds.window('mainwindow', q =true, exists = true,)): cmds.deleteui('mainwindow') ui = cmds.window('mainwindow', title = 'alert!', maximizebutton = false, minimizebutton = false, resizetofitchildren = true, widthheight = (250, 300), sizeable = false) myform=cmds.formlayout( ) txt = cmds.text(label = 'please check following objects :') tsl = cmds.textscrolllist(width = 200, height = 200, enable = tr

Convert AppleScript sdef to TypeScript .d.ts? -

most os x applications (particularly ones written apple) scriptable using either applescript or javascript. api each application supports described sdef file. (see e.g. sdef /applications/safari.app .) is there way automatically generate .d.ts files .sdef files, , create ambient typings suitable use typescript?

c# - Pass getdate() in dynamic query as parameter -

good morning everyone! building dynamical query parameters seen in code below. c.open(); string columns = "("; string values = "("; foreach (datagridviewcolumn column in rootdataview.columns) { if (virtualcolumns.contains(column.name)) { } else { columns += column.name + ","; values += "@" + column.name + " ,"; } } columns = columns.substring(0, columns.length - 1) + ")"; values = values.substring(0, values.length - 1) + ")"; sqlcommand command = new sqlcommand("insert " + tablename + " " + columns + " values " + values, c); foreach (datagridviewcolumn column in rootdata

shell - cannot understand combined exec and redirection in bash script -

i know exec executing program in current process quoted down here exec replaces current program in current process, without forking new process. not use in every script write, comes in handy on occasion. i'm looking @ bash script line of can't understand exactly. #!/bin/bash log="log.txt" exec &> >(tee -a "$log") echo logging output "$log" here, exec doesn't have program name run. mean? , seems capturing execution output log file. understand if exec program |& tee log.txt here, cannot understand exec &> >(tee -a log.txt) . why > after &> ? what's meaning of line? (i know -a option appending , &> redirecting including stderr) edit : after selected solution, found exec &> >(tee -a "$log") works when bash shell(not sh). modified initial #!/bin/sh #!/bin/bash . exec &>> "$log" works both bash , sh. from man bash : exec [-c

c# - Visual Studio not Recognising IDisposable Type -

i have following email class contains 1 method send : using system.net; using system.net.mail; static class email { const string emailaddress = "joebloggs@domain.com"; const string subject = "error detected in application"; public static void send(string body) { using (var client = new smtpclient("mail.mailserevrname.com", 25) { credentials = new networkcredential(), enablessl = false }) { client.send(emailaddress, emailaddress, subject, body); } } } i have used code in multiple applications , have never had problem (no errors, email gets sent as/when expected). however, in current project, when copy class in, seeing error: 'smtpclient': type used in using statement must implicitly convertible 'system.idisposable' i have never seen error being produced above code. can see the docume

sql - Performance improvement for linq query with distinct -

considering sample table col 1, col2, col3 1 , x , g 1 , y , h 2 , z , j 2 , , k 2 , , k 3 , b , e i want below result, i.e distinct rows 1 , x , g 1 , y , h 2 , z , j 2 , , k 3 , b , e i tried var result = context.table.select(c => new { col1 = c.col1, col2 = c.col2, col3 = c.col3 }).distinct(); and context.table.groupby(x=>new {x.col1,x.col2,x.col3}).select(x=>x.first()).tolist(); the results expected, table has 35 columns , 1 million records , size keep on growing, current time query 22-30 secs, how improve performance , down 2-3 secs? using distinct way go... i'd first approach tried correct 1 - need 1 million rows? see where conditions can add or maybe take first x records? var result = context.table.select(c => new { col1 = c.col1, col2 = c.col2,

Product images in Magento not displayed in frontend -

i've uploaded images 1 of magento products in backend, not displayed in frontend. i'm analysing mysql tables: select * catalog_product_entity entity_id=10; select * catalog_product_entity_media_gallery entity_id = 10; select * catalog_product_entity_media_gallery_value value_id in (46,47,48); and guess displayed image here: select thumbnail, small_image, small_image_label, thumbnail_label catalog_product_flat_1 entity_id = 10; but when selecting other image , saving changes in backend, values in table don't change... my cache disabled, permissions ok in /media folder... cannot understand why image not displayed... make sure images not saved on store level. switch store view , see if images saved on store level. remove store level values making "use default value" checkboxes checked , save product.

dynamics crm - AdxStudio: How display an entity form in Web template(Liquid Templates) -

i trying display entity form in adxstudio web template , found 1 link using liquid display entityform <div class="container">{% entityform name:'my entity form' %}</div> but did't work me. please me put entity form on web template in adxstudio. thanks in advance...... solved it! initially trying display web template footer web template of home page, did't work. for displaying entity form need to: place entity form in web template <div class="container">{% entityform name:'my entity form' %}</div> associate web template page template page template needs associate web page browse page, see/submit form. thanks!

Search elasticsearch all content from especific source -

i want know if possible search content specific _source in elasticsearch. for example have this: { "_shards":{ "total" : 5, "successful" : 5, "failed" : 0 }, "hits":{ "total" : 1, "hits" : [ { "_index" : "twitter", "_type" : "tweet", "_id" : "1", "_source" : { "user" : "kimchy", "postdate" : "2009-11-15t14:12:12", "message" : "trying out elastic search" } } ] } } i want query users source without specifying name. for eg: similar in sql this select * user twitter and give users thanks , sorry bad english edit: want search source. give example, have source store random word, store, not. want search source when have new wor

ios - crash on [GetReturnValue:] method is used to obtain OC object, help me -

using [code 1]【 getreturnvalue :】 ios reflection oc object, in 【iphone4s + ios8.4】、【 iphone 4 + ios7.1】 (crash), 【iphone6 + ios9.3】、【 iphone 5 + ios8.4.1】 (pass), but implement following [code 2] on of systems test pass, system bug or other reson? // code 1 id objcminor; if( !strcmp(minorreturntype, @encode (id)) ) {    [invominor getreturnvalue:&objcminor]; } // code 2 void *temp = null; [objcminor getreturnvalue:&temp]; id objcminor = (__bridge id)temp; nsmutabledictionary *dic = [nsmutabledictionary dictionary]; [dic setobject:objcminor forkey:@"minor"]; [[nsuserdefaults standarduserdefaults] setobject:dic forkey:@"test"]; edit xcode scheme->run->enable zombile objects console output *** -[cfnumber release]: message sent deallocated instance 0x7baa7460 crash screenshot : enter image description here test demo download link https://github.com/leopardpan/issuesdemo

c# - Regex to match exact words in double square brackets -

i have following regex, matches words inside double bracket squares: @"(?<=\[\[)[^]]+(?=\])" problem: want replace in input [[hello]] -> foo [[helloworld]] -> bar code following: message = message.replace(match.value, value.tostring()); message = regex.replace(message, @"[\[\]']+", ""); in output, receive fooworld. how should modify regex foo , bar? your regex @"(?<=\[\[)[^]]+(?=\])" matches 1+ characters other ] if preceded [[ , followed ] . not match [[x x x]] -like strings. not match [[x y ] bracket ]] -like strings. you achieve need @"\[\[(.*?)]]" regex (using regexoptions.singleline flag), , replacing $1 : message = regex.replace("[[hello]]", @"\[\[(.*?)]]", "$1")); see ideone demo however, given current requirements (or absence) can use message = message.replace("[[", "").replace("]]", "");

Permission Denied on mkdir php with nginx -

i struggling issue on lemp stack. cannot make nginx user create directory via php script. my stack rhel 7.2 nginx mariadb php i installed stack , used following code creating directory in index.php <?php echo(exec("whoami")); mkdir("test",0777,true); $error=error_get_last(); echo $error['mssage']; ?> output nginx mkdir(): permission denied nginx excecutes php via nginx user. applied 'chown -r nginx: nginx <working folder>' applied 'chmod -r 0777 <working folder> but above script gives same permission denied error. my plan install wordpress , import sites web server. since permission denied on working folder of nginx , wordpress not able create new directories or move content 1 folder other. set selinux disabled or permissive in /etc/selinux/config if selinux has enforcing, use semanage change context of my

php - Table headers in the wrong direction -

Image
i'm trying populate home html tables arrays in php, html knowledge far sufficient , wondering if me getting table headers go horizontally rather vertically? php: print "<table>"; print "<tr>"; ($x=0; $x <=10; $x++) { print "</tr>"; print "<th>$keys[$x]</th>"; print "<td>$step[$x]</td>"; } outcome: these headers want displayed horizontally rather vertically.. any appreciated always, thanks first make row headers, after row values. print "<table>"; print "<tr>"; ($x=0; $x <=10; $x++) { print "<th>$keys[$x]</th>"; } print "</tr>"; print "<tr>"; ($x=0; $x <=10; $x++) { print "<td>$step[$x]</td>"; } print "</tr>";

html - Why does Chrome (v.51.0.2704.106 m) ignore "@meda all and (max-width:849)? -

i don't find explanation why media query not work in chrome. works expected in firefox , safari, in chrome noe media query working. this how linked in html. tried without media="all" doesn't work. <html> <head> <meta charset="utf-8"> <title>example</title> <link rel="stylesheet" type="text/css" href="/webresources/css/styles~2016-07-28-09-01-05-000~cache.css" media="all"> </head> <body> </body></html> my sass/scss looks , i'm not getting error while transform css gulp task. @media , (max-width: 1200px) { } @media , (max-width: 849px) { } the strange thing first media query used second one, should override first one, isn't used. this style used on width: 800px i looked in source if code missing, media querys there. here found idea of problems link , media query, didn't help thanks help use record try? or equivale

openlayers 3 - map.on click is not working in openlayers3 -

i trying click feature info on map click in openlayers3. getting error message in console typeerror: layer.getsource(...) null click function map.on('click', function (evt) { var fl = map.foreachfeatureatpixel(evt.pixel, function (feature, layer) { return { 'feature': feature, 'layer': layer }; }); var feature = fl.feature; layer = fl.layer; if (layer == vectorlayer) { var admin = "<table>"; admin += "<tr><td style='color:green; border: 0px solid red;text-align:left;vertical-align:middle;font-size:15px;'><b> information<b></td></tr>"; admin += "<tr><td><b>type</b></td><td>:</td><td >" + feature.get('field1') + "</td></tr>"; admin += "<tr><td><b>district</b></td><td>:</td><td>" + fe

symfony - How to remove usage of cascade={"remove","persist"} from entities in Symfony2? -

i working on project there forced use cascade={"remove","persist"} because of problem described here. reading through documentation , quote: even though automatic cascading convenient should used care. not blindly apply cascade=all associations unnecessarily degrade performance of application. each cascade operation gets activated doctrine applies operation association, single or collection valued. and see same can fixed if use $em->persist($entity); in persistence services, calling. however, doctrine doesn't work expected. here entities. entity/employee.php <?php namespace appbundle\entity; use doctrine\orm\mapping orm; /** * @orm\entity * @orm\table(uniqueconstraints={@orm\uniqueconstraint( * name="uniq_employee_id_name_address_state_city_country", * columns={"id","name","city","state","country"} * )}) */ class employee { /**

windows - Disabling ALT & Application key in Win10 registry -

i disable alt & application key in windows10 editing registry key. found procedure: hkey_local_machine\system\currentcontrolset\control and click on keyboard layout on edit menu click add value type in sancode map, click reg_binary data type , click ok insert 00000000000000000300000000005be000005ce000000000 save & restart as above win keys wanted change alt & application key codes win keys are: left win key -> 0x5b right win key -> 0x5c codes alt & application keys are: application key -> 0x5d alt key -> 0x12 so changed value from: 00000000000000000300000000005be000005ce000000000 to: 00000000000000000300000000005de0000012e000000000 ...but doesn't work. suggestions? suspect value might wrong not sure how validate. ok, procedure works (verified win10 iot enterprise 2015 ltsb) problem incorrect mapping desired keys with @ilnspectable found correct mapping alt & application keys: 38 & e0_5d respectively

php - run multiple select quires in one page using codeigniter -

hello 1 can tell how load 2 function model class in controller 1 method. want run multiple select quires in 1 page using codeigniter: controller public function property_detail( $id ) { $this->load->model('insertmodel'); $select1 = $this->insertmodel->find($id); $select2 = $this->insertmodel->detail_list(); $data = array(); $this->load->view('home/property_detail', ['select1'=>$select1], ['select2'=>$select2]); //$this->load->view('home/property_detail', ['select2'=>$select2]); } model public function find( $id ) { $query = $this->db->from('article')->where(['id'=> $id])->get(); if( $query->num_rows() ) return $query->row(); return false; } public function detail_list(){ $query1 = $this->db->query("select * article"); return $query1->result(); } in controller public

android - ScrollView, ListView or RecyclerView -

i starting android development. for project, need finalize on 2 things - regarding - feature, ease of implementation & maintainability (actually, functionality - user enter youtube url & video name & should display new row in list.) the list which 1 choose? scrollview, listview or recyclerview (i know, recycleview featured 1 - selection justified here - using limited functionality) data format storing data using service & suggestive format retrieving - json, gson or retrofit scrollview - add scrolling view. it's container (like linearlayout). if choose between listview , recyclerview, use recyclerview viewholder pattern - because it's more flexible. retrofit - library for, example, rest api. , it's use json.

mdm - difference between normal profile and provisioning profile iOS -

i know difference between normal ios profile (configuration profiles, restriction profiles etc) , provisioning profile. in relation using mdm profile commands. there commands install/remove profile , there commands install/remove provisioning profile. what difference? thank a provisioning profile profile contains information app's signature. required in versions of ios 5 can not install .ipa without first installing provisioning profile. starting late ios 5, apple introduced feature xcode bundles embedded.mobileprovision file .ipa modern mdm servers can skip this.

javascript - Match 2 fields in different records Mongoose -

goodmorning i trying match fields on dataset. dataset contains records like: { "token" : "17e0d95f2e2112443cfb09970ae9140e", "answers" : { "yourname" : "marco", "youremail" : "marco@me.nl", "recemail" : "sonja@me.nl" } }, { "token" : "cf5ae65b05249dc6b2a0c99c4cf9688e", "answers" : { "yourname" : "sonja", "youremail" : "sonja@me.nl", "recemail" : "marco@me.nl" } } in case, should match 2 because recemail (recipients email) matches else's email address. , vice versa. trying find how find these 2 records (in larger dataset more of these matches). so, marco's recemail should find sonja's youremail , these 2 matches should made available save collection, that's not important part here. hope can me query than

windows - Sorting in Powershell except few output -

i have multiple services. suppose starts . when execute get-service a* - display services output starting a. i sorting complete output except 1 , want on top of list once sorted. using below command. get-service -displayname a* |sort-object {$_.name -ne 'ak'} it listing output in sorted way , ak on top below . ak ar and on . keeping ak on top , sorting others. want same thing 2 services. ak , ar(suppose)- both should in ak , ar order @ top other services need sort. how add in existing code ar . try -notin operator, can specify array of excludes: get-service a* | sort-object {$_.name -notin "ak","ar"} this way ak , ar service on top of sorted list edit: v2 simple , easy: get-service a* | sort-object {"ak","ar" -notcontains $_.name}

java - converting Japanese characters to hex not working -

my code simple (using commons-codec-1.10.jar) system.out.println(hex.encodehex("三菱グループ".getbytes(standardcharsets.utf_8), true)); it yields e4b889e88fb1e382b0e383abe383bce38397 in pc, in accoridng http://codebeautify.org/string-hex-converter , should 4e0983f130b030eb30fc30d7. missing anything? hex.encodehex working fine, results utf-8 encoding, whereas codebeautify.org appears using utf-16. let's take 三 start with. that's u+4e09. in utf-16 that's encoded 4e 09, matches start of codebeautify output. in utf-8 it's encoded e4 b8 89, matches java output. if want utf-16, use standardcharsets.utf_16be instead of standardcharsets.utf_8 . (but if really want utf-16. utf-8 better encoding use in cases, imo.)

R: How to create a new column in a data frame with "countif" values from another data frame? -

i have 1 dataframe (df1) looks follows. indicates years when company active in specific market. company country year austria 2010 germany 2010 austria 2011 b italy 2010 i have second dataframe (df2) looks follows. lists investments of company in country @ given time, investment type dummy variabes. company country year jointventure m&a greenfield austria 2010 1 0 0 austria 2010 0 1 0 austria 2010 1 0 0 ... my question follows: want add new column df1 , including "countif" of each investment type indicated in df2. instance, new df1: company country year count.jointventure count.m&a count.greenfield austria 2010 2 1 0 germany 2010 ........... austria 2011 b italy 2010 also, how able add new columns df1 transforming these counts dummy variables (1 if >0; 0 if 0)? thanks ,

android - Cannot get sent sms (text messages) from device -

i sent sms (text messages) device. can of them inbox with: public list<sms> getallinboxsms(context ctx) { list<sms> inboxsmslist = new arraylist<>(); try { uri urisms = uri.parse("content://sms/inbox"); cursor c = ctx.getcontentresolver().query(urisms, new string[]{"_id", "thread_id", "address", "person", "date", "body"}, "read=0", null, null); if (c != null && c.movetofirst()) { { inboxsmslist.add(new sms(c)); } while (c.movetonext()); } } catch (exception e) { log.e("getallinboxsms", e.tostring()); } log.i("inbox", "size: " + inboxsmslist.size()); log.i("inbox", inboxsmslist.tostring()); return inboxsmslist; } however if modify uri.parse("content://sms/inbox"); to uri.parse("content://sms/

ios - How to get cells with different cell classes -

i need text textfield i.e kgcustomcell , kgrepscustomcell. need fetch data field, when run buttonclicked method. i have tried add instance variables, contains kg , reps, first time click button, it's empty. second time it's okay. how can load data in correct way? func tableview(tableview: uitableview, cellforrowatindexpath indexpath: nsindexpath) -> uitableviewcell { let index = indexpath.row if indexpath.row == 0 && indexpath.section == 0 { let exercisename = tableview.dequeuereusablecellwithidentifier("exercise name", forindexpath: indexpath) as! loggedexercisenamecell exercisename.lblexercisename.text = self.exercise?.name return exercisename } if index == 0 && indexpath.section == 1 { let txtfieldkg = tableview.dequeuereusablecellwithidentifier("text kg", forindexpath: indexpath) as! kgcustomcell return txtfieldkg } if index == 1 && indexpath.section

c# - How to get the name of the signer from a signed file -

Image
i trying name of signers signed files using powershell. the signer of flashutil_activex.exe (in windows 10) “microsoft windows third party application component”: checked right click on file checked sigcheck.exe when tried powershell shows me different names: any of names (the “subject” , “issuer”) not “microsoft windows third party application component”. i tried get-applockerfileinformation no success: i needed use get-pfxcertificate command. can see name of signer appeared in "signature list". this how looks using command: and example file (igfxsdk.exe) number of signatures:

javascript - How to make my script works again -

"english not first language, please don't hate me. need little keep getting error , don't know why can me solve please? sorry bad english not main lang tried fix cant. var item: tl2item; begin while true begin delay(500); if inventory.user.byid(10437, item) , not (item.equipped) begin delay(500); engine.useitem(10437);//'icarus heavy arms' delay(800); end; end; end. i error [string "var..."]:2 '='expected near "item"

css3 - Apply style to all input text not empty via CSS -

can done via css3 ? var inputs = document.getelementsbytagname("input"); (var = 0; < inputs.length; i++) { if (inputs[i].type == "text") { if (inputs[i].value != "") { inputs[i].style.borderbottomcolor = '#448aff'; } } } var textareas = document.getelementsbytagname("textarea"); (var = 0; < textareas.length; i++) { if (textareas[i].value != "") { textareas[i].style.borderbottomcolor = '#448aff'; } } i don't mind not supporting ie10. textarea:valid, input:valid { border-bottom-color: #448aff; } also need add pattern=".*?\s.*" (only valid @ least 1 non-space character) , required attributes thos pseudo-classes. want customise :invalid state, too.

sql - Exception of type 'System.outOfmemoryException was thrown' -

i builed 3 reports in ssrs , 1 of them main 1 of 2 others reports need click on of links in main. i've noticed 1 click works fine if click again display else error: 'an error occurred during local report processing. error has occurred during report processing. execution failed shared data set 'a' exception of type 'system.outofmemoryexception thrown' any idea why happening? you can check resolution in article microsoft. http://support.microsoft.com/kb/909678

jquery - Javascript auto-scroll up and down, cancel at any time -

i have website button. when press button, want page (body) auto-scroll , down forever. until try scroll page myself, auto-scroll must stop until restarted button. i've found alot of posts on how auto-scroll - not in context, being able stop it. any ideas? hi can inspire example link <div id="listofstuff"> <div class="anitem"> <span class="itemname">item1</span> <span class="itemdescruption">aboutitem1</span> </div> <div class="anitem"> <span class="itemname">item2</span> <span class="itemdescruption">aboutitem2</span> </div> <div class="anitem"> <span class="itemname">item3</span> <span class="itemdescruption">aboutitem3</span> </div> <div class="anitem"> <

How can I remove the parent keys from a javascript Object? -

i have object: schoolsobject = [{ "college_1": { "id":"college_1", "location":"victoria", "name":"college one" }, "college_2": { "id":"college_2", "location":"tasmania", "name":"college two" } }]; i want remove top level keys ie. college_1, college_2 , 'flatten' object out this, have no 'top level' keys: flatschoolsobject = [{ "id":"college_1", "location":"victoria", "name":"college one" }, { "id":"college_2", "location":"tasmania", "name":"college two" }]; here latest attempt, i've made lot of different try's have not been documenting them: // schoolids = object.keys(schoolsobject);

loops - How to hit multiple http request in jmeter after taking a value from csv file -

Image
i have testing plan in have check login of application when hit login api 5 concurrent api request initiated in case of application i simulated same in jmeter . but system working first, makes login 10 users , other http requests initiated , , i want like first, take 1 value csv file , hit login api , hit other 4 , same repeated users.

data.table - How to count overlaps between multiple categories in R -

Image
i have data frame of start time, end time in unix time stamp , category, below: i want find overlaps of 1 category "a" among other categories "b" & "c" , same other categories. want find how many number of categories overlapped how many times e.g. 2 categories overlapped 3 times , 3 categories overlapped 5 number of time. , average of duration overlapped shown below.

I have Advagg Module for Drupal 7.x and i have many files in folders advagg_js/css.... why? -

i have drupal 7.x , advanced css/js aggregation 7.x-2.7 in folders advagg_js , advagg_css (path sites/default/files) have have many identical files , don't understand why... this name of file in advagg_css : css____tq6dknpjnnlolloo1chze6a0euazr40c2jw8lenlk__cmbidt93019zjxjbpnkuaosv78ghkpc3vgajyuwrvng__u78dxvtmngrsprqhj0bcjeltm2p5inlkjg6oqm4a72o how can delete these files without doing damage? maybe in performance/advagg/operations in box cron maintenance tasks must check clear stale files remove stale files. scan files in advagg_css/js directories , remove ones have not been accessed in last 30 days. ???? i hope can me... thanks lot i can guarantee there few duplicate files in directories. if want, can manually delete every file in there; lot of them generated again you're having lot of files (the css/js files auto created on demand, image styles). advagg @ preventing 404 happening when requesting aggregated css/js file. can adjust

php - How do I load an svg from a folder outside http while hiding location -

on of our sites keep images outside main http folder because people logged in can see these images. have function wrote ages ago loads images outside http folder , scrambles location cannot see loaded from, , works jpg , png. problem have started using svg images, , same code not work @ svg. question how change code make work svg well? function show_picture($location,$file) { $location=$location.$file; if ( file_exists($location) ) { $imagedata = base64_encode(file_get_contents($location)); $finfo = new finfo(); $fileinfo = $finfo->file($location, fileinfo_mime); $src = 'data: '.$fileinfo.';base64,'.$imagedata; echo'<img class="picture" src="'.$src.'" alt="part picture" /></a>'; } else { echo'<img class="picture" src="images/nopicture.jpg" alt="part picture not exist" /></a>&

java - A way to determine in which one of the boxes a number in Sudoku is -

Image
i started implementing sudoku solver , done of algorithm x. means there cover matrix lots of different possible solutions given sudoku , algorithm's task find correct ones. but problem in generator of matrix. i'll simplify problem as possible. using cover matrix helps me solve sudokus. each line in matrix unique entry. in order compose single line, need determine in cell, row, column , box given number in sudoku is. since sudoku dimensions defined dimensions of inner boxes (image below), i'm using dimensions determine in row , column pregiven number is. every box has dimension of width , height or if prefer m , n or other notation - classic 9x9 sudoku has m = 3 , n = 3 (the dimension of inner box). as can see custom sudoku dimensions m = 2 , n = 3 , has 6 boxes. i having problem creating formula give me information in box number is. input should position (index) of number in sudoku , output number of box in number is. below code tried polishing far still d

for loop - Cilk error expected ‘)’ before ‘;’ token -

i try compile programme using cilk don't works g++ -std=c++11 -fcilkplus -lcilkrts -ldl -o2 src/cpp/* -o bin/exe src/cpp/sous_monoide.cpp: dans la fonction src/cpp/sous_monoide.cpp:269:19: erreur : expected ‘)’ before ‘;’ token cilk_for (i = 0; < limite; i++){ ^ src/cpp/sous_monoide.cpp:269:36: erreur : expected ‘;’ before ‘)’ token cilk_for (i = 0; < limite; i++){ ^ src/cpp/sous_monoide.cpp:312:1: erreur : expected ‘}’ @ end of input } ^ src/cpp/sous_monoide.cpp:312:1: erreur : expected ‘}’ @ end of input src/cpp/sous_monoide.cpp:312:1: erreur : expected ‘}’ @ end of input this code : const int limite = n-1; int i; cilk_for (i = 0; < limite; i++){ .... } thanks help did include cilk/cilk.h ? #include <cilk/cilk.h> cilk_for defined in header file. alternatively, can use _cilk_for without including header.

Mysql Update and Select first element -

i use 2 requests : select `user` `table1` order `last activity` asc limit 0,1; and update `table1` set `last activity` = current_timestamp `user` = 'user' i join both in 1 request.. because 2 program take same user. edit: forgot need user name, update first element not enough. take user last activity, update time, , program user. problem many programs running simultaneously. , important not access same user @ same time between 2 requests it sounds looking subquery . that this: update `table1` set `last activity` = current_timestamp `user` = (select `user` `table1` order `last activity` asc limit 0,1)

ios - Convert NSObject to NSNumber -

how convert object of type nsobject nsnumber in objective-c? in android this: if(value instanceof integer){ intvalue = (integer)value; } but how can convert value in objective-c? my code: -(void)changewithvalue:(nsobject*)value{ if([value iskindofclass:[nsnumber class]]) float floatvalue = [value floatvalue]; } but not working :( help me please. thanks after clarification of error objective-c-ese solution use id parameter type. type id means "any object type" , compiler allows call method. have code along lines of: - (void)changewithvalue:(id)value { if([value iskindofclass:[nsnumber class]]) { float floatvalue = [value floatvalue]; ... } else { // handle not `nsnumber` } } you can make more general testing method rather type using respondstoselector: : - (void)changewithvalue:(id)value { if([value respondstoselector:@selector(floatvalue)]) { float floatvalue = [value float

c# - VSIX project template add inside vstemplate a new projectitem -

i'm creating project template in visual studio 2015 vsix project , linked c# class library project should template if i'm creating new project. in c# class library project in .vstemplate file want add folder and/or file put myself there. add items project in vs. <templatecontent> <project file="projecttemplate.csproj" replaceparameters="true"> <projectitem replaceparameters="true" targetfilename="properties\assemblyinfo.cs">assemblyinfo.cs</projectitem> <projectitem replaceparameters="true" openineditor="true">class1.cs</projectitem> </project> </templatecontent> this part of automatically generated .vstemplate file. now want add file created "usercontrol1.cs" , want add this: <templatecontent> <project file="projecttemplate.csproj" replaceparameters="true"> <projectitem replace

Multiple "One-Sample t-test" in R -

i have data.frame, similar one: cb <- data.frame(group = ("a", "b", "c", "d", "e"), wc = runif(100, 0, 100), ana = runif(100, 0, 100), clo = runif(100, 0, 100)) structure of actual dataframe: str(cb) data.frame: 66936 obs of 89 variables: $group: factor w/ 5 levels "a", "b", "c" ... $wc: int 19 28 35 92 10 23... $ana: num 17.2 48 35.4 84.2 $ clo: num 37.2 12.1 45.4 38.9 .... mean <- colmeans(cb[,2:89]) mean wc ana clo ... 52.45 37.23 50.12 ... i want perform 1 sample t.tests on every group , every variable for did following: a <- subset(cb, cb$group == "a") b <- subset(cb, cb$group == "b") ... t_a_wc <- t.test(a$wc, mu = mean[1], alternative = "two.sided") t_b_wc <- t.test(b$wc, mu = mean[1], alternative = "two.sided") .... t_a_ana <- t.test(a$ana, mu = mean[2], alternative = "two.sided") t_b_ana <- t.

c# - Multiknapsack algorithm - out of collection while trying to remove object -

i've encountered problem while working on multiknapsack solver. program working on 1 knapsack when comes multiple knaps there problems. problem: items aren't removed collection. know need this, because second knapsack iterating again through same objects - maximized val same... private void knapsack() { list<plecak> descendingkanps = _plecaklist.orderbydescending(o => o.w).tolist(); // list of configured kanpsacks in descending order list<produkt> descendingproducts = _produktlist.orderbydescending(o => o.cena).tolist(); // list of products pack in descending order int n = descendingproducts.count; //number of items in product list double maxval = 0; // accumulated value of 1 knapsack foreach (plecak p in descendingkanps) // every knapsack... { double[,] v = new double[n + 1, (int)p.w + 1]; //array stores best option (the value of item) (int c = 0; c <= p.w; c++) //since 0-1 mkp problem initialize whole array

c# - Writing to the end of a file if two things don't match -

counter = 0; string line; bool validcheck = true; // read file , display line line. system.io.streamreader file = new system.io.streamreader(deckfile); while ((line = file.readline()) != null && validcheck == true) { if (line.split(',')[1] == form1.tempusernameout) { validcheck = false; } else { if (file.endofstream) { int linecountdecks = file.readalllines(deckfile).length + 1; // makes variable set amount of lines in deck file + 1. string deckwriting = linecountdecks.tostring() + "," + form1.tempusernameout + ",1,,,,,,,,,,,2,,,,,,,,,,,3,,,,,,,,,,,4,,,,,,,,,,,5,,,,,,,,,,,"; // stores written in deck file in variable. // writes contents of variable "deckwriting" in deck file. streamwr