Posts

Showing posts from July, 2015

iot - Device onboarding in IBM Bluemix platform -

i have few questions regarding onboarding thing in ibm bluemix iot. questions follows: in scenario 1: let's need connect 1 thing bluemix platform, configure device type, device, authentication token, etc., connect device platform. possible in current situation. in scenario 2: if need connect 50 things platform, configuring each , every device device id, token, etc.? does bluemix provide discovery mechanism or other ways configure things automatically? you can programmatically register devices using bulk/devices operations. https://docs.internetofthings.ibmcloud.com/swagger/v0002.html#!/bulk_operations/post_bulk_devices_add also, recipe describes how register multiple iot devices. if using gateway, devices can auto registered: "gateway auto-registration" here other links may helpful. recipe talks in detail how register device in watson iot platform - https://developer.ibm.com/recipes/tutorials/how-to-register-devices-in-ibm-iot-foundation/ thi

telephonymanager - Android: How to calculate speed of the mobile internet(Upload speed) using signal strength by programatically -

in android, able find strength of signal using below code, protected int getsignalstrength(signalstrength signal) { string ssignal = signal.tostring(); string[] parts = ssignal.split(" "); int db = -120; // no signal measured when returning -120 db // if lte if (telephonymanager.getnetworktype() == telephonymanager.network_type_lte){ int ltesignal = integer.parseint(parts[9]); // check see if get's right signal in db, signal below -2 if(ltesignal < -2) { db = ltesignal; } } // else 3g else { if (signal.getgsmsignalstrength() != 99) { int strengthinteger = -113 + 2 * signal.getgsmsignalstrength(); db = strengthinteger; } } return db; } how calculate speed of mobile inte

coldfusion - Any better way to loop through a collection (struct) in CFML? -

please have @ code block below: <cfset index = 0 /> <cfloop collection="#anotherperson#" item="key" > <cfset index = index+1 /> <cfoutput> #key# : #anotherperson[key]# <cfif index lt arraylen(structkeyarray(anotherperson))> , </cfif> </cfoutput> </cfloop> <!--- result age : 24 , haar : blondes haar , sex : female , ort : hanau ----> now can please tell me how achieve same result without setting index outside , incrementing inside loop? if notice carefully, had write 2 more cfset tag , 1 cfif tag expensive code avoid comma (,) @ end of collection! ok, i'm showing 2 answers. first run on coldfusion 9. since other people might find thread , using lucee server or newer version of adobe coldfusion, i'm including one-liner uses higher order functions , runs on acf 2016. there's lot of syntactic sugar (like member functions) , functional programmi

argparse - Python parse_known_args with named arguments -

i pass arbitrary set of arguments in format --arg1 value1 python script , retrieve them in dictionary of kind {'arg1': 'value1} . want use argparse achieve that. function parse_known_args allows args, can retrieved simple list , not named. a better idea define one option takes 2 arguments, name , value, , use custom action update dictionary using 2 arguments. class optionappend(action): def __call__(self, parser, namespace, values, option_string): d = getattr(namespace, self.dest) name, value = values d[name] = value p.add_argument("-o", "--option", nargs=2, action=optionappend, default={}) then instead of myscript --arg1 value1 --arg2 value2 , write myscript -o arg1 value1 -o arg2value1 , , after args = parser.parse_args() , have args.o == {'arg1': 'value1, 'arg2': 'value2'} . this analogous use of list or dictionary hold set of related variables, instead of set of individ

angularjs - How to remove timestamp in Month View of Matt Lewis Boostrap Calendar? -

https://mattlewis92.github.io/angular-bootstrap-calendar/#?example=kitchen-sink mattlewis great calendar plugin got problem in monthview. month view shows timestamp , need omit in project. anyone has solution problem? draggable event (00:00) thats event want remove (00:00) . in previous version removed in updated 1 cant find put timestamp. to remove in older version here did. in calendarslidebox.html in template <a href="javascript:;" class="event-item" ng-click="vm.oneventclick({calendarevent: event})"> <span ng-bind-html="vm.$sce.trustashtml(event.title)"></span> <!-- (<span ng-bind="event.startsat | calendardate:(ismonthview ? 'time' : 'datetime'):true"></span><span ng-if="vm.calendarconfig.displayeventendtimes && event.endsat"> - <span ng-bind="event.endsat | calendardate:(ismonthview ? 'time' :

Android animate visibility change for two views at once -

i want hide 2 views (a viewpager , linearlayout ) @ once when button clicked. tried using android:animatelayoutchanges="true" , start hiding viewpager first , linearlayout , doesn't good. how can manually hide both views @ same time? have seen examples visibility of 1 view changed: myimageview.animate() .translationy(myimageview.getheight()) .alpha(0.0f) .setduration(300) .setlistener(new animatorlisteneradapter() { @override public void onanimationend(animator animation) { super.onanimationend(animation); myimageview.setvisibility(view.gone); } }); is there way chain 2 animate() calls of different views to trigger them simultaneously? edit: layout file, views want hide @ same time viewpager with id viewpager , linearlayout id ll_indicators: <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http

ios - Buttons in iPad not clickable -

Image
i creating buttons using data array. should following: override func viewdidload() { super.viewdidload() var xmargin:cgfloat = 20.0 var ytopmargin:cgfloat = 40.0 var = 1 let datatanks = ["button 1", "button 2", "button 3", "button 4", "button 5", "button 6"] index in 0...5 { let button = uibutton() button.tag=index var buttonframe = self.view.frame buttonframe.origin.x += xmargin buttonframe.origin.y += ytopmargin buttonframe.size.width = 200 buttonframe.size.height = 200 button.frame = buttonframe button.layer.cornerradius = 15.0 button.layer.shadowcolor = uicolor(red: 64/255, green: 64/255, blue: 64/255, alpha: 1).cgcolor button.layer.shadowopacity = 0.5 button.layer.shadowradius = 5 button.layer.shadowoffset = cgsizemake(2.0, 2.0) button.layer.zposition = 10 button.backgroundcolor = uicolor.l

itunesconnect - Explain in detail the reject of publication (itunes connect) -

anybody can explain in simple language need fix? please me understand... От: apple 4. 1 design: copycats design - 4.1 your app or metadata contains misleading content. specifically, app , metadata creates misleading association "my app name". we’ve attached screenshot(s) reference. next steps please remove or revise misleading content in app , metadata. in addition, recommend adjusting app name misleading element used descriptor, not part of product name. example, following style acceptable format names: greatapp - tagline "for app name" the tray attached application execution screenshots.

c# - Metadata attributes not being applied in Database-First Entity Framework -

i've spent 2 days scouring internet i'm doing wrong. every tutorial , question/answer here shows same solution : [metadatatype(typeof(people_metadata))] public partial class people { } public class people_metadata { [displayname("social security number")] public string ssn { get; set; } } the problem isn't working me. when crawl through properties people class in view, ssn property shows no attributes nor customattributes. can see people class has metadatatype attribute. i've tried separating classes separate files, same file, metadata class inside partial, 2 separate, setting metadata class partial, internal, sealed, public, everything. have literally no idea why isn't working me, when accounts ought to. please me. the people class below : public partial class people { public int id { get; set; } public string ssn { get; set; } public string name { get; set; } } it may worth emphasizing i'm trying see metadata attr

Scriplets in Liferay -

what can scriptlet <% resultrow row = (resultrow) request.getattribute(bookandauthor.search_container_result_row); book book = (book) row.getobject(); %> if want use value="${book.bookid} in code? <liferay-ui:icon-menu> <portlet:actionurl name="deletebook" var="deletebookvar"> <portlet:param name="bookid" value="<%=string.valueof(book.getbookid())%>" /> </portlet:actionurl> </liferay-ui:icon-menu> this little tricky thing should work. use variable hold value of constant search_container‌​_result‌​_row <c:set var="resultrowconstant" value="<%=bookandauthor.search_container‌​_result‌​_row%>" /> read attribute you should able use bracket notation access 'dynamic' properties: <c:set var="row" value="${[resultrowconstant]}"/> , hold resultrow object, access book object through ${r

How to send an HTTP request via MQL4 Expert Adviser? -

li have found code sends http request via mql4 expert adviser , modified personal ea logic. technically, works, there huge problem, sends requests on every tick. need change - 1 request per each signal. please me solve it! code example: #import "shell32.dll" // -------------------------------<begofimport>-section int shellexecutew( int hwnd, string lpoperation, string lpfile, string lpparameters, string lpdirectory, int nshowcmd ); #import // "shell32.dll" // -------------------------------<endofimport>-section if ( > b && 1 > orderstotal() ) { if ( ordersend( symbol(), op_sell, 1, bid, 10, 0, 0, 0, 0, 0, clrgreen ) ) orderselect( 0, select_by_pos, null ); shellexecutew( 0, "open", links, "", "", 1 ); } and how trading? is ea

curl - NodeJS install on Ubuntu -

i've installed nodejs on ubuntu, followihg instructions node site. went ok, kind of confused have done. i enterred following 2 commands: curl -sl https://deb.nodesource.com/setup_4.x | sudo -e bash - sudo apt-get install -y nodejs the second 1 clear me. first command do? curl command-line tool transfer data using urls. in case making request https://deb.nodesource.com/setup_4.x . the -l option (if read the curl manual page ) means if server responds redirect, curl try new location. the -s option means curl should silent, , not print errors or progress or other informational messages. the data curl receives printed on standard output. this output piped input sudo -e bash - command. sudo command runs specified command superuser root . option -e tells sudo preserve environment (e.g. $path environment variable etc.). the command sudo runs bash - , standard linux shell. trailing dash ( - ) tells bash should run login shell. bash command read s

eclipse - Getting java.lang.reflect.InvocationTargetException; nested exception is java.lang.reflect.InvocationTargetException: null -

maven not able identify testng.xml file. getting exception follows: caused by: org.apache.maven.surefire.testset.testsetfailedexception: suite file d:\selenium-workspace\web-automation\src\main\resources\regressionsuite.xml not valid file pom.xml <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <groupid>com.mycompany.automation</groupid> <artifactid>web-automation</artifactid> <version>0.0.1-snapshot</version> <name>mycompany.web.automation project</name> <description>mycompany.web.automation project</description> <dependencies> <dependency> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-resources

javascript - Cannot run globally installed node modules in Windows 7 -

note: have tried similar posts related issue , found nothing helpful me. hence posting this. issue : i'm trying install http-server package in windows 7 machine using npm install http-server -g , installation fine, when try execute using http-server command in command line i'm getting error saying, 'http-server' not recognized internal or external command, operable program or batch file. have tried same steps gulp , result same. i have tried setting node path as, set node_path=%appdata%\npm\node_modules; no luck. can shed light here? thanks, dave global packages needs installed using , administration console (cmd / run administrator)

spring - j_spring_security_check not invoked in tomcat -

i'm using tomcat 8.5.4 myfaces 2.2.10 , primefaces 5.3. local server works fine (tried run both standalone , eclipse) when open login screen , press login button following visible in logs: ...web.controller.logincontroller] - <validating login> ...antpathrequestmatcher] - <checking match of request : '/j_spring_security_check'; against '/external/**'> after transaction started , user validated against database expected. however when copied whole tomcat distribution remote server , deployed same application, j_spring_security_check not executed anymore: [org.springframework.faces.support.requestloggingphaselistener] - <entering jsf phase: restore_view(1)> [org.springframework.faces.support.requestloggingphaselistener] - <entering jsf phase: render_response(6)> [...web.controller.logincontroller] - <no error messages during validation> and after login screen reloaded. can me why there difference in behavior of same

php - After removing public from laravel controller not working? -

i have installed laravel 5 , localhost/laravel/public showing landing page of laravel. once created controller hello using php artisan command , created htaccess file below hello controller showing page not found. please me resolve error rewriteengine on rewriterule ^(.*)$ public/$1 [l] routes.php file route::get('/', function () { return view('welcome'); }); route::get('/hello', 'hello@index'); hello.php controller file <?php namespace app\http\controllers; use illuminate\http\request; use app\http\requests; class hello extends controller { public function index() { echo "test"; } } it funny true thing controller not depend on public folder. if copy files of public folder directory , includes other files index.php perfectly,surely work. require __dir__.'/../bootstrap/autoload.php'; /* |-------------------------------------------------------------------------- | turn on lights |

Azure WADPerformanceCountertable query returning all records while querying for specific interval -

how records specific interval azure wadperformancecounters table using java api? tried following code, giving records in table. seems timestamp based filters not working. tried partitionkey, timestamp, eventtick , timestamp column filtering same all. public static void main(string arg[]){ try { cloudstorageaccount storageaccount = cloudstorageaccount.parse(storageconnectionstring); cloudtableclient tableclient = storageaccount.createcloudtableclient(); cloudtable cloudtable = tableclient.gettablereference("wadperformancecounterstable"); long currtime = system.currenttimemillis(); date currentdate = new date(currtime); date endtime = getformattedtimestamp(currentdate); system.out.println("endtime:" + endtime); // calculation of start time db format in utc long offsetinmilliseconds = 1000 * 60 * 2; date starttime = getfo

c# - MongoDb indexes in ASP.NET MVC -

i'm working on asp.net mvc application of data stored in mongodb database. my collection contains documents stored (c# class example): public class metereddatareading { [bsonid] public int myid { get; set; } public string ediel { get; set; } public datetime createddate { get; set; } public datetime startoccurence { get; set; } public int version { get; set; } public datetime occurence { get; set; } [bsonrepresentation(mongodb.bson.bsontype.double)] public decimal quantity { get; set; } } now, when comes indexes, i'm bit lost. fields we're using is: ediel , occurence , createddate example query (pesudo) be: get metereddatareadings ediel = 1234 , occurence >= startdate , occurence <= enddate , createddate <= deadlinedate order occurence descending so, first pondering have is: how make indexes. should create single-field index 3 fields (ediel, occurence , createddate)? or should have @ creating maybe compound index?

mysql - How to insert Array[Byte] into binary datatype colunm with slick and mariadb? -

i attempted insert array[byte] binary datatype colunm scala , play framework , slick on mariadb. however, got error , data wasn't inserted. execution exception [mysqldatatruncation: data truncation: incorrect string value: '\x85\x09\x9b\x08%b...' column 'userid' @ row 1] the data uuid use java.util.uuid. conversion uuid array[byte] implemented uuidhelper.scala this code . how can insert array[byte] data database? my environment this. database: mariadb 10.1.16 mariadb [test]> show full columns user; +-----------+--------------+-----------------+------+-----+---------+-------+---------------------------------+---------+ | field | type | collation | null | key | default | | privileges | comment | +-----------+--------------+-----------------+------+-----+---------+-------+---------------------------------+---------+ | userid | binary(16) | null | no | pri | null | | select,insert,upda

Calculated date as column name SQL Server 2008 -

there numerous questions here naming column variable, don't believe duplicate of these, use calculation. i name column after previous month. expect work: select isnull(sum(case when datepart(mm,rc.datetime) = datepart(month, getdate()) -1 1 else null end),0) datename(mm, dateadd(mm, -1, getdate())) or readability: ... datename(mm, dateadd(mm, -1, getdate())) but not, incorrect syntax error. achievable? in advance given. try dynamic sql, declare @sql nvarchar(max) = '' set @sql = 'select isnull(sum(case when datepart(mm, rc.datetime) = ' + convert(varchar(10), datepart(month, getdate())) + ' - 1 1 else null end), 0) ' + datename(mm, dateadd(mm, - 1, getdate())) exec sp_executesql @sql

angularjs - Loading angular web application in the iOS UIWebView,it is not loading showing blank screen -

loading angular web application in ios uiwebview,it not loading showing blank screen. have inspected through mac browser , getting random errors. i.e angular not defined or angular module injection error. site working in web browsers , android web view. please me out

Google Cloud Speech use custom vocabulary -

i use google cloud speech recognizing speech in specific domain (healthcare). know allows add additional words vocabulary of recognizer (word hints), must done @ each api call. know if can done separately, creating priori own custom vocabulary?

jquery - trigger event with spacebar keydown for set duration -

i have animation should start on keydown set duration (3s or so). wondering if can bind animation function jquery keydown how can add duration or if there jquery plugin can handle this? the animation like: $('.slide1').slideup(); but need bind key-hold event triggered when holds down spacebar 3s. have no idea begin here. something - how trigger actual spacebar? $('spacebar').keydown( $('.slide1').slideup(); ), 3000) ? $(window).keypress(function (e) { if (e.keycode === 0 || e.keycode === 32) { e.preventdefault() console.log('space pressed') //do stuff here /*some animation*/.delay(3000);//plays animation 3 seconds } }); as others have commented, hard see looking without example code. sounds looking this.

javascript - Testing connected react component that needs params -

i'm trying test connected react component needs props.params.id call action creators. when try test component connected store "uncaught typeerror: cannot read property 'id' of undefined" reactdom.render( <provider store={store}> <router history={history}> <route path="/" component={app}> <indexroute component={postsindex}/> <route path="posts/:id" component={showpost}/> </route> </router> </provider> , document.queryselector('.container')); describe('connectedshowpost', ()=> { let initialstate = { posts: { postslist: postslistdata, post: postdata, error: '' }, comments: {showcomments: false}, auth: {authenticated: true} }; store = mockstore(initialstate); connectedshowpost = testutils.renderintodocument(<provider store={store}><connectedshowpost/></provider>); show

postgresql - Syntax error in create aggregate -

trying create aggregate function: create aggregate min (my_type) ( sfunc = least, stype = my_type ); error: syntax error @ or near "least" line 2: sfunc = least, ^ what missing? although manual calls least function : the greatest , least functions select largest or smallest value list of number of expressions. i can not find it: \dfs least list of functions schema | name | result data type | argument data types | type --------+------+------------------+---------------------+------ (0 rows) least , greatest not real functions; internally parsed minmaxexpr (see src/include/nodes/primnodes.h ). you achieve want generic function this: create function my_least(anyelement, anyelement) returns anyelement language sql immutable called on null input 'select least($1, $2)'; (thanks erwin brandstetter called on null input , idea use least .) then can create aggregate as cr

Image editing using ImageMagick PHP library -

Image
i developing image editor, write text on images on position x,y, need draw white image on image called white out. white image drawn @ position cord x, cord y , dynamic size of image width, height. write code not getting image on right coordinates , height width of image. here image rendering function. $image = new imagick('image.jpg'); $diagnose=$this->input->post('diagnoses'); $fontsize=$this->input->post('fontsize'); $fontstyle=$this->input->post('fontstyle'); $cordx = $this->input->post('posx'); $cordy = $this->input->post('posy'); $font_size = 20; // watermark text //$diagnose = "hello world.{newline}it's beautiful day."; $textlinesarray = explode("{newline}",$diagnose); // create new drawing palette $draw = new imagickdraw(); // set font properties $draw->setfont(

Swift: Set/Add Label color for files shown in finder -

i want set colored label files app processed (in swift), shown finder. don't know exact search term. "label" , "color" take me ui parts of osx. tipps such information? addition: found discussion localized color names. i'm able set or remove label, because guessed correct localized strings. idea, if there function or translation table? know few german , english names, problems chinese ones. ;-)

scala - Laziness of spark pipline -

i have question laziness of apache spark pipelines. understand spark transformations , actions. let's take example: the following snippet transformation returns rdd of filenames in folder. val filenames = sc.wholetextfiles("pathtodirectory").map( _ match { case (filename, content) => filename }) if execute action : filenames.count spark executing defined transformations including loading 'filename' rdd , 'content' rdd memory if 'content' not used is there better way write spark transformations such as: not used code (like 'content' rdd in previous example) not evaluated while executing actions? thank feedback.

unity3d - One or more APIs that are required for game services to work have been turned off in the API console -

i had implemented leaderboard in google play store console. after implementing when see play store console shows: one or more apis required game services work have been turned off in api console. recommend turn them on again ensure game working properly. also leaderboard not working. i had same issue, , when clicked turn apis button on, show error again after page refresh. i got in contact google , said few other developers experiencing issue , email me once had made progress finding out what's wrong now - because happened around time re-linking project google play games services, thought had messed up. being restless decided create new keystore file, , generate fresh sha-1 fingerprint. able enter newly generated code on api manager console, under credentials tab. for reason, worked; able sign via google , access high-scores page. might worth try?

How do I Create an Entire Web Form along-with its respected Code-Behind(.cs) file in Asp.Net on click of a button? -

i want create entire web-form on click of button along code-behind(.cs) file . can work asp.net love explore new things.just question popped in mind while working on new ! please if of great minds out there can please me out. thank you. instructions visual studio 2013 open web solution in solution explorer, right click web project choose "add web form" enter name form click ok see this link

twitter - spliting hashtags in a data.frame object with R -

i collecting twitter's hashtags. each tweet can include hashtags. tests <- c("xxxxxx #savethedate xxxxxx #histoire] xxxxxx #femmes xxxxxxx #ports", "xxxxxxxxxxxx", "xxxx #rock xxxxxx #nantes" , "xxxxxx #lvan xxxxxxx #nantes xxxxx #ilsepassetoujoursuntruc") library (stringr) hashtags <- str_extract_all(tests, "#\\s+") str (hashtags) ma results: str(hashtags) list of 4 $ : chr [1:4] "#savethedate" "#histoire]" "#femmes" "#ports" $ : chr(0) $ : chr [1:2] "#rock" "#nantes" $ : chr [1:3] "#lvan" "#nantes" "#ilsepassetoujoursuntruc" what expect: data.frame 1 hashtag row "#savethedate" "#histoire" "#femmes" "#ports" na .... what tried: hashtags_df <-as.data.frame(hashtags) hashtags[!lengths(hashtags)] <- na this replace

drools - Kie Workbench Execute Rules -

may question has been asked number of times not figure out actual solution going through them. have decision table in kieworkbench takes input 1 fact , sets fact. trying call rules invoking endpoint: http://localhost:8085/kie-server-6.4.0.final-ee7/services/rest/server/containers/instances/pocresult in header, have set content-type application/xml. <batch-execution lookup="ksession"> <insert out-identifier="subject"> <demo.pocfindresult.subject> <bcode> abc</bcode> <bgcode>xy</bgcode> <pcode>l0001</pcode> <subjecttype>ca</subjecttype> </demo.pocfindresult.subject> </insert> <fire-all-rules /> <get-objects out-identifier="result"> <demo.pocfindresult.result/> </get-objects> my decision table below: package demo.pocfindresult; //from row number: 1 r

eclipse - non-overrideing jaxb generation -

i trying generate bunch of xml annotated pojos. have xsd files in resource folder of project (they polycom rmx sdk, rmxsdkapiv7_8-ema_ema-v7_8_0_303). right click on each 1 (over 150 of them) go generate , click jaxb classes. pick project , give namespace finish wizard. after doing there warning newly generated classes override existing ones. problem, because commonly used objects have different definitions in different xsd files. when override happens whatever defined lost. so example, response_trans_conf.xsd defines as <xsd:element name="get"> <xsd:complextype> <xsd:sequence> <xsd:element ref="conference" minoccurs="0"/> </xsd:sequence> </xsd:complextype> </xsd:element> where schema file trans_conf_2.xsd defines as <xsd:element name="get"> <xsd:complextype> <xsd:sequence> <xsd:element ref="id"/&g

javascript - Regex match all strings containing a given series of letters or digits -

i have search box , need grab value of search , match div data-* value starting search value. cases: search value: 201 should match : data-year="2011" , data-year="2012" , data-year="2013" should fail : data-year="2009" , data-year="2001" this come far: \\b(?=\\w*[" + token + "])\\w+\\b token dynamic value search box. therefore need use regexp this working match value contain 2 or 0 or 1 (for understanding). 2009 valid match well. :/ i try add caret @ beginning in order match characthers @ beginning of world i'm missing here: ^\\b(?=\\w*[" + token + "])\\w+\\b the whole code is: var token = '200'; // should fail var tokentwo = '201'; // shoudl work var dataatt = $('#div').data('year').tostring(); var regexexpression ="^\\b(?=\\w*\\d*[" + token + "])\\w+\\d+\\b"; var regexpres = "^.*" + token + ".*$"; var regex =

php - Function mod_scorm_insert_scorm_tracks "Invalid parameter" -

Image
i have problem webservice function moodle callen " mod_scorm_insert_scorm_tracks " this function used inserting track information (i.e. star time) of user in scorm progress. part of estructure of function scoid= int attempt= int tracks[0][element]= string tracks[0][value]= string new php structe has this [tracks] => array ( [0] => array ( [element] => string [value] => string ) ) i have used 1 of examples had in website fine until got error <b>notice</b>: array string conversion in <b>c:\xampp\htdocs\otros\php-rest\curl.php</b> on line <b>247</b><br /> <?xml version="1.0" encoding="utf-8" ?> <exception class="invalid_parameter_exception"> <errorcode>invalidparameter</errorcode> <message>invalid parameter va

mysql - Retrieving connection status -

is there way status command called on connection. like: status 231073 where number id show processlist. in particular i'm interested in connection/client character sets. edit: status mean command call mysql shell (not show status ) you use following capture info of connections, say, @ start of app or @ anytime. instance max_allowed_packet change during client run lifecycle. so, in short, have in part of app startup. then have collected info on client connections, such character set settings. schema: drop table if exists connectionsnapshot; create table connectionsnapshot ( -- based off of (more or less) mysql 5.6 show create table information_schema.processlist; -- 3 columns @ least -- todo: compare same structure on mysql 5.7 id int auto_increment primary key, connid bigint unsigned not null, user varchar(16) not null, host varchar(64) not null, login varchar(100) not null, -- followed dreamt up: character_set_clie

Rails - creating place with weekdays in one form -

i created model place class place < applicationrecord has_many :open_days, dependent: :destroy end and model openday: class openday < applicationrecord belongs_to :place end i want able create record of place (what have simple textfields) day of weeks (and hours) place opened at. my current form: <%= form_for(@place) |f| %> <%= f.label(:name) %> <%= f.text_field(:name, placeholder: "place's name", class: "form-control") %> <%= f.label(:street) %> <%= f.text_field(:street, placeholder: "street", class: "form-control") %> <%= f.fields_for :open_days |open_day| %> <%= open_day.text_field :day %> <% end %> .... <% end %> my new controller def new @place = place.new 7.times @place.open_days.build end end i decided go table (code below) have absolutely no idea how create form model inside existing form @pla

angularjs - Sort Table by the order of the Array not Alphabetical -

like in title mentioned want sort table order of array , not normal way -> alphabetical. array constants. .constant("appconfig", { "status": [ "in work", "review", "again in edit", "finished" ] }) //in html standard code sorting atm alphabetical <th> <a href="#" ng-click="sorttype='status.status';sortreverse = !sortreverse"> status <span ng-show="sorttype == 'status.status' && !sortreverse" class="fa fa-caret-down"></span> <span ng-show="sorttype == 'status.status' && sortreverse" class="fa fa-caret-up"></span> </a> <select class="form-control" ng-model="select.status.status"> <option value="">

excel - How to merge 3 columns to 1 new column with VBA -

i'm trying merge 3 column have text (string) in them lets column this: hi " ? hi " ? hi " ? column b: peter mom dad column c: dk jp gb i want out put in column d be: hi peter" dk? hi mom" jp? hi dad" gb? my own code fare is: sub mergecolumns() dim lr long dim cell range, rng range lr = range("a" & rows.count).end(xlup).row set rng = range("a1:a" & lr) each cell in rng cell.offset(0, 4) = left(cell.value, 2) & range(b1:b) & mid(cell.value, 4, 13) & range(c1:c) & right(cell.value, 1) next cell range("c:c").columns.autofit end sub i kind of think bug @ range(b1:b) , range(c1:c) have no idea how insert column tried "concatenate" messed up. i use pair of replace functions on range.value2 property . option explicit sub wqwewuy() dim rw long, lr long activesheet lr = .cells(.rows.co

language agnostic - Is floating point math broken? -

0.1 + 0.2 == 0.3 -> false 0.1 + 0.2 -> 0.30000000000000004 why happen? binary floating point math this. in programming languages, based on ieee 754 standard . javascript uses 64-bit floating point representation, same java's double . crux of problem numbers represented in format whole number times power of two; rational numbers (such 0.1 , 1/10 ) denominator not power of 2 cannot represented. for 0.1 in standard binary64 format, representation can written as 0.1000000000000000055511151231257827021181583404541015625 in decimal, or 0x1.999999999999ap-4 in c99 hexfloat notation . in contrast, rational number 0.1 , 1/10 , can written as 0.1 in decimal, or 0x1.99999999999999...p-4 in analogue of c99 hexfloat notation, ... represents unending sequence of 9's. the constants 0.2 , 0.3 in program approximations true values. happens closest double 0.2 larger rational number 0.2 closest double 0.3 smaller rational number 0.3 . sum

undefined behavior - C - function returning a pointer to a local variable -

consider following code. #include<stdio.h> int *abc(); // function returns pointer of type int int main() { int *ptr; ptr = abc(); printf("%d", *ptr); return 0; } int *abc() { int = 45500, *p; p = &i; return p; } output: 45500 i know according link type of behavior undefined. why getting correct value everytime run program. every time call abc "marks" region @ top of stack place write of local variables. moving pointer indicates top of stack is. region called stack frame. when function returns, indicates not want use region anymore moving stack pointer originally. result, if call other functions afterwards, reuse region of stack own purposes. in case, haven't called other functions yet. region of stack left in same state. all above explain behavior of code. not necessary c compilers implement functions way , therefore you should not rely on behavior .

javascript - The same graph is repeated in my view and upon page refresh, the graph changes -

this loop in controller. trying create , display chart using angular js unable so. same graph repeated in view , upon page refresh, graph changes. want response "options" , "votes" json. mistake making? for (var = 0; < response.response.options.length;i++) { labels.push(response.response.options[i].options); data.push(response.response.options[i].votes); $scope.labels = labels; $scope.data = [ data ]; this json. have multiple calls , multiple jsons called api. { "response": { "poll": { "id": "17", "story_id": "28346", "user_id": "32425", "question": "who's favorite actor?", "status": "1", "docs": "1473121969" }, "options": [ { "