Posts

Showing posts from February, 2015

vscode - Is there a way to see a preview of a webpage? -

i wondering if there way see preview of webpage page working on in web browser directly visual studio code editor, instead of having click file make open default web browser. you can open visual studio code project in browser window configuring gulp task node module gulp-open. can run gulp task inside visual studio code. here's how might configure gulp task: var open = require('gulp-open'); gulp.task('browser', function(){ // define source match file wish open: gulp.src('./www/index.html') // designate browser wish file opened in: .pipe(open('<%file.path%>', {app: 'google-chrome'})); }); }); since we've named our task "browser", inside visual studio code can hit command/control p bring command pallet , type task. start type browser. should see code complete full task type. hit return , open file in browser designate. once browser open, can resize , visual studio code side side. work can ref

ruby - Split string and append to array -

i split string , append split result 2 separate arrays simultaneously. there way this? example: mystrings = ['abc:def', 'ghi:jkl', 'mno:pqr'] first = [] second = [] mystrings.each |string| first, second << string.split(':') end this doesn't work. didn't know if there syntactical ruby way perform split , appending simultaneously. mystrings = ['abc:def', 'ghi:jkl', 'mno:pqr'] first, second = mystrings.map{|str| str.split(":")}.transpose

javascript - How to emulate Ajax request using PHP CURL? -

i getting 400 http_code error when send ajax request curl below code. $header = array( "accept : application/json, text/javascript, */*; q=0.01", "accept-encoding : gzip, deflate", "accept-language : en-us,en;q=0.5", "content-type : application/json; charset=utf-8", "host : https://some.com", "referer : https://some.com/dashboard/reports", "x-requested-with : xmlhttprequest" ); $c = curl_init('https://domain.com/report.php'); //curl_setopt($c, curlopt_ssl_verifypeer, false); //curl_setopt($c, curlopt_verbose, true); curl_setopt($c, curlopt_useragent, $_server['http_user_agent']); curl_setopt($c, curlopt_returntransfer, 1); curl_setopt( $c, curlopt_post, true ); curl_setopt( $c, curlopt_postfields, $data_url ); curl_setopt($c, curlopt_httpheader, $header); //curl_setopt($ch, curlopt_httpheader, array("x-requested-

php - Using .htaccess to remove folder from URL -

i have laravel app, , document root of host configured @ laravel root folder (upper directory of public). i tried following .htaccess silently rewrite urls, keeps redirecting me /public, instead of showing domain url , rewriting /public rewriteengine on rewriterule ^(.*)?$ /public$1 [l,nc] i want visit example.com , see laravel app, not redirecting user example.com/public . this definitely : removing /public segment in laravel 4 app http://creolab.hr/2013/03/removing-the-public-segment-in-a-laravel-4-app/

SSRS: Cannot read the next data row for the dataset hexadecimal value 0x02, is an invalid character -

can please me following error on 1 value of parameter in ssrs report , works rest:ssrs: cannot read next data row dataset. hexadecimal value 0x02, invalid character . the ssrs report works ssas cubes. parameter fails on list of insurer names of varchar value , cannot spot ascii characters in actual data. said works rest of insurers ...i cannot seem find solution anywhere. looks there invalid character in data. i didn't test solution 1 suggestion solve issue change invalidxmlcharacters property in data source in database. should possible select remove or replace . please see more details here .

css3 - How to override css attribute-only style -

i have page need modify behavior. element i'm working on has [attribute] directive, this: <div class="someclass" myattributedirective></div> the myattributedirective has it's own css page defines styling, this: [myattributedirective] { /* few different properties */ border: 1px solid red; position: relative; } /* more class stylings related directive */ so see, in css, it's defining styles attribute, if attribute exists in element, apply stylings. when view element in dev tools, doesn't quite right. in order "fix" it, un-check 1 of css properties causing issue, position: relative; . but i can't change "core" css directive, because it's used throughout application. and, if try override property, doesn't work (actually, cycling through different position: * options leads making things worse). so, how override specific property, without changing core css file? if want override style in cas

php - How to multiply session values -

i trying create menu booking. if select meal set 1 , price $100, meal set 2, price $200 , selected value multiple amount of tables request below code price showing $0 in total. if($_post['radiogroup1'] == 'meal set 1') { $menuprice = '100'; } else if ($_post['radiogroup1'] == 'meal set 2'){ $menuprice = '200'; } else if ($_post['radiogroup1'] == 'meal set 3'){ $menuprice = '300'; } //store price of menu in session $_session["pricemenu"] =$menuprice; ?> // display amount <?php $_session['total'] = ($_session["pricemenu"] * $_session['nooftables']); echo $_session['total'] ?><br> put $menuprice = ''; in front if statement make global. can't not take string out of if statement before making global. had problem before , work me. hope y

ruby - How to generate direct access keys to nested hash which contains hash and arrays as values? -

i want compare 2 xml files 1 input , other output. converting both hash. my idea keys input xml converted hash, , search each key in both input , output hashes respective key/value pairs. i have hash: { "requisition_header" => { "requested_by" => {"login" => "coupasupport"}, "department" => {"name" => "marketing"}, "ship_to_address" => {"name" => "address_1431693296"}, "justification" => nil, "attachments" => [], "requisition_lines" => [ { "description" => "cleaning services building a", "line_num" => 1, "need_by_date" => 2010-09-23 07:00:00 utc, "source_part_num" => nil, "supp_aux_part_num" => nil, "unit_price" => #<bigdecimal:a60520c,'0.3e4'

sqlite3 - SQLite how to refer to column name by a query -

what want select (select fields tableb interest=yes) tablea why can not this? workaround? example: got tablea this time|c1|c2|c3 --------------- 0.0 |1 |11|111 1.0 |2 |22|222 2.0 |3 |33|333 tableb this field| interes -------------- c1 |yes c2 |yes c3 |no i want able put command this select (select field tableb interest=yes) tablea time=1.0 that gives me 2|22 heart of issue not let me refer column_names query result. :( i'm guessing little have written want variable list of fields (where list of fields retrieved tableb ) retrieved tablea . this isn't possible directly in sql. need make 2 calls, first 1 retrieve list of fields, , second 1 have generated sql statement exoplicit list of fields first call.

Android/java Parsing JSON with numbered data -

this question has answer here: how parse dynamic json key in nested json result? 3 answers i have been looking parsing json data in java/android. unfortunately, there no json same mine. have json data include weird number, looks : { "formules": [{"1": { "formule": "linear motion", "url": "qp1" },"2": { "formule": "constant acceleration motion", "url": "qp2" },"3": { "formule": "projectile motion", "url": "qp3" } } ] } please me how parse in java/android. thanks try this jsonobject jsonobject = new jsonobject(string); jsonarray jsonarray = jsonobject.getjsonarray("formules"); jsonobject jsonobject1 = jsonarray.getjsonobject(0); now can access object "1" as

php - Composer commands generate error on Windows 8 and Laravel 4 -

i trying run command composer install command line , every time generate following error: loading composer repositories package information installing dependencies (including require-dev) lock file nothing install or update generating autoload files {"error":{"type":"symfony\\component\\debug\\exception\\fatalerrorexception","me ssage":"main(): failed opening required '..\/app\/controllers\/userscontroller.p hp' (include_path='c:\\xampp\\htdocs\\project\\html\\vendor\/phpseclib\/phpsecli b\/phpseclib;.;c:\\xampp\\php\\pear')","file":"c:\\xampp\\htdocs\\project\\html\ \app\\filters.php","line":2}}script php artisan clear-compiled handling post -install-cmd event returned error [runtimeexception] error output: install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-p lugins] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress ] [-v|vv|vv

javascript - jQuery popup doesn't close -

i've tried closing jquery iframe popup can't seem able to. i've seen lot of solutions similar problems, think gravely wrong code. i have code <a id="button" href="#popupvideo" data-rel="popup" data-position-to="window" class="ui-btn ui-corner-all ui-shadow ui-btn-inline">Ε</a> <div data-role="popup" id="popupvideo" data-overlay-theme="b" data-theme="a" data-tolerance="15,15" class="ui-content"> <iframe id="iframeid" src="http://localhost:8080/newfile.php","msgwindow" width="1000" height="600" seamless=""></iframe> </div> and want, provides window iframe file have. however, while closing clicking outside in grayed out area simple, using button close window somehow proving hard do. i want pretend button event similar clicking outside window. want button

sendmessage - Android. Send text to facebook messenger by Facebook SDK 4.X -

as document facebook, can send image android app facebook messenger below. string metadata = "{ \"image\" : \"trees\" }"; sharetomessengerparams sharetomessengerparams = sharetomessengerparams.newbuilder(contenturi, "image/jpeg") .setmetadata(metadata) .build(); // sharing activity messengerutils.sharetomessenger(this, 0, sharetomessengerparams); but want send text. tried below. sharetomessengerparams sharetomessengerparams = sharetomessengerparams.newbuilder(null, "text/plain") .setmetadata("text send") .build(); // sharing activity messengerutils.sharetomessenger(this, 0, sharetomessengerparams); when tested this, java.lang.nullpointerexception: must provide non-null uri exception occurs. how can send message facebook messenger..? using intent not available now, need use facebook sdk 4.x. here facebook documentation facebook (and messenger) do

javascript - How to get POSTed (jquery) array data in Node.js (using express) -

i trying post array server. have difficulties in doing properly. the array trying post, array of objects dynamically structured, don't know it's length. to more precise, array of form. var names =[{id:1, name:"nick"},{id:2,name:"bob"},{id:3,name:"john"}.....{id:n, name:"whatever"}] i posting using jquery: $.post("save_names", { 'names[]': names }, function(results) { alert(results); }); my node code, following: (i use stormpath-express) app.post('/save_names', config.access_group, function(req, res) { console.log("body ", req.body); }); this way getting following console.log body { 'names[]': [ '[object object]', '[object object]', '[object object]' ] } when try print array : console.log("body ", req.body.names); body undefined can explain why happening? how solve error, , why can't post names:names ,

c# - List of String and Value Duplicates -

Image
i have db entity orderitems , class ordercountet have method counting made statistic of popular products in shop based on orderitems. after code below have output this: name quantity chocapic 7 bread 2 chocapic 7 bread 2 cheese 3 i want make list without duplicates. because output says have 14 chocapic in list have 7. trying search how achieve found hashset. distinct list solution list of string or integer. public class statistic { //productname string name {get: set;} //quantity product int quantity {get: set;} //class counting , ordercounter ordercounter{get: set;} } public class ordercounter { private list<statistic> list_statistic =new list<statistic>(); public list<statistic> list_statistic { get{ return list_statistic ;} } public void counting() { foreach(order k in db.orderitems) { int sum=0; statistic temp =new stati

php - Wrong calculation codeigniter pagination -

i have made codeigniter pagination show product in image. wrong on second page, not sustainable or continuously. i set per_page is: 6, total data 11. in page 1 result ok, show image id form 1 - 6,but when click second page start 3 - 8. this model public function record_count() { return $this->db->count_all('mytable'); } public function fetch_jenislogam($limit, $start) { $start--; if($start<0) { $start=0; } $this->db->limit($limit, $start); $query = $this->db->get("tb_jenislogam"); return $query->result_array(); } this view <?php foreach($results $data) { ?> <div class="col-lg-3 text-center"> <a href="<?php echo base_url();?>item/subitem/<?php echo $data->id; ?>"> <!-- direct product subitem --> <img class="img-responsive" src='<?php $img = $data->pics; if ($img) { echo base_url().'uploads/origin/'.$data->pics; } e

php - CURL request & Response redirecting to Page -

i ask opinion or ideas if encountered scenario. 1.) user send curl request http://mycurl_url.com/get_request 2.) get_request function access through rest api. 3.) get_request function validates request redirects them external site www.external_site.com/receive_redirect_response_value for coding here sample client requesting curl: $curl = curl_init('http://mycurl_url.com/get_request'); curl_setopt($curl, curlopt_followlocation, true); curl_setopt($curl, curlopt_customrequest, "post"); ... // rest api key submitted here curl_exec($curl); then on mycurl_url.com/get_request here's code $has_access = has_accessed($_get['key']); if ($has_access) { header('location: www.external_site.com/receive_redirect_response_value?value=this_is_the_value'); } return false; now idea here user curl request , if he's allowed redirected external site "properly". quoted word "properly" since based on experienced it's redire

wso2 - How can I add claim mapping in wso2is via configuration? -

i added in claim-config.xml dont see claim being added in management console. <claimuri>http://wso2.org/claims/serialnumber</claimuri> <displayname>serialnumber</displayname> <attributeid>url</attributeid> <description>serialnumber</description> <displayorder>3</displayorder> <supportedbydefault /> </claim> also dont want add claim mapping management console. want automate process need configuration change. you can use claimmanagementservice admin service of wso2 identity server crud operations on claims. can idea of available methods referring wsdl of claimmanagementservice. please refer this link more information regarding calling admin services of wso2 servers.

javascript - Ember Simple Auth: how to keep data in a step by step process after redirection to login route -

i'm creating app using ember.js. application allows book appointment @ doctor. you have booking process few steps. after step 1 (booking/start), have screen shows if user isn't connected (booking/user). on page, have 2 links: 1 login page, 1 registration page. steps "needs" booking controller. the link login link next step (booking/confirmation), since user isn't logged in, he's automatically redirected login page authenticatedroutemixin. when log in, works fine, i'm connected , redirected booking/confirmation. but, lose data booking controller. it's obvious, since login doesn't have connection booking controller. i believe not pure ember simple auth question, more general ember.js question. have idea how should change login behavior keep data or change logic of app save data before going login page, retrieve on booking/confirmation? my code available here: https://github.com/lionelrudaz/wellnow-frontend let me know if need more i

excel - Formula that finds the last non blank cell which is greater than zero in a range -

Image
i have slight puzzle excel formula , using in conjunction ibm cognos disclosure management disables vba can't use coded work around normally. i need formula finds last non blank cell greater 0 in range (single row) so instance: in example i’d expect col f returned value of 6. this formula works other way round: =index(a1:i1,match(1,index(1-isblank(a1:i1),1,0),0) but can’t figure out how flip goes other side. count value of 0 want ignore. does body have idea how achieve this? thanks the value given by: =lookup(2,1/(1:1>0),1:1) the location (column number) given array formula: =if(counta(1:1)=0,"",max((1:1<>0)*(column(1:1)))) array formulas must entered ctrl + shift + enter rather enter key.

android - How to only update contacts instead adding in sync adapter -

i have few numbers stored in apps database. wanted match numbers in contacts app , update contact mimetype. how whatsapp does. sync contacts , app icon comes in contact. i have done sync part , if add new contact able show app icon in contact . requirement update existing contact. this have tried update contact, arraylist<contentprovideroperation> ops = new arraylist<contentprovideroperation>(); ops.add(contentprovideroperation.newinsert(addcallerissyncadapterparameter(data.content_uri, true)) .withvaluebackreference(data.raw_contact_id,id) .withvalue(data.mimetype, mimetype) .withvalue(data.data1, "username") .withvalue(data.data2, "ite's me") .build()); try { context.getcontentresolver().applybatch(contactscontract.authority, ops); } catch (exception e) { e.printstacktrace(); } and rawcontactid fetching cursor

tomcat7 - Increasing Tomcat server start up time -

i want increase server start timeout in tomcat. increasing connectiontimeout parameter in connector tag in server.xml work? i assume run tomcat under eclipse otherwise wouldn't have start-up timeout issues. go server view double click tomcat instance , increase timeout value in time out section there 45 secs default.

css - Bootstrap navbar not visible in IE8 -

Image
i know question has been asked several times , checked through possible solutions none worked me. here problem: using bootstrap 3.2 , have created navbar working in chrome, firefox , latest ie not in ie8,7. tried adding following files didnt help: <!--[if lt ie 9]> <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <![endif]--> other that, tried adding: filter: none !important; , removed .collapse{display:none} after playing these things got menu in vertical position rather horizontal. here 2 images showing dropdown menu before , after hacks tried. ie8 ie11 after removing .collapse{display:none} here code: <div class="navbar navbar-inverse"> <div class="navbar-collapse collapse navbar-responsive-collapse"> <ul class="nav navbar-nav">

android - Site footer is shaky on my mobile device -

my website http://galnova.com/ has been given responsive upgrade. fine on browsers when @ on samsung device page wont scroll , shakes crazy. not find error in footer class or structure curious why happening. <footer> <div class="wrap"> <a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/3.0/deed.en_us"><img alt="creative commons license" style="border-width:0" src="http://i.creativecommons.org/l/by-nc-nd/3.0/88x31.png" /></a><br />this work <a xmlns:cc="http://creativecommons.org/ns#" href="http://www.galnova.com" property="cc:attributionname" rel="cc:attributionurl">keith jeter</a> licensed under <a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/3.0/deed.en_us">creative commons attribution-noncommercial-noderivs 3.0 unported license</a>.<!--<br />based on wor

Restrict Google OAuth Client to only App Engine -

we have app engine application build in python using endpoints. access restricted. we have software connects app engine using service account. service account can access google cloud storage create buckets. now want allow access app engine (and not cloud storage) specific clients write own software. software end-user. what have create , share client software can authenticate app engine? a service account not seem possible since allows access cloud storage.

java - Camel consume single message and stop, transacted -

i trying use camel consume single message jms queue in transacted manner. in flow this: wait until message published on jms queue try consume , process single message if processing fails (exception occurs), rollback consumption if processing passes, acknowledge , stop consuming anymore messages later in application lifecycle, process triggers consumption start again (1) at first tried using polling consumer, using consumertemplate, can't figure out if possible transactionally - seems transaction internal consumertemplate regardless of message acknowledged consumed time consumertemplate returns. can using consumertemplate? can using camel , if best approach (simple examples appreciated)? i ended using pollenrich dsl achieve this. example route builder looks like: from("direct:service-endpont").transacted("propogation_required").setexchangepattern(exchangepattern.inout).pollenrich("activemq:test-queue").bean(myhandler); i use

How do I use a dynamic variable as a Meteor/MongoDB collection name? -

so tried didn't work (on isserver) : var tablename= ""; (...) if (silly_cond === 1){ tablename = "table1"; }else{ tablename = "table2"; } tablecol = new mongo.collection(tablename); for reason can't work. seems accept tablecol = new mongo.collection("table1"); the idea fetch tablename table id, , apply same js different tables (on different templates). doing wrong? you need declare tablename outside functions, otherwise can't seen. var tablename = ""; if (silly_cond === 1){ tablename = "table1"; }else{ tablename = "table2"; } tablecol = new mongo.collection(tablename);

Modifying formatters in Haskell's formatting library -

i'm using chris done's formatting library (specifically formatting-6.0.0). i'm finding difficult construct `higher order' function maps formatter list formatter, performing custom action on resultant list of builders: list :: ([builder] -> builder) -> format r (a -> r) -> format r ([a] -> r) this desirable because allows me embed builder formatting logic in format string. as example, suppose builder function mconcat . format (list mconcat int) [1,2,3] yield "123" . in practice, may use builder function formats list english list, such output above input "1, 2 , 3" . thanks help! let's expand out format types list :: ([builder] -> builder) -> format r (a -> r) -> format r ([a] -> r) format r (a -> r) -> format r ([a] -> r) holey builder r (a -> r) -> holey builder r ([a] -> r) ( (builder -> r) -> (a -> r))->(

angularjs - What is md-visually-hidden used for? -

in angular material design, see md-visually-hidden in codepen form developer team. it used this: <button ng-click="togglesidenav('left')" hide-gt-sm class="md-icon-button menubtn"> <span class="md-visually-hidden">menu</span> </button> is hides content, purpose of adding , hiding text "menu"? guess point not replace html commenting... i suspect used screen readers. context , there comment fragment has md-visually-hidden class.

python - Why doesn't len(None) return 0? -

none in python object. >>> isinstance(none, object) true and such can employ functions __str__() >>> str(none) 'none' but why doesn't same __len__()? >>> len(none) traceback (most recent call last): file "<pyshell#3>", line 1, in <module> len(none) typeerror: object of type 'nonetype' has no len() it seems pythonic same way if list acceptable if variable none , not empty list. are there cases make use of len(none) more of problem? you mention want this: because comes error when function returns none instead of list presumably, have code like: list_probably = some_function() index in range(len(list_probably)): ... and getting: typeerror: object of type 'nonetype' has no len() note following: len determining length of collections (e.g. list , dict or str - these sized objects). it's not converting arbitrary objects integers - isn't implem

how to add values of two arrays with common index in php? -

this question has answer here: how sum values of array of same key? 13 answers consider following arrays: array 1 contents: index1 value2 5 b 6 c 2 and array 2 contents: index2 value2 4 b 2 i need array 3 should sum of above 2 arrays. like: index value 9 b 8 c 2 this function need: function array_merge_with_sum_values(array $array1, array $array2){ $finalarray = array_merge($array1, $array2); $keys = array_keys($finalarray); foreach($keys $key){ if(isset($array1[$key]) && isset($array2[$key])){ $finalarray[$key] = $array1[$key] + $array2[$key]; } } return $finalarray; }

ios - Cannot edit search bar width and x y coordinate in `UITableViewController` -

Image
i useing swreveal slide menu want add search bar in it. however, search bar has been covered parent view. slide_areawidth = self.revealviewcontroller().rightviewrevealwidth searchbar = uisearchbar(frame: cgrectmake(300, 0, 60, 64)) var searchdisplaycontroller: uisearchdisplaycontroller = uisearchdisplaycontroller() searchdisplaycontroller = uisearchdisplaycontroller(searchbar: searchbar, contentscontroller: self) //searchdisplaycontroller.delegate = self searchdisplaycontroller.searchresultsdatasource = self self.tableview.tableheaderview = searchbar self.tableview.tableheaderview!.frame = cgrectmake(300, 0, 60, 64); there simple way can solve issue can find in swrevealviewcontroller.m swift: self.revealviewcontroller().rightviewrevealoverdraw = 0

java - @ManyToMany using @JoinTable -

i have following 2 entities , 1 join table: entity: @entity @table(name = "person") public class parent { @onetoone(mappedby="person", cascade= cascadetype.all) private reader reader; //more fields , getters , setters , of course @id..... } and entity: @entity @table(name="reader") public class reader{ @id @column(name= "reader_id") @generatedvalue(generator="gen") @genericgenerator(name="gen", strategy="foreign", parameters=@parameter(name="property", value="person")) private long readerid; @onetoone @primarykeyjoincolumn private person person; @manytomany(fetch = fetchtype.eager) @jointable(name = "reader_books", joincolumns={@joincolumn(name="reader_id")}, inversejoincolumns={@joincolumn(name="book_id")}) private list<books> books; //more fields , getters , setters } and have join table in data base named "reader_b

java - non static variable cannot be referenced from a static context in Adapter -

i using base adapter displaying image in grid view. working fine when images fixed image_urls directly try geting url list , assign image_urls shows non static variable cannot referenced static context. don't know how solve issue. please solve issue public class imagegridfragment extends abslistviewbasefragment { public static final int index = 1; string description=""; arraylist<string> img = new arraylist<string>(); @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { view rootview = inflater.inflate(r.layout.fr_image_grid, container, false); listview = (gridview) rootview.findviewbyid(r.id.grid); img.clear(); bundle bundle = this.getarguments(); description = bundle.getstring("description"); string[] separated= description.split(","); for(int i=0;i<separated.length;i++) { img.add(separated[i]); }

Aes Encryption For Custom(User defined type) class C# -

can use aes encryption technique encrypt/decrypt user defined type. in this link encryption done simple string. suppose want encrypt below user defined type. public class person { public string firstname { get; set; } public string lastname { get; set; } } how can done. or there other alternative way it. p.s - have tried following after jon's answer while getting exception "length of data decrypt invalid" while decrypting data. using following code encrypt , decrypt data. [serializable] public class person:iserializable { public string firstname { get; set; } public string lastname { get; set; } public void getobjectdata(serializationinfo info, streamingcontext context) { info.addvalue("firstname", firstname); info.addvalue("lastname", lastname); } public person() { } public person(serializationinfo info, streamingcontext ctxt) { firstname = (string)info.getvalu

javascript - HighCharts using Text in yAxis instead of numbers -

i have following jsfiddle of highchart working number values on yaxis want change it, data want put in instead of 26.5 26.5 16.5 26.5 hot warm cold is there anyway working data received database formatted hot warm cold $(function () { $('#container').highcharts({ chart: { type: 'spline' }, title: { text: 'monthly average temperature' }, subtitle: { text: 'source: worldclimate.com' }, xaxis: { categories: ['16 feb 15', '16 apr 15', '27 jul 15', '10 nov 15', ] }, yaxis: { title: { text: '' }, labels: { formatter: function () { return this.value + '°'; } } }, tooltip: { crosshairs: true, shared: true },

jquery - Sending JSON Objects in DataTables from javascript -

i trying populate datatable json object getting following error: datatables warning: table id=filteredalertstable - requested unknown parameter 'messageid' row 0. more information error, please see http://datatables.net/tn/4 here code: var dataset = '${data}'; $('#filteredalertstable').datatable( { "bprocessing": true, "aadata": dataset, "aocolumns": [ { "mdata": "messageid" }, { "mdata": "host" }, { "mdata": "creationtime" }, { "mdata": "resolvedtime" }, { "mdata": "severity" }, { "mdata": "alerttext" } ] } ); i getting dataset javascript variable, tried passing following, [{ "severity": "severity", &q

unity3d - syntax error on #pragma kernal Main -

i have following shader: #pragma kernal main rwtexture@d<float4>reult; [numthreads(8,8,1)] void main (uint3 id:sv_dispatchthreadid) { result[id,xy]=float4(id.x & id.y, (id.x & 15)/15.0, (id.y & 15)/15.0, 0.0); } in unity. creates error "shader error in ":parse error: syntax error @ line 1" //that #pragma kernal main i have looked around #pragma kernal [name of main function] seems correct syntax doing wrong? this in unity 5.0.1 32 bits edition "kern e l", not "kern a l". see: unity compute shaders rwtexture@d -> rwtexture2d next compile error. followed "reult" -> "result", , "id,xy" -> "id.xy".

sql server - T sql select 2 same datetime -

i have table called " customers " customer table has below column createddate (datetime) customer table has below data 2011-01-06 2013-01-02 2010-01-03 2014-01-04 2013-01-02 2011-01-06 2010-01-03 2014-01-04 question: how can select customer table below 2010-01-03 2010-01-03 2011-01-06 2011-01-06 2013-01-02 2013-01-02 2014-01-04 2014-01-04 something this? select fields customer --where order createddate

c# - OneDrive get access token request case-sensitivity -

i have winforms c# app using onedrive api. working until last week when new token requests after authorizing user started failing telling me 'code' parameter invalid. after reviewing code, noticed routine extracting authorization code authorize call using .tolowerinvariant resulted in authorization code starting lower-case 'm'. when removed .tolowerinvariant , code started upper-case 'm' , token request worked correctly. obviously i'm happy code working, i'd try , understand why started having problems. many thanks james

wildfly - Where is Willdfly 8.1 runtime in Eclipse? -

this question has answer here: how install jboss / wildfly server in eclipse java ee 3 answers the eclipse (kepler) server -> runtime environments contains wildfly 8.1 runtime when i'm trying set wildfly server runtime webapp in add library -> server runtime not contains wilfly runtime... how set it? first have download jboss tools download additional server adaptors on right , of selecting wildfly 8.1. have down load wildfly 8.1 server in location. after can use wildfly 8.1 server time eclipse.

mongodb - How do query among many collections then write result to corresponding collection -

if want query users' age > 18, and export result corresponding collection, how rewriteing following script? the following psuedo code source_collections = ["user_1", "user_2", ..., "user_999"] output_collections = ["result_1", "result_2", ..., "result_999"] pipeline = [ { "$match":{"age": > 18} } { "$out" : output_collections } ] cur = db[source_collections].runcommand('aggregate', {pipeline: pipeline,allowdiskuse: true}) the script you're looking like: var prefix_source = 'user_'; var prefix_output = 'result_'; var source_collections = []; var output_collections = []; var numcollections = 999; (var = 1; <= numcollections; i++) { source_collections.push(prefix_source + i); output_collections.push(prefix_output + i); } var pipeline = [{'$match': {age: {'$gt': 18}}}, {'$out': 

amazon web services - Connection Partially Encrypted in Firefox :SSL -

i have uploaded ssl certificates iam purchased comodo , evrything looks fine in chrome , opera. mozilla giving error: "connection partially encrypted". not able gauge why happening. link : https://www.advisorcircuit.com/ please tell me possible culprit this? , want know , how can redirect users https ebven if type http if type http website loads , opens. using aws t2.medium instance. there configuration need in console?? redirection: have few options: block http traffic, allow https on security group level ( not nicest solution. use elastic load balancer, listening on https port. ( same above) the webserver ( of them tomcat, iis, etc) supports redirection, sends "http/1.1 301 moved permanently", client browser call again on https. if use elastic load balancer ssl termination ( practice, less load on server, easier setup of ssl certificate). traffic inside vpc goes on port 80. in case need setup webserver redirect differently. instead of incoming

android - How to store multiple ParseFile objects in single ParseObject -

my question similar post " storing multiple parsefile objects in single parseobject ", can't resolve on own parseobject pobject = new parseobject(); arraylist<parsefile> pfilelist = new arraylist<parsefile>(); (string thumbpath : thumblist) { byte[] imgdata = convertfiletobytearray(thumbpath); parsefile pfile = new parsefile("mediafiles",imgdata); pfilelist.add(pfile); } pobject.addall("mediafiles", pfilelist); pobject.saveeventually(); and hector ramos answered question:try uploading parsefiles using save method before associating them parse object. can tell me how change piece of code? appreciate kindly help.

Integer powers program Java help needed -

so getting program in book , tested it, worked fine. need though understanding how excactly works. know power of 2 means example 2x2x2x2x2x2x2x2x2 = 512. well, here program: // compute integer powers of 2. class power { public static void main(string args[]) { int e; int result; for(int i=0; < 10; i++) { result = 1; e = i; while(e > 0) { result *= 2; e--; } system.out.println("2 " + + " power " + result); } } } so i've learned result *=2 means: result = result * 2. don't how works. example, 4. result = 1 again, e=i, e 4. 4 higher 0, while loop runs. say's result result * 2, that's 1=1 * 2 = 2. result should 16. how result changes here 16? because 1 time. don't it. also, why e-- part? i've tried program e++, prints result 1 , after 0. tried without e-- or e++ @ all, freezes in dos-prompt. please no

How to make a polynomial approximation in Scilab? -

Image
i've set of measures, want approximate. know can 4th degree polynomial, don't know how find it's 5 coefficients using scilab. for now, must use user-friendly functions of open office calc... so, keep using scilab, i'd know if built-in function exists, or if can use simple script. there no built-in polyfit function in matlab, can make own: function cf = polyfit(x,y,n) = ones(length(x),n+1) i=1:n a(:,i+1) = x(:).^i end cf = lsq(a,y(:)) endfunction this function accepts 2 vectors of equal size (they can either row or column vectors; colon operator makes sure column-oriented in computation) , degree of polynomial. it returns column of coefficients, ordered 0th nth degree. the computational method straightforward: set (generally, overdetermined) linear system requires polynomial pass through every point. solve in sense of least squares lsq (in practice, seems cf = a\y(:) performs identically, although algorithm bit different there). example of

mysql - Separate query in single var and execute it using perl script -

i have working on perl script . select column1,column2,column3.. table. this query contain part in $cmd="select column1 "; , other $cmd1=",column2,column3 table"; // dynamic part, split query in 2 different variable. after execute whole query. how query splitting part.? use dbi; use strict; use warnings; # input ! $cmd = "select column1 "; $cmd1 = ",column2,column3 table"; # wondering why have query ... # anyway, lets assume there's reason behind this! $dbh = dbi->connect( 'dbi:mysql:databasename;host=db.example.com', # todo change 'username', # todo change 'password', # todo change { raiseerror => 1 } ) or die "could not connect database: $dbi::errstr"; $sth = $dbh->prepare( $cmd . $cmd1 ); $sth->execute(); @row; while ( @row = $sth->fetchrow_array ) {

ios - How do I update the badge number for uitabbaritem when a new push notification arrives -

how can update badge specific uitabbaritem when new push notification arrives? example activity tab in instagram you should use following code: [[[[[self tabbarcontroller] tabbar] items] objectatindex:tabindex] setbadgevalue:badgevaluestring];

Asynchronous programming in javascript -

i have load() function, inside want call function download() , download xml file. once download completed , have call function parsexml() parses downloaded xml file. once parsing completed, have call function processparsedxmlfile() . can please guide me how can achieve in simplest possible way ? you can use callbacks load(params , function(){ download(params, function(){ parsexml(params, function(){ processparsedxmlfile(params, function(){ ... }) }) }) })

How to delete a folder NOT generated by the installer (Advance Installer)? -

i'm using advanced installer create installer. application creates folder cache not controlled installer. question is; how can remove folder not handled/controlled advanced installer? i've looked here no luck: http://www.advancedinstaller.com/user-guide/qa-remove-file-or-folder.html thanks, almir the article linked quite old, latest version of advanced installer has built-in support removing folders 1 have (i.e. not created installation, app). take @ following article, on folder removal operations . edit: no, can configure not create folder. in this sample project , folder test . first create folder, configure removal operation , hit ok. right click on folder , select properties, , first tab untick option "create folder on target machine". the info removal operation not removed our website , part of offline user guide advanced installer, how ever using version 12.1 still have it. we remove website articles features no longer exist, , in case

struct - Don't understand composition in Go -

in example below i've embedded http.responsewriter own struct called response . i've added field called status . why can't access field inside root handler function? when print out type of w in root handler function says it's of type main.response seems correct , when print out values of struct can see status there. why can't access going w.status ? this contents of stdout: main.response {responsewriter:0xc2080440a0 status:0} code: package main import ( "fmt" "reflect" "net/http" ) type response struct { http.responsewriter status int } func (r response) writeheader(n int) { r.status = n r.responsewriter.writeheader(n) } func middleware(h http.handler) http.handler { return http.handlerfunc(func(w http.responsewriter, r *http.request) { resp := response{responsewriter: w} h.servehttp(resp, r) }) } func root(w http.responsewriter, r *http.request) { w.wri

jquery - Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource. -

i downloaded jquery plugin tree view. want run index.html in chrome, blank page appears, running in web inspector, receive following error. now, i've read why appears , how solve (using webserver) - thread here because use locally on more computers won't have webserver, i'm asking if it's possible solve without webserver in chrome . usage : customers click on data want display in application built in other programming language. app generate code, including json file. user (with lower knowledge) have click open. going open index.html in default browser . work in ie, firefox, opera, etc. won't work in chrome gain alot of troubles.

ruby - how do i get the uniq value for this hash? -

i want uniq region , filtered "status = stopped". without using loop. possible? hash: {"a123" => {"status"=>"stopped", "region"=>"us-east"}, "b123" => {"status"=>"stopped", "region"=>"us-east"}, "c123" => {"status"=>"stopped", "region"=>"us-west"}, "d123" => {"status"=>"running", "region"=>"us-west"}, "e123" => {"status"=>"running", "region"=>"us-north"}} my code filtering status: hash.select{ |k, v| v["status"] == "stopped" }.values #=> [{"status"=>"stopped", "region"=>"us-east"}, {"status"=>"stopped", "region"=>"us-east"}, {"status"=&g

css - Nivo Slider forcing background colour in Chrome/Firefox - IE works fine -

Image
i've exhausted fair amount of time investigating issue , found nothing has helped, i'm posting question here in hope may able assist. i've had issue while found time try , resolve issue. created our sharepoint based company intranet few years ago designed ie our corporate browser. on past few months there has been increase in other browsers various processes, chrome in particular. the nivo slider on our main portal within ie (9 & 11) works expected. images displayed , rotated designed. the issue have within chrome , firefox slider not display images @ all. edit: section within css #slider {position:relative; background:#202834;} forcing background colour on image. i've tried comment out bg colour slider css has not resolved issue, displays white background instead. /edit the images still rotate within slider, it's image not appear, example below: i've played around few options within css , changed window.load document.ready no avail. kno