Posts

Showing posts from January, 2015

javascript - What does it mean in parentheses word (EVENT),in html,and why I have to write it down?without that (event) all the code will not work -

html <div id="cube" onmousemove= cordinate(event)></div> <p id= "text"></p> css #cube{ width: 300px; height: 300px; border: 2px solid black; } and js function cordinate(a){ var x = a.clientx; var y = a.clienty; var cor = "cordinates: " + x + " " + y; document.getelementbyid("text").innerhtml= cor; this code mouse-cordinate of div "cube" in onxxx attribute, event variable contains object information action caused handler triggered. instance, in onmousemove , event object contains mouse coordinates in clientx , clienty properties. you can read detailed documentation event object here . this site has more details on how event object passed event handlers, depending on how define them.

Starting Ruby app terribly slow due to requires from GEM_HOME -

i working on ruby application, running (very!) slow.. until now, i've tried couple of things , narrow down main issue: ruby trying it's requires in every single directory in $load_path. basically observing, ruby looking through lot of files, trying see if it's requires exist on there. in case wont find them, go next directory in line. nice thing can see happening strace. there lot of output this: open("/boa_proj_build/nsteen/.gem/gems/i18n-0.7.0/lib/commander/help_formatters/base.rb", o_rdonly|o_cloexec) = -1 enoent (no such file or directory) open("/boa_proj_build/nsteen/.gem/gems/thread_safe-0.3.5/lib/commander/help_formatters/base.rb", o_rdonly|o_cloexec) = -1 enoent (no such file or directory) open("/boa_proj_build/nsteen/.gem/gems/tzinfo-1.2.2/lib/commander/help_formatters/base.rb", o_rdonly|o_cloexec) = -1 enoent (no such file or directory) open("/boa_proj_build/nsteen/.gem/gems/minitest-5.8.2/lib/commander/help_formatters/

angularjs - Equivalent to target="_self" programatically in angular -

is there way full reload of app using $state.go('/', {}, {reload: true}); which have same effect if user clicked link target="_self" ? ok found solution doc : $window.location.href = '/';

c - Program crashes on line t->time = t0; -

i usiung mingw c programing environment, found serious problem. test code follows: #include <time.h> #include <stdlib.h> #include <stdio.h> typedef struct { /* time struct */ time_t time; /* time (s) expressed standard time_t */ double sec; /* fraction of second under 1 s */ } gtime_t; typedef struct { gtime_t time; int type; } raw_t; int main(){ raw_t *t; gtime_t t0={0}; t->time = t0; printf ("%d",(t->time).time); return 0; } i defined 2 struct , 1 struct contained in other one. when run test program, crush on line t->time = t0; can me on this? t pointer has not been initialized. can't dereferenced assign value member. can either initialize heap t = malloc(sizeof(raw_t)); or initialize stack raw_t tonthestack; raw_t *t = &tonthestack;

asp.net - How to use a jquery function for multiple buttons -

i have jquery function used prevent double clicks on button , works well. want use same function other button on other tab (same page). tried couple ways , doesn't work. here code jquery: var issubmitted = false; function preventmultiplesubmissions() { if (!issubmitted) { $('#<%=cmdsave1.clientid %>').val('submitting.. please wait..'); issubmitted = true; return true; } else { return false; } my .aspx page: <asp:button id="cmdsave1" runat="server" cssclass="button" text="save" onclientclick="return preventmultiplesubmissions();" onclick="cmdsaveemergency_click"></asp:button> <asp:button id="cmdsave2" runat="server" cssclass="button" text="save"

c++ - Program is asking for input three times the first time, then twice when it shouldn't and ends prematurely -

Image
my code seems asking numbers 3 times first time, twice when shouldn't , prematurely ending. can't seem figure out why. little backstory: august, june, july 30 days (ignore july 31st) of weather. use '0' june, '1' july, , '2' august. 's' sunny 'r' rainy , 'c' cloudy. store in 2 dimensional array , display user in format. this what's happening and bigger picture it goes through list #30 twice put @ end the snippet of code believe affecting // char 'r' = 82 // char 'c' = 67 // char 's' = 83 bool flag = true; char temp; int calendar[3][30]; for( int x = 0; x <= 2; x++) { for( int y = 0; y <= 29; y++) { if(x==0) { if(flag) { cout << "\nplease enter weather june"; flag = false; } cout << "\nday #" << y + 1 << " "; ci

In Eclipse/CVS how to update a branch from head? -

we use cvs eclipse. there has been code changes committed head. need update branch changes head. how this? the merging branch topic covers this.

apache - How to fetch the filename of an image and rewrite the path removing the file extension(jpg,png, etc.) using htaccess? -

i able partially htaccess code below, turns out need remove image's file extension, such .jpg, .png, etc. new url well. here htaccess code: rewritecond %{request_filename} .*jpg$|.*gif$|.*png$ [nc] rewritecond %{http_referer} !mysitee\.com [nc] rewriterule ([^/]*\.(jpg|gif|png))$ http://mysitee.com/?attachment=$1 for example, 1 of many images have is: http://mysitee.com/wp-content/uploads/2015/10/myimage.jpg and when use code new url this: http://mysitee.com/?attachment=myimage.jpg how can make doesn't add path before image? want this: http://mysitee.com/?attachment=myimage a little guesswork , got working! rewriterule ([^/]*)\.(jpg|gif|png)$ http://thetechreader.com/?attachment=$1 i moved \.(jpg|gif|png) outside of parenthesis, , seems work. i leave question open though if have better answer.

uitableview - Why does my superclass call the subclass' method instead of its own in Swift? -

here's example project: http://cl.ly/3n2u2i1s441m i'm in uitableviewcell superclass, because when subclass being initiated call super.init() . @ bottom of init s both subclass , superclass, call method, call stylecell applies styling it. method protocol both conform to, 1 implicitly conforming because it's subclass , overrides method. at end of super class' init , style method gets called, calls subclass' stylecell method, not own. why on earth happening? is bug swift? i'm attaching code in addition project above show issue: superclass table cell: class supertableviewcell: uitableviewcell, style { var mysuperview: uiview! override init(style: uitableviewcellstyle, reuseidentifier: string?) { super.init(style: style, reuseidentifier: reuseidentifier) mysuperview = uiview() dostyle() } required init?(coder adecoder: nscoder) { fatalerror("must created in code.") } func dosty

csv - python pandas insert column -

i writing code insert new column in csv file: import sys,os,csv,glob dir = os.path.dirname(__file__) import pandas pd updatecsv() def updatecsv(): files = 'example.cs' df = pd.read_csv(files) df = df.convert_objects(convert_numeric=true) #until here, code running fine #now wanted add new column in specific index value =10 df.insert(2,'new',1000) when run code, no error given. when open csv file, new row not added. decided check using python shell: >>>files = 'example.csv' >>>df = pd.read_csv(files) >>>df = df.convert_objects(convert_numeric=true) >>>df b c d 0 1 2 3 4 1 5 6 7 8 2 9 10 11 12 df['new']=13 >>>df b c d new 0 1 2 3 4 13 1 5 6 7 8 13 2 9 10 11 12 13 >>>df['new'] = df['new'] +1 >>>df b c d new 0 1 2 3 4 14 1 5 6 7 8 14 2 9 10 1

c# - No overload for method 'ToString" takes 1 arguments when casting date -

i trying save date angular ui-datepicker sql database. date in format (10-27-2015 12:00 am) not save. tried using following convert sql datetime format: datetime? mydate = form.dtestartdate; string sqlformatteddate = mydate.tostring("yyyy-mm-dd hh:mm:ss"); but receive error "no overload method 'tostring' takes 1 arguments. field in sql type 'datetime'. any assistance appreciated. you want use datetime.tostring(format) not nullable<datetime>.tostring(no overload) : datetime? mydate = form.dtestartdate; string sqlformatteddate = mydate.value.tostring("yyyy-mm-dd hh:mm:ss"); of course doesn't handle case there no value. perhaps this: string sqlformatteddate = mydate.hasvalue ? mydate.value.tostring("yyyy-mm-dd hh:mm:ss") : "<not available>";

node.js - using sqlite3 at child process issue -

node-webkit : 0.12.3 ide : webstorm 10 pc : win7 64bit childprocess.js var file = "./test.db"; var sql = require('../module/sqlite3').verbose(); // child process crash here var db = new sql.database(file); db.close(); i don't understand happens? others node-webkit can't find node_sqlite3.node path. i copied "node_sqlite3.node" "node-webkit-v0.12.3-win32-x64" "node-v46-win32-x64" . but still not work. wrong? well sqlite3 has native codes in need compile before using it. follow steps. $ npm install node-pre-gyp cd in node_modules/sqlite3 then $ node-pre-gyp build --runtime=node-webkit --target=x.xx.x (your version) i.e copying .node file won't work

node.js - RangeError: Maximum call stack size exceeded (Babel Ramda) -

this code produces stack trace below it: import r 'ramda'; function quicksort(list) { if ( r.isempty(list) ) return list; let pivot = r.head(list); let lesser = r.filter( e => e < pivot , list ); let greater = r.filter( e => e >= pivot, list ); return r.concat( quicksort(lesser), pivot, quicksort(greater) ); } var sorted = quicksort([2,3,1]); console.log(sorted); stack trace: $ babel-node quicksort2015.js /users/ivan/.nvm/versions/node/v4.1.2/lib/node_modules/babel/node_modules/babel-core/node_modules/core-js/modules/es6.object.to-string.js:3 var classof = require('./$.classof') ^ rangeerror: maximum call stack size exceeded @ array.tostring (native) @ module.exports (/users/ivan/.nvm/versions/node/v4.1.2/lib/node_modules/babel/node_modules/babel-core/node_modules/core-js/modules/$.cof.js:4:19) @ module.exports (/users/ivan/.nvm/versions/node/v4.1.2/lib/node_modules/babel/node_modules/babel-core/node_modu

c++ - Parse a stringstream into strings and doubles -

i writing program takes inputs on 1 line follows: run 10.1 50.2 where "run" string , rest of line doubles. scientific notation , negative numbers can used double inputs: -5.88e-11 example (standard c++ library allows this). here initial code tried. string command; double input1; double input2; getline(cin,input); stringstream ss(input); ss >> command >> input1 >> input2; the problem approach if blank space or letter input in place of double output of stringstream 0. believe because there no null holders double in c++. another approach tried read each input string, check string numerical , convert double. however, becomes complicated when scientific notation , negatives can entered. attempt @ this: for (int i=0; input1[i]; i++){ if (isdigit(input1[i])){\ isdigit = true; }else{ isdigit = false; } } how can parse input string , alphanumerical doubles on same line? (while retaining negatives , scientific notat

javascript - Can I use a global helper to pass data into onRendered? -

i'm trying set variable in onrendered callback equal value active global helper. global helpers defined follows: client/lib/helpers.js //all possible calculations// getresults = function(valuationid,targetid){ var valuation = valuations.findone({_id: valuationid}); var targetticker = companies.findone({_id:targetid}).ticker; var targetdata = companiesdata.findone({ticker: targetticker}); return { pefy1: targetdata.epsfy1 * valuation.priceearningsfy1, pefy2: targetdata.epsfy2 * valuation.priceearningsfy2 //more// } }; //choose 1 value above, based on several other variables// template.registerhelper('active',function(){ var valuationid = this._id; var targetid = this.targetid; var valuationperiod = this.valuationperiod; switch (valuationperiod) { case "fy1" return getresults(valuationid, targetid).pefy1; break; case "fy2":

Google maps swift ios mapwithframe on GMSMapView error -

Image
i using google maps ios sdk(using swift) , after running program multiple times decided exit xcode resume working on project later. after re-opening xcode , trying relaunch project error: terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[nsmanagedobject tilecoords]: unrecognized selector sent instance 0x7c037e90' . it saying there no mapwithframe method on gmsmapview object, although copied sample code directly off of google maps sdk website. could receive bit more guidance on handling issue? here image of call stack image , line of code blowing on. let camera = gmscameraposition.camerawithlatitude(37.5784623,longitude:-77.42166750000001, zoom: 4) blows here ----> mapview = gmsmapview.mapwithframe(cgrectzero, camera: camera) try initializing map view frame , in view appear set camera follow: mapview = gmsmapview(frame: cgrectzero) // on view appear mapview.camera = gmscameraposition.camerawithlatit

javascript - Converting jQuery Modal Service to AngularJS directive doesn't allow 2 way binding -

i've inherited legacy system previous colleague working on, asked remove server side components app , replace them angularjs... it's old jsp system , bit of hack. anyway, there jquery library within old system produces modal windows, rather have add ui-bootstrap colleague converted jquery service angularjs directive , kind of works... 1 exception, here directive code... .directive('popupwindow', ['$document', '$compile', function ($document, $compile, messagesservice) { "use strict"; return { restrict: 'a', scope: {}, link: function (scope, element, attrs) { var newpopup = new basebox({ contenturl: '/ng/xtemplate/widgets/ccc/' + scope.gettype + '.html', type: 'regular', id: 'sf-basebox', hidebackground: false,

angularjs - app.get req.body undefined -

i'm mean stack newb experiencing problems routes, , presumably, parsing: following code gets me req.body: undefined.: server.js: var express = require('express'); var app = express(); var bodyparser = require('body-parser'); var mongoose = require('mongoose'); var db = mongoose.connect('mongodb://127.0.0.1/roomem'); var roomie = require('./public/models/roomie.server.model'); app.use(bodyparser.json()); var roomieroutes = require('./public/routes/roomie.server.routes'); roomieroutes(app); module.exports = app; app.listen('3000'); controller.js: roomem.controller('roomiectrl', ['$scope', '$http', '$location', '$log', function($scope, $http, $location, $log) { $scope.login = function() { console.log($scope.person.meta); // outputs object correctly $http.get('/roomielogin',$scope.person.meta).success(function(response)

linux - File read(i.e. using vfs_read()) from LKM init_module() -

i read files lkm "initialization" function can config lkm configuration files. i'm wondering if not practice read files initialization function of lkm; heard not recommended read files lkm after kernel initialized. please advice me. thank you. daum reading from/writing files kernel not recommended. the kernel newbies wiki page describes quite nicely. for several reasons: selecting , in format read/write data policy , policy not belong kernel. userland daemon easier replace 1 receives or sends data on network, generates or converts them from/to different format etc. filesystem operations need user context (i.e.: current != null). can't sure you're in user context can't write (for example) interrupt handler. the kernel allows multiple filesystem namespaces user processes. 1 should use? how make sure indeed uses 1 want? kernel should not depend on particular layout of filesystem nor on ava

objective c - Failed to Generate disassembly for stack frame because the URL can't be translated in Xcode 7 -

Image
when run application in debugging adding breakpoints got below message can 1 tell these means

node.js - Bower no such file or directory: /opt/local/bin/bower -

i have uninstalled macport , trying homebrew. after installing node using brew. installed bower didn't give error. $npm install -g bower => ~/npm-global/bin/bower -> ~/npm-global/lib/node_modules/bower/bin/bower => ~/npm-global/lib after installation, tried bower errors out $bower => no such file or directory: /opt/local/bin/bower earlier have run following issue. https://github.com/bower/bower/issues/1335 as part of fix had alias in ~/.zshrc alias bower='noglob /opt/local/bin/bower' i had change alias bower='noglob bower'

javascript - jQuery custom function - this.each -

i need regarding jquery plugin i'm creating. $.fn.mymethod = { init : function(options){ this.each(function() { var settings = { }; if(options){ $.extend(settings, options); } }); return this; } } $("input[type=text]").mymethod.init(); it doesn't seem work, error: typeerror: this.each not function on line i hope can point me in right direction. thanks! you want way without level of object reference: $.fn.mymethodinit = function(options){ this.each(function() { var settings = { }; if(options){ $.extend(settings, options); } }); return this; } when interject object in way in original proposal, means has called as: $(...).mymethod.init() and, calling way, means this pointer mymethod , not jquery object need be. consequence of how javascript sets this pointer when call foo.bar.method() . there work-arounds, ugly , complicated give level of dot synt

json - Setting the sku name and tier of Azure ARM template serverfarm -

we creating deployment template using azure resource manager. have virtually set created hostplan not pick correct pricing tier. no matter values use seems default 'free' 'f1' pricing plan. here section { "apiversion": "2015-08-01", "type": "microsoft.web/serverfarms", "name": "[variables('siteplanname')]", "location": "[resourcegroup().location]", "sku": { "name": "b1", "tier": "basic", "capacity": 1 }, "properties": { "numberofworkers": 1 } }, any thoughts appreciated. regards can try specify sku inside "properties" node of serverfarms description, : { "apiversion":"2015-08-01", "name":"[variables('hostingplannam

how to fix recognized obsolete hibernate namespace waring massage -

configuration [info] hhh000043: configuring resource: com/logiware/webtool/hibernates/hibernate.cfg.xml configuration [info] hhh000040: configuration resource: com/logiware/webtool/hibernates/hibernate.cfg.xml configuration [info] hhh000221: reading mappings resource: com/logiware/webtool/hibernate/domain/bookingterminal.hbm.xml dtdentityresolver [warn] hhh000223: recognized obsolete hibernate namespace http://hibernate.sourceforge.net/. use namespace http://www.hibernate.org/dtd/ instead. refer hibernate 3.6 migration guide! configuration [info] hhh000221: reading mappings resource: com/logiware/webtool/hibernate/domain/bkgtemplate.hbm.xml my code: <!doctype hibernate-configuration public "-//hibernate/hibernate configuration dtd 3.0//en" "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"> <!-- generated myeclipse hibernate tools. --> <hibernate-configuration> <session-factory> <property name=&

if jquery has no 'readonly' on 'select' and 'checkbox'? -

i can't find function readonly on 'select' , 'checkbox'. 'disable 'seems option variable no longer exist. fix them out by: $('input[type=checkbox]').each(function(){ if ( $( ).prop( "checked" ) ){ $(this).change(function() { $(this).prop('checked', true); }); } else{ $(this).prop("disabled", true); } }); $('select option:not(:selected)').prop("disabled", true); they seems ok , may leave 1 choice want , others disabled. are there other options? there disabled checkboxes , selects. because readonly prevents user changing value of input , not interacting , changing state of input. with checkboxes , select input change state instead of value , readonly has no effect. so should use disable instead. still submit values can use hidden field contains value want submit , display disabled checkbox user let

localization - openGraph locale for Argentina -

i expecting es_ar using es_ar og:locale causes error in debugger <meta property="og:locale" content="es_ar"> so opengraph locale should using argentina? see these possible settings español in source... 'es_co' => _('spanish (colombia)'), 'es_es' => _('spanish (spain)'), 'es_la' => _('spanish'), 'es_la' looks general spanish latin america, add underneath `es_ar line correct according i18n standards, , facebook debgugger should be. the meta tags used on google+ , linkedin, , search engines bing not removed es_ar when valid, tag aded locale using og:locale:alternate es_la described here . here facebook says, https://developers.facebook.com/docs/internationalization the locales facebook supports referenced in facebook locales xml file. codes in xml file follow iso language , country codes respectively, concatenated underscore. basic format ll_cc, ll two-letter langua

android - how to create custom calendar with months scrolls vertically -

in application want have calendar show details, had done same libraries available problem want show months in calendar view. in libraries used 1 month shown in activity, on clicking left/right arrow shows next/previous months. custom calendar months scrolls vertically https://github.com/traex/calendarlistview hope helps...

html - Why is my webpage not fitting the screen? -

Image
my page has width of 1920px on body element. 15" macbook pro supposedly has resolution of 2880x1800. why need zoom out see entire page? the pixel density of many modern screens high. if viewed content intended more traditional screens on them using native pixel resolution, end pin sharp text small people read. macbook retina displays are, default, scaled software treats them having resolution of 1440x900. means 10px high text (for instance) uses 20 physical pixels , still large enough read, sharper on screen 1440x900 physical pixels.

How to get maximum column values across a row in Teradata sql? -

i have table named cnst_chrctrstc_abc 10 columns (equ_gender1 - bb_population_flag) each row contain numeric values (count) . want maximum 5 values out of each row across 10 numeric columns. the query have looks following .. sel ( sel sum(case when coalesce(act.equ_gender1,'') = coalesce(inact.equ_gender1,'') 0 else 1 end ) equ_gender1_chg_cnt, sum(case when coalesce(act.exp_ex_bmyr1,'') = coalesce(inact.exp_ex_bmyr1,'') 0 else 1 end ) exp_ex_bmyr1_chg_cnt, sum(case when coalesce(act.equ_age1,'') = coalesce(inact.equ_age1,'') 0 else 1 end ) equ_age1_chg_cnt, sum(case when coalesce(act.maritalstatus1,'') = coalesce(inact.maritalstatus1,'') 0 else 1 end ) maritalstatus1_chg_cnt, sum(case when coalesce(act.person_type1,'') = coalesce(inact.person_type1,'') 0 else 1 end ) person_type1_chg_cnt, sum(case when coalesce(act.homeowner,'') = coalesce(inact.homeowner,'') 0 else 1 end ) home

How to Insert values in Dictionary in swift -

Image
i first declare dictionary let storesentenceordering = [string, int ](); then want insert value in getting error: - can in following way var cardictionary: [string:int] = [:] // below subscript way of adding or updating value dictionary, if key not present key inserted assigned value else updated new value cardictionary["ford"] = 345000 cardictionary["hyundai"] = 546788 print(cardictionary) - can use update add value existing dictionary cardictionary.updatevalue(234500,forkey:("wolkswagen")) - dictionary can initialized in 1 following ways var cardictionaryone: [string:int] = [:] var cardictionarytwo: [string:int] = () var cardictionarythree = ["ford":12345, "audi":57689]

dictionary - What is a simple way to store mixed values as a key value pair in Java? -

i trying figure out way store mixed values key value pair. what have far 2 level linkedhashmap. first level primary keys. names of items. each key linkedhashmap too. trying work. in second linkedhashmap need able store mixed values. example boolean, int, float. any ideas how so? also there better way achieve idea nested linkedhashmaps? me seemed best thing. i don't have code, scratch paper right now. thanks! create custom class , have required data types there. declare map as: map<string,yourcustomclass> mydatamap = new hashmap<string,yourcustomclass> (); you can make <string, object> make generic, can perform casting later on based on logic.

android - Listview in ScrollView not displaying all items -

i have layout has 2 listviews , inside scrollview because contents can exceed device's height. here layout: <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="com.galleri5.android.activities.imageactivity"> <android.support.v7.widget.toolbar android:id="@+id/toolbar" android:elevation="4dp" android:layout_width="match_parent" android:layout_height="?attr/actionbarsize" android:background="#fac80a"> <relativelayout android:id="@+id/relativelayout" android:layout_width="match_parent" android:layout_height="wrap_content"> <textview android:la

How to implement table view in sencha -

can tell how implement table view in sencha i want display view tabular format vertical line column1 column2 column3 s.no name age 1 test1 23 2 test2 24 3 test3 25 thanks you can use touch-grid package available sencha complete. if used sencha-complete easy this.

xml - Unique simple type element in parent complex type element -

i wish add unique constraint name element of familyconvention complex type. reason, schema below not detect duplicated names: <xs:element name="validatedconvention"> <xs:complextype> <xs:sequence> <xs:element name="family" type="familyconvention" minoccurs="1" maxoccurs="unbounded"/> </xs:sequence> </xs:complextype> <xs:unique name="keyfamilyname"> <xs:selector xpath="family/name"/> <xs:field xpath="."/> </xs:unique> </xs:element> <xs:complextype name="familyconvention"> <xs:sequence> <xs:element name="name" minoccurs="1" maxoccurs="1"> <xs:simpletype> <xs:restriction base="xs:string"> <xs:pattern value="([a-za-z0-9])+

java - How do I append more record into existing .csv file -

i trying write .csv file using java.i using supercsv jar. have scenario have write record batch. example if have 100 record have write same .csv in batches of ten. first problem facing not giving me option download file or not writing csv file. getting value in console. how achieve writing batches. this java code public class supercsvparserexample { public static void main(string[] args) throws ioexception { //list<employee> emps = readcsvtobean(); employee emp1=new employee(); employee emp2=new employee(); employee emp3=new employee(); employee emp4=new employee(); employee emp5=new employee(); emp1.setid("1"); emp1.setname("a"); emp1.setrole("developer"); emp1.setsalary("100000"); emp2.setid("2"); emp2.setname("b"); emp2.setrole("tester"); emp2.setsalary("200000"); emp3.setid("3"); emp3.setn

Concatenate list of string in Python -

hello enthusiast programmers, seems bad @ manipulating lists in python (i come idl world, , struggle python). have list of string, say: mylist =['boring', 'enjoyable', 'great'] and string, say: s = 'python ' and want build list: ['python boring', 'python enjoyable', 'python great'] mynewlist = s + l as have done in idl, doesn't work of course ... not able simply! (i.e. without loop , intermediate variables) thanks help! s. use map or list comprehensions: map(lambda x: "python " + x, mylist) ["python " + x x in mylist] both solutions implicit loop, idl would; inevitable have 1 in scenario. no overt loop for ...: .

java - Handle deserialization when datatype of class field changed -

i have serializable class. public class customer implements externalizable { private static final long serialversionuid = 1l; private string id; private string name; public string getid() { return id; } public void setid(string id) { this.id = id; } public string getname() { return name; } public void setname( string name) { this.name = name; } @override public string tostring() { return "id : "+id+" name : "+name ; } @override public void readexternal(objectinput in) throws ioexception, classnotfoundexception { this.setid((string) in.readobject()); this.setname((string) in.readobject()); } @override public void writeexternal(objectoutput out) throws ioexception { system.out.println("reached here"); out.writeobject(id); out.writeobject(name); } } i have se

sql - Database Relation Anomalies -

Image
i tasked find anomalies within relation. had identified few insertion, deletion , update anomalies. commission percentage: percentage of total sales made salesperson paid commission salesperson. year of hire: year salesperson first hired department number: number of department salesperson works manager name: name of manager of department however, confused anomalies pulled out. below statement: there can not manager same name in company there no primary identifier manager entity except name, can duplicate within company. may know how should phrase above statement , under (update/deletion/insertion) anomaly should include in? thank you may request additional assistance below well: how change current design , how new design address problems have identified current design. my current design splitting 3 relations: salesperson(salespersonnumber, salespersonname, commissionpercentage, yearofhire, deparetmentnumber) product(productnumber, productname, unitprice)

json - How to send String using HttpURLConnection in android -

i need send string web service , have doubts how send string using httpurlconnection. obs: in string "result" have like: {"sex":"famale","nome":"larissa aparecida nogueira","convenios":[{"convenio":2,"tipo":"principal","number":"44551-1456-6678-3344"}],"user":"lari.ap","email":"lari.ap@yahoo.com.br","cell":"(19)98167-5569"} following code: public usuerservice(context context, string result) { this.progressdialog = new progressdialog(context); this.context = context; this.result = result; } @override protected string doinbackground(string... params) { string responsestring = ""; try { url url = new url(constants.usuario + "/createusuario"); httpurlconnection httpurlconnection = (httpurlconnection) url.openconnect

broadcastreceiver - SMS Broadcast Receiver not called on Android 6 -

i trying capture sms received on phone, when phone receives sms message method 'onreceive' not called. code: i have broadcastreceiver declared in 'androidmanifest.xml' inside tag 'application': <receiver android:name=".util.incomingsmsreceiver" android:exported="true"> <intent-filter android:priority="2147483647"> <action android:name="android.provider.telephony.sms_received" /> </intent-filter> </receiver> this incomingsmsreceiver.java public class incomingsmsreceiver extends broadcastreceiver { public static final string sms_received = "android.provider.telephony.sms_received"; @override public void onreceive(context context, intent intent) { log.i(tag, "onreceive executed"); if (intent.getaction().equals(sms_received)) { ... } } } i'm doing tests on emulator

java - DDMS: unable to connect jdb to DDMS port -

i learning android, , developing application without using ide through ant. build applications ant debug, , deploy them on emulator adb. have marked app wait debugger attach developer settings. when try connect jdb ddms port, get java.io.ioexception: shmembase_attach failed: system cannot find file specified @ com.sun.tools.jdi.sharedmemorytransportservice.attach0(native method) @ com.sun.tools.jdi.sharedmemorytransportservice.attach(sharedmemorytransportservice.java:90) @ com.sun.tools.jdi.genericattachingconnector.attach(genericattachingconnector.java:98) @ com.sun.tools.jdi.sharedmemoryattachingconnector.attach(sharedmemoryattachingconnector.java:45) @ com.sun.tools.example.debug.tty.vmconnection.attachtarget(vmconnection.java:358) @ com.sun.tools.example.debug.tty.vmconnection.open(vmconnection.java:168) @ com.sun.tools.example.debug.tty.env.init(env.java:64) @ com.sun.tools.example.debug.tty.tty.main(tty.java:

ios - ld: framework not found Box -

i'm getting error every time when try compile project. started happening after adding pods "use_frameworks!" , updating use : #import <mbprogresshud/mbprogresshud.h> insted of: #import "mbprogresshud.h" for frameworks. there no framework named "box" not understand refer to.. this error shows after project compiles, @ end. did 1 manage fix issue? edit my podfile: platform :ios, '8.0' # ignore warnings pods inhibit_all_warnings! use_frameworks! xcodeproj 'stox' pod 'flex', '~> 2.0', :configurations => ['debug'] pod 'fbsdkcorekit', '~> 4.5' pod 'dcintrospect-arc', '~> 0.0.4' pod 'fiksusdk', '~> 4.5.0' pod 'raven' pod 'pkrevealcontroller' pod 'uiimage+blurredframe' pod 'sdwebimage' pod 'pephotocropeditor' pod 'reachability' pod 'hpgrowingtextview', '~>

excel - Iterate over slicer via VBA and select a single item each time -

i have several slicers within spreadhseet. i'd able loop on 1 of these via vba, , select every option 1 one. macro below seems fine tired eyes, doesn't work when run it. when add breakpoint @ 'breakpoint tag here below, first item gets selected, macro goes second 1 while keeping first 1 selected , end items selected... sub slicers(slname string) dim slitem sliceritem, sldummy sliceritem dim slbox slicercache set slbox = activeworkbook.slicercaches(slname) each slitem in slbox .sliceritems each sldummy in slbox .sliceritems sldummy.selected = (sldummy.name = slitem.name) next sldummy next slitem 'breakpoint end sub sub test() call slicers("a_slicer_name") end sub thanks help edit: pointed out scott holtzman, turns out need clear filter (slbox.clearmanualfilter) upon selecting new item. why necessary whereas boolean test works when debug.print it? the code below works fine: sub