Posts

Showing posts from August, 2010

html5 - How can I resolve bootstrap CSS issue? -

Image
this actual output how remove highlighted section in red, in actual output? this expected output jsfiddle demo link example, .wizard ul { list-style: none outside none; padding: 0; margin: 0; width: 4000px; } .wizard ul li { float: left; margin: 0; padding: 0 20px 0 30px; line-height: 35px; position: relative; background: #f5f5f5; color: #d0d0d0; font-size: 12px; cursor: default; -webkit-transition: .218s ease; -moz-transition: .218s ease; -o-transition: .218s ease; transition: .218s ease; } .wizard ul li .chevron { border: 24px solid transparent; border-left: 14px solid #d4d4d4; border-right: 0; border-width: 18px 0 17px 14px; display: block; position: absolute; right: -14px; top: 0; z-index: 1; }

windows - Sony, Camera And JSON -

i have implemented sony remote api in c# on windows. works qx10. however, asked use implementation dsc-hx90v , ilce-5000. can locate camera using ssdp three. can camera's device description xml file. point. the problem having dsc-hx90v , ilce-5000 not json send whereas qx10 handles well. my json assumed correct or not work qx10. using newtonsoft.json. any idea problem might be? i have discovered problem. json had \r\n in , cameras not that. removed \r\n , no longer bad json error.

matlab - Using radon function to find black bar position in white background image -

Image
i want use radon projection find horizontal position (x coordinate) of black bar in white image (first image). code returns result in third image while expectation second image. problem, code here: clear; clc; img = rgb2gray(imread('2.png')); bwimg = ~im2bw(img); [r, xp] = radon(bwimg, 0); [h w] = size(img); dw = w / length(xp); [a ix] = max(r(:,1)); pos = round(w/2 + xp(ix)*dw); bwimg(:, pos) = 1; figure; imshow(bwimg);

Fortran OpenMP program shows no speedup of CPU_TIME() -

the use of parallelism should lead minimizing time of program did not happened me. when programmed code in parallel using openmp, run time augmented, i.e. parallel time > serial time. my code: program main use omp_lib implicit none real*8 times1,times2 integer i,j real, allocatable, dimension(:) :: allocate(a(1000)) j = 1, 1000 a(j)=j enddo ! ***************no parallel code ************************************ call cpu_time(times1) write(*,*) 'cpu no parallel started:',times1 = 1, 1000 j = 1, 500000 a(i)=a(i)+0.0001 end a(i)=a(i)+a(i)+a(i) enddo call cpu_time(times2) write(*,*) 'cpu cpu no parallel finished:',times2 write(*,*) 'no parallel times:',times2-times1 write(*,*) '---------------------------------------------------' ! ***************parallel code ************************************ call cpu_time(times1) write(*,*) 'cpu paralle

javascript - How to get path variable in express(node.js) -

i trying value of path variable "userid" using req.params getting undefined , if 1 can guide me in problem ll thankful him. have place code below. have go through example examples doing in way don't know going wrong code. thank you, parent router controller app.use("/user/:userid/group",groupcontroller); action in controller router.post("/", function (req, res, next) { var group = new group(req.body); console.log(req.params); group.userid = req.params.userid; group.save(new datacallbacks(req, res, next, "group").insert()); }); i think wrong route, can't route /user/:userid/group , post / doesn't make sense. mean userid param, should post /user/:userid/group : route file route.js : var ctrl = require('controller.js'); app.route('/user/:userid/group').post(ctrl.doit); controller file controller.js : exports.doit = function(req, res, netx) { var group = new group

c++11 - Clang or GCC compiler for c++ 11 compatibility programming on Windows? -

i wondering compiler better use on windows os (8.1) in temrs of compatibility c++11's (and later 14) functions, liberies , features (like lambdas) , comfortable use (less bugs). i university student hence i'm not looking @ subject product-wise (even though code bit more projects studies). i using eclipse luna ide if matters. notice compiler != ide . vc++ 1 of populars on windows , depending on version has support c++11 features. check list on msdn blog find out if there's need. gcc ported windows , can install mingw use (4.8.1.4 @ moment of writing this). pretty complete on c++11. clang available windows platform , complete on c++11 support (plus has diagnostic messages), notice have use linker since clang doesn't ship 1 (although there ongoing effort write it: http://lld.llvm.org/ ) all compilers cited above pretty stable but, based on experience, if you're looking latest , greatest c++11/14/17 features, might want go gcc or clang (vc+

python - Pandas: Conditionally generate descriptions from column content -

i trying iron out issues function uses pandas regex via str.extract each row in column "name" generate column "description" . using regex , not split since code must able manage variety of formattings. the function must modified acknowledge various conditions. dataframe: import pandas pd import re df = pd.dataframe(["long axp un x3 von", "short bidu un 5x von", "short goog von", "long goog von"], columns=["name"]) input: name "long axp un x3 von" "short bidu un 5x von" "short goog von" "long goog von" current code: description_map = {"axp":"american express", "bidu":"baidu"} sign_map = {"long": "", "short": "-"} def f(strseries): stock = strseries.str.extract(r"\s(\s+)\s").map(description_map) leverage = strseries.str.extract(r"(x\d+|\d+x)\s", flag

Python BeautifulSoup webcrawling: Formatting output -

the site trying crawl http://www.boxofficemojo.com/yearly/chart/?yr=2013&p=.htm . specific page i'm focusing on http://www.boxofficemojo.com/movies/?id=catchingfire.htm . from page, having trouble 2 things. first thing "foreign gross" amount (under total lifetime grosses). got amount function: def getforeign(item_url): response = requests.get(item_url) soup = beautifulsoup(response.content) print soup.find(text="foreign:").find_parent("td").find_next_sibling("td").get_text(strip = true) the problem is, can print amount out console, can't append these values list or write them csv file. previous data needed on site, got individual piece of information each movie , appended them 1 list, exported csv file. how can "foreign gross" amount separate amount each movie? need change? the second problem related getting list of actors/actresses each movie. have function: def getactors(item_url): source_c

vaadin7 - what version of GWT is Vaadin 7.4/7.5 based on? -

what version of gwt vaadin 7.4/7.5 based on? i know vaadin includes own version of gwt addons , possible additional bug fixes version vaadin 7.4/7.5 based on? surely need know if intend switch gwt jars vaadin provided jars. example gwt rpc not work in development mode when use gwt jars on client , vaadin jars on server when vaadin based on same version of gwt. e.g vaadin 7.1 believe based on gwt 2.5.1 we have gwt application uses rpc , vaadin application. we've had make sure vaadin gwt version , gwt application use same version of gwt (if know mean). we want move vaadin 7.4/7.5 assuming need migrate our gwt application same version vaadin 7.4/7.5 based on? i'd 2.7 changes vaadin. can't sure, assumptions based on property gwt.version=2.7.0.vaadin3 in file: https://github.com/vaadin/vaadin/blob/7.5/build.properties here same file fore vaadin 7.4: https://github.com/vaadin/vaadin/blob/7.4/build.properties

java - InputStream blocks when reading large amount of data from external process -

i have problem getting data prom process.exec() there process must call java, can work long time, , process can produce large amount of data. doing this: public inputstream exec() throws ioexception, interruptedexception{ processbuilder pb = new processbuilder(args); process p = pb.start(); p.waitfor(); return p.getinputstream(); } this code blocks after runs time. assume inputstream buffer being filled, , it's waiting me read it. want return inputstream since output can, not must, compressed, decompress output later, , must read output byte output stream how can run process , it's output data?

javascript - Fullcalendar Week Title Format -

is possible fullcalendar show week titles single letter? instead of default: mon tue wed thu fri sat how can display: s m t w t f s i've tried: $('#calendar').fullcalendar({ header: { right: '', center: 'prev, title, next', left: '' }, columnformat: { month: 'd' //also tried 'd' number displayed instead } )} the shortest can 2 letters $('#calendar').fullcalendar({ header: { right: '', center: 'prev, title, next', left: '' }, columnformat: { month: 'dd' //also tried 'd' number displayed instead } }); this library uses moment library , possible formats can found here

Kernel density scatter plot in R -

Image
i saw beautiful plot , i'd recreate it. here's example showing i've got far: # kernel density scatterplot library(rcolorbrewer) library(mass) greyscale <- rev(brewer.pal(4, "greys")) x <- rnorm(20000, mean=5, sd=4.5); x <- x[x>0] y <- x + rnorm(length(x), mean=.2, sd=.4) z <- kde2d(x, y, n=100) plot(x, y, pch=".", col="hotpink") contour(z, drawlabels=false, nlevels=4, col=greyscale, add=t) abline(c(0,1), lty=1, lwd=2) abline(lm(y~x), lty=2, lwd=2) i'm struggling fill contours colour. job smoothscatter or package? suspect might down use of kde2d and, if so, can please explain function or link me tutorial? many thanks! p.s. final image should greyscale seems want filled contour rather jus contour. perhaps library(rcolorbrewer) library(mass) greyscale <-brewer.pal(5, "greys") x <- rnorm(20000, mean=5, sd=4.5); x <- x[x>0] y <- x + rnorm(length(x), mean=.2, sd=.4) z <- kde2

Spring AOP Method Interceptor vs Method Advice -

i new aop , trying understand difference between method interceptor , methodadvice(i.e. methodbeforeadvice or methodafteradvice). me looks both doing same thing i.e. called on method invocation. when should use methodinterceptor vs methodadvice. take @ definition of org.aopalliance.interceptinterceptor interface (implemented methodinterceptor): public interface interceptor extends advice { } it's easy see methodinterceptor advice. difference between advice being defined in @aspect class , such interceptor interceptor implementations can added , removed spring aop proxies @ runtime (casting them 'advised'), whereas advice you're talking more static construct. still essential spring aop since presence tells spring beans wrap in proxy object during application context startup.

c# - Predicate Builder for dynamic Objects -

i have home made library creates expresions used in filetring data in grids ui elemen basic method: public static expression<func<t, bool>> getpredicate<t>( string modelpropertyname, searchtype searchtype, object data) it's simple query objects. basicaly need property name, operator , data compare. it's using reflection create expressions each operator. and have requirement extend functionality.... method uses type t can see.now want me change , pass type argument new method should like: public static expression<func<object, bool>> getpredicate(type t , string modelpropertyname, searchtype searchtype, object data) the don't know how many propperties object have. want tu use "dynamic" objects , expandoobjects. sucks. i don't know if can anonymous type @ runtime expandobject. don't know if can return expression<func<object, bool>> and apply expression dynamic object. sure can't used within

How do I search a file for certain lines and then extract only certain sections of that line in Perl? -

so have text file server report , has 1000 lines of information in it. i'm trying write script can search report pieces of information i'm looking for. example: server 1 health check date - count of errors 06/25/15 : 14 6/24/15 : 21 6/23/15 : 17 6/24/15 : 33 server 2 health check date - count of errors 06/25/15 : 4 6/24/15 : 13 6/23/15 : 21 6/24/15 : 33 errors caused x server 1: 32 server 2: 24 the 3 sections "server health check 1", "server health check 2", , "errors caused x." data each section need extracted in bold. know how go doing this? here's perl script: #!/usr/bin/env perl use warnings; use strict; use constant section_health_check => 'health check'; use constant section_errors => 'errors

java - How to create non-transactional JUnit integration tests in Spring? -

an integration test class annotated with: @runwith(springjunit4classrunner.class) @contextconfiguration(classes = integrationtestconfig.class) it's not supposed run in transaction isn't marked @transactional i'm getting errors when trying perform persist, merge etc. operations on entitymanager , injected using @persistencecontext : no transactional entitymanager available how can resolved? edit: requested in comments, spring version 4.1.0.release , integrationtestconfig below: @enableaspectjautoproxy @enableasync @enablescheduling @enabletransactionmanagement @configuration public class integrationtestconfig { /** * override existing jpa data source bean test data source. * @return test data source */ @bean public datasource datasource() { final simpledriverdatasource datasource = new simpledriverdatasource(); datasource.setdriverclass(org.h2.driver.class); datasource.seturl("jdbc:h2:mem:test;mo

php - Build a batch query for MySQL insert each 1000 items -

i need perform batch insert in mysql/mariadb since data dynamic need build proper sql query. in few steps: i should find whether current row exists or not in table - first select inside loop right have 1454 have insert around 150k later, better batch query 150k insert per item on loop if record exists should update if doesn't should insert ,i not care update yet , code you're seeing insert so here doing: // values csv file array of values $data = convertcsvtoarray($filename); echo "debug count(data): ", count($data), "\n"; $i = 0; $sqlinsert = "insert reps(veeva_rep_id,first,last,email,username,lastloginat,lastsyncat,display_name,rep_type,avatar_url,createdat,updatedat) "; // processing on each row of data foreach ($data $row) { $sql = "select id,lastsyncat reps veeva_rep_id='{$row['id']}'"; echo "debug: ", $sql, "\n"; $rs = $conn->query($sql); if ($rs === false) {

Convert standard Datetime format in given format using c# -

i need convert datetime in c# specific format 2002-09-24+06:00. i want result in datetime variable , not string since need pass soap call expecting datetime in format. how can result? a datetime object doesn't have format , stores date value. , if webservice expect special format, i'm shure wants string . you can special formatted string this: string.format("{your_format}", your_datetime_object); if soap need type xs:datetime try following formatting string : your_datetime_object.tostring("o") this give format: yyyy-mm-ddthh:mm:ss

winapi - Convert events from a USB human interface device using C++ -

i have usb hid touchpad collects input. default, when press on touchpad generates carriage return (enter) , when try use mouse enters dragging state. what want convert carriage return mouse click event , dragging state cursor move without initial clicking part. i found raw input alternative. however, don't know how convert mouse click , cursor move . here code responsible mouse 'reading': lresult callback mouseproc (int ncode, wparam wparam, lparam lparam) { mousehookstruct * pmousestruct = (mousehookstruct *)lparam; if (pmousestruct != null) { if(wparam == wm_lbuttondown) { cout<<"clicked"<<endl; } printf("mouse position x = %d mouse position y = %d\n", pmousestruct->pt.x,pmousestruct->pt.y); stringstream sx, sy; sx << (int) pmousestruct->pt.x << endl; sy << (int) pmousestruct->pt.y << endl; } retu

sql - Alter table variable to add primary key get error Incorrect syntax -

i want add composite primary key constraint defined table variable depending on condition: declare @tbl table(col1 int, col2 int) if [mycondition] alter table @tbl add constraint c primary key(col1) else alter table @tbl add constraint c primary key(col1,col2) but get: incorrect syntax near '@tbl'. alter statements can't used on table variables. as alternative, use temporary table: create table #tbl (col1 int not null, col2 int not null) if [mycondition] alter table #tbl add constraint c primary key(col1) else alter table #tbl add constraint c primary key(col1,col2)

Defining AKKA Actor hierarchies -

understand akka actors derived /user guardian actor. in order take care of exceptions, define myappparent actor , have actors under actor. possible using akka. in realtime need sending messages directly child actors mailbox under myappparentactor , not through parent actor. pointers on how if possible akka. thanks, cabear just started looking akka. understanding (correct me wrong) question. akka has hierarchy. root guardian -> user guardian -> actor hierarchy. if want create top level actor (children of user guardian). actorsystem system = actorsystem.create("mysystem"); actorref ref = system.actorof(props.create(toplevelactor.class); now if want create child actor above created top level actor. instead of 'system' use actors context. eg getcontext().actorof(props.create(childoftoplevel.class)).tell( new message(0, 200000), getself()); you can use tell method above instruct top level actor send messages child created. m

Python - remove excessive html tags -

so i'm having text: <i>this article written </i><a href="http://google.com"><i>test</i></a><i>.</i> i think html, however, want clean up, remove excessive <i> tags , simplify single <i> tag: <i>this article written <a href="http://google.com">test</a>.</i> i tried clean myself, i'd need ahead text, , haven't had success this. there package can use or way can or i'd have manually it? thank you the use of html parser reliable solution. able cope tags split across many lines. the following solve example, not more... def outeri(text): outer = re.search("(.*?)(\<i\>.*<\/i\>)(.*)", text) if outer: return "%s<i>%s</i>%s" % (outer.group(1), re.sub(r"(\<\/?[ii]\>)", "", outer.group(2)), outer.group(3)) else: return text print outeri('<i>thi

html - Targetting a specific Mobile page in wordpress back end -

im trying change ground specific post on mobile wordpress page. @media screen , (max-width: 940px) #page { max-width: 768px; width: 100%; margin: 0 auto; background: #007a52; box-shadow: 0 0 10px #999; } i know page id used im not sure how? http://www.thedoughbros.ie/wp-content/plugins/contact-form-7/includes/css/styles.css the file above has following css , custom backgrounds posts. 806 represents post-id if want custom backgrounds keep adding new blocks different id @media screen , (max-width: 940px) page.custom-background.page-id-806 /*-------------------------------------------------------------- custom backgrounds --------------------------------------------------------------*/ body.custom-background.page-id-806 { background-image: url( http://www.thedoughbros.ie/wp-content/uploads/2015/05/menubackground.fw_.png); } body.custom-background.page-id-723 { background-image: url(http://thedoughbros.ie/wp-content/uploads/2015/03/van3.fw_.png); }

AFNetworking JSON post using Objective C returns unsupported media type -

This summary is not available. Please click here to view the post.

javascript - what is possibility of collision in djb2 function? -

i trying generate unique id using djb2 hash function string "114.143.227.82mozilla/5.0 (windows nt 6.3; wow64; rv:38.0) gecko/20100101 firefox/38.0" what possibility of collision using algorithm given below in javascript. string.prototype.hashcode = function(){ var hash = 5381; if (this.length === 0) return hash; (var = 0; < this.length; i++) { var character = this.charcodeat(i); hash = (( hash << 5 ) + hash ) ^ character; } return hash; } usage: var hash = new string("114.143.227.82"+navigator.useragent).hashcode(); alert(hash); reference: http://www.cse.yorku.ca/~oz/hash.html for above string getting -ve integer value. how return +ve integer types of string? i got solution after modifying above code. string.prototype.hashcode = function(){ var hash = 5381; if (this.length === 0) return hash; (var = 0; < this.length; i++) { var character = this.charcodeat(i);

javascript - Mobile browsers freezing on jQuery prompt -

i want users able enter own options few selects when selecting "add new". using following code answer, can't remember where, works: $(function(){ $('select').change( function(){ var value = $(this).val(); if (value == 'new') { var other = prompt('add new:'); if(!other) return false; $(this).append('<option value"' + other + '" selected="selected">' + other + '</option>'); } }); }); however, when try "add option" mobile devices, iphones far, browser displays prompt freezes completely, forcing restart of browser. occurs in chrome not safari. there other ways of prompting text input or doing wrong? not experienced jquery. i using jquery 1.11.3 google cdn. jsfiddle gives me same result of working on pc , in mobile safari, not on mobile google chrome. tried iphone 5.

javascript - How to always refresh file loaded by ajax, avoiding cached file -

first load external javascript file following code (it appends ext_chat.js script source current dom): var protocol = ('https:' == document.location.protocol ? 'https://' : 'http://'); (function(d, t, p) { var g = d.createelement(t), s = d.getelementbyid('chat_script'); g.src = p + 'mydomain.lc/js/ext_chat.js'; s.parentnode.insertbefore(g, s.nextsibling); }(document, 'script', protocol)); inside ext_chat.js . here i'm including css file: function r(f) { /in/.test(document.readystate) ? settimeout('r(' + f + ')', 9) : f() } r(function () { includecssfile(getbaseurl() + '/css/ext_chat.css')); // getbaseurl() gives correct url }); function includecssfile(href) { var head_node = document.getelementsbytagname('head')[0]; var link_tag = document.createelement('link'); link_tag.setattribute('rel', 'stylesheet'); link_tag.setattribute('

angularjs - Widgets with different dynamic content (angular-gridster) -

i trying create web dashboard based on angularjs angular-gridster module. gridster works fine , don't have problems binding content (like text or images ng-bind-html). but in fact don't want add text or images these "widgets", i'm trying create dashboard dynamic content in it. so, user want add new widget dashboard , choose type (for example clock-widget or else) , maybe configure widget. the problem don't know how add dynamic content (javascript, different html elements, ...) widget. widget created out of scope object, like: $scope.standarditems = [ { name: "item 1", content: "text 1", sizex: 2, sizey: 1, row: 0, col: 0 }, { name: "item 2", content: "clock widget", sizex: 2, sizey: 2, row: 0, col: 2 } ]; i still beginner in angular excuse me if stupid question... what solution add javascript , html elements? directives? own modules? how? thank help! in-order add dynamic content have crea

powershell - Remove parent path -

the following script lists file in directory , return name , path in console. the result like: c:\projects\company\trunk\www\client\project\customer\start.js i need instead removing initial part , having result like project\customer\start.js i not able set right regular expression in replace. please point me out in right direction? get-childitem -path c:\projects\company\trunk\www\client\project -filter *.js -recurse -file | sort-object length -descending | foreach-object { $_ = $_ -replace '\\c:\projects\company\trunk\www\client\project', '' "'" + $_.fullname + "'," } $_ fileinfo object, not string, path doesn't start backslash, , backslashes in search string must escaped if want use -replace operator. try this: $basedir = 'c:\ppp\nnn\trunk\www\client' $pattern = [regex]::escape("^$basedir\") get-childitem -path "$basedir\nnn" -filter *.js -recurse -file | sort-

rx java - Android RxJava: I am not unsubscribing after onComplete -

i have class called pendingrequests . class counter volley requests. have 2 volley methods - 1 called checkopen , 1 called checkcompleted . each methods selects either open or completed records on sqlite tablet database , checks them against server. in checkopen , checkclose , use 3 calls pendingrequests . @ start call initialize() , add volley request queue call add() , begin receive responses call subtract() . both checkopen or checkclose add() 50 , countdown ( subtract() ) zero. once countdown zero, call oncomplete . here code pendingrequests import rx.observable; import rx.subjects.publishsubject; import rx.subjects.subject; /** * created admin on 6/17/15. */ public class pendingrequests { private static integer pendingreq; private static subject<integer, integer> pendingobser = publishsubject.create(); public static void initialize(integer myint) { pendingreq = myint; pendingobser.onnext(pendingreq); } public static

php - Find Facebook global profile ID from app_scoped_user_id -

this has been asked plenty of times on stack overflow, answers explain how convert facebook profile id app_scoped_user_id . asking opposite: i have app_scoped_user_id , provided facebook graph api. i want global profile id, can output link user's facebook page. here flow of php application: a facebook request made /me , returning facebook response on response, call getgraphobject() return facebook graph object . when authenticating own facebook account, contents of graph object: array (size=11) 'id' => string '1117686364915316' (length=16) 'email' => string 'greg.bowler@g105b.com' (length=21) 'first_name' => string 'greg' (length=4) 'gender' => string 'male' (length=4) 'last_name' => string 'bowler' (length=6) 'link' => string 'https://www.facebook.com/app_scoped_user_id/1117686364915316/' (length=61) 'locale' => string '

c# - Mvvm light messenger strange working -

i think question weird. example have code like messenger.default.register<binaryselectorcommunicator>(this, (emp) => { if (emp.option == ((int)games.highlow).tostring()) { db = null; db = new higlow(); db.boxes = new observablecollection<boxstruct>(); } }); it's working in debug mode compiler enter in each row. when adding new function messenger.default.register<binaryselectorcommunicator>(this, (emp) => { if (emp.option == ((int)games.highlow).tostring()) { db = null; db = new higlow(); db.boxes = new observablecollection<boxstruct>(); db.inputassets = new observablecollection<string>((from x in inputdata select x.id).take(1)); } }); it not work. compiler in debug mode not enter messenger. know question weird. why happen in theory? it's throw exception?

c# - wpf : Bind to a control in another xaml file -

i have main.xaml file. in main.xaml file, refer listbox in xaml file. call using view:layoutviewlist in main.xaml file, there button. button enable when listbox selected. elementname=view.layoutviewlist.layoutlistbox not working. thank much button isenabled="{binding elementname=view:layoutviewlist.layoutlistbox, path=selecteditems.count}" binding error : system.windows.data error: 4 : cannot find source binding reference 'elementname=view:layoutviewlist.layoutlistbox'. bindingexpression:path=selecteditems.count; dataitem=null; target element 'button' (name=''); target property 'isenabled' (type 'boolean') system.windows.data error: 4 : cannot find source binding reference 'elementname=view:layoutviewlist.layoutlistbox'. bindingexpression:path=selectedindex; dataitem=null; target element 'button' (name=''); target property 'notarget' (type 'object') you need use relativesour

Bulk updates using linq entities -

i have list of object list category has properties, categoryid, categoryname, categorymessage, i have use list update records in database table categories, has same columns categoryid, categoryname, categorymessage items in list have matching categoryid in database table how can bulk update, using entity framework extensions, examples saw have update value hard coded below, (statusid =2), whereas me value has retrieved item in list matches categoryid in database table. context.tasks.update( t => t.statusid == 1, t => new task {statusid = 2}); thanks in advance. i not sure whether looking for? haven't run code. list<category> categorylist = new list<category> { new category { id = 1, message = "a", name = "a"}, new category { id = 2, message = "b", name = "b"}, new category { id = 3, message = "c", name = "c&quo

package - Python module importation error -

trying install openstack kilo, nova logs returns trace nova neutronclient.neutron import v2_0 neutronv20 trace nova importerror: no module named neutron i tried import modules of neutronclient python : >>> neutronclient.neutron import v2_0 traceback (most recent call last): file "<stdin>", line 1, in <module> importerror: no module named neutron >>> neutronclient import common >>> neutronclient.common loaded. neutronclient.common , neutronclient.neutron has folder (and __init__.py ) in /usr/lib/python2.7/dist-packages/neutronclient/ why python package not detected? tried reinstall package apt-get it's not better. run following command. apt-get install python-neutronclient or pip install neutronclient or download tar file https://pypi.python.org/pypi/python-neutronclient

python - file open throws an error float type -

i have 1 method takes many argument , return multiple value i trying open file in method shows me error like fc=open("abc.txt","a") type error: 'float' object not callable` i don't know why showing error mean there nothing float value. same line if put in calling function create/open file successfully. fc=open("abc.txt","a") the issue might somewhere else in code, have defined variable called open storing float type value. example - open = 0.1 the above line overwrites inbuilt function open float variable, hence after line call open referencing float variable, causing issue. should not use built-in names variables, try renaming variable.

excel - Search a cell for multiple critera from a list and return a corresponding value from the list -

this example should explain question clearly i have huge table of values (50,000+ rows) in format phrase 1 | phrase 2 | value sun | blue | north moon | green | south star | red | west i have list of phrases in format (again 50,000+ rows) b 1| moon fun light green | 2| star amazing ball red | 3| sun cat inside blue | 4| star dog red watch | i need search along following lines - search a1 if find row both phrase 1 & phrase 2 present return corresponding value below example of how results look. i.e. search has checked see if of word combos present in top table , returned appropriate result if possible. there won't issue of 2 sets of positives i.e. moon fun , light green. real values artist name , track name combinations. b 1| moon fun light green | south | 2| star amazing ball