Posts

Showing posts from May, 2011

module - Trying to get params from list in joomla -

i have joomla 3 module. works great. want add parameters in administration section can use in tmpl->default.php file, i'm struggling find out how it. i have in xml file: <config> <fields name="params"> <fieldset name="basic"> <field name="show_category" type="list" label="what display" description="what display" default=""> <option value="0">day/time/event</option> <option value="1">day/time/event/description</option> </field> </fieldset> </fields> </config> and in default.php file: <?php defined('_jexec') or die; $module = jmodulehelper::getmodule('mod_calendar_ajax_google'); $moduleparams = new jregistry(); $moduleparams->loadstring

c# - Add new row to DataGridView using textboxes -

i trying add textboxes datagridview code doesn't work datagridview1.rows[0].cells[0].value = textbox6.text; datagridview1.rows[0].cells[1].value = textbox5.text; datagridview1.rows[0].cells[2].value = textbox7.text; datagridview1.rows[0].cells[3].value = datetimepicker3.value; here suggest knowing indeed in forms project. see person has suggested already, adding in assertion if of textbox controls empty row not added. if ((!string.isnullorwhitespace(textbox6.text)) || (!!string.isnullorwhitespace(textbox5.text)) || (!string.isnullorwhitespace(textbox7.text))) { datagridview1.rows.add(new object[] {textbox6.text,textbox5.text,textbox7.text,datetimepicker3.value }); }

IntelliJ launches internet explorer in no addons mode which disables my gwt plugin -

i'm developing gwt application , hate using super dev mode i've still been using ie still supports npapi plugins. problem when have intellij launch browser part of run configuration, opens in ie (no addons) mode disables gwt plugin. now, can take url , open normal ie , paste in works fine, it's horribly annoying can't have launch without work. so far, in intellij can setup browsers, i've pointed ie 1 shortcut know launches in normal ie, yet still somehow opens in no addons mode when intellij launches it. any , appreciated! edit: know other people have used ie while developing gwt app in intellij , never ran issue, it's possible it's ie issue , not intellij related when setting browser setting path ie executable or shortcut website ("launches in normal ie" doesnt make clear). under tools > web browsers, internet explorer path iexplore? if go run, via start menu , enter in path box in intellij, correct ie start?

augmented reality - 3D object detection -

i need able recognise 3d objects. the objects - simplicity consider objects pen, coin , mug. the environment - objects placed on assembly line. camera placed above them @ fixed distance(so angle should same). light should more or less same. the goal - camera spends few seconds scanning object x , has able whether pen, coin or mug. ideally device android tablet question more on theory , best approach in general. although objects 3d objects real world, static during scan. you can use available tools (e.g. vuforia) capable of 3d object recognition i'm quite sure don't need 3d object recognition capability if camera fixed , real objects recognized same angle (more or less). few images deal, if light changes within limits.

c# - Got error during make a setup for win app using VS 2012 -

after finishing c# application had make installer. when want choose sql express in prerequisites section error appear : "error 3 enable 'download prerequisites same location application' in prerequisites dialog box, must download file 'sqlexpress2008r2\sqlexpr32_x86_enu.exe' item 'sql server 2008 r2 express' local machine. more information, see http://go.microsoft.com/fwlink/?linkid=239883 ." i use installer extenssion visual studio 2012. i had same problem, though files in c:\program files (x86)\microsoft sdks\windows\v8.1a\bootstrapper\packages\sqlexpress2008r2 directory. this worked me - not sure if it's "correct" solution did job: i copied 2 files sqlexpr_x64_enu.exe , sqlexpr32_x86_enu.exe \en subdirectory within above path. en subdirectory unlike of other packages. imagine different language code depending on local culture, or there possibly more one? i have windows 7 professional visua

r - Apply a function on multiple columns in each row -

below data frame have. column 2 days expiration of nearest contract, column 3 days expiration of next nearest contract. i'm trying create vector gives me percentage of column 2 needed give me weighted average days expiration of 28 days each row. date daysxone daysxtwo 1 2006-01-03 15 43 days 2 2006-01-04 14 42 days 3 2006-01-05 13 41 days 4 2006-01-06 12 40 days 5 2006-01-09 9 37 days 6 2006-01-10 8 36 days i've tried: f <- function(x){ df$daysxone*(x) + (df$daysxtwo*(1-(x)) -28} and i've tried few things uniroot(), i'm stuck thanks! or go data.table : library(data.table) df <- data.frame(daysxone = c(15,14,13,12,9,8), daysxtwo = c(43, 42,41,40, 37,36)) setdt(df)[,perc := (28-daysxtwo)/(daysxone - daysxtwo),] daysxone daysxtwo perc 1: 15 43 0.5357143 2: 14 42 0.5000000 3: 13 41 0.4642857 4: 12

Is it OK if I sign Android debug and production builds with the same key? -

i ran sha-1 messed-up situation (i guess) firebase config. so, decided sign both debug , and production builds same key (my own key, not default debug key). cause problem in future? tks it's ok. long keep key not publicly available. easiest way assign signing config both debug, , release profile in build.gradle

php - How to get jquery ajax response data and display in codeigniter view html div id -

i new in codeigniter. i want display data in codeigniter view div id ajax on window load. view.php <script type='text/javascript' language='javascript'> $(window).load(function() { $.ajax({ type: "post", url: "<?php echo base_url(); ?>colleges/index", success: function(server_response { if(server_response == 'success') { $("#fillgrid").html(server_response); } else{ alert('not okay'); } } }); //$.ajax ends here }); </script> i added explanations directly in code: $(window).load(function() { $.ajax({ type: "post", url: "<?php echo base_url(); ?>colleges/index", success: function(server_response) // added missing parenthesis { if(server_response == &#

html - Adding option to select dynamically with jquery is producing side effects -

my jquery script: var categorias = ["a","b","c"]; $(document).ready(function () { $.each(categorias, function(index,item){ $("#mycategoria").append(new option(item)) }); }); my html: <!doctype html> <html> <head> <title>inserir obra</title> <meta charset="utf-8"/> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"> </script> <script src="categorias.js"></script> <script src="instrumentos.js"></script> <script src="obra.js"></script> </head> <body> <h3>inserir obra</h3> <label for="mycategoria">categoria: </label> <select id="mycategoria" name="categoria"/> <p>isto é um teste</p> </body> </html>

android studio Logcat shows json data in single line and part of data -

Image
i used logcat show json data in android studio, showed in single line , couldn't show whole json data. how should can make logcat show whole json data in multi-line eclipse? thanks help! try using soft wraps . turn on in android monitor tool window. should make wrap content.

c# - Update View in "Realtime" with data from ObservableCollection in MVVMLight -

i'm writing sort algorithm visualizer in c#/wpf using mvvmlight , fody. in viewmodel have observable collection this: public observablecollection<int> numberscollection{ get; set; } now in command (method) change contents of collection (in case i'm doing bubble sort). this: imutablesortalgorithm sorter = servicelocator.current.getinstance<imutablesortalgorithm>(); sorter.muatblesort(this.numberscollection); while (!sorter.finished()) { sorter.nextstep(); this.raisepropertychanged("numberscollection"); // not neccesary thread.sleep(400); } after call of sorter.nextstep() collection changed. after each step tried update view calling raisepropertychanged , sleeping 400ms. so want view update after every change (step), view updated after method finished. (and don't need call raisepropertychanged...) i use background worker convenience. first

azure webjobssdk - WebJob Message submittion always goes to poison queue rather than actual Queue -

we using webjob latest sdk our web job, see weird behavior time our queue messages goes poison queue rather actual queue. don't find error in webjob dashboard also. has 1 faced kind of issue. public async static task processqueuemessage( [queuetrigger("%queuename%")] parameter message, int dequeuecount, textwriter log ) { try { //read parameters //perform db operation last 2-5 mins } catch { } } public static void bindtopoisonqueue( [queuetrigger("queuename-poison")] parameter message, textwriter log ) { log.write("problem message: " + message); } i don't find issue code, not sure why messages automatically redirected poison queue instead of actual queue. the sdk moves message poison queue if has failed processing number of times greater retry count configured via jobhostqueuesconfiguration.maxdequeuecount. check message details - might message body failing deserialize parameter poco

fedora - MySQL password always prompt to reset password -

Image
there's wrong mysql after updated newer version. prompts reset password everytime boot/re-boot laptop. is there way out of prompts? can set password without reset everytime open mysqlworkbench, , it's horrible change mysql configuration on codes everyday. here's screenshot. thanks in advance. for troubled problem, reset password usual , can run command after logged on mysql alter user 'user'@'localhost' password expire never ps: i'm using mysql 5.7.9 under fedora 22

xcode - Pitch transpose with AudioToolbox AudioUnit samplerUnit -

this "pitch transposing" test code not working audiounit samplerunit. sending same midi messages thru midi out external sound module, works perfect. wrong. can't use "pitch bend" case. controller "0x06" not implemented in api? - (void) demotranspose { [at0 setinstrument :0x11 :0x00]; [at0 midievent :0xb0 :0x65 :0x00]; [at0 midievent :0xb0 :0x64 :0x02]; [at0 midievent :0x90 :0x3c :0x7f]; // note on usleep(1000000); [at0 midievent :0xb0 :0x06 :0x40+6]; // 40: center, +6 semi tones higher usleep(1000000); [at0 midievent :0xb0 :0x06 :0x40+12]; // 40: center, +12 semi tones higher usleep(1000000); [at0 midievent :0x90 :0x3c :0x00]; // note off [at0 midievent :0xb0 :0x06 :0x40]; // reset center } - (void) midievent :(byte)statusinfoa :(byte)param1a :(byte)param2a { musicdevicemidievent (self.samplerunit, statusinfoa, param1a, param2a, 0); }

cloudera cdh - Ensure that Impala query gets materialized -

it there reliable , efficient way ensure impala query results gets materialized without printing results console? example use inner join query. the obvious way materialize query results create table select . create table t3 stored parquet select t1.* t1 inner join t2 on t1.id=t2.id; the problem writes disc therefore inefficient. i'm looking efficient way execute query , ensure results materialized. as example, in spark can use .cache method followed .count ensure query materialized. val t3 = t1.join(t2, "id") t3.cache t3.count i try workaround sub-query. select count(*) (select t1.* t1 inner join t2 on t1.id=t2.id) t3; but still need ensure sub-query materialized, not obvious if query optimizer discovers i'm interested in total count. maybe there hints enforce or other tricks? afaik can't impala , , never able to. cloudera designed tool support bi tools such tableau, qlik, microstrategy etc. -- not support ad hoc etl scripts.

javascript - The processing instruction target matching "[xX][mM][lL]" is not allowed. XML error -

i have error : error parsing /web-inf/includes/verdatosproyeccion.xhtml: error traced[line: 4302] processing instruction target matching "[xx][mm][ll]" not allowed. i using code of same code of : http://jsfiddle.net/qxln3h86/ . cuted code , past code. my code looks : <table id="tbl1"> <tr> <td>name</td> <td>birthday</td> <td>amount</td> <td>rebate (10%)</td> </tr> <tr> <td>smith</td> <td data-type="datetime" data-style="date" data-value="1980-03-23">mar 23 1980</td> <td data-type="number" data-style="currency" data-value="1234.56">$ 1,234.56</td> <td data-formula="=rc[-1]/10" data-type="number" data-style="currency">$ 123.45</td> </tr> <tr> <td>doe</td> <td

java - How to create a multidimensional Array to take input from .txt file and store the strings and the numbers separate -

public class arraydirectory { public static void main(string args[]) throws filenotfoundexception { string file = ("lab4b2.txt"); scanner scan = new scanner(new filereader(file)); // initialises scanner read file file string[][] entries = new string[100][3]; // creates 2d array 100 rows , 3 columns. int = 0; while(scan.hasnextline()){ entries[i] = scan.nextline().split("\t"); i++; } //loops through file , splits on tab (int row = 0; row < entries.length; row++) { (int col = 0; col < entries[0].length; col++) { if(entries[row][col] != null){ system.out.print(entries[row][col] + " " ); } } if(entries[row][0] != null){ system.out.print("\n"); } } //prints contents of array not "null" } } how make following code split string pieces , store them in multidimentional array? example

css - Height issue with news posts (length of title messes up formatting) -

i'm having issue news posts. image makes pretty self-explanatory. how use css fix this? image: http://image.prntscr.com/image/25a47fd31b1141e0af17c4960c3be011.png i not sure, wrong or right css on linked image. flexbox , such divs can positioned in more advanced way.

java - DatagramChannel.receive() seems to buffer packets -

i have server sending udp packets of 40 bytes every ~50 milliseconds client. client receives these packets of time. however, every ~1-3 seconds no packets arrive ~500ms , following packets after arrive @ 0ms delay, if packets buffered. the following code called in separate thread sole purpose of receiving packets: public synchronized int readudp(datagramchannel channel) throws ioexception { inetsocketaddress sourceaddress = (inetsocketaddress) channel.receive(in); bytesread = in.position(); in.flip(); // read data out of buffer... } here notes on debugging findings: the server runs on same computer client, communication 1 way (server -> client). traffic goes 127.0.0.1 127.0.0.1 , therefore there no network interference. using rawcap have taken @ packets , times , no oddities visible, delta times between packets in capture ~50ms . the datagramchannel in blocking mode. the client connected server tcp simultaneously, no packets actively sent on c

serialization - Phoenix - JSON API 406 Not Acceptable response -

i started brand new phoenix project , using jaserializer json api. followed documentation add project, have: config/config.esx config :phoenix, :format_encoders, "json-api": poison config :plug, :mimes, %{ "application/vnd.api+json" => ["json-api"] } web/router.ex pipeline :api plug :accepts, ["json-api"] plug jaserializer.contenttypenegotiation plug jaserializer.deserializer end and used json api generator: mix ja_serializer.gen.phoenix_api user users first_name:string last_name:string username:string email:string bio:text i'm using postman test requests, , here's see when add headers it: accept */* returned 200 accept application/vnd.api+json returned 406 accept application/* returned 406 so in phoenix server console, it's outputting: [debug] ** (phoenix.notacceptableerror) no supported media type in accept header, expected 1 of ["json-api"] i tried deleting _build folder , re

asp.net mvc - Database update notification using SignalR and Entity Framework -

i'm trying make website using asp.net mvc 4 , ef 6 want update messagebox of adminpanel if user sends him message. i'm using signalr live notification i'm new signalr , reason don't updates live, i've refresh page newly added message. here codes, hub class public class chathub : hub { myproj.models.msgtoowner messages = new myproj.models.msgtoowner(); public void sendnotify(string username, string title, string datetimenow) { var newname = messages.name; var newtitle = messages.title; var newtime = messages.addedtime; ihubcontext context = globalhost.connectionmanager.gethubcontext<chathub>(); context.clients.all.getnotify(newname, newtitle, newtime); } } view messages @{ var msglist = (list<myproj.models.msgtoowner>)viewbag.msglist; } <body> <script src="~/scripts/jquery.signalr-1.1.4.min.js"></script> <script src="~/signalr/hubs"

time - erlang:system_time/1 undefined function -

when call function erlang:system_time(seconds). shell throws undefined function error. have followed documentation function here . tried on otp 17.

javascript - Backbone.js does't work -

i have next html page: ... <script src="/scripts/app/pep.js"></script> </head> <body> <div id="main"> &nbsp; </div> </body> ... the 'pep.js' contains next content: var pep = { models: { }, views: { loginview: backbone.view.extend({ tagname: 'div', id: 'logincontainer', el: $('#main'), events: { }, initialize: function() { this.listento(this.model, "change", this.render); }, render: function () { this.$el.html("<p>asd</p>"); return this; } }) }, route: backbone.router.extend({ routes: { "login": "login", // #login }, login: function () { var lv =

php - WooCommerce product categories custom fields - Setting time purchasing restrictions -

Image
i have wordpress/woocommerce site displays categorized products. i'm trying create custom field in admin individual categories pages (backend), can set start , end time related categorized products purchase availability. how should work: customers purchase products category "open" (between start , end time set category) products still visible if not purchasable. i wondering if has idea best way begin , achieve that. for moment here related code have: function custom_product_taxonomy_add_new_meta_field() { //add term page //this add custom meta field add new term page ?> <div class="form-field"> <label for="term_meta[custom_term_meta]"><?php _e( 'post code(s)' ); ?></label> <input type="text" name="term_meta[custom_term_meta]" id="term_meta[custom_term_meta]" value=""> <p class="description"><?php _e( 'enter delivery po

vba - Referencing a table to look up values between worksheets in Excel -

ok here's doosy of question: i work in healthcare, have workbook references values using index:match function based off of patients name, manually enter. pull 7/10 columns using method automatically. 8th column generation date of information , 9th column date/time stamp sheet enter manually based off of patient's room number. here's tricky part. 2 reports, i'm pulling our bed management program allscripts, don't translate bed names/numbers same way. created translation table in different sheet. question this: there way can use function index:match, vlookup or else within either excel or vba reference translation table in order bed name/number , auto fill information need? spreadsheet looks this: https://docs.google.com/spreadsheets/d/1j8b2jz7zuzkpmoqoisfbvccdkw_cwdfwcgl_cco2hco/edit?usp=sharing so column g on 'raw data page' needs reference column e same page, translate bed name based off of 'bed translation page' , date/time info

mysql - How to design a relationship between team and game? -

Image
i have come 2 options relate teams , games in database; 1 appropriate? i trying make simple, here want. teams have many games , , each game has home team , away team . it's many many relationship. here thought: i not sure whether should put boolean field called ishome in competes table or add 2 fields called home_id , away_id , , set them foreign key references team.id in following picture. if have 2 teams playing against each other can use competes table -------------- home_team_id away_team_id game_id like in 2nd option. if have dynamic number of teams in game use other.

c - Strcmp does not do the comparing -

why isn't comparing between strings work? know user strings not have endlines @ end of them, still username not accepted. char user[24]; int userlog = -1; file *usernames; usernames = fopen("usernames.cfg", "r"); if (usernames == null){ perror("usernames - err"); return(-1); } while(fgets(user, sizeof(user), usernames) !=null){ strtok(user, "\n"); printf("%s -- %s\n", user, possibleusername); // first edition of question contained: // if((possibleusername, user) == 0) // still having problems version: if(strcmp(possibleusername, user) == 0) userlog = 1; else userlog = 0; } if(userlog == 1) printf("username accepted: %s\n", possibleusername); else if(userlog == 0) printf("username doesn't exist in database.\n"); fclose(usernames); usernames.cfg: user justplayit etc i suppose should be if(strcmp(possibleusername, user) == 0)

php - Artisan is trying to use the Ubuntu MySQL database instead of XAMPP's -

Image
i using linux web development first time. developing application using laravel (and xampp) , had no trouble doing on windows. this time, however, whenever run php artisan command refresh database error artisan can't connect database. i realized he's trying access ubuntu's mysql databse instead of xampp's database. that's because using global php command instead of running xampp's php command (which used on windows). positive .env file , database configuration file point correct database. is there way make artisan work xampp's php command? please remember have limited linux knowledge. thank you. you should terminate ubuntu's mysql server, google how this, , can start xampp mysql server xampp controller.

python - Vectorising a decrement operation on a list of objects -

is there pythonic/efficient way carry out simple decrement operation on each element (or more accurately subset of elements) in list of objects of arbitrary class? i potentially have large-ish (~ 10k) list of objects, each of updated periodically on basis of countdown "time update" (ttu) value. the simple way handle decrement value in each element below: def batesnumber(start = 0): n = start while true: yield n n += 1 class foo: index = batesnumber() def __init__(self, ttu): self.id = next(foo.index) self.time = ttu self.ttu = ttu def __repr__(self): return "#{}:{}/{}".format(self.id, self.ttu, self.time) def decrement(self): self.ttu -= 1 def reset(self): print("reset {} {}".format(self.id, self.time)) self.ttu = self.time def isreadyforupdate(self): if self.ttu == 0: return true else: return false

php - Issues Installing PHPword -

i've been trying install phpword last 4 hours , have had no luck. i've tried methods of installation including composer downloading folder itself. whenever run php file, returns me error "fatal error: class 'phpword' not found in /home/ubuntu/workspace/hello-world.php on line 9" also, seems whenever attached phpoffice/phpword in composer.json file, kept on giving me installation error saying no version specified. btw, running these files on cloud hosting website (c9.io). i've attached composer.json hello_world.php any appreciated. hello_world.php <?php require_once('phpword-master/autoloader.php'); \phpoffice\phpword\autoloader::register(); //use phpoffice\phpword\phpword; //use phpoffice\phpword\style\font; // creating new document... $phpword = new phpword(); /* note: element append document must reside inside of section. */ note: it's possible customize font style of text element add in 3 ways: - inline; - using name

angular - Not able to load component dynamically -

i tried create sample application wanted load component dynamically on button click event parent component. when click on button component not loaded instead getting following error in browser console. please visit plunker application code zone.js:461unhandled promise rejection: cannot read property 'createcomponent' of undefined ; zone: angular ; task: promise.then ; value: typeerror: cannot read property 'createcomponent' of undefined @ eval (https://run.plnkr.co/eq3xbfuupwfmtu2c/src/app.ts!transpiled:38:45) @ zonedelegate.invoke (https://npmcdn.com/zone.js@0.6.12/dist/zone.js:323:29) @ object.oninvoke (https://npmcdn.com/@angular/core/bundles/core.umd.js:9100:45) @ zonedelegate.invoke (https://npmcdn.com/zone.js@0.6.12/dist/zone.js:322:35) @ zone.run (https://npmcdn.com/zone.js@0.6.12/dist/zone.js:216:44) @ https://npmcdn.com/zone.js@0.6.12/dist/zone.js:571:58 @ zonedelegate.invoketask (https://npmcdn.com/zone.js@0.6.12/dist/zone.js

Divide by zero exception of average of columns in a row in SQL Server -

i have code made calculate average of row in table. problem sum of mintwee , mineen , nul , pluseen , plustwee (are column names) equal zero, gives me divide 0 exception (what normal of course) . how can protect it given't that? if sum equal 0 average equal 0 of row. use sql server 2014. select top 5 id, mintwee, mineen, nul, pluseen, plustwee, naam topic categorieid = 7 , verwijderd = 0 order round(cast((mintwee * (-2) + mineen * (-1) + nul * 0 + pluseen * 1 + plustwee * 2) float) / (mintwee + mineen + nul + pluseen + plustwee), 1) desc, creatie desc you can test 0 value case when select top 5 id, mintwee, mineen, nul, pluseen, plustwee, naam topic categorieid = 7 , verwijderd = 0 order case when (mintwee + mineen + nul + pluseen + plustwee) = 0 creatie else round(cast((mintwee * (-2) + mineen * (-1) + nul * 0 + pluseen * 1 + plustwee * 2) float) / (mintwee + mineen + nul + pluseen + plustwee), 1) end desc, creatie

C - Passing function with unknown params to another function, and calling it -

i'm trying achieve this: void sum(int a, int b){ printf("result: %d", a+b); } void callfunc(void (*funct)(...), ...) { va_list ars; va_start(ars, funct); funct(ars); va_end(ars); } int main() { callfunc(sum, 2,3); return 0; } but doesn't work, because of needing of 2 va_list s, funct params , arguments passed. however, if try pass sum function, says: error: invalid conversion 'void (*)(int, int)' 'void (*)(...)' so how make work old c-style? you can't that. it's not possible. the best can (while keeping generic) change funct take va_list , vprintf . won't work purposes. alternatively, can macro: #include <stdio.h> #define call_func(func, ...) func(__va_args__) void sum(int a, int b){ printf("result: %d", a+b); } int main() { call_func(sum, 2, 3); return 0; }

outlook - Exchange ErrorInvalidClientAccessTokenRequest -

i built outlook add-in , uses token download email attachments exchange server. on o365 developer account, retrieves token. add-in has been deployed client's outlook when try retrieve token, response message: messagetext:"the token extension not retrieved. "responseclass:"error" responsecode:"errorinvalidclientaccesstokenrequest" token:null __type:"getclientaccesstokenresponsemessage:#exchange" the code same , request. there clues figure out environment cause fail? the errorinvalidclientaccesstokenrequest field applicable clients target exchange online , versions of exchange starting exchange server 2013.

ios - Deleting an object in a tableView cell from Parse -

i attempting delete objects parse. user able save posts , trying implement way them delete them. saved posts can found in tableview. i have following. override func tableview(tableview: uitableview, editactionsforrowatindexpath indexpath: nsindexpath) -> [uitableviewrowaction]? { let deleteaction = uitableviewrowaction(style: .default, title: "remove") { (action: uitableviewrowaction!, indexpath: nsindexpath!) -> void in let query = pfquery(classname: "savedobjects") query.orderbydescending("createdat") query.wherekey("savedbyuser", equalto: (pfuser.currentuser()?.username)!) query.findobjectsinbackgroundwithblock({ (objects : [pfobject]?, error: nserror?) -> void in if error == nil { object in objects! { object.deleteinbackground() } } }) self.tableview.reloaddata() } deleteaction.backgro

javascript - how to append an element to an empty parent with null lastChild? -

from js object, i'm trying assemble element children. can please see how append element (e.g. appendchild ) empty parent null lastchild or guide me better methods assemble such element (copied in below) , inject document.body ? time. z=[ {"level":0,"order":0,"t":"section","a":{"class":"ro s-14 m-3"},"first":1}, {"level":1,"order":0,"t":"h1","a":{"class":"tx-1 s-35"},"x":"team"}, {"level":1,"order":1,"t":"div","a":{"class":"tx-0"}}, {"level":2,"order":0,"t":"h3","x":"roberto carlos"}, {"level":2,"order":1,"t":"ul"}, {"level":3,"order":0,"t":"li","x":"t

c++ - cant figure out what to write for the last string of code for function -

hi guys have far function , question asking me write function findpattern() receive 3 integers representing 3 bowling scores. function determine pattern followed these scores, printing 1 of following six cases (make sure have these 6 cases): stayed same –- 3 scores same increasing –- scores going steadily upward decreasing –- scores going steadily downward , down –- scores first went up, went down down , –- scores first went down, went 2 same –- 2 consecutive scores same, , other 1 (first or third) either higher or lower this have far can't figure out last part appreciated void findpattern(int score1, int score2, int score3) { if (score1 == score2 && score1 == score3 && score2 == score3 ) { cout << "all 3 scores same" << endl; } else if (score1 < score2 && score2 < score3) { cout << "the scores going steadily upward" << endl; } else if (score1 >

Parsing JSON data and it's objects into different PHP functions -

Image
i've been looking around hoping find issue i'm stumbling upon... couldn't find it. i've made class in php, within class there function connects api retrieving json data (this function has been tested , works charm). i'm trying seperate objects of json data receive different functions. i've managed parse data through foreach , echo, it'd hassle constantly. this looks idea. edit issue has been resolved, public function foo(); had , $info variable had json_decode(); interupted next function split data. class parsedata{ var $name; var $domain; public function foo($name, $domain) { $this->name = $name; $this->domain = $domain; $ch = curl_init(); $user_agent = 'mozilla/5.0 (x11; linux i686) applewebkit/537.31 (khtml, gecko) chrome/26.0.1410.43 safari/537.31'; $request_headers = array(); $request_headers[] = 'user-agent: ' . $user_agent; $request_he

compilation - How to Compile a Github Project (Windows) -

i found project on github https://github.com/noio/kingdom , , wondering how compile it. im new coding, if answer , great. the project written in actionscript (by adobe) , recommend use flashdevelop , free code editor. give actionscript 3 wiki , gives full overview of need started , compile code. since new programming suggest start beginning, within simple hello world! before messing such big projects (it's lot of fun, know :p).

c++ - error C2039: 'type_name' : is not a member of of 'swig::traits<Bar>' -

i'm unable swig wrap function returns map of pointers class instances. compile errors when generated swig code compiled. error c2039: 'type_name' : not member of 'swig::traits<bar>' here .i file class foo { ... }; class bar { ... }; %template(mapfooptrbarptr) std::map<foo*, bar*>; std::map<foo*, bar*> getmap(); add following typemap code .i file before %template. note lack of '*' after class name in return string. %{ namespace swig { template <> struct traits<bar> { typedef pointer_category category; static const char* type_name() { return "bar"; } }; } %} got solution from: http://swig.10945.n7.nabble.com/std-containers-and-pointers-td3728.html

assembly - moving data segment address DS via direct addressing mode -

in x86 assembly language, in order move start address of data segment data segment register, 1 has first move ax , move ax ds . this: dtseg segment ... dtseg ends cdseg segment main proc far mov ax,dtseg mov ds,ax cdseg ends end main i want know, using direct addressing mode in first line? consider, define string byte in data segment this dtseg segment data db 'hello' dtseg ends this time, have load effective address using mov ax,offset data or lea ax,data . both of them valid. now, second question still use direct addressing mode? then, third question why don't load effective address of data segment? this: mov ax,offset dtseg ; ??? lea ax,dtseg ; ??? is there reason that? the following lines don't use addressing mode. addressing modes used memory operands , these instructions move immediate operand register operand: mov ax,dtseg mov

java - Source code for Neo4j graph algo 2.3 -

where can source code neo4j graph algo 2.3? the closest thing found code on repo: https://github.com/dmontag/neo4j-community but old, @ least on branch master. that repository different, looking for. here is: https://github.com/neo4j/neo4j/tree/2.3/community/graph-algo

css3 - Using VW units on Android stock browser v4.4.2 -

as far can tell should supported, test phone won't use value. os version on phone 4.4.2 (it's samsung s3). missing something? it's basic css: .elem {height: 13vw;) .elem h4 {font-size:3.4vw;} .elem h5 {font-size:2.7vw;} etc.

java.lang.RuntimeException: Could not generate dummy secret at sun.security.ssl.RSAClientKeyExchange.<init> -

i working on java ee application (netbeans ide 8.0.2, glassfish 4.1, jdk 1.8.0_45). the access pages of application should secured https, modified web.xml : <security-constraint> <web-resource-collection> <url-pattern>/*</url-pattern> </web-resource-collection> <user-data-constraint> <description/> <transport-guarantee>confidential</transport-guarantee> </user-data-constraint> </security-constraint> when deploy & start glassfish via netbeans can access application via https://localhost:8181/myapp/ when bundle application in .war file , deploy manually copy of same glassfish installation files netbeans uses, exception while trying connect application: warning (35) grizzly0013: exception during filterchain execution java.lang.runtimeexception: not generate dummy secret @ sun.security.ssl.handshaker.checkthrown(handshaker.java:1429) @ sun.security.ssl.sslen

Connecting inside container at docker environment using JSCH -

i developing java application connect (using ssh) linux machine attach docker container , send commands on that. now, able connect linux machine, send commands , read responses, when try attach container , send commands inside it, nothing received , not able send commands. i usinf code below. please me issue? try{ jsch jsch=new jsch(); string host=null; if(arg.length>0){ host=arg[0]; } else{ host=joptionpane.showinputdialog("enter username@hostname", "root@10.46.68.147"); } string user=host.substring(0, host.indexof('@')); host=host.substring(host.indexof('@')+1); session session=jsch.getsession(user, host, 22); //session session=jsch.getsession("root", "10.46.68.147", 4184); // username , password given via userinfo interface. userinfo ui=new myuserinfo(); session.setuserinfo(ui); session.connect(); string temp = ""; string al

c++ - DirectShow's SampleGrabber retrieves erroneous sample -

being newbie ds needed samplegrabber can handle videoinfoheader2, imediadet cannot. so took samplegrabber dx8.1 samples - in contrast stock grabber - allows kind of media. used sample code quite is, , grabbing 1 single frame seems work fine: graph built without returning errorcodes etc. calling hr = pseeking->setpositions( &seek, am_seeking_absolutepositioning, null, am_seeking_nopositioning ); with seek = 2 the callback called: hresult callback( imediasample * psample, reference_time * starttime, reference_time * stoptime, bool typechanged ) the problem buffer: has right size (getsize () == 691200 = 3 byte * 640 * 320) content "205", cannot (in format ever). suspicious it: parameters of "callback" starttime = 834168, stoptime = 1251251 , typechanged = 1. i tried showing graph @ graphedit https://msdn.microsoft.com/en-us/library/windows/desktop/dd390650%28v=vs.85%29.aspx?f=255&mspperror=-21472173

sql - Search multiple rows by space with PHP/MySQL -

i making search searches sql table multiple rows. example: | firstname | lastname | |----------------------| | john | doe | |----------------------| select firstname,lastname users firstname '%inputhere%' or lastname '%inputhere%' limit 10 when search full name (e.g. john doe ) no results appear because no 1 row has value. i there way separate search query spaces in order avoid this? similar gordon said, best solution use full text indexes. however, can this: select * users concat(firstname, " ", lastname) "john doe" you can feel free turn "john doe" "%john doe%" or "john doe%" . try here: http://sqlfiddle.com/#!9/d0042/5/0

javascript - Why does this regex match on angular fail only on Safari? -

i have following code on angular project. chrome , firefox works in safary causes , exception. var shour = "9:00:00 pm cdt"; var ehour = "12:00:00 cdt"; var conver_shour = shour.match(/^(\d+):(\d+)/)[0] + shour.match(/[ap][m]$/)[0]; var conver_ehour = ehour.match(/^(\d+):(\d+)/)[0] + ehour.match(/[ap][m]$/)[0]; console.log("shour: " + conver_shour); // answer should 09:00pm console.log("ehour: " + conver_ehour); // answer should 12:00am i try run on jsbin , plunkr , jsfiddle fail , cannot see cause. this exception error: null not object (evaluating 'shour.match(/[ap][m]$/)') $eval@ https://ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular.min.js:142:467 $apply@ https://ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular.min.js:143:193 https://cdnjs.cloudflare.com/ajax/libs/angular-ui-calendar/1.0.0/calendar.min.js:1:326 https://ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular