Posts

Showing posts from April, 2011

finding unique items in an excel list -

i trying count unique number of entries in pivot table. my pivot table displayed such: u v w x y z aa pn# customer offer# date $ qty sum of offer# 123456 00000001 157815 09.06.2015 16,3 25 1 123456 00000001 157815 09.06.2015 31 10 1 123456 00000001 157815 09.06.2015 43,5 5 1 123456 00000001 157815 09.06.2015 65,3 1 1 123456 00000002 156682 31.03.2015 10 140 1 123456 00000003 157505 19.05.2015 20 25 1 123456 00000004 156925 13.04.2015 10,04 1000 1 123456 00000004 157459 18.05.2015 9,44 1000 1 123456 00000005 158036 23.06.2015 16,3 25 1 123456 00000006 157064 20.04.2015 10,8 100 1 123456 00000006 157064 20.04.2015 12,5 50 1 123456 00000007 156616 26.03.2015 9,5 700 1 123456 00000007 157264 29.04.2015 9,3 450 1 this list of order offers make customers. want analyse see how of...

cs50 pset4 recover.c need advice -

i use guidance on pset cs50. below code have far. stuck @ point have no idea how proceed. when run program output 16 jpg files cannot view them must wrong. tips welcome. #include <stdio.h> #include <stdlib.h> int main(void) { // create buffer store in unsigned char buffer[512]; // array filename 8 "000.jpg" char jpgname[8]; // declaring counter amount of jpegs int jpgcounter = 0; // open memory card file file* inptr = fopen("card.raw", "r"); file* outptr = null; if (inptr == null) { printf("could not open %s.\n", "card.raw"); return 1; } // repeat until end of card while(fread(buffer, sizeof(buffer), 1, inptr) == 1) { // find beginning of jpg if(buffer[0] == 0xff && buffer[1] == 0xd8 && buffer[2] == 0xff && (buffer[3] == 0xe0 || buffer[3] == 0xe1)) { // if allready outptr fi...

vb.net - Clear and Add items to a DataGridViewComboBox but only for the selected row, not the entire column -

there couple of posts on datagridviewcombobox don't cover specific case. have dgv in shoe billing form, , first 3 columns comboboxes. first, model; second, color; third, number. since want people sell what's in stock, in cellvaluechanged ; depending on columnindex clear next combo , insert corresponding items. quick example, have "nike pegassus" in first combo, select "green" on second one, , select available numbers model , color , insert third column, after cleared items in there, in case there color selected. here's part of code if e.rowindex >= 0 if e.columnindex = 0 dim objcolumna datagridviewcomboboxcolumn = dtgdetalle.columns(1) dim colitems new collection dim dattabla datatable dim objcolor new clscolor(objobjeto.sesion) dattabla = objcolor.buscartodos("codcolor in (select distinct stock.codcolor stock inner join color on stock.codcolor = color.codcolor stock.cantidad > 0 , stock.cod...

How to return relationship type with Neo4J's Cypher queries? -

i trying relationship type of simple cypher query, following match (n)-[r]-(m) return n, r, m; unfortunately return empty object r . troublesome since can't distinguish between different types of relationships. can monkey patch adding property [r:knows {type:'knows'}] wondering if there isn't direct way relationship type. i followed official neo4j tutorial (as described below), demonstrating problem. graph setup : create (_0 {`age`:55, `happy`:"yes!", `name`:"a"}) create (_1 {`name`:"b"}) create _0-[:`knows`]->_1 create _0-[:`blocks`]->_1 query : match p=(a { name: "a" })-[r]->(b) return * json response body : { "results": [ { "columns": [ "a", "b", "p", "r" ], "data": [ { "row...

JavaScript window resize event -

how can hook browser window resize event? there's a jquery way of listening resize events prefer not bring project 1 requirement. jquery wrapping standard resize dom event, eg. window.onresize = function(event) { ... }; jquery may work ensure resize event gets fired consistently in browsers, i'm not sure if of browsers differ, i'd encourage test in firefox, safari, , ie.

ios - Realm query 'where before date' -

i've discovered realm , started working in objective-c . i'm trying objects where create_date before specific date , time i read this answer on stackoverflow , tried : nsstring *datestring = @"2015-06-03 08:24:00"; nsdateformatter * dateformatter = [nsdateformatter new]; [dateformatter setdateformat:@"yyyy-mm-dd hh:mm:ss"]; nsdate *newdate = [dateformatter datefromstring:datestring]; rlmrealm *realm = [rlmrealm defaultrealm]; nsstring *_where = [nsstring stringwithformat:@"create_date < '%@'", newdate]; rlmresults *results = [database_articles objectsinrealm:realm where:_where]; but i'm getting following error: 'expected object of type date property 'created' on object of type 'database_articles', received: 2015-06-03 05:24:00 +0000' so how can pass nsdate in query in realm ?? thanks in advance .. you used method + (rlmresults *)objectsinrealm:(rlmrealm *) where:(nsstring...

Using MySQL "NOT IN" but allowing for substrings -

i trying query rows not in set of rows. however, other set of rows may contain strings include strings first table. i'm confusing myself trying explain i'll use following example tables: mysql> describe tablea; +------------+----------+------+-----+---------+-------+ | field | type | null | key | default | | +------------+----------+------+-----+---------+-------+ | name | char(40) | no | pri | | | +------------+----------+------+-----+---------+-------+ mysql> describe tableb; +------------+----------+------+-----+---------+-------+ | field | type | null | key | default | | +------------+----------+------+-----+---------+-------+ | nametag | char(40) | no | pri | | | +------------+----------+------+-----+---------+-------+ mysql> select name tablea; +------------+ | name | +------------+ | cat | | dog | | cow | +------------+ mysql> select nametag tableb; +----------...

android - How to detect if SearchView is expanded? -

i have menu items like: <item android:id="@+id/action_search" android:title="search" app:actionviewclass="android.support.v7.widget.searchview" app:showasaction="always"/> @override public boolean oncreateoptionsmenu( menu menu ) { getmenuinflater().inflate( r.menu.passenger, menu ); searchitem = menu.finditem( r.id.action_search ); searchview = (searchview)menuitemcompat.getactionview( searchitem ); searchview.setsubmitbuttonenabled( false ); return super.oncreateoptionsmenu( menu ); } i want check if searchview expanded. i tried searchitem.isactionviewexpanded() , searchview.ishovered() none of them worked. what missing? tia try searchitem.isiconified() returns current iconified state of searchview. returns true if searchview iconified, false if search field visible. http://developer.android.com/reference/android/widget/searchview.html#isiconified%28%29

Magento Tier Price on Category view is different from Product view -

we have store 2 different currencies: euro (multiple sites) & pound sterling (only 1 website). have trouble displaying correct tier prices on category page of uk store. we have setup tier prices follows: all sites | [eur] | 3 , higer | 7.50 all sites | [eur] | 5 , higer | 7.25 all sites | [eur] | 10 , higer | 7.00 all sites | [eur] | 18 , higer | 6.75 uk site | [gbp] | 3 , higer | 7.50 uk site | [gbp] | 5 , higer | 7.25 uk site | [gbp] | 10 , higer | 7.00 uk site | [gbp] | 18 , higer | 6.75 the problem reason magento shows wrong tier prices on category view uk. on product page tier prices uk correct. for example: 6.75, shown on category view low as: 4.82. on product page it's 6.75 again (the correct price). my guess magento captures [eur] prices, recalculates them [gbp] , shows these prices in category view uk store. how can fix without having set tier prices each individual store view [eur], , have magento use [gbp] prices uk store. try clean ...

dart - Template data binding -

Image
i'm trying create custom element data binding. here custom element template: <link rel="import" href="packages/paper_elements/paper_shadow.html"> <link rel="import" href="packages/polymer/polymer.html"> <polymer-element name="tweet-element"> <template> <link rel="stylesheet" href="tweet_element.css"> <paper-shadow z="1"> <div id="header" horizontal layout> <div id="user-image"> <img _src="{{profileimage}}"> </div> <div id="user-details" flex> <div horizontal layout> <div id="name">{{name}}</div> <div id="screen-name">(@{{screenname}})</div> </div> <div id="date-published">{{date}}</div> </div> ...

c# - Take the first five elements and the last five elements from an array by one query using LINQ -

i have been asked co-worker: possible take first 5 elements , last 5 elements 1 query array? int[] somearray = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 }; what i've tried: int[] somearray = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 }; var firstfiveresults = somearray.take(5); var lastfiveresults = somearray.skip(somearray.count() - 5).take(5); var result = firstfiveresults; result = result.concat(lastfiveresults); is possible take first 5 elements , last 5 elements 1 query? you can use .where method lambda accepts element index second parameter: int[] somearray = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18 }; int[] newarray = somearray.where((e, i) => < 5 || > somearray.length - 6).toarray(); foreach (var item in newarray) console.writeline(item); output: 0, 1, 2, 3, 4, 14, 15, 16, 17, 18

python - How can I remove the extra spaces between my output? -

here first code printed output in order: import csv import random import os.path def filename (): filename = 'filename.txt' open ("filename.txt", "r") data_file: line in data_file.readlines(): line = line.strip().split() print (line [0], line [1], line[2]) this output: 1 63075384 0.781952678 1 212549126 0.050216027 2 35003118 0.027205438 2 230357107 0.065453827 3 77023025 0.098224352 3 225622058 0.785312636 i wanted randomize output. here second code did that: import random open('filename.txt') fin: lines = list(fin) random.shuffle(lines) line in lines: print (line) here output. adds blank space between each line: 2 35003118 0.027205438 3 77023025 0.098224352 2 230357107 0.065453827 1 212549126 0.050216027 3 225622058 0.785312636 1 63075384 0.781952678 my desired output is: 2 35003118 0.027205438 3 7702...

c - Find Sequences of any range -

given array of numbers, print each , every range available. example array : 9, 3, 5, 7, 4, 8, 1 output: 1, 3-5, 7-9 note: please execute problem without using additional array. how proceed? * #include<stdio.h> int main() { int a[]={9,8,8,7,6,5,14}; int n= sizeof(a) / sizeof(a[0]); int i,j; int temp; for(i=0;i<n;i++) { for(j=i+1;j<n;j++) { if(a[i]>a[j]) { temp=a[i]; a[i]=a[j]; a[j]=temp; } } } } * 1st sort in ascending order, don't know next? p.s : coding in c. the next step identify sequences. try following loop (not debugged): first= next= a[0]; (i=1; i<n; i++) { if (a[i] > next+1) { if (next>first) printf("%d-%d,", first, next); else printf("%d,", first); first= next= a[i]...

javascript - Is it possible to import an image into canvas from a different domain that does not support CORS -

i want import picture different domain not support cors. picture supposed go canvas can change colors. is possible? thanks in advance no. if use proxy or such. otherwise violate same-origin policy.

php - Image is loading but not showing -

Image
i have weird problem , can't seem able find fix. when load post on site, it's supposed show main image, , other uploaded images below it. main image loads/shows fine, other images related post load don't show on page. the container images loads too, can see there's empty space images should have loaded. if "inspect element" can see image exists, , hovering on line marks container. can see image has loaded (200). if make live css changes via "inspect element", images pop , shows fine. i have feeling it's css issue, nothing i've tried seems work. appreciated. php: <?php $arr = auctiontheme_get_post_images(get_the_id(), 4); if($arr) { echo '<ul class="image-gallery">'; foreach($arr $image) { echo '<li><a href="'.auctiontheme_wp_get_attachment_image($image, array(900, 700)).'" rel="image_gal1">'.wp_get_a...

php - elseif echo issue, prints wrong value -

i have problem cant figure out. point of view, should work... database setup 3 different priority values. 0,1,2 0=low, 1= medium, 2=high. following code should able print correct information using if , elseif, reason prints rows "high" priority, in database has 0 or 1. $pri = $row["prioritet"]; if($pri = 2) { $pri = "<span class='badge badge-danger'>high</span>"; } elseif($pri = 1) { $pri = "<span class='badge badge-warning'>medium</span>"; } elseif($pri = 0) { $pri = "<span class='badge badge-success'>low</span>"; } the if , elseifs need use comparison operators ('==' or '===', etc). using '=', inadvertently trying assign value 2 $pri, example.

how to update specific cell in data grid view using SQL and VB.net -

i trying update specific cell in datagridview using vb.net , sql ( or other method) using code split somme strings , save database. private sub salveazadata() dim list string() = rtbcomdata.text.split(environment.newline.tochararray()) smddatadataset1.searchadrese.rows.clear() smdtabletableadapter.clearsearchadrese() me.searchadresetableadapter.update(me.smddatadataset1.searchadrese) each row string in list if not (row = "at+dscan" or row = "ok" or row = "" or row = "at+rssi") dim s string() = split(row, "|") dim arow smddatadataset1.smdtablerow = smddatadataset1.smdtable.newsmdtablerow() arow.model = s(0) arow.adresaunica = s(1) arow.statusmodul = "active" try smddatadataset1.searchadrese.rows.add(s(1)) smddatadataset1.smdtable.rows.add(arow) catch ex exception ...

java - Why not access update DB in jax-rs web service -

i create jax-rs web service using following technology. can't update db technology used java 1.8 eclipse luna ide resteasy-3.0.8.final spring-framework-3.2.11.release hibernate-4.2.15.final apache maven 3.2.1 apache tomcat 8.0.23 mysql-connector-java-5.1.32 this spring-hibernate-resteasy.xml <?xml version="1.0" encoding="utf-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemalocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/...

java - Can't set values in second activity -

so i'm making simple application takes information user i.e name, address etc , puts in the textviews in next activity when put in values , move next activity there's nothing displayed in textviews. here's first activity public class mainactivity extends activity { public string name; public string age; public string address; public string city; public string phoneno; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); edittext name = (edittext) findviewbyid(r.id.edittext1); name = name.gettext().tostring(); edittext amge = (edittext) findviewbyid(r.id.agee); age = amge.gettext().tostring(); edittext address2 = (edittext) findviewbyid(r.id.address); address = address2.gettext().tostring(); edittext city2 = (edittext) findviewbyid(r.id.city); city = city2.gettext().tostring(); edittext phone2 = (edittext) findviewbyid(r.id.phone); phoneno = phone2.gettext().tostr...

c# - Regex expression for string matching -

i need match string "*b*[xxx]" . example "mb0[23]" or "db50.dbb152[128]" . @ moment, it's complicated me. please help. if right example, format has contain capital b , brackets numbers in it. try use 1 of these: this strings contain "b" , brackets after (with optional contents): char c = convert.tochar(65535); string format = @"/(?:[\0-" + c + @"]+)?b(?:[\0-" + c + @"]+)?\[(?:[\0-" + c + @"]+)?\]/"; this strings contain "b" , brackets after numbers or nothing in it: char c = convert.tochar(65535); string format = @"/(?:[\0-" + c + @"]+)?b(?:[\0-" + c + @"]+)?\[(?:\d+)?\]/"; this strings contain "b" , brackets after numbers in it: char c = convert.tochar(65535); string format = @"/(?:[\0-" + c + @"]+)?b(?:[\0-" + c + @"]+)?\[(?:\d+)\]/"; this should match both examples provided. can check , learn...

css - Something like an If statement -

in css, want like: :root{ underline-all-h1-tags:true } /* it's not h1 tags, it's h1-tags-with-a-bunch-of-other-things". kiss reasons, we'll assume it's of them.*/ /* ... lots , lots of other stuff...*/ h1{ if(underline-all-h1-tags == true){ text-decoration: underline } else { text-decoration:none } } is there way this? know :root{h1-underline:underline} h1{text-decoration:var(h1-underline)} but trying make code readable me-in-10-years-when-i-have-totally-forgotten-how-to-css. why not make use of cascading part of cascading style sheet? h1{ text-decoration:none; } .underline h1{ text-decoration:underline; } applying class "underline" parent element same thing looks you're trying describe above. you add or remove underline class js, or set statically on elements want affected.

Gulp - SCSS Lint - Don't compile SCSS if linting fails -

just wondering if can me gulp setup. @ moment using gulp-sass , gulp-scss-lint watch task. want happen when scss file saved linting task run , if errors or warnings thrown scss files not compile , watch continue running. at moment seem have working errors not warnings, still compile stylesheets. /// <binding projectopened='serve' /> // macmillan volunteering village gulp file. // used automate minification // of stylesheets , javascript files. run using either // 'gulp', 'gulp watch' or 'gulp serve' command line terminal. // // contents // -------- // 1. includes , requirements // 2. sass automation // 3. live serve // 4. watch tasks // 5. build task 'use strict'; // // 1. includes , requirements // ---------------------------- // set plugin requirements // gulp function correctly. var gulp = require('gulp'), notify = require("gulp-notify"), sass = require('gulp-sass'), scss...

x86 64 - x86_64 assembly %rsp vs %esp -

i have been playing assembly recently, , came across strange bug in program. have found if modify %rsp doing 64-bit math, works fine, if modify %esp same amount, except 32-bit math, segmentation fault. tried printing out both %esp , %rsp , , same every time run. question: why matter whether 64-bit math or 32-bit math when whole register using 32 bits? .cstring _format: .asciz "%d\n" .text .globl _main _main: # program setup pushq %rbp movq %rsp, %rbp # program - 16 byte aligned @ point # print stack pointer memory movq %rsp, %rax call bob # prints same value next call bob xorq %rax, %rax movl %esp, %eax call bob # prints same value previous call bob # code breaks subl $16, %esp # bug here if use (32 bit math) subq $16, %rsp # works fine if use (64 bit math) call bob addq $16, %rsp # program cleanup movq %rbp, %rsp popq ...

c++ - How to know if initscr() of ncurses has been called earlier? -

more of curiosity @ moment, there way know if initscr() of <ncurses.h> has been called before? believe calling initscr() twice bad idea. you have bool variable that's initialized false , set true after calling initscr() (and performing other initializing). downside have remember check bool variable, , set after calling initscr(). there's straightforward example in link: http://math.hws.edu/orr/s04/cpsc225/curses.html note: jonathon leffler points out in comments, link isn't great example overall, i'm pointing snippet of code initializes give example. i'm not familiar library, looks declare window* , set null, , check see if it's null later see if it's been called. documentation found googling says on failure function doesn't return wouldn't have null pointer if it's run. that's in essence same using bool, maybe little less cluttered (and checking pointers see if they're null common c idiom). a c++ way create ...

php - mysql_fetch_array()/mysql_fetch_assoc()/mysql_fetch_row() expects parameter 1 to be resource -

i trying select data mysql table, 1 of following error messages: mysql_fetch_array() expects parameter 1 resource, boolean given or mysqli_fetch_array() expects parameter 1 mysqli_result, boolean given or call member function fetch_array() on boolean / non-object this code: $username = $_post['username']; $password = $_post['password']; $result = mysql_query('select * users username $username'); while($row = mysql_fetch_array($result)) { echo $row['firstname']; } the same applies code $result = mysqli_query($mysqli, 'slect ...'); // mysqli_fetch_array() expects parameter 1 mysqli_result, boolean given while( $row=mysqli_fetch_array($result) ) { ... and $result = $mysqli->query($mysqli, 'selct ...'); // call member function fetch_assoc() on non-object while( $row=$result->fetch_assoc($result) ) { ... and $result = $pdo->query('slect ...', pdo::fetch_assoc); // invalid...

javascript - Building a gulp proj with sub-projects - how can I use globs &/or require-all to run tasks on multiple sub-projects? -

i'm building project using gulp-chug run tasks using gulpfiles in multiple sub-projects. works great slow , feel using globs or more efficient. my example proj this: gulpfile.js src/ 160x600/ 300x600/ 300x250/ 768x90/ all of sub-directories in "src/" dir mini-websites .js, .css, .html files, etc. , identical in folder structure. create gulp tasks in main gulpfile.js run identical tasks on each sub-project. instance, generating spritemap each project dependent on images located in each of "images/" directory. currently, in each sub-projects' gulpfile.js have code runs fine: var spritedata = gulp.src(process.cwd()+'/assets/images/*').pipe(spritesmith({}) //the "src" output is: src/160x600/assets/images... the above works great using gulp-chug. if try , remove gulp-chug , bring code main gulp file using globs seems freeze in console or err: var spritedata = gulp.src('./src/**/assets/images/*').pipe(sprites...

php - Object exist BUT trying to get property on a non object -

im working on project on laravel5 php 5.5.12 , mysql 5.6.17 yesterday working fine, when come code today, have error "trying property of non-object" on multiple models objects, case occurs when have relationships other models. if write : $test = $model->relation->property; i error. if write : echo / var_dump($model->relation->property); then printed no problem. i don't know happen , appreciated. ps: sorry if im wrong text wrote, first time ask question on stackoverflow :) oh , did read similar questions this stay.php model : namespace app\models; use illuminate\database\eloquent\model; class stay extends custommodel { protected $table = 'stay'; protected $fillable = array('reservation_terms_convention_id', 'reservation_id', 'period_id', 'total_price', 'price_ht', 'occupant_id', 'prestation_fixe_id', 'pax', 'checkin', 'checkout'); protected $guar...

android - mpandroid chart certain methods unable to resolve -

so i'm using awesome mpandroid chart library make simple linechart. able customize heavily using example project on github. the problem is, when move own code, methods no longer able resolved: mlinechart.setextraoffsets() , mlinechart.setautoscaleminmaxenabled() in particular. there might others these 2 i've noticed. everything else works fine though. idea why can't access these 2 methods? should dig find out more why case? public class myfragment extends fragment { private linechart mlinechart; // stuff here @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { // stuff here // creating numbers line chart candidate linechart numchart = (linechart)view.findviewbyid(r.id.numberslinechart); setnumchart(numchart, mobject.getnums()); // stuff here } public void setnumchart(linechart linechart, list<integer> nums){ mlinechart = linechart; mlin...

javascript - How to send form data along with jQuery DataTables data in server-side processing mode -

i trying post form data without success , data couldn't loaded. how can pass form data array , single textbox, combobox, etc. fnserverdata ? table_obj = $('#group-table').datatable({ "sajaxsource": "url goes here", fnserverdata: function(ssource, aodata, fncallback,osettings) { osettings.jqxhr = $.ajax( { "datatype": 'json', "type": "post", "url": ssource+'?'+$.param(aodata), "data": $("#frm").serializearray(), "success": fncallback } ); }, aasorting: [[ 1, "desc" ]], bprocessing: true, bserverside: true, processing : true, columndefs: [{ 'targets': 0, 'searchable':false, 'orderable':false, 'classname': 'dt-body-center', 'render': function (data, type, full, meta){ return ...

Allow a DynamoDB User to modify a subset of documents -

how can create policy in dynamodb, allows corresponding iam users modify subset of documents in table? for example, let's there attribute published , , want iam user perform putitem , updateitem on documents have published: false . you can use dynamodb fine-grained access control on hash key value. save item "draft" pre-pended hash-key value , use following policy: { "version": "2012-10-17", "statement": [ { "effect": "allow", "action": [ "dynamodb:updateitem", ], "resource": [ "arn:aws:dynamodb:region:account_number:table/table_name" ], "condition": { "forallvalues:stringlike": { "dynamodb:leadingkeys": ["draft*"], } } } ] } adapte...

c# - Entity Framework 7 Beta5 - DbUpdateException resolution -

i having issues using entity framework simple crud operations. believe configured correctly, when call savechanges after adding entity dbset, dbupdateexception thrown. i'm not quite sure code provide, i'm going include exception detail , logic involved. exception detail: microsoft.data.entity.update.dbupdateexception occurred hresult=-2146233088 message=an error occurred while updating entries. see inner exception details. source=entityframework.relational stacktrace: @ microsoft.data.entity.relational.update.readermodificationcommandbatch.execute(relationaltransaction transaction, irelationaltypemapper typemapper, dbcontext context, ilogger logger) @ microsoft.data.entity.relational.update.batchexecutor.execute(ienumerable`1 commandbatches, irelationalconnection connection) @ microsoft.data.entity.relational.relationaldatastore.savechanges(ireadonlylist`1 entries) @ microsoft.data.entity.changetracking.internal.statemanager.savecha...

Winform Set readonly for tablelayoutpanel C# -

i have tablelayoutpanel contains many controls. wanna lock tablelayoutpanel can copy data in fields. tablelayoutpanel has enabled property --> cannot copy data in them. please me lock tablelayoutpanel , can copy in these fields. there's nothing in tablelayoutpanel allows functionality. instead, loop through controls, @ type, , set property need: foreach (var control in tablelayoutpanel1.controls.cast<control>()) { var tb = control textboxbase; if (tb != null) tb.readonly = true; // controls textbox , richtextbox else control.enabled = false; // other controls }

grails - How to use ant.resourcelist in groovy-script/gradle -

i have task - remove files list, stored in file. want use groovy script. in ant have no problem using following target: <delete failonerror="false" verbose="true"> <resourcelist > <file file="/path/to/file"/> </resourcelist> </delete> but in groovy script causing error: ant.delete( failonerror: "false", verbose: "true", ant.resourcelist( ant.file( file: "/path/to/file" ) ) ) error: the <resourcelist> type doesn't support nested text data ("/path/to/file"). how configure groovy skipt remove files list located in file? in advance. you're using wrong syntax, has (here using groovy task) : <project> <taskdef name="groovy" classname="org.codehaus.groovy.ant.groovy"/> <groovy> ant.delete(failonerror: f...

javascript - Polymer 1.0 can't access elements within nested <template> element -

i using polymer 1.0 , building small accordion example. have data binding accordion text fine, want change icon of accordion when click it. below code <dom-module id="ab-accordion"> <template> <iron-ajax auto handle-as="json" on-response="handleresponse" debounce-duration="300" id="ajaxreq"></iron-ajax> <template is="dom-repeat" id="accordion" items="{{items}}" as="item"> <div class="accordion" on-click="toggleparentacc"> <div id="accordion_header" class="accordion__header is-collapsed"> <i class="icon icon--chevron-down"></i> <span>{{item.name}}</span> </div> <div id="standard_accordion_body" class="accordion__body can-collapse"> ...

laravel 4 - How to add .blade.php extension in netbeans ide? -

some previous posts have solutions did not work. not want text editors sublime. there any plugins? i created bug report this. update post when fixed. current answer : can't https://netbeans.org/bugzilla/show_bug.cgi?id=255675

how to maintain table orignal order after using dense_rank() in sql server -

i have table :- id | name | address | code -----+---------+----- 1 | b | b-11 | 111 2 | b | b-11 | 123 3 | | a-11 | 456 4 | | a-11 | 789 i need output : - id | name | address | code | addressid -----+---------+------+---------- 1 | b | b-11 | 111 | 1 2 | b | b-11 | 123 | 1 3 | | a-11 | 456 | 2 4 | | a-11 | 789 | 2 when use following sql statement desired format order of table gets changed. can tell me how addressid column values without changing table order. select id, name, address, code, dense_rank() on (order name,address) addressid table1 with above code wrong output - id| name | address | code | addressid --+------+---------+------+---------- 3 | | a-11 | 456 | 1 4 | | a-11 | 789 | 1 1 | b | b-11 | 111 | 2 2 | b | b-11 | 123 | 2 as said - don't have order, unless explicitly specify it - that's need - specify ordering want have adding or...

javascript - How to increase limit of local storage into mozilla firefox? -

i want increase local storage size javascript code mozilla firefox browser. possible change javascript code ? ofcourse no. or want increase user take whole pc storage , crash it? :)

php - file_get_contents - Special characters in URL - Special case -

i'm not getting file_get_contents() return page in particular case url contains 'Ö' character. $url = "https://se.timeedit.net/web/liu/db1/schema/s/s.html?tab=3&object=cm_949a11_1534_1603_dag_dst_50_Övrigt_1_1&type=subgroup&startdate=20150101&enddate=20300501" print file_get_contents($url); how make file_get_contents() work expected on url? i have tried following solutions whithout working result: 1. print rawurlencode(utf8_encode($url)); 2. print mb_convert_encoding($url, 'html-entities', "utf-8"); 3. $url = urlencode($url); print file_get_contents($url); 4. $content = file_get_contents($url); print mb_convert_encoding($content, 'utf-8', mb_detect_encoding($content, 'utf-8, iso-8859-1', true)); found in these questions: file_get_contents - special characters in url php url special characters without urlencode:ing them! file_get_contents() breaks utf-8 characters update: can see ...

hazelcast - Monitoring ReplicatedMap on Management center? -

there tabs map , list , queue , executors etc in left navigation pane of management center. but, don't see tab replicatedmap . there way can query it? we're working on adding relpicatedmap view management center (no eta @ point though). meanwhile, can use scripts view query replicated map using javascript or groovy.

How to deal with multiple include in different php file? -

i want send message on whatsapp php file. i've discovered library let , works in way: <?php include_once './src/whatsprot.class.php'; function send($target,$message){ $username = "phone"; $password = "password"; $w = new whatsprot($username,"nickname", true); //name application replacing “whatsapp messaging” $w->connect(); $w->loginwithpassword($password); $w->sendpresencesubscription($target); //let first send presence user $w->sendmessage($target,$message ); // send message } send("phone","text of message"); ?> if try execute or launch via php web server works. if try call method send($target,$message); php file, this, doesn't work: <?php include "whatsapp.php"; send($target, $message); ?> what's problem? how can fix it? if try call method send($target,$message); php file, doesn't work what's problem? most php file located in differe...

python - Number 1 to Z input using def operator -

i'm having trouble question, , don't know start: write function prints characters using following header: def printchars(ch1, ch2, numberperline): this function prints characters between ch1 , ch2 specified numbers per line. write test program prints ten characters per line 1 z. i have far: import string import random ch1 = 1 ch2 = str('chr(90)') char_line = 10 numberoflines = 36 def printchars(ch1,ch2,char_line): in range(numberoflines): = 0 while in range(numberoflines): += 0 print(string.digits) print(string.ascii_uppercase) if <= char_line: print('\n') elif >=36: return printchars(ch1,ch2,char_line) and when inputted, repetition of 0123456789 abcdefghijklmnopqrstuvwxyz when should getting 1234567890 abcdefghij klmnopqrst uvwxyz p.s. i'm newcomer stackoverflow, , i'm still learning system i think you're on complicating things - need iterate c...

bitmap - Android decodeBitmap with size depend on density -

i trying decode bitmap using injustdecodebounds. outwidth , outheight width dimensions of original image. example if image in xxhdpi folder , phone xhdpi density , image 500 x 500px outwidth = 500, should smaller, since run on xhdpi ( don't have folder xhdpi drawables). there way while decoding use screen density. in advance. here way load scaled down version of bitmap : http://developer.android.com/training/displaying-bitmaps/load-bitmap.html#load-bitmap you can calculate reqwidth , reqheight values found here : http://developer.android.com/reference/android/util/displaymetrics.html like : int currentwidth = 500; displaymetrics metrics = new displaymetrics(); getwindowmanager().getdefaultdisplay().getmetrics(metrics); reqwidth = currentwidth * (metrics.densitydpi/(float)displaymetrics.density_xxhigh );

excel - Clear copy of current file from data -

there workflow fill in sheet , mail when you're done. method mail send current sheet attachment, should directly create new copy of sheet data removed from. i can clear current sheet, that's wrong, need clear new sheet. have read running macros on other workbooks, fails run macro. what's best solution? sub senddata_click() if msgbox("sure send?", vbyesno, "confirm") = vbyes ' save current sheet activeworkbook.save ' send current file mail_activesheet ' mark sheet sent worksheets("data").range("b6").value = true ' create new emptied version create_new_copy msgbox "your data sent" end if end sub sub create_new_copy() dim wb workbook dim newfilename string dim fileextstr string dim filepath string set wb = activeworkbook newfilename = "filenamehere " & format(dateadd("d",...

javascript - How to parse through Twitch webpage and get list of online streamers -

i know has been done many times before new coding scene (relatively new) , love fiddle around things. i've never managed make functional, in useful me. i'm trying make chrome extension shows list of online counter strike streamers streaming. have no idea how go this. there way through jquery go through this page , take first ~10 usernames find? i know how make extension , html , stuff. looking functionality. have list @ moment on html page. there's nothing in list want fill online streamers. solely doing "fun" project practice in. not looking full answers point me in right direction :d. completely lost on how this. regular expressions work? a mediocre way go twitch page, elements repeat each streamer , grabbing inner html, is, information on who's streaming. the proper way go through twitch's dev api , find information using dedicated web services , information hooks. consider way twitch people invested in website providing them easy ...

c++ - Syntax for converting expired weak_ptr<T> to shared_ptr<T> -

from i've read, shared_ptr<t> not de-allocated until both strong references , weak references dropped. i understand shared object considered expired when there no more strong references it. standard lock() function of weak_ptr<t> therefore fails in such case because object considered 'expired'. however, if deleter of shared pointer overridden such managed object not deleted, should valid generated shared_ptr<t> weak_ptr<t> - cannot find right syntax this. std::shared_ptr<int> s_ptr(new(42), d()); std::weak_ptr<int) w_ptr(s_ptr); s_ptr.reset(); s_ptr = std::shared_ptr<int>(w_ptr, false); edit to clarify bit further, i'm trying construct object pool of re-usable shared_ptr<t> . reason behind because every use of shared_ptr results in 1 or more heap memory allocations. i've added deleter every shared_ptr<t> stores weak_ptr<t> reference such deleter gets called should able re-add pool of avail...

unix - what is a library exerciser program? -

i reading "the art of unix programming" book , found quote saying : in unix world, libraries delivered libraries should come exerciser programs. so library exerciser? a library exerciser program, or collection of programs, testing library (by calling some, or most, , ideally public functions or methods of library). read unit testing . btw, advice make library exercisers imho not specific unix world (it should hold gnu hurd, posix, vms , windows systems), useful software library . guess related modules , names in linkers . in exotic, interesting, programming environments (think of lisp or smalltalk machines, or persistent academic oses grasshopper ) notion of library not exist, or far linux-like libraries (written in c or c++) exercisers might not mean same thing... .... notice languages (ocaml, go, d, ... not c11 or c++14) might know notion of modules , have module-aware notion of libraries