Posts

Showing posts from January, 2011

css - maintain Menu Item selected state -

i have menu in asp.net page.the menuitem , url loading dynamically code behind during ispostback=false . after clicked on of menu item, selected item background color changed , after directing url, selected state cleared. i tried code below , not work.the css class not applied item after postback dim s2 string = request.querystring("sub") each item menuitem in menu1.items if item.text = s2 item.selected = true exit end if next <asp:menu id="menu1" runat="server" role="tablist" orientation="horizontal" cssclass="nav nav-pills" forecolor="black" renderingmode="list" includestyleblock="false"> <%-- <statichoverstyle cssclass="focus" />--%> <staticmenustyle cssclass="nav nav-pills"/> <staticmenuitemstyle cssclass...

html - Google map I frame issue -

i have embedded google map using frame; map shows pin point when clicking on address window opened. how set window opened default http://demo.coregenie.com/walltech/contact-us/ you should @ google's info window displayer ; this, can use code infowindow.open(map,marker); automatically open infowindow using $( document ).ready(function(){ infowindow.open(map,marker); }); :)

python - what is different loads, dumps vs read json file? -

i have simple json file 'stackoverflow.json" { "firstname": "stack", "lastname": "overflow" } what different between 2 below functions: def read_json_file_1(): open('stackoverflow.json') fs: payload = ujson.loads(fs.read()) payload = ujson.dumps(payload) return payload def read_json_file_2(): open ('stackoverflow.json') fs: return payload = fs.read() then use 'requests' module send post resquest payload 2 above funtions , works both. thanks. the 'loads' function takes json file , converts dictionary or list depending on exact json file. `dumps' take python data structure, , converts json. so first function loading , validating json, converting python structure, , converting json before returning, whereas 2nd function reads content of file, no conversion or validation the functions therefore equivalent if json valid - ...

c# - Linq Expression Selector -

expression<func<t, object>> selector selector have parameter. my method generic type , lets want multpile property values form class being called. a =>a.customername being passed expression.please explain, possible have multiple selections ? like example want customer address also, both string values. if want multiple properties out, could use multiple parameters, each extracted single value, more common use lambda expression creates anonymous type. example: var result = foo.somemethod(customer => new { customer.name, customer.address }); the compiler generate type name , address properties, , create expression tree creates instance of type using properties in customer object provided.

Reading a formatted date as a Calendar or Date object in Java -

this question has answer here: error when converting date format another 3 answers i'm trying create date or calendar object string representation of date in java. tried using simpledateformat.parse , result produced totally different gave input. can explain i'm doing wrong here? import java.util.*; import java.lang.*; import java.io.*; import java.text.*; class ideone { public static void main (string[] args) throws java.lang.exception { simpledateformat sdf = new simpledateformat("yyyymmdd"); sdf.settimezone(timezone.gettimezone("gmt")); date dt = sdf.parse("20141208"); system.out.println(dt.getday() + " " + dt.getmonth() + " " + dt.getyear()); system.out.println(sdf.format(dt)); } } i getting output 0 11 113 20141229 you have use lower y year : simpledateformat...

tableview - objective C update title for UITableView sections -

i have tableview multi sections, each section has title number, want insert new sections press "add new" button in each of sections. for example, when pressed "add new" button in section one, add new section between section 1 , origin section 2, origin section 2's title still "title - 2" (it should title - 3), if scroll tableview, 2nd title-2 not changed title-3 title - 1 section 1 = add new title - 2 section 2 = add new title - 2 section 2 = add new title - 3 section 3 = add new

hadoop yarn single node performance tuning -

Image
i have hadoop 2.5.2 single mode installation on ubuntu vm, is: 4-core, 3ghz per core; 4g memory. vm not production, demo , learning. then, wrote vey simple map-reduce application using python, , use application process 49 xmls. these xml files small-size, hundreds of lines each. so, expected quick process. but, big22 surprise me, took more 20 minutes finish job (the output of job correct.). below output metrics : 14/12/15 19:37:55 info client.rmproxy: connecting resourcemanager @ /0.0.0.0:8032 14/12/15 19:37:57 info client.rmproxy: connecting resourcemanager @ /0.0.0.0:8032 14/12/15 19:38:03 info mapred.fileinputformat: total input paths process : 49 14/12/15 19:38:06 info mapreduce.jobsubmitter: number of splits:49 14/12/15 19:38:08 info mapreduce.jobsubmitter: submitting tokens job: job_1418368500264_0005 14/12/15 19:38:10 info impl.yarnclientimpl: submitted application application_1418368500264_0005 14/12/15 19:38:10 info mapreduce.job: running job: job_...

wpf - Showing part of UserControl like CroppedBitmap -

i can't english yet. please understand if can't understand me clearly. i have huge data table in usercontrol.xaml, downscale usercontrol object showing whole in mainwindow. i want same size datatable showing of partially usercontrol in mainwindow. like image display way: <image> <image.source> <croppedbitmap source="<path source image>" sourcerect="20,20,50,50"/> </image.source> </image> showing usercontrol in mainwindow sourcerect. if understand correctly, have several options. first way, , think easiest use viewbox control. 1. viewbox the viewbox control inherited decorator used stretch or scale child element, scaled proportionally, ie can not set him size such 300x100. example <viewbox width="300" height="300"> <datagrid> ... </datagrid> </viewbox> the second way use screen capture of control, show, , i...

Using Expressions in SSIS Casting Issue -

i'm using expressions in control flow choose different data flow tasks based upon name o file being parsed (basically loading data excel source ole db destination). i'm using following expression , variants desired result: (dt_i4) (dt_wstr, 2) findstring( @[user::srcfilepath] , "division", 1) (dt_bool) (dt_wstr, 2) findstring( @[user::srcfilepath] , "division", 1) (dt_bool) findstring( @[user::srcfilepath] , "division", 1) i want dft executed if expression true. there casting errors coming. the promising result comes when use expression: (dt_wstr, 2) findstring( @[user::srcfilepath] , "division", 1) answer '45' in string form cannot use logical operators or compare them against numbers ... any appreciated. why not compare findstring result against 0 (not found)? findstring("division_abc.xls", "division", 1 ) > 0 that evaluate true - replace "division_abc.xls" @[user:...

android - How to execute asynctask in viewpager? -

i have 3 pager views. when try execute asynctask app crashes because task starts simultaneously. want perform asynctask pager visible. how do that? pager 1: public class test extends android.support.v4.app.fragment { private myasynctask mauthtask = null; @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { view test = inflater.inflate(r.layout.test, container, false); ((textview)test.findviewbyid(r.id.textview)).settext("test"); return test; } @override public void setuservisiblehint(boolean isvisibletouser) { super.setuservisiblehint(isvisibletouser); if (isvisibletouser) { attemptlogin(); } } @override public void onviewcreated (view view, bundle savedinstancestate) { } public void attemptlogin() { if (mauthtask != null) { return; } mau...

codepages - DotNetZip zipping files with Arabic names -

when creating zip file out of many arabic named files, have prompted in dotnetzip's faq changed code page following: using zip new zipfile() zip.adddirectorybyname("files") zip.alternateencoding = encoding.utf8 zip.alternateencodingusage = ionic.zip.zipoption.always dim row integer row = 0 ds.tables("d").rows.count - 1 filetodownload = server.mappath("~/.../resources/attachments/" + ds.tables("d").rows(row).item(1).tostring) zip.addfile(filetodownload, "files") next response.clear() response.bufferoutput = false dim zipname string = [string].format(gvrow.cells(8).text.trim + ".zip") response.contenttype = "application/zip" response.addheader("content-disposition", ...

objective c - How to remove timer from runloop immediately -

i have timer triggered in 5 seconds added global queue, though invalidating after 2 seconds run loop won't terminate till 5 seconds. in following snippet backgroundtimer instance var, , run member function. what's wrong in following code blocking run loop termination. dispatch_async(dispatch_get_global_queue(dispatch_queue_priority_default, 0), ^{ _backgroundtimer = [nstimer timerwithtimeinterval:5 target:self selector:@selector(run) userinfo:nil repeats:no]; [ [nsrunloop currentrunloop] addtimer:_backgroundtimer formode:nsrunloopcommonmodes]; [[nsrunloop currentrunloop] run]; nslog(@"run loop terminated"); }); dispatch_after(dispatch_time(dispatch_time_now, (int64_t)(2 * nsec_per_sec)), dispatch_get_global_queue(dispatch_queue_priority_default, 0), ^{ [_backgroundtimer invalidate]; _backgroundtimer=nil; }); the first problem here timer being added run loop on arbitrary background thread. (i.e. thread have been created g...

Scala collections: why do we need a case statement to extract values tuples in higher order functions? -

related tuple unpacking in map operations , don't understand why need case (that looks partial function me) extract values tuple, that: arrayoftuples map {case (e1, e2) => e1.tostring + e2} instead of extracting in same way works in foldleft , example def sum(list: list[int]): int = list.foldleft(0)((r,c) => r+c) anyway don't specify type of parameters in first case, why need case statement? because in scala function argument lists , tuples not unified concept in haskell , other functional languages. function: (t: (int, int)) => ... is not same thing function: (e1: int, e2: int) => ... in first case can use pattern matching extract tuple elements, , that's done using case syntax. actually, expression: {case (e1, e2) => ...} is shorthand for: t => t match {case (e1, e2) => ...} there has been discussions unifying tuples , function argument lists, there complications regarding java overloading rules, , default/named...

How can I create a date sequence in Stata? -

i wish create date sequence in stata. search on forum , others did not yield helpful code stata. there many answers r shown example on this link. want create sequence january 1, 2000 december 31, 2010. how can that? dates can tricky in software. in stata, other software, there no substitute reading documentation carefully. help dates , times answers questions. quirk may trap unwary date() in stata function creating daily date variables, , no other kind. best, stata 13 on, new users use synonymous function daily() when seek daily dates. said, function more convenient here creating date sequences, mdy() . here example: clear di mdy(1,1,2000) di mdy(12,31,2010) di mdy(12,31,2010) - mdy(1,1,2000) set obs 4018 gen mydate = mdy(12,31,1999) + _n format mydate %td list in 1 list in l notes: mdy() creates daily date variables arguments indicating month, day , year. _n observation number, 1 up. so need work out starting date , number of observations desired , it...

css - Bootstrap v2.3.2 Column size edit -

i have theme in prestashop use bootstrap v2.3.2 , bootstrap responsive v2.3.2. layout have header, 3 columns (left, center, right) , footer. have hide right column. i have margin-left before left column , margin-right before center column i'd edit, change size in "% think" size of device screen. want left column (with same size) more near margin left, , center column (more large) near margin right what have edit? thank much i'm not sure recommend reading fluid grid system in boostrap 2.3 http://getbootstrap.com/2.3.2/scaffolding.html html <div class="row-fluid"> <div class="span4 column1">...</div> <div class="span4 column2">...</div> </div> css .comlumn1 { margin-left:your spacing; margin-right:your spacing; } .comlumn2 { margin-left:your spacing; margin-right:your spacing; } in order sizing want may want use bigger span size. span 1 - 12

GridGain: How to add composite primary keys -

in gridgain, have load data such primary key composite key. say have class person{ int id; int officeid; ... } here want add primary key both id , officeid. possible add composite key in gridgain? in gridgain object can used key, hashmaps. need make sure override equals(...) , hashcode() methods composite keys.

intern - Is iti possible to find an element by a custom attribute? -

all elements in web application that: <div id="12zd34" test-attr="elt1_stop2_3"> . the id automatically generated , change each execution not test-attr attribute. is possible find testing elements custom attribute or xpath custom attribute? thanks help. use jquery: $('div[test-attr="elt1_stop2_3"]')

javascript - Splitting data into pages depending on height (creating a printable song book) -

Image
im trying make song book eg. birthdays, weddings etc. choose couple of songs , songs shown on website in size of a5 paper, , users can edit text there, before converting pdf. create new page each song, fill out space possible. having more 1 song per page, or atleast have verses of song on same page, , show rest on next page. a5 size height: 793.7px width: 559.3px   <div class="songpage currentpage"> <h4>song #1</h4> <div class="verse"> <table> <tr> <td> <p>1 - lipsum lipsum</p> <p>2 - lipsum lipsum</p> <p>3 - lipsum lipsum</p> <p>4 - lipsum lipsum</p> <p>5 - lipsum lipsum</p> </td> <td> ...

visual studio 2010 - MultiLine Regex search in VisualStudio? -

Image
i need insert db text literals in web page. looking @ <article> <h2 class="f5_heading"> marketing </h2> </article> i need find "marketing" so did regex search in visual studio search : \>[^\<]#\< but doesn't find it. does find : notice : there no line breaks . question: i don't understand why doesn't find in first regex : the [^\<]# means : anything not closing tag characters. how can enhance regex match multilines ? you can use following regex (?<=>)\n?\s*\w+ the above match "marketing" , spaces before it. in c# want like (?m)(?<=>)\n?\s*\w+ demo

c# - How to access the database that comes with ASP.NET Web Application? -

i using visual studio 2013. i have done file -> new -> project i choose template -> visual c# -> web -> asp.net web application project name set webapplication1. when press f5 run website becomes basic working website user can register account. the problem facing how access database store registered users? how can manage users? intend in future publish website. need find way backup users. should need add in own tables should put them in separate database or should store database comes project? i cannot find information on this. suspect keywords used searching might wrong. can give me suggestions? the default template asp.net creates database localdb light version of sql server , installed visual studio 2013, see generated database, browse appdata folder in project , find long file contains of project name, generated database. can attach db file sql server through management studio if have 1 or can change connection string sql server instance w...

Issue with sending sms using twilio in my rails app -

i building rails application (based out of india) wherein need send sms users bookings confirmed. using trial account on twilio purpose. however, when try send sms, status shows 'pending' , don't receive sms desired destination number. reason? i have created notification_controller below code: class notificationcontroller < applicationcontroller skip_before_action :verify_authenticity_token def notify client = twilio::rest::client.new 'my_account_sid', 'my_account_token' message = client.account.messages.create from: 'twilio_number_assigned', to: 'my_number', body: 'learning send sms are.' render plain: message.status end end and made post request /notifications/notify. update: in case bulk sms provider service has worked rails app, feel free share related docs. thanks! try send hash, that's twilio suggest , that's how used in app: client = twilio::rest::client.new account_sid, ...

docker - How to configure a high-availability cluster of MariaDB and Redis in Mesos or CoreOS -

in tutorials, presentations , demos, stateless services presented load balanced either via dns (skydns, skydock, etc.) or via reverse proxy, such haproxy or vulcand, configured etcd or zookeeper. is there best practice deploying cluster of mariadb , redis using: coreos + fleet + docker; or mesos + marathon + docker any other cluster management solution how can 1 configure redis cluster , mariadb cluster (galera), when host running master may change? https://github.com/sheldonh/coreos-vagrant/tree/master/redis http://www.severalnines.com/blog/how-deploy-galera-cluster-mysql-using-docker-containers after posting question, lucky , came across few repositories have achieved looking for: redis https://github.com/mdevilliers/docker-rediscluster - redis cluster 2 redis instances , 3 redis sentinel monitors. if master fails, sentinels promote slave master. mark has created project configures haproxy use promoted master - https://github.com/mdevilliers/redishappy...

Contents of variable set from for loop variable substitution refer to previous run in Windows batch script -

if code saved file tst.bat: @echo off %%a in (%1) ( echo "%%~fa" set b=%%~fa echo "%b%" ) and invoked twice follows, i'd expect this: c:\windows\temp>tst.bat abc "c:\windows\temp\abc" "c:\windows\temp\abc" c:\windows\temp>tst.bat xyz "c:\windows\temp\xyz" "c:\windows\temp\xyz" but instead, this: c:\windows\temp>tst.bat abc "c:\windows\temp\abc" "" c:\windows\temp>tst.bat xyz "c:\windows\temp\xyz" "c:\windows\temp\abc" do have wrong expectations? once upon time, wrote great intro answer i'm give, can't find it. basically, if want have variables inside for loop update loop, need use delayedexpansion. @echo off setlocal enabledelayedexpansion %%a in (%1) ( echo "%%~fa" set b=%%~fa echo "!b!" )

shelving - Mercurial: How can a I make a snapshot of my working directory without doing a changeset? -

while working on new feature arrive @ point works, still not @ point want create changeset. create "restore point" or "snapsnot" can come working version of codebase. in tfs create shelve set. in mercurial, shelve sets behave different: move file shelf, file reverts state of last changeset. purpose of creating snapshot , continue working, behavior makes shelving not solution. how can snapshot work , continue files are? i know there many questions shelving in mercurial here, not find answer question in them. comment on helpful answers @mathiasdm , @gill bates for go commit --amend, available in tortoishg: commit button can converted amend button. ammend adds changes previous commit instead of creating new changeset. so first create commit rough version , improve on ammend ing it. "hg shelve && hg unshelve --keep" , mq extension nice alternatives. one command particularly suited is: hg commit --amend it allows cr...

Android - Menu items are not shown in ActionBar to start app -

i creating activity 2 fragments. implementing different menu items each fragment. having problem. sequence of error: tab 1 - fragment 1 -> no buttons appear on actionbar menu tab 2 - fragment 2 -> menu appears correctly tab 1 - fragment 1 -> menu displayed until pass fragment 2 , return fragment 1 icons of actionbar not shown. can error? thank you fragment 1 public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { rootview = inflater.inflate(r.layout.fragment_listado, container, false); declararobjetos(); iniciarbasedatos(); sonidos(); cargarlocalizacion(); reiniciarlistview(); pintarelementos(); sethasoptionsmenu(true); modulo.getoverflowmenu(getactivity()); activitycompat.invalidateoptionsmenu((activity) context); return rootview; } public void onprepareoptionsmenu(menu menu) { menuitemactualizarlista = menu.finditem(r.id.menuopcactualizarlista); menui...

maps - Calculating walking distances in iOS -

i have list of latitude , longitude values in database. based on user’s location need extract closest location database based on walking distances. purpose, need first values database array , calculate walking distances each , return lat/long of shortest distance. note: have no problem extracting database values. need calculation of walking distances between 2 points. i have far found threads here either show straight line distances. there way walking distances between 2 points? if so, appreciate if point me in right direction (link/previous question) or provide guidance on classes or functions use. you can distance in meter using the cllocationdistance distance = [locationone distancefromlocation:locationtwo]; you can acoordingly convert centimeter or kilometer, may serve purpose

ssl - adding ip with forwarding rules in google cloud -

can provide tutorial on how add additional ip instance via forwarding in google cloud? the current documentation complicated , not helpful. not states command should executed , instruction vague. i've been trying setup new instance, not understand on how setup forwarding of traffic on instance other instance. highly appreciate if shine light on topic. thank you. i understood question differently (compared other answer). understand need second public ip pointing instance has own public ip. if case, follow these steps: let's start sdk, since mention: it not states command should executed , instruction vague the commands executed in terminal once have downloaded , installed google cloud sdk . in linux/os x be: curl https://sdk.cloud.google.com | bash there's 3-step guide in link more information. issue command: gcloud compute instances list to list of instances , zone belong to. take note of name , zone of instance need work wit...

configuration - duplication in parsing spring context -

nowadays i've got know spring mvc. about context:component-scan and mvc:annotation-driven and tx:annotation-driven in spring config xml here question. know, "context:component-scan" scans beans. , heard, mvc:annotation-driven, tx:annotation-driven"s scan beans. i think not efficient , not reasonable. why scan twice, 3 times. is there way avoid duicate parsing? any answer appreciated. thank you. in opinion, scanning process not twice, 3 times think. declare related beans think. please refer below summarize , find out how differences. <context:annotation-config> declares support general annotations such @required, @autowired, @postconstruct, , on. <context:component-scan> can <context:annotation-config> <context:component-scan> scans packages find , register beans within application context. <mvc:annotation-driven /> enables spring mvc @controller programming model , declares explicit suppor...

procedures - How to get previous row data by using SQL? -

here table example main_cd code 1 aa 1 bb 1 cc 2 1231 2 1232 . that table have lots of data. use main_cd "1" (other data other pages cannot delete it) my question if got value of "cc". want sent pre_data ("aa") , next data ("cc") also if got value of "cc", pre_data "bb" , next_data "aa"

javascript - How to make a jQuery slider that will act like a volme control in a television -

i have design jquery slider act volume control , change color while grow higher value.i able design problem slider changing manually want supply value on basis of value slider shrink or grow . here jsfiddle demo upto have got. http://jsfiddle.net/lotusgodkk/gcu2d/133/ $(document).ready(function () { $('.checked').slider({ }); }); i want slider changed upon input demo html <section> <span class="tooltip"></span> <!-- tooltip --> <div id="slider"></div> <!-- slider --> <span class="volume"></span> <!-- volume --> </section> jquery $(function () { //store elements in variables var slider = $('#slider'), tooltip = $('.tooltip'); //hide tooltip @ first tooltip.hide(); //call slider slider.slider({ //config range: "min", min: 1, value: 1, st...

How would I create a handle manager in Rust? -

pub struct storage<t>{ vec: vec<t> } impl<t: clone> storage<t>{ pub fn new() -> storage<t>{ storage{vec: vec::new()} } pub fn get<'r>(&'r self, h: &handle<t>)-> &'r t{ let index = h.id; &self.vec[index] } pub fn set(&mut self, h: &handle<t>, t: t){ let index = h.id; self.vec[index] = t; } pub fn create(&mut self, t: t) -> handle<t>{ self.vec.push(t); handle{id: self.vec.len()-1} } } struct handle<t>{ id: uint } i trying create handle system in rust , have problems. code above simple example of want achieve. the code works has 1 weakness. let mut s1 = storage<uint>::new(); let mut s2 = storage<uint>::new(); let handle1 = s1.create(5); s1.get(handle1); // works s2.get(handle1); // unsafe i associate handle specific storage this //pseudo code struct handle<t...

c++ - How to change language of the build in VS2008? -

this question has answer here: making mfc application international 4 answers i have mfc application use russian language, want translate interface , make build english version of windows. what usual way change language in vs2008 build? i found code in *.rc file // russian resources #if !defined(afx_resource_dll) || defined(afx_targ_rus) #ifdef _win32 language lang_russian, sublang_default #pragma code_page(1251) #endif //_win32 and #define text_locale_id (makelcid( makelangid(lang_russian, sublang_default), sort_default )) in *.h file store strings in format such as #define some_str_rus _t("Строка на русском") try converting every "russian" term english term. such : 1)defined(afx_targ_eng) 2)language lang_english, sublang_default 3) (makelcid(makelangid(lang_english, subland_english),sort_default)) this worke...

html - How do I create a link in a table that reveals my search results from a count? -

i have 2 sets of data, 1 clients , 1 vacancies of clients. in table have created button when clicked displays client results, includes clientid , client name. have linked in vacancy details manage to tally amount of vacancies have in relation client. right create fourth table header populated links bring user page displays vacancies, instead of tallying them in header. paste code (except data) see if helps. 8th day of coding mvc , still find confusing @ time. if dont want write code, helpful if tell me if need controller, or more models. thank you. view: <table> <thead> <tr> <th> reference </th> <th> client name </th> <th> number of vacancies per client </th> <th> link vacancies </th> </tr> </thead> <tbody> <% dim oclient vacancymanager2.datamodels.client ...

gruntjs - Setting up grunt to launch & live reload browser (with minimal plugins) -

i'm setting web project , want use grunt automation , workflow. have sass, jshint, jsdocs, minifiers playing nice having no end of trouble launch & reload of browser grunt shell. i have 2 conditions i'd meet in doing this: no browser plugins. (i want work straight out of repo; "npm install", "grunt") keep npm modules minimum. (ideally grunt-contrib-watch & grunt-contrib-connect) this config 2: connect: { options: { base: 'app/', port: '8888', livereload: true } }, watch: { all: { files: [ 'gruntfile.js', 'app/index.html', 'app/partials/*.html', 'app/styles/sass/*.scss', 'app/scripts/*.js' ], tasks: ['default'], options: { livereload: true } } } in testing have tried: connect: { options: { base: "app/...

spring mvc - Retun list of checkboxes using thymeleaf -

<p th:each="accommodationcategory,accommodationcategorystat : ${accommodationcategorylist}" > <input type="checkbox" th:field="*{accommodationcategorylist[__${accommodationcategorystat.index}__].valid}" /> <label th:text="*{accommodationcategorylist[__${accommodationcategorystat.index}__].name}">label</label> </p> accommodationcategory class has 2 attribute valid , name. form return list of accommodationcategory. can fill accommodationcategory's valid attribute checkbox, want fill name attribute using ${accommodationcategory.name} not user input. can't fill accommodationcategory's name attribute when post form.

python - Legend transparent to horizontal grid in matplotlib -

Image
i'm working following class: import numpy np import matplotlib matplotlib.use('qt4agg') import matplotlib.pyplot plt import matplotlib.ticker plticker class matplotliv(): def __init__(self, basefilename, temperatures, length=none, width=none, area=none, title = '', ylim=none): self.basefilename = basefilename self.temperatures = temperatures if length , width: self.length = length self.width = width self.area = length*width*1e-5 else: self.area = area self.title = title self.ylim = ylim filenames = [("%s_%sk.txt" % (self.basefilename, str(temp)), temp) temp in self.temperatures] self.rawdata = [(np.loadtxt(fname), temp) fname, temp in filenames] self.colors = colors = ['#1b9e77', '#d95f02', '#7570b3', '#e7298a', '#e6ab02', '#a6761d', '#666666'] self.maxvaluerow ...

ios - Jenkins "Xcode build error" -

Image
developing ios mobile application, while building jenkins , throws error. xcodebuild: error: directory /users/nikhilchallagulla/documents/bombardier/workspace/014_rapidbuild_rwps_eic_ios not contain xcode project or workspace." "[014_rapidbuild_rwps_eic_ios] $ /usr/bin/xcodebuild -list xcodebuild: error: directory /users/nikhilchallagulla/documents/bombardier/workspace/014_rapidbuild_rwps_eic_ios not contain xcode project or workspace." like please me in resolving issue. thanks. if trying build xcode project or workspace need specify location of file or workspace in xcode plugin(if using xcode plugin). can provide location in advanced xcode build options. see screenshot below. project file ends .xcodeproj , workspace ends .xcworkspace extension.

Change font in android -

Image
i know question has been asked many times still not getting right.so please me.i want change font of textviews.i find code on google , end doing this code public class sliderfont extends textview { public sliderfont(context context, attributeset attrs) { super(context, attrs); typeface typeface = typeface.createfromasset(context.getassets(), "fonts/redhead.ttf"); settypeface(typeface); } } and used in xml <pocketdocs.indiehustlers.com.pocketdocsv2.utils.sliderfont android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_marginleft="5dp" android:text="awaited approval" android:textcolor="#fff" android:textsize="@dimen/edit_text_size" /> but still not getting desired font. i have created assets folder instead : typeface typeface = typeface.createfromasset...

email - Alt, title and other tags in e-mail html -

does make sense putting alt, title , other tags on or elements in html of e-mail? google preety reads gmail and since clients send emails products, there sense in putting tags elements google understand mailing people? thank you, em2 is there sense in putting tags elements google understand mailing people? i wouldn't worry google, though, yes, help. put more relevant ads on side, potentially competitor. where come in handy though, , why should use them people have screen readers, , people block images. if images can't seen, reason, especially blind(ish) readers , there should alt attribute describing image.

java - How to unmarshall XML to this class? -

i unmarshall xml using jaxb unmarshaller object of type. public class pair<t1,t2> implements serializable { private t1 first; private t2 second; public pair(t1 first, t2 second) { this.first = first; this.second = second; } public t1 getfirst() { return first; } public void setfirst(t1 first) { this.first = first; } public t2 getsecond() { return second; } public void setsecond(t2 second) { this.second = second; } } public class trippair<t1,t2> extends pair<t1,t2> { public trippair(t1 first, t2 second) { super(first, second); } } public class fare extends pricing implements comparable<fare> { private list<trippair<integer,integer>> trips = new linkedlist<>(); } xml file <faregroups> <trips> <second>37</second> <first>0</first> </trips> </fare...

javascript - How to write function-y accepting parameter-fct_x which accesses var-a which is required to be defined in function-y? -

function x() { return + 1; // can accessing var-a. } function y(fct_x) { var = 2; fct_x(); // exception: not defined } y(x); // exception: see above // x function access var-a required defined in function-y question: how write function-y above calling fct_x() within function-y not throw exception? note: fct_x function (user given) accesses var-a. var-a not defined in function-x, required defined in function-y. with referring is possible achieve dynamic scoping in javascript without resorting eval? , have tried this , not work. why ask above question: question comes "mongodb mapreduce", this: there 3 properties , 28 functions available map-reduction. 1 of 28 function emit(key,value). (see mongodb doc) . take example, function mapfunction() { emit(this.fielda, this.fieldb) }; db.collection.mapreduce(mapfunction, reducefunction, {...}); // calling mapreduce-function the emit-function within mapfunction not defined in mapfunction. ...

ios - Detect array with issue (Debug mode) -

Image
my app crushing when i'm calling few methods i can see error message , understand don't know how detect array problem message. have lots of arrays in project. how can know problem come from? this message: 2014-12-16 15:07:01.830 myapp[2776:1237923] *** terminating app due uncaught exception 'nsrangeexception', reason: '*** -[__nsarraym objectatindex:]: index 0 beyond bounds empty array' *** first throw call stack: (0x2a3eae3f 0x37a98c8b 0x2a2ffc49 0x114c07 0x2d8e515d 0x2d8e3835 0x2d8df47d 0x2d885b37 0x2d2adccd 0x2d2a96b5 0x2d2a953d 0x2d2a8f21 0x2d2a8d25 0x2d2a2bfd 0x2a3b15cd 0x2a3aec8b 0x2a3af093 0x2a2fd621 0x2a2fd433 0x316ab0a9 0x2d8e7809 0x12fee5 0x38018aaf) libc++abi.dylib: terminating uncaught exception of type nsexception to handle exceptions, xcode click on show breakpoint navigator click + button @ bottom side , pop click on add exception breakpoint. this add exception break points application, try run again , execution stop if r...

c# - Making a controller not visible to the client in ASP.NET WEB API (or MVC) -

let's suppose have layer of abstract controllers, delegates request child controller class, until reaches implementation. think of pipeline of controllers, request must go through, , includes caching responses, authorizing , authenticating user, validating input , output data, handling repository access, etc. my leaf class (the last child of hierarchy), may have following signature: public class seasonscontroller : defaultpersistencerestcontroller <int, season, seasonputdto, seasonpostdto, seasonquerydata> { /** controller implementation here **/ } the base classes have lot of reusable code located in 1 module, , has helped me lot when changing logic of controllers @ global level. now, suppose seasonscontroller need call episodescontroller , irrelevant reasons. the call this: episodescontroller episodecontroller = new episodescontroller(); //do episodescontroller the problem don't want episodescontroller acces...