Posts

Showing posts from September, 2015

Proper way to return a string in C -

i have following code: char* get_address_string(package* pkg){ char *c; sprintf(c, "%02x:%02x:%02x:%02x:%02x:%02x", pkg->address[0], pkg->address[1], pkg->address[2], pkg->address[3], pkg->address[4], pkg->address[5]); return c; } the code works fine. however, know not proper way return string in c. receiving warning "c used uninitialized in function". what proper way write function in c? c pointer, no memory allocated. return value ok, that's how can done in c. but need allocate memory.

elixir - "dialyzer: Analysis failed with error.." (dialyzer bug? or wrong use of map-type?) -

working on simple application in progress of learning elixir, ran minor roadblock when checking types dialyzer. running dialyzer on code results in analysis failed error... far dialyzer has given me warnings , not errors when violate type spec's, have no clue error about. trying narrow down problem, made ultra simple function performs offending return value. @spec blabla(integer) :: %{atom => any} def blabla(1) %{:error => 'wrong input (us-state)'} end def blabla(2) %{ location: 'new york city, central park, ny', temp_c: '23.3', visibility_mi: '10.00', weather: 'a few clouds', wind_dir: 'north', wind_kt: '0' } end when running dialyzer on following error proceeding analysis... =error report==== 14-jul-2015::17:26:55 === error in process <0.31.0> exit value: {function_clause,[{erl_types,t_form_to_string,[{type,12,map_field_assoc,{type,12,atom,[]},{type,12,any,[]}}],[{

go - syntax error: unexpected name, expecting semicolon or newline -

i don't understand why code has syntax error. package main import ( "fmt" "os/exec" "time" ) func ping(curl_out string) endtime int64 { try_curl := exec.command("curl", "localhost:8500/v1/catalog/nodes") try_curl_out := try_curl.output() try_curl_out == curl_out { try_curl := exec.command("curl", "localhost:8500/v1/catalog/nodes") try_curl_out := try_curl.output() } endtime := time.now().unix() return endtime } func main() { run_container := exec.command("docker", "run", "-p", "8400:8400", "-p", "8500:8500", "-p", "8600:53/udp", "-h", "node1", "progrium/consul", "-server", "-bootstrap") container_id, err := run_container.output() if err != nil { fmt.println(err) return } run_curl := exec.co

php - the curl link is not sent -

create message function not working form execute need go sms api link , not getting called please me fix this <?php include_once('inc/class.simple_mail.php'); include_once('inc/gump.class.php'); include_once('mail-config.php'); // check data $isvalid = gump::is_valid($_post, array( 'first-name' => 'required', 'last-name' => 'required', 'phone-number' => 'required', 'email-address' => 'required|valid_email', 'address' => 'required', 'city' => 'required', 'zip-code' => 'required', )); if($isvalid === true) { // submit mail $mail = new simplemail(); $mail->setto(your_email_address, your_company_name) ->setsubject('new car rental request') ->setfrom(htmlspecialchars($_post['email-address']), htmlspecialchars($_post['first-name'].' '.

java - Wrong 2nd argument type found 'com.technology.computer.mit.ctechmit.Menu_pageFragment' required 'Android.app.Fragment' -

i have written code fragment replacement on click of send button. code shows error saying wrong 2nd argument type found 'com.technology.computer.mit.ctechmit.menu_pagefragment' required 'android.app.fragment' in below line under word 'newfragment' transaction.replace(r.id.fragment_container, newfragment); when searched solution online says extend fragmentactivity instead of extending fragment. if home_activity (one has no errors) shows many errors. can please suggest me solution this? below home_pagefragment in sendmessage method replaces menu_pagefragment on click of send method in layout: package com.technology.computer.mit.ctechmit; import android.app.fragmenttransaction; import android.support.v4.app.fragment; import android.os.bundle; import android.view.layoutinflater; import android.view.view; import android.view.viewgroup; /** * placeholder fragment containing simple view. */ public class home_pagefragment extends fragment { pu

SAP BPC EPM dynamic table member -

Image
i'm quiet new bpc , struggle right looking easy. have table splitted in 3 parts. in first 2 data coming cube in 3rd part (in red), data calculated excel formulas formula of cell d33 :(=d26 - d40) .... work long dimension doesn't move, if add new member formualas , number shifted , don't match anymore.. solution solve , stay dynamic ? tried several option epmformattingsheet , excel formulas, local member , formulas :((( has idea on how solve ? thank e. local members formulas should work case

Private Variables vs Properties in C# -

this question has answer here: why use private members use public properties set them? 5 answers why use simple properties instead of fields in c#? [duplicate] 5 answers i teaching myself c# , curious need declaring private member variables accessed public properties. textbook i'm using says sake of encapsulation, why need private variables begin if properties can changed depending on 'get' or 'set' functions? here's example: namespace practice { struct person { private int id; private string name; public int id { {return id;} set {id = value;} } public string name { get; set; } public int age { get; set; } } class program { static void main(string[] args) { pers

c# - how to call a method in a windows from another method in asp.net web-api -

i have c# solution has 2 projects: windows forms project (desktop) , asp.net web-api project (rest service). trying call method enablemachine() in form1.cs post() method in valuescontroller.cs , though referenced namespace shows errors. if define enablemachine() static works, cannot because need instantiate object within method. ideas on how solve problem ? in advance ! using system; using system.collections.generic; using system.linq; using system.net; using system.net.http; using system.web.http; using restlayer.models; using validatorconnector; namespace restlayer.controllers { public class valuescontroller : apicontroller { // post api/values public void post() { ... } } } using system; using system.collections.generic; using system.componentmodel; using system.data; using system.drawing; using system.text; using system.windows.forms; using log4net; namespace validatorconnector { pub

mocking - JMS Queue testing with spock -

i using activemq , trying send , whether possible test if own created mock sent message queue. using activemq & want automate test where, mock send message queue , spock make sure message has been sent. you can first create queuebrowser , using enumeration number of messages. let loop run till enumeration object has elements. check message in loop, if there. code should somehow looks this queuebrowser qbrowser = session.createbrowser(queuename); enumeration messages = qbrowser.getenumeration(); while (messages.hasmoreelements()) { textmessage message = (textmessage) messages.nextelement(); string a=message.gettext(); if (message there) { return true; } } cheers :)

sql - Can not use ORDER BY when creating materialized view with SDO geometry in Oracle 11g -

i using oracle 11g 2.0.1.0 spatial , oracle sql developer on client. have table places primary key id , view coordinates tw columns: id referencing post in places , , sdo geometry point . i want create materialized view following sql: create materialized view placecoordinates nocache noparallel build immediate using index refresh on demand complete disable query rewrite select places.id, coordinates.point places left outer join coordinates on places.id = coordinates.id order places.id this gives me error: ora-30373: object data types not supported in context no matter sort on (even if silly 1 ) same error. however, if remove order by statement works fine. works fine sorting if ordinary select without creating materialized view. why wouldn't able sort? there anyway around problem? the key thing order in materialized view makes no sense. under covers, materialized view table gets automatically updated when tables based on updated. being table

c# - Output table with nested repeaters -

i nest 2 asp.net repeaters output content of table (dynamic number of columns). table contained in sqldatasource object. i know how gridview, bind events controllers in different cells aswell. how go doing this? ie for rows columums output cell attempt: <asp:repeater id="repeater1" runat="server" datasourceid="sqldatasource1"> <headertemplate> <asp:repeater id="repeater2" runat="server" datasourceid="<%# (datarowview)container.dataitem %>"> <itemtemplate><%# ((dataitemcontainer).dataitemcontainer)%></itemtemplate> </asp:repeater> </headertemplate> </asp:repeater>

asp.net mvc 4 - itextsharp advance pdf generation by configuration xml -

i generating pdf using itextsharp.i got many sample code in google how can configure pdf setting required generate pdf like var doc = new document(pagesize.a5); var doc = new document(new rectangle(100f, 300f)); these setting wanted set config xml file , read xml , generate pdf on fly. professional sample example code available?plz help..

excel - Finding if a value is located in a range of cells in a corresponding column, to a row with the same value as a given cell in a given row -

Image
given column contains directory paths, , column b contains actions on these paths; i'd resultant cell contain specific string if specific string located in column b (per column a). granted can sort column, believe can use offset , know how locate ending index of cells can search range returned offset . for example: path operation /share/admins accessed /share/admins removed /share/admins added /share/admins changed /share/network accessed /shared/projects accessed in case, want search path unique value (in case /share/admins , /share/network , , /shared/projects ), , given range in path , i'd search corresponding operation , , if operation matches removed , added , changed exists, i'd cell value write ; , if values aren't found, "read". in case, expect column (with header result ) read: path operation result /share/admins accessed write /share/admins remov

jquery - Javascript : Change img src After some interval of time -

this question has answer here: how delay function call 5 seconds? [duplicate] 2 answers guys don't know how add interval of time in javascript. know how add time before changing src of image. code w3schools document.getelementbyid("image").src = "http://www.w3schools.com/js/landscape.jpg"; <!doctype html> <html> <body> <img id="image" src="http://www.w3schools.com/js/smiley.gif" width="160" height="120"> <p>the original image smiley.gif, script changed landscape.jpg</p> </body> </html> jsfiddle settimeout(function() { document.getelementbyid("image").setattribute("src", "http://www.w3schools.com/js/landscape.jpg"); }, 5000); <img id="im

c# - How to invoke a generic method with weak-typed parameter -

i've got generic interface , bunch of classes implement it. here simplified example: interface iprinter<in t> { void print(t args); } class intprinter : iprinter<int> { public void print(int args) { console.writeline("this int: " +args); } } class stringprinter : iprinter<string> { public void print(string args) { console.writeline("this string: " + args); } } i have dictionary of classes generic argument's type key (i use reflection populate it): private readonly dictionary<type, object> printers = new dictionary<type, object> { {typeof (int), new intprinter()}, {typeof (string), new stringprinter()} }; now recive instance of list<object> input, contains bunch of parameters of arbitrary type. each parameter want pick object, implement appropriate interface , call print method. not sure how implement that. var args = n

Not sure about instance variable scenario in Typescript -

here's class (ignore console.logs left on attempt debug) import fs = require('fs'); export interface answer { order: number, text: string } export class config { answers:answer[]; timestamp_column: string; name_column: string fromjsonfile(filename: string) { var filestring = fs.readfilesync(filename); this.answers = json.parse(filestring.tostring()); console.log(this.answers); } mapanswertonum(answer:string):number { console.log(typeof this.answers); (var in this.answers) { if (a.text == answer) { return a.order;} } (var in this.answers) { console.log(a.text); } console.log(typeof this.answers); throw new error(`invalid response string ${answer}`); } } and here's invocation: import { config } './config'; var config = new config(); config.fromjsonfile("./csvconfig.json"); ... var respints:number[] = respstrings.map(this.config.mapanswertonum); ... the question: ins

How to show a prompt window on setting the cursor on a button with JavaFX? -

i want show prompt window while user set cursor on button. asking exactelly of how action on setting cursor on controller button, don't need butn.setcursor(cursor.hand); how can , thanks. you can use button.setonmouseentered event show textinputdialog , wait user input , use it. here small example, shows textinputdialog , prints data entered user. import javafx.application.application; import javafx.scene.scene; import javafx.scene.control.button; import javafx.scene.control.textinputdialog; import javafx.scene.layout.stackpane; import javafx.stage.stage; import java.util.optional; public class main extends application { public static void main(string[] args) { launch(args); } @override public void start(stage primarystage) throws exception { stackpane box = new stackpane(); button button = new button("hover on me !!!"); textinputdialog dialog = new textinputdialog("itachi"); dialog

javascript - how to sort elements in the array: jQuery -

summary: have table rows added each btn click. using jquery-ui sortable() function move/sort rows. let have this: <tbody> <tr><td>a</td></tr> <tr><td>b</td></tr> <tr><td>c</td></tr> <tr><td>d</td></tr> <tr><td>e</td></tr> <tr><td>f</td></tr> </tbody> issue: can move rows using sortable() function. not able update elements in rows. using $('.report-configuration .configuration-table tbody').sortable({ 'change': function(event, ui){ arr=['a','b','c','d','e','f']; console.log(ui); var tmp = arr.splice(ui.originalpostion);//i missing logic here arr.splice(ui.postion, tmp); console.log(arr); }}); i looking logic update positions in array. after sortable has ended html changed. jquery can select changed html , determin

css - Safari shows bigger font-size in landscape mode -

in current responsive project have issue when using iphone in landscape mode, font-size lot bigger , introducing -webkit-text-size-adjust: none; didn't (see jsfiddle below). i use these definitions in project: <meta name="viewport" content="width=device-width, user-scalable=yes"/> and breakpoints @media screen , (max-width: 35em) , (orientation:portrait) { ... } @media screen , (max-width: 47em) , (orientation:landscape) { body { -webkit-text-size-adjust: none; } } @media screen , (max-width: 35em) , (orientation:portrait), screen , (max-width: 47em) , (orientation:landscape) { ... } you can directly test @ result page of jsfiddle . <div class="test">this test</div> <div class="test">this test</div> <div class="test">this test</div> <div class="test">this test</div> <div class="test">this test</div> and @vie

java - Most efficient data structure for sorting an ArrayList by categorical factors -

i have created object, let's call eventobject, hold results of sql query. objects aggregated single arraylist. trying develop method @ each eventobject in arraylist, , if equals given value of categorical factor, copies group. for example, if timestamp value eventobject1 falls on sunday, copy object sunday level of weekday factor; if same timestamp falls in month of may, copy may level of month factor well, etc. i stuck type of data structure(s) efficient sorting. not know how many eventobject fall level of given factor, , number of factors analyzed dependent upon id pass method. required have k factors, each known number of levels; , each level can have number of eventobjects after soring occurs. should attempt hold factors in single arraylist? requires 3 dimensional structure. more prudent create separate data structure each factor?

php - I want to print value in $s1 $ s2 $s3 instead of variable name -

i want print value in $s1 $ s2 $s3 instead of variable name. when value sent in database there goes variable names $s1,$s2,$s3 etc not values in them. <?php echo $s1=$_post['1']; echo $s2=$_post['2']; echo $s3=$_post['3']; echo $s4=$_post['4']; $proo=$_post['proo']; $semm=$_post['semm']; $shii=$_post['shii']; $secc=$_post['secc']; $subb=$_post['subb']; if($btnn) { $sele=mysql_query("select * `sconfirmed` `pro`='$proo' && `sem`='$semm' && `section`='$secc' && `shift`='$shii' "); $count=mysql_num_rows($sele); $b='1'; { $a='1'; $s='$s'; while($ro=mysql_fetch_array($sele)) { $pic=$ro['pic']; $sname=$ro['sname']; $rollno=$ro['rollno']; $sfather=$ro['sfather']; $phone=$ro['

php - Application does not do anything when inserting values to MYSQL using Android -

i trying develop , android application can insert values in mysql database using android application. not able values stored in database. have followed few tutorials , tried till have had no luck. could 1 let me know code have used correct. the have used below code insert values values mysql database package com.example.androidsql.mysqlsample01activity; import android.os.asynctask; import android.support.v7.app.actionbaractivity; import android.os.bundle; import android.util.log; import android.view.menu; import android.view.menuitem; import android.view.view; import android.widget.edittext; import android.widget.textview; import android.widget.toast; import org.apache.http.httpentity; import org.apache.http.httpresponse; import org.apache.http.namevaluepair; import org.apache.http.client.clientprotocolexception; import org.apache.http.client.httpclient; import org.apache.http.client.entity.urlencodedformentity; import org.apache.http.client.methods.httppost; import org.apac

javascript - Return -1 if JSON Array is NULL works only in some data -

i wanted to: return -1 if data (array) null or empty if data not null , if array has rain_value property wanted 2nd index value of array based on length below snippet of code: success: function (data) { //console.log(data); $.map(data, function (e) { var max = -1; var dev_id = e.dev_id; var data = e.data; var r; if (data) { (var j = 0; j < data.length; j++) { r = parsefloat(data[j].rain_value) || 0; arr[j] = parsefloat(r); } } if (arr.length) { max = arr[1] * 4; //max = math.max.apply(math, arr) * 4; } (var k = 0; k < len; k++) { var jsonobj_device_id = jsonobj.features[k].properties.device_id; if (jsonobj_device_id == dev_id) { var namer = "rain_intensity"; var rainvalue = max; jsonobj.features[k].properties[namer] = rain

ios - GMSMapView compass button not visible -

i using google maps ask ios app using swift. have added map(gmsmapview) in story board , trying compass button mapview.settings.compassbutton = true but unable see compass button. if navigation bar visible, compass button behind it. make appear below navigation bar need add padding top side of map view. objective-c uiedgeinsets mapinsets = uiedgeinsetsmake(80.0, 0.0, 0.0, 0.0); gmsmapview *mapview; mapview.padding = mapinsets; swift let mapinsets = uiedgeinsets(top: 80.0, left: 0.0, bottom: 0.0, right: 0.0) mapview.padding = mapinsets

mod rewrite - RewriteRule assistance -

i maintain (system side) application utilizes ibm htp server , websphere application server (standalone). team wants change made can't figure out need do. the problem - users enters http://my-site.com/customerfiles/client/subdir/file.pdf his/her browser. site allows file directly sent user, bypassing application code. basically, pdf file gets sent browser , opened. application team application control , send file (if user authorized retrieve file). right now, customer can access other customers' files. they above url redirected siteinfo getafile?cust=client&filetype=subdir&file=file.pdf i have test ihs system can play , have coded rewriterule ^/customerfiles/(\w+)/(\w+)/(\w+)$ http://%{http_host}/xs2/getafile?cust={$1}&filetype={$2}&file={$3} [r=301,l,qsa] i enabled rewritelog feature , these messages being issued: 10.17.1.163 - - [14/jul/2015:07:37:02 --0500] [10.17.1.163/sid#474ff0] [rid#6c1620/initial] (3) applying pattern '^

ios - How to make part of UITextView uneditable and clickable, with properly shown emojis? -

Image
i have uitextview in app, , should contain uneditable , clickable suffix (categorystring), facebook 'feeling, watching, eating,...' status . shouldchangetextinrange , textviewdidchange methods this: func textviewdidchange(textview: uitextview) { dispatch_async(dispatch_get_main_queue(), { textview.selectedrange = nsmakerange(self.globalint, 0) //on long press backspace, goes wrong //nsmutableattributedstring, clear textview //and set it's text categorystring again: if(!textview.text.hassuffix(self.categorystring)){ self.globalint = 0 self.posttextview.font = constants.fonts.posttextcategory textview.text = self.categorystring textview.selectedrange = nsmakerange(0,0) } }) self.mymutablestring = nsmutableattributedstring(string: self.posttextview.

GenyMotion and VirtualBox 4.3.30 Yosemite -

i'm getting message using genymotion - genymotion, “unable load virtualbox engine.” i updated virtualbox 4.3.28 virtualbox 4.3.30 morning , seems causing this. reinstalled both, scratch, swapping installed first each time. restarted virtualbox terminal - no luck! have rolled virtualbox 4.3.28 , seems fine now, wondering of others having issue , if they're workaround (other not updating virtualbox 4.3.30). edit (05/08/15) i have updated following , works fine virtualbox 5.0: android studio genymotion plugin version 1.0.5 updated genymotion 2.5.2 updated virtualbox 5.0 further information can found here (30th july 2015 entry): https://www.genymotion.com/#!/release-notes you not alone ~~~~~ have rolled virtualbox 4.3.12

database - VB.NET and MySQL query -

how can values mysql database usin while loop? sry bad english , i'm new in vb.net please not insult me because not know vb.net, i'm trying learn, i'll try explain need. :) lets go: we know emailaddress real email address, first query must query1 = "select id database.table_users email='" & emailaddress & "'" now know query1 return value id table_users . need create new query query2 = "select friend_id database.table_friends user_id='" & query1 & "'" okay, query2 return friend_id table_friends . 1 more query query3 = "select displayname database.table_users id='" & query2 & "'" query3 must return displaynames of users got in query2 . example: first need query id table_users email=emailaddres need query friend_id table_friends user_id=id after nedd query displayname table_users id=friend_id *these examples , not correct can see :d

migration - php code coverage on request execution -

i working on php migration project complex , huge . i want know there tool me see line of codes got executed when 1 page rendered on browser. me find codes in use , check business logics & migrate 1 required. like code coverage report in unit test. there available know code executed when particular request executed. if enable xdebug profiler can use code coverage data , use later identify unused code. please find more details here: http://xdebug.org/docs/code_coverage if need formatted in nicer way can use php-code-coverage lib phpunit using generate reports. can find example how here: https://github.com/sebastianbergmann/php-code-coverage

javascript - Mark the radio button checked after clicking the anchor tag -

when click on anchor tag, radio button inside must marked checked. data coming through loop there large amount of data. here code: <a class="toggleanchor sectionsdiv accordion-toggle <?php if($i!=1){ ?> collapsed <?php } ?>" data-toggle="collapse" data-parent="#accordion" href="#collapseone<?=$i;?>"> <div class="col-md-12 col-sm-12 col-xs-12"> <div class="form-group col-md-4 col-sm-4" style="padding:0;"> <div class="checkbox checkreward"> <label> <input type="radio" name="radio" <?php if($i==1){ ?> checked <?php } ?> class="form-control radio-height" id="radioid<?=$z;?>" value="<?=$reward['amt'];?>"/> $<?=$reward['amt'];?> <input type="hidden" id="giftval-&

perl - Index a continuous stream of documents in SOLR -

i need index thousands of documents continuously solr. documents picked redis queue ( ssdb) , indexed solr whenever use library function $solr->add() there new http call made solr. there better mechanism index bulk items solr ? there couple of points should consider: first, suggest de-couple process of pulling data queue , indexing solr. mean have process pull data queue, massage correctly , write out solr json file. file should have multiple records; number determined size of each record , total number of items have in each batch. play around different settings. then have process index files, can have multiple processes indexing these solr well. ensure de-queuing process not hung on indexing items solr; not quick. next; evaluate library of choice. if have data local solr server, can pass path via request index or can stream on network. first approach faster, requires store json locally on solr box. finally, review committing strategy. kind of delay acceptabl

sql - Find all NULL values and set them to lowest unused number using MySQL query -

i want find all null values in column parameter_id , set them lowest unused parameter_id . i have query find lowest unused parameter_id , know how list of null values. select min(t1.parameter_id)+1 table t1 not exists (select * table t2 t2.parameter_id = t1.parameter_id+1) i can list of rows parameter_id=null , make query find current lowest unused parameter_id , update parameter_id lowest unused number. since table has 50.000 rows, approach create thousands of queries (50.000 * 2 per row). is there way run "single query" find parameter_id=null , update them current lowest unused parameter_id ? here table decrtiption (mysql 5.5): id (int) primary key, auto_increment parameter_id (int) default null sample data: # id, parameter_id 1, null 2, 1 3, null 4, 5 5, 3 desired result: # id, parameter_id 1, 2 2, 1 3, 4 4, 5 5, 3 edit: i distilled want single query. need run query until there 0 rows affected update. update `table` set parameter_id=

php - Laravel artisan script memory footprint -

in application (laravel 5.1) have different commands simple: get ip rabbitmq attempt establish connection ip update db entry since can take while connect ip (up 30sec). forced launch multiple instances of script. i've created console commands launched systemd. once went in production quite surprised amount of memory these scripts consuming. each script (as reported memory_get_usage ) using 21mb on startup. considering ideally need run 50-70 on scripts on same time it's quiet big issue me. just test i've installed clean laravel 5.1 project , launched default artisan inspire command, php reported 19mb. is normal laravel or missing crucial here?

javascript - Split string with tags using regular expressions -

i split kind of texts in following manner: "string1<%string2%>string3" => [string1, <%string2%>, string3] "string1<%string2%><%string3%>" => [string1, <%string2%>, <%string3%>] how can done regular expressions? here way: alert("string1<%string2%><%string3%>".split(/(<%.*?%>)/).filter(boolean)); the (<%.*?%>) regex matches <%...%> -like entities, , captures them preserved in resulting array. alternative regex can (<%(?!%>).*?%>) . with .filter(boolean) able rid of empty array elements. in case there no spaces inside <%...%> , can use (<%\s+%>) regex.

How to give sort_by name in where condition in rails -

i have included given code @operator_selected = operator.where(:id => selected_operator).map{|opr| opr.name} i want show operator sort name. please guide me how this. try this @operator_selected = operator.where(:id => selected_operator).order(:name).map{|opr| opr.name}

how to add mit-scheme for sicp in linux -

this question has answer here: pros , cons of mit scheme , drscheme studying sicp [closed] 3 answers i studying structure , interpretation of computer programs (sicp).i want know mit-scheme used course.thanks in advance. follow link: http://ftp.gnu.org/gnu/mit-scheme/stable.pkg/9.2/mit-scheme-9.2-x86-64.tar.gz http://www.gnu.org/software/mit-scheme/documentation/mit-scheme-user/unix-installation.html helpful solve problem

Android: How do I correctly implement Parcelable for Objects with ArrayList<T> with custom types? -

edited refelect qbix's answer i have class holds data , used passing around data between activities. has couple of fields, string, 2 more fields of type arraylist , arraylist when try data intent back, getting exception: java.lang.runtimeexception: parcel android.os.parcel@53614d6c: unmarshalling unknown type code 7471184 @ offset 156 i think problem lies somewhere having arraylist not correctly handled. how correctly implement parcelable arraylist custom types? here classes: public class openingperiod implements java.io.serializable{ private int openday; private string opentime; private int closeday; private string closetime; public openingperiod() { } public openingperiod(int closeday, string closetime, int openday, string opentime) { this.closeday = closeday; this.closetime = closetime; this.openday = openday; this.opentime = opentime; } // here come getters , setters.... } and edited parcelable, still crash

angularjs - Add extra field to iframe in grid view update table data option in kendo UI? -

think database have 6 fields. show 4 fields , it's data in grid using kendo ui . add toolbar grid(buttons add , edit data). when click edit button iframe show 4 fields show in grid. need add field iframe . can in kendo ui ??? if can suggest way ?? i using angularjs project... finally found answer this..... i feel had search wrong way.. the answer in here ... answer

c# - Setting specific COM HRESULT value from .NET -

i'm creating .net assembly needs com callable e.g. vb6 etc. most of stuff works fine - i'm fine-tuning error handling right now. what i'd create specific hresult values exceptions - e.g. use values 0x88880001 etc. exception cases. i'd use common "prefix" (like 0x8888 ) , add internal error codes (running decimal 1001 up) number. so internal error 1001 should become hresult = 0x888803e9 , forth. i have own custom .net exception class, , know can set protected hresult property on base applicationexception class - somehow can't manage "prefix" plus error code work.... using system; public class customexception : applicationexception { public customexception(string message, int errorcode) : base(message) { base.hresult = (uint) 0x88880000 + errorcode; } } no matter try here - cannot int value (for base.hresult , int ) represents 0x888803e9 stored base class... what missing here?? the c# compiler

vbscript - Script does not wait for statement to finish and starts exectuing next line -

i having scenario if application installed, first uninstall older version, install new version. i have written following piece of code in batch file using vbscript: set wshshell = wscript.createobject( "wscript.shell" ) set fso = createobject("scripting.filesystemobject") path="c:\program files\mysetup\my app 3.5" 'path folder exists = fso.folderexists(path) if (exists) wshshell.run "msiexec /qb /x {3d5d4357-217c-49ba-a8e8-00907d631f05} " end if wshshell.run "msiexec /qb /i c:\build\" & msifilename i facing issue when execution goes if (exist) block, lets assume application installed, goes inside if block , start uninstall application , runs asynchronously , start executing next line (installing new version) , cause problem "another installation in progress". all want once goes uninstalling application, should wait until finished, go next line execution (installing newer version).

mysql - sql count by value stack by different value pt.2 -

previous question i have database this: table1(article) id | name | description | cat_id 0 | val1 | desc1 | 1 1 | val2 | desc2 | 2 2 | val3 | desc3 | 1 3 | val4 | desc4 | 2 4 | val5 | desc5 | 1 5 | val6 | desc6 | 2 table2(categories) id | name 0 | shoe 1 | glove 2 | hat it should return: articles_connected | categorie_name 3 | glove 0 | shoe 3 | hat i thought solution: select count(category.id) article_amount, category.name article_table article, category_table category category.id = article.cat_id group category.id but code isn't correct. sql query doesn't count zero'd index count values larger 0. how change following query count 0'd index ? select count(category.id) articles_connected, category.name arcticle article, categories category category.id = arcticle .categorie

java - JWT token encryption and transferring in http get -

i'd validate 1 security approach we'd use. have 2 applications , we'd pass data using jwt token (make redirect 1 pllication + pass sensitive information in token). for purpose created jwtsigner shared secret , sign claims. jwtsigner signer = new jwtsigner(secret); return signer.sign(claims); as per understanding preferable need additionally encrypt information signing pervent tampering info. the question whether it's secure enough pass token parameter in url ? it depends. if done right, yes, safe -- applications able issue valid tokens. if done wrong, worthless. how right (tm): the payload in jwt not encrypted; can read third parties after base64-decoding. signing prevents tampering, not disclosure. jwt has "alg" field can used specify encryption algorithm used. attacker-friendly : not trust contents. make immune replay attacks, example using , verifying request counter or time-stamp. use strong encryption. public-key encryption

windows - How to connect to SVN using PuTTY and private key in PhpStorm -

Image
friends. can't connect svn using putty. i have private key , working pageagent putty; windows 7 , phpstorm 9; i have remote url svn+ssh://host.to.svn.repository; problem : don't have password, have private key. i specified data in dialog: but update uses old data: i tried "clear auth cache", it's not helped me. i want ro work svn via phpstorm. p.s. tortoisesvn work fine. resolve : setting -> version control -> subversion -> ssh settings; select "subversion config" , specify path plink , path private key, using parameter "-i"; example: 1 - path plink; 2 - parameter "-i"; 3 - path private key; p.s. make sure check "enable interactive mode" removed in general tab. you can set options svn+ssh in phpstorm settings: go file -> settings go version control -> subversion click ssh settings tab here can specify path ssh client , set credentials connection.