Posts

Showing posts from May, 2012

kotlin - private visibility modifier and subpackages -

so started experimenting kotlin , stumbled upon this: if top-level declaration marked private, private package it’s declared in ( see visibility modifiers ). since packages nest in kotlin, i.e. package foo.bar considered member of foo, if private in package, visible subpackages. note members of outer packages not imported default, i.e. in file in package foo.bar can’t access members of foo without importing them. from: visibility , package nesting so let's consider following example: file1.kt package foo private fun bar() = println("this bar!!!") and file2.kt package foo.baz import foo.bar fun main(args: array<string>) = bar() from understand function bar() should visible in package foo.baz , callable main(). when try compile above following error message: error: kotlin: cannot access 'bar': 'private' in 'foo' is bug or has spec of language been updated , documentation hasn't? missing somet...

javascript - How can I get all text in an SVG document that's exactly within a rectangular region? -

i have complex svg document generated pdf research paper via pdf.js, , want find text within rectangular area. in support of web-based labeling tool users can draw rectangles on top of arbitrary regions of rendered svg file (basically treating image) , need see corresponding text. first approach thought of iterating through each of svg's svg:text or svg:tspan elements , checking whether intersects rectangle in question, perhaps using checkenclosure() ( unsupported ff , btw). however, won't work cases rectangle annotates characters subset of svg:text or svg:tspan . example, imagine want annotate individual keywords in line: keywords: heusler alloys; pressure effect; curie temperature the svg in case breaks 2 's (because 'keywords ' italics): 'keywords: ' and 'heusler alloys; pressure effect; curie temperature' if 1 rect drawn around words 'pressure effect', program need scan each character in each , intersec...

java - return Statement from each branching -

this question has answer here: java error missing return statment 6 answers some times found compilation error - public static boolean returntruefalse(){ if(someconditions) return true; if(someconditions){ //do return true; } if(someconditions){ //do return false; } //got compilation error here } in above situation got compilation error @ commented portion saying - missing return statement . how can avoid situation? thanks well, message of compile error pretty clear : code must encounter return statement of every possible execution path because method has non-void return type. add return statement last case, or throw exception if should not reach state in normal execution.

java - Best way to represent set of string values in DB and UI -

i'm looking opinions guess 'which better' question. have webapp build in javascript/jquery , struts uses hibernate access data in relational db (mysql). when object/database field has limited set of strings values, better use full string in object/db or 'code' string, single char instead of entire string? class user { int id; string username; string type; // values of 'administrator', 'regular' or char type // values of 'a', 'r' or char type // values of 'a', 'r' string typestring; // can returned on fly based on 'type' or db in sql case statement } if database has full text string, easy coding way around, wasting space (in db, data transfer) on has few values. if database has 'code' when presenting field user ( in grid of existing users, or dropdown selection list when creating new user ) char value must converted full string. question s...

c# - Which part of the code shows validation errors after Post in asp.net MVC? -

let's have 1 view model. has 1 required name property. , have disabled client-side validation. have code in action method: if (!modelstate.isvalid) { return view(model); } so, works fine. highlight required field after post. but, can't understand jquery validaion function process? how, jquery validation detects form has been submitted once? i want find code, because want change slightly. example, have own helpers, has custom validation logic. now, custom helper validation not showing after invalid post. and, want add logic built-in function, can not find anywhere. firstly, if have disabled client side validation, jquery validation has nothing (you have disabled it!). briefly explain happens when post , return view. the defaultmodelbinder initializes new instance of model the defaultmodelbinder reads form data (name/value pairs) , if property name matches 1 of form data values, property set (assuming valid) , value adde...

Get a string with HTML tags inside a larger string with ColdFusion regex -

i'm new regular expressions , use help. i attempting use coldfusion rereplace scrape data , desired content. this have far: <cfoutput> #rereplace("remove please <p>make display please</p> remove please", "", "", "all")# </cfoutput> what regular expression take string , return "make display please"? in order subtext longer string, need match need, capture need capturing group (...) , , match rest of string end. replacement \1 back-reference references text captured capturing group. so, use #rereplace("remove please <p>make display please</p> remove please", ".*<p>(.*?)</p>.*", "\1", "all")# the regex matches: .* - matches character newline beginning last </p> <p> - literal <p> (.*?) - 0 or more characters other newline symbol few possible (it means closest </p> here) </p> - matc...

c# - Checking who accessed a directory last time -

main purpose i'm trying create program defends user personal files being accessed hacker. programming environment c# microsoft visual studio 2013 concept the program loops through directories of file system continously. checks file accessed it if none of users accessed modified or read, sounds alarm my question how check accessed file last time? my ideas i tought maybe check through directory security fileinfo class thanks in advice solution hi all, have solution, thank answers. here's code if needs in his/her project: public static string getspecificfileproperties(string file, params int[] indexes) { string filename = path.getfilename(file); string foldername = path.getdirectoryname(file); shell32.shell shell = new shell32.shell(); shell32.folder objfolder; objfolder = shell.namespace(foldername); stringbuilder sb = new stringbuilder(); foreach (shell32.folderitem2 ...

jquery - Neon-animated-pages does not resize -

i'm using polymer 1.0 in website. i'm trying <neon-animated-pages> element work in conjunction <paper-tabs> . the issue have using affects layout structure of web page. works fine, since positioning of pages ( <neon-animatable> ) element implicitly absolute, wrapping element <neon-animated-pages> not expand fit content. content pages varies in height, footer (content after this) overlaps in background. you can visualize image slider, variable height images followed content. is there work-around achieving this? or should create own element bound paper-tabs (if so, can provide general idea achieve this)? can remove absolute position, ruins animation flow on page change. here have: <template is="dom-bind" id="scope"> <paper-tabs selected="{{tab}}"> <paper-tab>tab1</paper-tab> <paper-tab>tab2</paper-tab> </paper-tabs> <neon-animated-pages class="flex layout v...

php - How can I search my database, in WordPress, for all the options of a custom field? -

i'm in custom taxonomy page , need display options of particular custom field called "region". tried doing database query possible values, because multiple regions selectable in custom field, resulted values many different combinations of regions (such "asia, africa, europe" one, "central america, north america" , "europe, central america", etc etc.) i want retrieve them singularly, ("asia" one, "europe" another, etc. etc.) how go doing this? you can use basic coding approach of php. approach: use explode() function of php , set values in array each meta value key 'coffee_region' (adding each meta value in single array. make sure adding elements not overwriting previous values of meta in array). then use array_unique() function rid of repetitive countries array. and when print array having listing of unique country names meta fields

Android - SDK platform-tools is missing? -

i'm trying make sd card default downloading apps, , i'm using guide i've downloaded sdk tools, written there. problem don't have platform tools package, required it. i've done it's computer that's why didn't have program. i tried using this page , wrote command: android.bat update sdk --no-ui it says failed fetch urls , says there's nothing update. should do? note: downloaded /:d , cause problem? didn't have space on c . i don't think calling update enough, need install platform tools explicitly. please see how use non-ui sdk manager here: updating sdk command line

unix - Grep: Recursive option produces unexpected behavior when fed pipe-input -

i've been using utility many years, in many environemnts. i'm noticing on 1 particular environment, produces unexpected results. grep -r 'search-term1' . | grep 'search-term2' the above code greps recursively instances of search-term1, in current-dir. results piped grep, selects lines contain search-term2. works expect. grep -r 'search-term1' . | grep -r 'search-term2' the difference in above code -r recursive flag in specified in both grep commands. expect behavior not change particular case. after all, input 2nd grep pipe-input, , there's nothing further found recursively. i have been using command successfully, many years, in many different environments (both unix , mac-os). however, recent environment started working in (unix), breaks above behavior. second piped grep searches instances of search-term2, not in piped-input, files in current directory. because of this, instead of getting results contain both search-terms, resu...

eclipse - How to send variable to url, get input, then print results java -

i trying send variable (ip address) in java website (whois.com) , have variable entered websites search bar print out results in program. you need study website, @ form find out request (post, get, fields, etc.) expects, send request , parse result. in other words, have simulate being browser. not should do. https://www.whoisxmlapi.com/ offers real api, perhaps that's you.

java - No bean named 'persistenceUnit' is defined -

im starting new proyect spring , jpa , hibernate , mysql database, having problem configuration. i developed similar architecture, never created it, fighting this. this dispatcher-servlet.xml <!-- persistencia --> <bean class="org.springframework.orm.jpa.support.persistenceannotationbeanpostprocessor" /> <!-- datasource --> <bean id="datasource" class="org.springframework.jdbc.datasource.drivermanagerdatasource"> <property name="driverclassname" value="com.mysql.jdbc.driver" /> <property name="url" value="jdbc:mysql://localhost:3306/editor" /> <property name="username" value="root" /> <property name="password" value="root" /> </bean> <bean id="hibernate4annotatedsessionfactory" class="org.springframework.orm.hibernate4.localsessionfactorybean"> <property name=...

text - 2 different Ranges Compare from different Sheets not Working VBA -

why isnt text compare working? i'm trying compare 2 different ranges different sheets. is there simple way of doing this? sub selecttest() text3 = sheets("input data").range(cells(2, 2), cells(2, columns.count).end(xltoleft)) text4 = sheets("sap output data").range(cells(3, 1), cells(rows.count, 1).end(xlup)) if strcomp(text3, text4, vbtextcompare) = 0 else cells(cell.row, "a").interior.colorindex = 26 cells(cell.row, "b").interior.colorindex = 26 cells(cell.row, "c").interior.colorindex = 26 cells(cell.row, "d").interior.colorindex = 26 end if end sub is there im doing incorrectly? also tried no errors wont solve: sub comprangetest() thisworkbook.sheets("input data") text3 = range(cells(2, 2), cells(2, columns.count).end(xltoleft)).select end thisworkbook.sheets("sap output data") text4 = sheets("sap output data").range(cells(3, 1), cells(rows.count, 1).end(xlup)).select ...

java - virtualClasspath equivalent in tomcat 8 -

i deploying instance of tomcat 8 , trying find equivalent of virtualclasspath. below snippet of configuration descriptor had in tomcat 7, <context path="/path"> <loader classname="org.apache.catalina.loader.virtualwebapploader" virtualclasspath="/home/kedar/third_party_jars/*.jar" /> </context> how can specify similar thing in tomcat 8. more specific, how include multiple third party jars(as above) under classpath in configuration descriptor of tomcat 8? we can include each jar 1 one in following way, looking regex kind of way include multiple jars. <resources classname="org.apache.catalina.webresources.standardroot"> <postresources classname="org.apache.catalina.webresources.jarresourceset" base="/home/kedar//third_party_lib/xyz.jar" internalpath="/" webappmount="/web-inf/classes" /> </resouces> ...

PHP - declare a non-static member array? -

on question: array push not working it seems answers indicating historyarray static array. did not declare static; php implicitly arrays? there way declare member array not static? if read through comments, see array static, edited it.

sql server - SQL - Get Sum of Values with same Date -

i'm sure i've done type of operation 1000 times before reason not working me. i'm doing report determine if patient receive medication on day. regardless if 1 or 5 doses in day value should 1. staff corrections on system, come in negative values. need sum of dose value each day, if + value 1, otherwise 0. all want accomplish @ point have 1 row each date either 1 or 0. here sql query sum values: select dim_drug_name_short.drug_name_short 'med_name_short' , sum(baseline.doses) 'dot' , day(baseline.dispense_date) 'd_date' fact_ams_baseline_report baseline inner join dim_drug_name_short on baseline.med_name_id = dim_drug_name_short.drug_name_long inner join dim_date tdate on baseline.dispense_date = tdate.date baseline.encounter = '00000001/01' group dim_drug_name_short.drug_name_short , baseline.dispense_date , doses order drug_name_short for time being i'm pulling 1 encounter...

c# - How to handle navigation logic in selenium web driver tests -

i'm new selenium web driver. trying implement automated suite of tests , following pom (page object model). question page navigation. instantiate web driver in actual test. tell url go to? if that's case, have every time write test? or there better way handle navigation perhaps page object have url in it, don't have specify on every single test. see various options , others doing. in advance. only 1 time need specify url , 1 time webdriver initialization enough.

How to delete all android contacts that start with a specific name? -

i want delete contacts android phone starts "aaa" or contains "aaa" . here's tried: private void deletecontact(string name) { contentresolver cr = getcontentresolver(); string = contactscontract.data.display_name + " = ? "; string[] params = new string[] {"aaaa"}; arraylist<contentprovideroperation> ops = new arraylist<contentprovideroperation>(); ops.add(contentprovideroperation.newdelete(contactscontract.rawcontacts.content_uri) .withselection(where, params) .build()); log.e(",,,,",string.valueof(ops.get(0))); try { cr.applybatch(contactscontract.authority, ops); } catch (remoteexception e) { // todo auto-generated catch block e.printstacktrace(); } catch (operationapplicationexception e) { // todo auto-generated catch block e.printstacktrace(); ...

bower - Visual Studio 2015 RTM - Where did bower_components go? -

it looks visual studio 2015 rtm, bower_components folder gone , packages saving directly wwwroot/lib/ folder. verified fact default gulpfile no longer has function copying files bower_components wwwroot. however in default project.json, bower_components still in "exclude" property though folder no longer exists. possibly oversight? does know going on this? didn't see in release notes or bug fixes , known issues articles. also, thought entire point of wwwroot folder house white-listed files needed actual site. which, guess there no harm in making library code available here, makes our lives easier add new libraries, throughout beta period bower_components folder pretty strictly separated. https://www.visualstudio.com/en-us/news/vs2015-vs.aspx https://support.microsoft.com/en-us/kb/3025135 i've been trying adjust project match changes in latest vs project template asp.net 5 well. from can tell, there task copy stuff bower_components folder wwwro...

java - Error when publishing or saving an API in WSO2 -

i using wso2 1.9.0 , bam 2.5.0, jdk 1.7.0_79 , mysql-connector-java-5.1.36-bin.jar. when try save or publish api in api publisher, alert appears "error occurred while updating api". in "/wso2am-1.9.0/repository/logs/wso2carbon.log" file: error {org.apache.catalina.core.applicationdispatcher} - servlet.service() servlet jaggeryservlet threw exception {org.apache.catalina.core.applicationdispatcher} java.lang.abstractmethoderror: com.mysql.jdbc.preparedstatement.setbinarystream(iljava/io/inputstream;)v @ org.wso2.carbon.apimgt.impl.dao.apimgtdao.addurltemplates(apimgtdao.java:6721) @ org.wso2.carbon.apimgt.impl.dao.apimgtdao.updateurltemplates(apimgtdao.java:6917) @ org.wso2.carbon.apimgt.impl.dao.apimgtdao.updateapi(apimgtdao.java:7022) @ org.wso2.carbon.apimgt.impl.apiproviderimpl.updateapi(apiproviderimpl.java:547) @ org.wso2.carbon.apimgt.impl.userawareapiprovider.manageapi(userawareapiprovider.java:71) ...

Does setting a Core Data property to the same value trigger an update? -

is officially necessary check see if core data property set yes or no (for example) before setting same value (yes or no) again when enumerating ... in order avoid triggering update no reason? or, smart enough avoid unnecessary updates? instead of: [object setisred:@(yes)]; is necessary do: if (![[object isred] isequaltonumber:@(yes)]) { [object setisred:@(yes)]; } just wondering!

why the database table TABLES.table_rows column does not match select count(*) from the physical table in MySQL -

when comparing information_schema.tables.table_rows column physical row count retrieved "select count(*) " numbers not match. why row counts different? mysql> select table_rows tables table_name = 'gbl_session' , table_schema = 'mydb'; +------------+ | table_rows | +------------+ | 7306 | +------------+ 1 row in set (0.01 sec) mysql> select count(*) mydb.gbl_session; +----------+ | count(*) | +----------+ | 7800 | +----------+ 1 row in set (0.01 sec) for innodb tables, row count rough estimate used in sql optimization. (this true if innodb table partitioned.) read more information: https://dev.mysql.com/doc/refman/5.1/en/tables-table.html as comment on there suggests, can try to: table_rows (and perhaps other columns in information_schema.tables) may out of sync current table contents, can update running analyze.

mongodb - doctrine ODM / Mongo DB and Object References -

for life of me, can not find answer problem. so, i'll ask here. let's have 3 document types in mongo. // provider { $id: objectid('xxx'), "name": "some name", } // category { $id: objectid('yyy'), "name": "some category" } // item { $id: objectid('zzz'), "name": "some item", "references": { "provider": { $ref: "provider", $id: objectid('xxx') }, "category": [ { $ref: "category", $id: objectid('yyy') } // etc etc, more referenced categories ] } } now, how annotate doctrine entity can read out , query referenced objects. clarity keep external references within "references" block. any appreciated. marc

ruby on rails - Postgres: Default for column (string) cannot be cast automatically to type enum -

i have status column in table want enum. created field integer, thinking use built in rails enum functionality. turns out requires @ least rails 4.1, using 4.0 , process of upgrading going take time. but thinking how works, realized can have either activerecord enum or postgres enum, not both. thought in long term having more explicit postgres enum best. so, wrote migration convert status column integer enum. execute "create type status_options enum ('pending', 'declined', 'approved');" change_column :site_applications, :status, "status_options using status::status_options" but, error: pg::cannotcoerce: error: cannot cast type integer status_options alter table "site_applications" alter column "status" type status_options using status::status_options everything have seen far in searchings tells me should have worked , doesn't. thought maybe problem can't go integer enum. it. solution first conver...

php - The block type "sonata.admin.block.admin_list" does not exist -

i tried install symfony cmf sonata admin bundle have issues enabling it. apparently i'm not first, other answers have not helped me wery unfortunatly. this complete exception: an exception has been thrown during rendering of template ("the block type "sonata.admin.block.admin_list" not exist") in sonataadminbundle:core:dashboard.html.twig @ line 35. and appkernel.php: $bundles = array( // symfony standard edition bundles new symfony\bundle\frameworkbundle\frameworkbundle(), new symfony\bundle\securitybundle\securitybundle(), new symfony\bundle\twigbundle\twigbundle(), new symfony\bundle\monologbundle\monologbundle(), new symfony\bundle\swiftmailerbundle\swiftmailerbundle(), new symfony\bundle\asseticbundle\asseticbundle(), new doctrine\bundle\doctrinebundle\doctrinebundle(), new sensio\bundle\frameworkextrabundle\sensioframeworkextrabundle(), // symfony cmf standard edition bundles new doctrine\bundle\...

jquery - Get ID of which ID sortable replaced -

here current code, works. issue need find out id replaced, not index. instance, if move item 3 item 5, need start variable 127 , end variable 129 example. how alter code information? $(function() { $( "#sortable" ).sortable({ start: function(event, ui) { ui.item.startpos = ui.item.index(); }, stop: function(event, ui) { alert("start position: " + ui.item.startpos); alert("new position: " + ui.item.index()); alert("item moved: " + $(ui.item).attr('id')); var start = ui.item.startpos; var end = ui.item.index(); var id = $(ui.item).attr('id'); $.ajax({ data: (start, end, id), type: 'post', url: 'update_order.php?start='+start+'&end='+end+'&id='+id+'' }); } }); $( "#sortable" ).disableselection(); }); <ul id="sortable"> <li class="ui" id="125...

c# - can nuget packages compiled against .net4.5 be referenced by dnxcore50 -

Image
i'm compiling application targets dnxcore50 only. i'm attempting reference nuget package know works fine when run against dnx451. when dnx . run get: system.invalidoperationexception: failed resolve following dependencies target framework 'dnxcore,version=v5.0': it suggests dnu restore package there it not work package under circumstances (if any) ? in order work must package manager build version compiled against dnxcore50? update this chart makes things bit clearer (copied here ) no. dnxcore50 indicates you're running on dnx on top of .net core. assemblies can load in .net core target compatible profile, in case e.g. dnxcore50 , dotnet , or 1 of compatible portable profiles. if have assembly compiled against full .net framework (via net45 , net451 , etc.), won't run when on .net core same apis aren't available.

apache - laravel 5 showing internal error -

i have laravel 5 app working quite on local server transfer files server in directory (not in root) , accessing http://example.com/directory/public/ showing "500 internal server error". have searched on stack overflow , found error .htaccess . i tried adding rewritebase / , options all nothing worked. tried .htaccess code provided in laravel docs didn't work. storage directory set 0777 , laravel log file set 0666. files set 0664 , 0666. deleting .htaccess file public folder shows same error. i have ftp'd files of laravel app local live server. if have shared hosting move files , folders public root directory , change paths in index.php file accordingly. , either rename public folder or delete it. i think cannot access public folder accessing on local machine. first run server access directory name. if don't want run server have mentioned in first paragraph. work on live server. access address http://example.com/directory

winforms - Datagrid view in Windows Form C# -

Image
hello using datagridview in c# windows form , in data grid view using data grid link columns, example code here datagridviewlinkcolumn editlink = new datagridviewlinkcolumn(); editlink.usecolumntextforlinkvalue = true; editlink.headertext = "edit"; editlink.datapropertyname = "lnkcolumn"; editlink.linkbehavior = linkbehavior.systemdefault; editlink.text = "edit"; gvjobs.columns.add(editlink); and gives me output its fine when reload grid gives doesnot remove existing edit column giving data source null. example code , output here. gvjobs.datasource = null; var jobs = (from v in general.ent.jobs (v.mrnumber == (string)txtmrnumber.text) select new { mrnumber = v.mrnumber, numberofdocuments = v.noofdocuments, ...

xml - How to run test suites parallel or serially in multiple browser using selenium grid -

how run test suites parallel or serially in multiple browser using selenium grid. have 3 xml files, 1 chrome.xml(contains test run in chrome), , 1 firefox.xml(contains test run in firefox) , testng.xml contains both suites. chrome.xml <suite name="chrome"> <listeners> <listener class-name="ww5.listener.listener" /> </listeners> <test name="v5"> <parameter name="browser" value="chrome"/> <classes> <class name="ww5.testcases.version.version" ></class> <class name="ww5.testcases.loginsuite.logintest" ></class> <class name="ww5.testcases.loginsuite.logouttest" ></class> </classes> </test> </suite> firefox.xml <suite name="firefox"> <listeners> <listener class-name="ww5.listener.listener" /> </listeners> <test...

github - C9 created workspace before repository -

i made mistake of creating workspace before repository on c9.io . as result not have version control. naturally, want use git project before make more changes. have tried has failed. rather not have copy code i've made new work space set repository. if has suggestions or answers problem, via command line, gui or else wonderful. cloud9 doesn't special magic when cloning git repository, , can add remote standard way locally: git init initialize git repository in current folder git add -a add (or want) git commit -m "initial commit" commit git remote add origin git@github.com:<me>/<repo>.git add repo git push origin head:master push head master branch in remote added

sftp - SSH Server confirms Client? -

my company uses commercial (tibco mft) software system handle file transfers, , encountered instance unable connect specific clients sftp server. connect day when going linux terminal on same local server, when trying use software failed authenticate. using simple user/password set connect them. fixed (in software control panel) selecting "use default key"(which way our key)in ssh options, selection had been "none". mind, should have been required use some sort of key, brought attention have lot of sftp push file transfers use server configurations ssh key marked "none". have looked around , not found satisfactory answer. have suspicions though: does remote server have file containing keys remote systems (sort of known_hosts?), , if client system not in file, won't let me log in? does have "double key exchange" used in ssh2? if customer server using ssh1 not require server key? i appreciate insight in this. ssh can set...

oracle - The fast way to select with where cause -

i have table 10 million records have table structure this ------------------------------------------- barcode | price | brand ------------------------------------------- 1001001000111 | 1 usd | 1001001000112 | 1 usd | b 1001001000113 | 1 usd | 1001001000114 | 1 usd | b 1001001000115 | 1 usd | c . . . i want barcode value brand equal b; query. select barcode mytable brand='b'; i spent lot of time wait result, try change where condition where brand='b' brand not in ('a','b','c',..) . seem faster first query amount of element in ('a','b','c',..) small, amount of elements in ('a','b','c','d',...) getting huge query getting slower. what fastest way data? please me solve this. if there no index on brand end doing full table scan. if there index on brand, large fraction of table brand b query optimizer may decide full table scan still best method. if ther...

c# - How does Array.Reverse work? -

i have simple piece of code.. bool istrue(char[] number) { char[] reverse = number; array.reverse(reverse); } when debugging application saw number reversed too. can explain me why? related how char arrays work, or missing something? with char[] reverse = number; you not creating copy of array, reference it. if want copy array, can use .clone() : char[] reverse = number.clone();

c# - Partial View: An unhandled exception of type 'System.StackOverflowException' occurred in mscorlib.dll -

i know there numerous posts couldn't seem fix error. i getting above error (title) in partial view believe means have infinite loop not sure why happening. please see below: homecontroller public actionresult usertable() { manager = new manager(); var data = manager.getallusers(); var userdetails = u in data select new userdetail { userid = u.id, username = u.name, userlogin = u.login, firstname = u.firstname, surname = u.surname, email = u.email, active = convert.toint32(u.active), rightid = u.rightsid, groupid = u.groupsid, }; ...

asp.net mvc - Edit CSS to apply for certain elements -

i know it's dumb question couldn't find solution myself. have 2 lists in html page. first 1 : <ul id="menu"> <li><a href='@url.action("mainpage","shirts")'>main page</a></li> <li><a href='@url.action("onsale","shirts")'>on sale</a></li> <li><a href='@url.action("recent","shirts")'>recent</a></li> </ul> the second 1 pagedlistpager generates html list : @html.pagedlistpager(model, page => url.action("mainpage", new { page, sortorder = viewbag.currentsort, currentfilter = viewbag.currentfilter })) this css html : ul { list-style-type:none; margin:0; } li { display:inline-block; float: left; margin-right: 1px; } li { display:block; min-width:140px; } li:hover { background: #19c589; } li:hover ul { background: #f3f3f3; color: #...

html - Text box that gets longer as you type -

<div class="container"> <form action="/html/tags/html_form_tag_action.cfm" method="post"> <div> <input type="text" id="text" name="text_name" class="mytext" placeholder="comments" style="height:100px"/> </div> </form> </div> i want create text box has set size type in text box, box can longer not wider ie on facebook or twitter post, type instead of text getting hidden on left hand side whole box becomes longer i have attached code have (also side note, how can comment placeholder move top of text box) thanks in advance this how it: .mytext { word-break: break-word; } here jsfiddle demo

jquery - Google Maps API, Directions From Marker To Marker -

so have map lots of markers plotted. want able right click marker , select "start point", right click marker , select "destination point". i remove markers , show 2 markers ive clicked directions drawn on map. i have no idea begin here, new jquery. here code far have stripped out non important code make small possible: window.onload = function () { var markerarray = new array(); var mapoptions = { center: new google.maps.latlng(markers[0].lat, markers[0].lng), zoom: 6, maptypeid: google.maps.maptypeid.roadmap }; var infowindow = new google.maps.infowindow(); var map = new google.maps.map(document.getelementbyid("map-canvas"), mapoptions); var image = 'marker.png'; (i = 0; < markers.length; i++) { var data = markers[i] var mylatlng = new google.maps.latlng(data.lat, data.lng); var ischeckedd4 = ...

python - Error on doing shutil.rmtree -

in python code copying installer temp , installing , want delete temp copy. using "shutil.rmtree" function remove installer copy in temp. sometime getting error "[error 32] process cannot access file because being used process" how can avoid ? have way check directory not used other program ? if yes can check availability of directory till other process leaves control , delete ? please me sample codes ! pretty new python. copy_dst = tempfile.mkdtemp() if success: success = robocopy_file_or_folder(installer_location, copy_dst) local_path_to_setup = os.path.join(copy_dst, app_folder, 'setup.exe') if success: success, response_text = install_product(local_path_to_setup, success, response_text) try: if success: shutil.rmtree(copy_dst, ignore_errors = false, onerror=handle_remove_readonly) except oserror e: log(" %s\n delete installer local copy @ \"%s\" failed.\n" % (e, copy_dst)) success =...

python - Size of FITS file different before and after processing -

i have problem file size after processing...i wrote script create edited image...(from raw image data deduct flat field image data , dark image data)...here code convert float numpy array big endian , problem is...at beggining have fits file size 2.8mib type >2i...after processing have fits file 11mib , type float64 , dont know why? in idl fix method http://www.exelisvis.com/docs/fix.html . in python use imgg=imgg.astype(np.int16,copy=false).so image file 2.8mib in white black color... any suggestion please? from http://docs.astropy.org/en/stable/io/fits/appendix/faq.html#why-is-an-image-containing-integer-data-being-converted-unexpectedly-to-floats if header image contains non-trivial values optional bscale and/or bzero keywords (that is, bscale != 1 and/or bzero != 0), raw data in file must rescaled physical values according formula: physical_value = bzero + bscale * array_value as bzero , bscale floating point values, resulting value must float well. if o...

.net - C# async/await strange behavior in console app -

Image
i built async/await demo console app , strange result. code: class program { public static void beginlongio(action act) { console.writeline("in beginlongio start... {0} {1}", (datetime.now.ticks - ticks) / timespan.tickspermillisecond, thread.currentthread.managedthreadid); thread.sleep(1000); act(); console.writeline("in beginlongio end... \t{0} {1}", (datetime.now.ticks - ticks) / timespan.tickspermillisecond, thread.currentthread.managedthreadid); } public static int32 endlongio() { console.writeline("in endlongio start... \t{0} {1}", (datetime.now.ticks - ticks) / timespan.tickspermillisecond, thread.currentthread.managedthreadid); thread.sleep(500); console.writeline("in endlongio end... \t{0} {1}", (datetime.now.ticks - ticks) / timespan.tickspermillisecond, thread.currentthread.managedthreadid); return 42; } public static task<int32> l...

javascript - AngularJS - Can I change the value / expersion of ng-repeat in View using a directive -

i have hypothetical question. have 2 object arrays in controller , in view loop through data of 1 of these object arrays. possible me switch value of ng-repart (or change expression) in directive. example... here controller: controller('mainctrl', ['$scope', function($scope) { $scope.beatles = [{id:1, name: "john", inst: "guitar", alive: false},{id:2, name: "paul", inst: "bass", alive: true},{id:3, name: "george", inst: "guitar", alive: false},{id:4, name: "ringo", inst: "drums", alive: true}]; $scope.huskers = [{id:1, name: "bob", inst: "guitar", alive: true},{id:2, name: "grant", inst: "drums", alive: true},{id:3, name: "george", inst: "bass", alive: true}]; }]) here view... <div data-my-template-dir class="beatles"> <div data-ng-repeat="beatle in beatles tra...