Posts

Showing posts from January, 2012

TypeScript constructor in interface -

the typescript doc says following code: interface clockconstructor { new (hour: number, minute: number): clockinterface; } interface clockinterface { tick(); } function createclock(ctor: clockconstructor, hour: number, minute: number): clockinterface { return new ctor(hour, minute); } class digitalclock implements clockinterface { constructor(h: number, m: number) { } tick() { console.log("beep beep"); } } class analogclock implements clockinterface { constructor(h: number, m: number) { } tick() { console.log("tick tock"); } } let digital = createclock(digitalclock, 12, 17); let analog = createclock(analogclock, 7, 32); ... because createclock’s first parameter of type clockconstructor, in createclock(analogclock, 7, 32), checks analogclock has correct constructor signature. however, compiling same code without constructor, not throw error can see here why that? missing anything?

Java: How i pass the string in xml and get diffrent attribute -

i have xml-string and, want result -elements messageid -, designation - , status -members it. how can that? "null <?xml version="1.0" encoding="utf-8"?> <results> <result> <status>-13</status> <messageid></messageid> <destination>null</destination> </result> <result> <status>-3</status> <messageid></messageid> <destination>911234567898</destination> </result> <result> <status>0</status> <messageid>146092209473920945</messageid> <destination>917827767338</destination> </result> <result> <status>0</status> <messageid>116092209473924510</messageid> <destination>918527593928</destination> </result> <result> <stat

javascript - Angularjs form validation, based on serve response show error msg -

i have form in checking if email exists. if exists showing error msg json response. part done (this checking when user click on submit button). i getting 409 error if email exists. i need update email input filed. need add msg email exists. using ng-show="personalinfo.$submitted" <form name="personalinfo" role="form" autocomplete="off"> <div class="form-group"> <input type="text" maxlength="11" class="form-control" name="usupiemail" ng-model="usuattributes.personalinfo.email" ng-focus="showplaceholder('email')" /> <label>email id</label> <div class="error-message" ng-show="personalinfo.$submitted" ng-cloak> please verify email. </div> </div> <button type="submit" class="btn-default" ng-click="usupiupdateuser()">next</button>

linux - Encryption/decryption doesn't work well between two different openssl versions -

i've downloaded , compiled openssl-1.1.0 . i can encrypt , decrypt using same exe of openssl (as here ) me@ubuntu:~/openssl-1.1.0$ ld_library_path=. ./apps/openssl aes-256-cbc -a -salt -in file.txt -out file.txt.enc enter aes-256-cbc encryption password: 123 verifying - enter aes-256-cbc encryption password: me@ubuntu:~/openssl-1.1.0$ ld_library_path=. apps/openssl aes-256-cbc -a -d -in file.txt.enc -out file.txt.dec enter aes-256-cbc decryption password: 123 this openssl uses: libcrypto.so.1.1, libssl.so.1.1 when try decrypt openssl installed on ubuntu, uses: /lib/x86_64-linux-gnu/libssl.so.1.0.0, /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 i error: me@ubuntu:~/openssl-1.1.0$ openssl aes-256-cbc -a -d -in file.txt.enc -out file.txt.dec2 enter aes-256-cbc decryption password: 123 bad decrypt 140456117421728:error:06065064:digital envelope routines:evp_decryptfinal_ex:bad decrypt:evp_enc.c:539: what may cause this? thanks the default digest changed md5 sh

Rest-Assured JIRA Java unable to get Response -

please consider below code, import org.junit.test; import org.omg.corba.request; import com.jayway.restassured.restassured; import com.jayway.restassured.response.response; import static com.jayway.restassured.restassured.*; import static org.hamcrest.matchers.*; public class app { @test public void loginauthentication() { restassured.authentication = basic("username", "password"); response resp = given(). contenttype("application/x-www-form-urlencoded"). when(). post("https://unitrends.atlassian.net/login?username=gayatri.londhe&password=gayatria4"); system.out.println(resp.prettyprint()); } } i getting below response, <div class="aui-message error"> <span class="aui-icon icon-error"/> <span class="error" id="error-authentication_failure_invalid_credentials"> sorry, didn't r

html - Another 'can't center content' topic -

first time using stackoverflow, sorry newbie mistakes. here's code on codepen: http://codepen.io/ayliffe1987/pen/gjaeaz i can't life of me, center lower section of website called 'features.' it's in same container/wrapper div other centered content on site, wont center. .wrapper {width: 80%;margin: 0 auto;padding: 10px;} any ideas? has wrapper collapsed? thanks guys edit: tried text-align: center in several places, no avail add text-align:center .features ul { margin: 80px 0; text-align: center; } remove float property & add display:inline-block; .features ul li{ display: inline-block; /*float: left;*/ margin-right: 10px; padding-top: 140px; text-align: center; width: 300px; }

java - how to auto inject multiple beans into an ArrayList property with spring and its annotation -

e.g. have array list property in action. private arraylist<sitesbusiness> businesses; and sitesbusiness nothing interface, , property intended contain beans implements sitesbusiness. the question want use spring annotation mechanism auto inject beans implements sitesbusiness businesses. any 1 can help? many thanks. i tried use autowired on method job @autowired public void addbusiness(sitesbusiness business) { system.out.println("sitesaction, addbusiness.di1210, business.identifier: " + business.getidentifier()); (int = 0; < this.businesses.size(); ++i) { if (globalmethods.getinstance().checkequal(this.businesses.get(i), business) || globalmethods.getinstance().checkequal(this.businesses.get(i).getidentifier(), business.getidentifier())) { return; } } this.businesses.add(business); } unfortunately, got: expected single matching bean found 2: accountbusine

c# - Linq .Select() / .SelectMany() automatically uses second, optional parameter -

i found weirdest behavior in linq: when calling unary functions pass function name, instead of var foo = mylist.select(item => myfunc(item)); i write var foo = mylist.select(myfunc); which should same. in cases, isn't! namely if function has second parameter int , optional: private string myfunc(string input, int foo = 0) { ... } in case, statement var foo = mylist.select(myfunc); equals var foo = mylist.select((item, index) => myfunc(item, index)); if second parameter either not opional or not int , compiler complains, in case, sneakily surprises you. has else encountered this? other linq expressions work way? (so far, .selectmany() does). , elegant way work around behavior (and keep others falling same trap?) this not issue of specific linq extension method, how optional parameters handled func s , action s, in short - not, considered regular parameter , default value omitted when selecting corresponding func / action signature. ta

java - Mockito validates already verified invocations -

static class foo { public void bar(int i) {} } @test public void foo() { foo f = mockito.spy(new foo()); f.bar(42); mockito.verify(f, mockito.times(1)).bar(42); f.bar(42); mockito.verify(f, mockito.times(1)).bar(42); } causes org.mockito.exceptions.verification.toomanyactualinvocations (wanted 1 time, 2) on last line. running in debug shows, invocationmatcher ignores fact first invocation verified. , not depend on witch matcher passed bar . doing wrong, or bug of mockito? there no bug. implementors of library thinks multiple invocations in single test method not best practice. there 2 choices overcome issue: good one: use separate tests each f.bar() invocations , test them independently. not one: use mockito.reset(f) before second invocation. resets state of spied f ; instance if have inserted mock call dothrow(new exception).when(f).bar(45) , reset after reset() call. second verify works times(1) .

Removing character data from numeric dataframe in R -

i have dataframe has header recycled couple of times, looks this: var1 var2 var3 var4 1 1 1 'ch' 1 1 1 'ch' 1 1 1 'ch' var1 var2 var3 var4 1 1 1 'ch' 1 1 1 'ch' 1 1 1 'ch' var1 var2 var3 var4 most of variables have numeric values; some, however, have character – converting whole df numeric won't me. wondering how subset dataframe remove re-appearing header? so, have this: var1 var2 var3 var4 1 1 1 'ch' 1 1 1 'ch' 1 1 1 'ch' 1 1 1 'ch' 1 1 1 'ch' 1 1 1 'ch' having headers have turned of data factors (or character if used stringsasfactors=false ): dd <- read.table(text="var1 var2 var3 var4

python - Drawing a rubberband on a panel without redrawing everything in wxpython -

i use wx.paintdc() draw shapes on panel. after drawing shapes, when left click , drag mouse, rubberband (transparent rectangle) drawn on shapes. while dragging mouse, each motion of mouse, evt_paint sent , (all shapes , rectangle) redrawn. how draw rubberband on existing shapes (i don't want redraw shapes), mean, nice if can save existing shapes on dc object , draw rubberband on it. application draw faster. you presumably want have @ wx.overlay . here example.

Memory error on large Shapefile in Python -

import shapefile data = shapefile.reader("data_file.shp") shapes = data.shapes() my problem getting shapes shapefile reader gives me exception memoryerror when using pyshp . the .shp file quite large, @ 1.2 gb. using ony 3% of machine's 32gb, don't understand it. is there other approach can take? can process file in chunks in python? or use tool spilt file chinks, process each of them individually? although haven't been able test it, pyshp should able read regardless of file size or memory limits. creating reader instance doesn't load entire file, header information. it seems problem here used shapes() method, reads shape information memory @ once. isn't problem, files big. general rule should instead use itershapes() method reads each shape 1 one. import shapefile data = shapefile.reader("data_file.shp") shape in data.itershapes(): # something...

javascript - how can prevent remaining table rows from ng-repeat start in nested json? -

Image
property in homepalgroupprop.properties my json data : property=[{unitname : 1bhk, data:[{}]] }, {unit name : 3bhk},{}] like this { "unitname": "3 bhk", "data": [ { "unitname": "3 bhk+3t", "property_size": "1521 ", "bedrooms": 3, "unit_type_name": "3 bhk", "unit_type_status": 1, "unitprice": 6538779, "price_per_sqft": "4299", "hp_property_id": 9, "unit_price_id": 51, "$$hashkey": "object:65" }, { "unitname": "3 bhk+3t", "property_size": "1523 ", "bedrooms": 3, "unit_type_name": "3 bhk", "unit_type_status": 1, "unitprice": 6547377, "price_per_sqft&quo

unit testing - Angular2 Cli Test (Webpack) Erros: "Error: Template parse errors" -

this appmodule: import { browsermodule } '@angular/platform-browser'; import { ngmodule, custom_elements_schema } '@angular/core'; import { formsmodule } '@angular/forms'; import { httpmodule } '@angular/http'; import { appcomponent } './app.component'; import { citiescomponent } './cities/cities.component'; @ngmodule({ declarations: [ appcomponent, citiescomponent ], imports: [ browsermodule, formsmodule, httpmodule, ], providers: [], bootstrap: [appcomponent], schemas: [custom_elements_schema] }) export class appmodule { } citiescomponent simple module. , use component inside appcomponent . application builds , works without errors; when execute ng test fails error: error: template parse errors: 'app-cities' not known element: 1. if 'app-cities' angular component, verify part of module. 2. if 'app-cities' web component add "custom_elements_schema" '@

JSON: How to access deep level array -

everything pre-loop fine. need finding way access deeper level json. i'm stuck in "for" loop. product_name comes out okay in first loop nothing deeper that. i've added output each deeper level loop don't seem pass second one. follow url view json array. <script> var xmlhttp = new xmlhttprequest(); var url = 'http://www.weber.se/?type=88&pagealias=lecareglttklinker26&json=1'; xmlhttp.onreadystatechange=function() { if (this.readystate == 4 && this.status == 200) { readjson(this.responsetext); } } xmlhttp.open("get", url, true); xmlhttp.send(); function readjson(response) { var object = json.parse(response); var output = '<div class="container-fluid">'; output += '<div class="row">'; output += '<div class="col-xs-6 text-left"><img src="' + object.product[0].packaging_picture + '" height="230">

php - Codeigniter pagination not showing content on page 2 -

i searching 2 days still no luck. problem codeigniter pagination have set controller show 1 data per page have 2 data means have 1,2 pagination. [1] page showing correct data, when try click [2] still shows data [1] page plus url page=1. here controller class campaign extends ci_controller { public function __construct() { parent::__construct(); $this->load->helper(array('form', 'url')); $this->load->library('form_validation'); $this->load->model('campaign_model'); $this->load->database(); $this->load->library('pagination'); } function index() { $this->load->view('campaign_view'); } function submit() { $this->form_validation->set_rules('campaignname', 'campaign name', 'trim|required|is_unique[ch_campaigns.c_campaign_name]'); if($this->form_validation->run() == false) { echo validation_errors(); } else { $campaignname = $this->inp

Calculations in SQL Server -

i want use microsoft sql server management studio data database. in want calculations: for every day have 2 different datapoints. want add new datapoint sum of 2 datapoints. in example want code following task: for every 'date' want new datapoint (let's call category3) sum af 'data' 'category1' , 'category2'. code: select [date], [category], [data] [ ... ] category in ('category1', 'category2') order asofdate do want simple group by query where ? select [date], sum(data) [ ... ] category in ('category1','category2') group asofdate

git - Github merge conflict -

Image
i'm having problems github project i'm doing. error i'm getting when dealing pull request. i think have accidently got files on machine when dealing 1 persons branch, says i'm 26 uncommits on changes on master. if sync straight master github pick code his? cause don't want take credit else's work. you should not commit these file git repos. now please delete them --cache . , add gitignore. commit. example: git rm --cached wil/wil.v12.suo if keep in repo, see conflict every time.

ios - I made the inheritance of classes, right or wrong? -

i had error "multiple inheritance classes 'baseviewcontroller' , 'pfquerytableviewcontroller'".tell me how out of situation? i made inheritance. if it's right, not know why data not displayed when parsing? my code import uikit import parse import parseui class sportviewcontroller: baseviewcontroller { override func viewdidload() { super.viewdidload() addslidemenubutton() self.navigationitem.titleview = uiimageview(image: uiimage(named: "uklogo.png")) let querymatch = pfquery(classname: "betting") querymatch.addascendingorder("match") querymatch.findobjectsinbackground(block: { (objects:[pfobject]?, error:error?) in if error == nil { print (objects!.count) } else { } }) } override func viewwillappear(_ animated: bool) { super.viewwillappear(animated) } class sportviewcontroller: pfquerytable

install - How to secure/encrypt Inno Setup from decompiling -

i using inno setup tool pack/setup files (dll,exe,jpg, etc). found there software called innoextractor can open setup , read scripts , extract files, since need hide/protect files in setup spent lot of time/efforts secure setup.exe generated inno setu p, found people saying add passowrd inno setup script, wrong because client kowns password , can use innoextractor , extract protected password! not it!? now, ask if there someoen can suggest me solve problem. in fact embded xml files , dll used install specific files @ client side according client machine, if client extract dll machine catestropha !! need way prevent client seeing/extracting setup.exe ! there's no way 100% protect installer attacker. if want crack can it. what can do: 1) encrypt files custom (3rd party) system or use [setup] encryption directive 2) modify inno setup - download sources, change them , compile again 3) place sensitive files , data on server , download them during setup (+ encry

angular - How to use the HashLocationStrategy with the Auth0 Lock widget for user login -

after updating auth0 login sample use hashlocationstrategy in app.module.ts : import { locationstrategy, hashlocationstrategy } '@angular/common'; // (...) @ngmodule({ providers: [ {provide: locationstrategy, useclass: hashlocationstrategy}, approutingproviders, auth_providers ], //(...) the auth0 lock authenticated event not raised anymore: import { injectable } '@angular/core'; import { tokennotexpired } 'angular2-jwt'; // avoid name not found warnings declare var auth0lock: any; @injectable() export class auth0service { // configure auth0 lock = new auth0lock('i21eajbbpf...', '....au.auth0.com', {}); constructor() { // add callback lock `authenticated` event this.lock.on("authenticated", (authresult) => { // use token in authresult getprofile() , save localstorage this.lock.getprofile(authresult.idtoken, function(error, profile) { if (error) { // handle

javascript - AG-Grid | Page is unresponsive when screen was left for an hour or longer -

i using ag-grid (version 6.0.1) angularjs (version 1.2.6). in case, grid updated after 4seconds. it's observed when screen left hour or longer, page gets unresponsive , crashed. //update grid data $scope.gridoptions.api.setfloatingtoprowdata([rootnode]); $scope.gridoptions.api.setrowdata(agdata); any can reason?

php - Doctrine entity validation at construct -

i'm trying improve myself doctrine, , doing best practices. found presentation of best practices : https://ocramius.github.io/doctrine-best-practices/#/50 i try have valid object after __construct. (see https://ocramius.github.io/doctrine-best-practices/#/52 ) i'm using @assert annotation validating object. how can validate ? have inject validator service inside object @ __construct ? my object : class person { /** * @var int * * @orm\column(name="id", type="guid") * @orm\id * @orm\generatedvalue(strategy="uuid") * @expose */ private $id; /** * @var int * * @orm\column(name="name", type="string") * @assert\email() */ private $email; public function __construct($email, validatorinterface $validator){ $this->email = $email; $validator->validate($this); // practice ? } my final goal unit test input validat

java - Siddhi How to track what's going on inside ExecutionPlanRuntime -

is there way track/log inner execution of siddhi execution plan? i'm talking vanilla siddhi not wso2 cep. didn't find way how turn on. how debug rules? thanks. you can use built-in logger function of siddhi. please refer documentation . however, available after siddhi 3.1.0

vba - Automating import of an Excel file -

i trying import file, saved in our public drive, access database table. this have far. dim timestamp2 string timestamp2 = month(date) & "." & day(date) - 1 & "." & year(date) dim xlfile string, shtname xlfile = "open orders @ " & timestamp2 & ".xls" shtname = "current open orders" docmd.transferspreadsheet aclimport, acspreadsheettypeexcel12, "open orders yesterday", "\\cletus\knxgendb$\daily order bookings\open orders @ " & timestamp2 & ".xls", true, shtname & "!" this error i'm getting: run time error 2306: there many rows output, based on limitation specified output format or microsoft access here specific fixes: fix file extension. in 1 place have ".xlsx" , in another, ".xls" correct spelling of acimport (in code incorrectly spelled "aclimport") to delete table before import, try docmd.deleteo

mongodb - Mongo query for field name -

i have collection summarizes data related documents in other collections. it's structure like: { campaignid : objectid(...) impressions : { ... '2016-09-20': 1800, '2016-09-21': 1500, '2016-09-22': 2000 }, clicks : { ... '2016-09-20': 60, '2016-09-21': 55, '2016-09-22': 80 } } i realize there better ways of doing it, it's can't control. the issue need query documents had impressions in previous 7 days . so need query based on field key instead of value. is possible doing in query? as need query based on field key instead of value first need provide keys previous n days(7 days in case). after building these keys(programmatically or manually ), can achieve in different ways ----- 1 - using $where db.collectionname.find({$where: function() { var previous2days = ["2016-09-21","2016-09-20"] (var

sql server - T-SQL Select, manipulate, and re-insert via stored procedure -

the short version i'm trying map flat table new set of tables stored procedure. the long version: want select records existing table, , each record insert new set of tables (most columns go 1 table, go others , related new table). i'm little new stored procedures , t-sql. haven't been able find particularly clear on subject. it appear want along lines of insert [dbo].[mynewtable] (col1, col2, col3) select oldcol1, oldcol2, oldcol3 [dbo].[myoldtable] but i'm uncertain how save related records since i'm splitting multiple tables. i'll need manipulate of data old columns before fit new columns. thanks example data myoldtable id | year | make | model | customer name 572 | 2001 | ford | focus | bobby smith 782 | 2015 | ford | mustang | bobby smith into (with no worries duplicate customers or retaining old ids): mynewcartable id | year | make | model 1 | 2001 | ford | focus 2 | 2015 | ford | mustang m

programming languages - What does it mean by saying conflating environment and object is the fundamental sin of Javascript? -

i watching programming languages courses given prof. shriram krishnamurthi on youtube. in episode, https://youtu.be/suh7jhrtktk?t=1600 he said conflating environment , objects fundamental sin of javascript. environment exposed language users, , users can manipulate environment. i don't quite understand means actually. refer how "this" works in javascript? are there code examples can demonstrate sin? after little bit of digging, i’ve found paper professor shriram’s group. https://cs.brown.edu/research/plt/dl/jssem/v1/ in section 2.5, pointed out not clear whether javascript lexically scoped because scope chain in javascript formed ordinary objects, , with statement lets programmers add arbitrary objects scope chain. i think understand means in video. i highly recommend paper. indeed catches of essence of javascript according title, not part, bad part.

javascript - Get a substring from url jquery -

i working one-page website uses jquery , ajax. because 1 page website, url mydomain.com/#contact . have made ajax call , want refresh page , scroll particular section of page different id say, mydomain.com/#home . in order this, have current url using document.url (let's returns mydomain.com/#contact ), remove /#contact , replace /#home . know can replace /#contact /#home concatenating + don't know jquery function (if any) remove /#contact . thanks help simply set hash, don't need evaluate existing url: window.location.hash = "home";

ios - React Native ScrollView scrolling both directions -

i'm trying react native scrollview scroll horizontally , vertically, reason won't it. know doesn't work on android, supposed work on ios. i've looked @ issue: https://github.com/facebook/react-native/issues/2962 and did suggested, still scrolls 1 direction. this how have declared: <scrollview directionallockenabled={false} horizontal={true} style={styles.container}> {this.buildcontent()} </scrollview> any ideas on how scroll both directions? there not direct way achieve this. if setting contentcontainerstyle prop not problem you, can go way. if is, can use 2 nested scrollviews . <scrollview> <scrollview horizontal={true}> {this.buildcontent()} </scrollview> </scrollview>

ruby on rails - Rerun Cucumber step only in case of specific failure -

running cucumber in circleci selenium tests fail due circleci's performance. common failure net::readtimeout error, never seems happen locally. want rescue steps error , try them again, not want rerun failed tests. i put build rescue specific step(s) seem trigger error, ideally able provide cucumber list of errors rescues once or twice, rerun step, before letting error pass through. something like: # support/env.rb cucumber.retry_errors = { # error => number of retries "net::readtimeouterror" => 2 } does exist? i surprised if found looking in cucumber. re-running failing step make sure actual failure , not random network glitch is, perspective, solving wrong issue. my approach see if verification looking possible without network. might consider using other tooling cucumber if must re-run few times make sure error error. would, however, lead me down rabbit hole. how many times should run, threshold? should 3 out of 5 executions pass dec

ruby on rails - Digital Ocean Bundle Install Killed -

i'm trying deploy website on digital ocean following guide ( https://www.digitalocean.com/community/tutorials/how-to-use-the-ruby-on-rails-one-click-application-on-digitalocean ) when bundle install message fetching gem metadata https://rubygems.org/.....killed it stops me continuing next step. please help! you might not have enough memory run bundle install command. clues, check end of /var/log/syslog (you'll need root access) see if there warnings memory being exhausted. if that's problem, may need upgrade bigger droplet more resources.

excel vba - execute Worksheet_Change when cell changed by a macro -

i have edited question initial posting since realized no macro activate worksheet_change function. i using userform create macro edit cell. want worksheet take value 1 cell , create values in other cells. works manually, not in via macro! from userform: sub writeoperatingfunds(dates, description, money) dim ws2 worksheet set ws2 = thisworkbook.worksheets("operatingfunds") 'find first empty row in database irow = ws2.cells.find(what:="*", searchorder:=xlrows, _ searchdirection:=xlprevious, lookin:=xlvalues).row + 1 ws2.cells(irow, 1).value = dates ws2.cells(irow, 2).value = description ws2.cells(irow, 3).value = money end sub and worksheet: private sub worksheet_change(byval target range) dim change string dim chngrow long dim incrow long dim exprow long dim totrow long dim income long dim expense long dim total long set ws = thisworkbook.worksheets("operatingfunds") totrow = ws.cells(ws.rows.count

Ruby on rails use devise display error on heroku -

i'm trying deploy app on heroku, there error. i've tried add require 'devise' in config/application.rb didn't work. link project on github: https://github.com/qjpioneer/12in12-blog gemfile source 'https://rubygems.org' # bundle edge rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 5.0.0', '>= 5.0.0.1' # use sqlite3 database active record group :development gem 'sqlite3' end group :production gem 'pg' gem 'rails_12factor' end # use puma app server gem 'puma', '~> 3.0' # use scss stylesheets gem 'sass-rails', '~> 5.0' # use uglifier compressor javascript assets gem 'uglifier', '>= 1.3.0' # use coffeescript .coffee assets , views gem 'coffee-rails', '~> 4.2' # see https://github.com/rails/execjs#readme more supported runtimes # gem 'therubyracer', platforms: :ruby # us

c# - What is the difference between Dictionary.Item and Dictionary.Add? -

reading accepted answer of c# java hashmap equivalent , literary states: c#'s dictionary uses item property setting/getting items: mydictionary.item[key] = value myobject value = mydictionary.item[key] and when trying implement it, error when using: mydictionary.item[somekey] = somevalue; error: cs1061 'dictionary' not contain definition 'item' and need use mydictionary.add(somekey, somevalue); instead same this answer , msdn - dictionary in order resolve error. the code fine, out of curiosity doing wrong? other 1 not compile, difference between dictionary.item[somekey] = somevalue; and dictionary.add(somekey, somevalue); edit: i edited accepted answer in c# java hashmap equivalent . see edition history know why. difference simple dictionary[somekey] = somevalue; // if key exists - update, otherwise add dictionary.add(somekey, somevalue); // if key exists - throw exception, otherwise add as error

email - MailChimp HTML Outlook Conditions -

i have spent of afternoon trying find solution problem. i have html email template works fine on devices when viewing on outlook 2013 (the outlook version have access to test it) renders mobile device. think have tracked down outlook conditions have contained in code. <!--[if (gte mso 9)|(ie)]> <table align="center" border="0" cellspacing="0" cellpadding="0" width="500"> <tr> <td align="center" valign="top" width="500"> <![endif]--> however when open email in outlook, have been changed to: <!--/*sc*/ [if gte mso 9]> <center> <table><tr><td width="580"> <![endif] /*ec*/--> i guess stands sc = start comment , ec = end comment. am right in saying these interfering outlook conditions? dose know how can stop mailchimp putting them in template? i use code in templates , works fine outlook 97 until 2013. starting o