Posts

Showing posts from January, 2012

html - white-space property breaks the elements widths -

Image
so initial thing wanted achieve 2 elements stacked side-by-side both of them take full available height, 1 of them has fixed width , width of container varies. left element contains image (70px wide) whole element should 200px wide. right element should fit 1 line of text , overflowing text should clipped showing ... . html: <div class="wrapper-wrapper"> <div class="wrapper"> <div class="left"> <image src="http://s4.postimg.org/i1huts8vt/kitten.png" /> </div> <div class="right"> text row 1 freaking wide row tons of text deal or gtfo. have enough text fill box ? </div> </div> </div> aaand css : .wrapper-wrapper { width: 600px; } .wrapper { border:1px solid #aaa; margin:0 0 10px 0; display: table; width: 100%; } .left { width:200px; background-color:#eee; } .left, .right { di

python - Pandas.DataFrame.read_sql to read as float32 instead of float64 -

i'm using pd.dataframe.read_sql retrieve large number of records sql database causing huge amount of memory used. i noticed dtype of numerical values float64 , require float32 dtypes on of numerical values. is possible retrieve values via read_sql float32 ?

Swift/iOS - Whats the alternative to multiple android drop down lists -

Image
i'm new ios , swift. i've been making android app couple years now. i'm learning swift , making ios devices. i need alternative ways of drop down lists, since thats i've using in android. i've been researching uipickerviews, uipopovers table views , more. twist is, need multiple alternate of drop down lists in 1 viewcontroller. here view in android app, want pretty similar in ios version. i've been building survey applications last couple of months , exact problem has come several times. while uipickerview makes sense, doesn't allow user see more few options @ time , doesn't scale iphone 4s 6+ or ipad. the first thing recommend create button drop down menu. i've found looks remotely button works making hyperlink or inline what's surrounding doesn't work ux perspective. here's button use looks like: all is a. uibutton thin border around corner radius of ~5. as actual drop down, i've found popovers pretty

Android M FingerPrint Security -

i have found no document indicates : - whether fingerprint stored ( in secure place : apple in chip ? - if google grantee fingerprints not tracked. ideas? google give info in post: http://android-developers.blogspot.co.uk/2015/10/new-in-android-samples-authenticating.html the android fingerprint api protects user privacy keeping users’ fingerprint features contained within secure hardware on device. guards against malicious actors, ensuring users can safely use fingerprint, in untrusted applications.

mysql - PHP Script not respect greater than symbol (>) when write in DB -

i have game developed in scirra construct 2 saves scores in database. submit scores database using ajax, , hosting of receive php files . php checks if score sent greater score in existing database , , if greater , stores , , if less discards . the game works , keep scores higher every time , have problem. if close game , open omits previous score , overwritten new being lower. it seems resets write again , not respect saved score above. for example: if in first run 25 points, after 75 points, last value saved in db 75 because greater 25. if after close game , run again, if first try 25, game should conserve 75 points, in case ocurrs error , 75 points changed 25 points, still if 25 < 75. what's going on? this php [img] https://i.gyazo.com/6650fa313895fa1ffceb87dd2f1a8ebd.png[/img] [img] https://i.gyazo.com/844b2c2fadce1b85cf7b5cd3d8e36678.png[/img] is writed in spanish. the parameters u, pm, ps, pr pm, pt, sent ajax in normal way (with request url etc...

java - Android recyclerview: more efficient notifydatasetchanged or notifydatarangeremoved then notifydatarangeinserted? -

i have recyclerview number of elements changes time. might have 5 items, 7, 70. more efficient way of changing out entire dataset: 1) calling clear(), adding new dataset calling notifydatasetchanged? 2) calling clear(), calling notifyitemrangeremoved, adding new dataset , calling notifyitemrangeinserted? public void swapdata(arraylist<datatype>() newdata) { int oldsize = recyclerlist.size(); recyclerlist.clear(); if (oldsize > 0) { notifyitemrangeremoved(0, oldsize); } ... } the easiest way involves few steps, works if items have proper ids. override getitemid(int position) , return item's id. in recycleradapter's contructor, add line: sethadstableids(true); just use notifydatasetchanged() in swapdata method after you've switched lists.

command line - sudo chmod permission denied -

i accidentally executed following command: sudo chmod -r 0700 /lib now every single command (even sudo) gives me 'permission denied' (even simple commands 'ls'). got told because important executable files in lib folder not executable anymore. basically system blocked. there way restore (it server reinstalling not option)?

ios - View width is not equal to cell width inseide uitable? -

Image
i trying add view inside uitablecell.it works fine devices on ipad width of view not equal cell width.the width of view half of width of cell.please tell me here. constraints are: please select width , height (any,any) in storyboard.it may helpful you.

Multiple where in mysql query not returning anything -

i know easy question, why isn't query returning ? mysql> select * notifications; +----+---------+-------------+---------+--------+---------------------+ | id | user_id | sec_user_id | item_id | action | date | +----+---------+-------------+---------+--------+---------------------+ | 1 | 1 | null | null | null | 2015-10-09 23:47:36 | +----+---------+-------------+---------+--------+---------------------+ 1 row in set (0.00 sec) mysql> select id notifications user_id = 1 , action = null; empty set (0.00 sec) change action = null action null .

html - ASP:Content master page control being called when not in markup? -

i'm using asp master page lay out content on webpage. the site.master file looks this. <div class="container fullwidth-main-content"> <asp:contentplaceholder id="fullwidthmaincontent" runat="server"> </asp:contentplaceholder> </div> <div class="container margin-main-content"> <asp:contentplaceholder id="marginmaincontent" runat="server"> </asp:contentplaceholder> </div> now.. on default.aspx i'm calling <asp:contentplaceholder id="fullwidthmaincontent" control. amongst other content controls. however on portfolio.aspx page reason though i'm not calling <asp:contentplaceholder id="fullwidthmaincontent" control it's still appearing underneith other content have called. why happening?

html - css only half text box is showing? -

Image
just got search button codepen, tried placing in website , boom, doesn't work! i've had mess around , can't see issue is, what happens animations plays lovely! search bar loads, when typing, can see half text, see image below heres code $brand: #b3c33a; $speed: 0.5s; body { color: $brand; background-color: #333; } .search { position: absolute; top: 50%; left: 50%; margin-left: -300px; width: 600px; } svg { position: absolute; transform: translatex(-246px); width: 600px; height: auto; stroke-width: 8px; stroke: $brand; stroke-width: 1px; stroke-dashoffset: 0; stroke-dasharray: 64.6 206.305; transition: 0.5s ease-in-out; stroke-linejoin: round; stroke-linecap: round; } .input-search { position: absolute; width: calc(100% - 148px); height: 64px; top: 0; right: 20px; bottom: 0; left: 0; border: none; background-color: transparent; outline: none;

html - How to make the size of my text fill more of its existing line-height? -

i've setup mockup of page display users name, value, , units. i'm trying value in middle fill entire container. i've used vh units set height of both font , parent, want number closer row boundaries above , below. if add anymore height font-size, pushes row below down, causing scroll bar show up, , if play with/remove line-height jumps value above upper row boundary. responsively right works way i'd like, except value not filling more of container. .row.userprofile { width: 100%; margin-left: auto; margin-right: auto; max-width: initial; } .person-1 { background-color: green; color: white; } .person-1 .person-name, .person-1 .person-value, .person-1 .person-units { font-weight: 700; text-align: center; text-transform: uppercase; } .person-1 .person-name, .person-1 .person-units { font-size: 9vh; line-height: 15vh; min-height: 15vh; } .person-1 .person-value { font-size: 70vh; line-height: 1.0; margi

c++ - Running HTTP server example from Boost Asio -

i'm getting errors when trying run http server example comes source of boost library, under path: boost_1_59_0/libs/asio/example/cpp11/http/server/ . i ran following commands in boost_1_59_0 directory: $ ./bootstrap.sh $ sudo ./bjam install $ sudo ./b2 install after installing targets, tried compile main.cpp , server.cpp command: g++ -std=c++0x -o main main.cpp -i "/home/user/desktop/boost_1_59_0" -l "/home/user/desktop/boost_1_59_0/libs/" -lboost_system . suggestion on how compile server example? i linked files boost_1_59_0/libs/asio/example/cpp11/http/server/ folder after main.cpp, @richard hodges suggested. still didn't work, got errors concerning lpthread , added compiling options. program compiled failed execution, returning error saying didn't find library libboost_system.so.1.59.0 . tried linking folders -l /path/to/library didn't work. solution: my compilation command: g++ -std=gnu++0x -o main main.cpp server.cpp conn

ios8 - How to align title of google map marker to right for RTL in ios? -

i using code below set title in marker google maps. cllocationcoordinate2d position = cllocationcoordinate2dmake(lat, longi); gmsmarker *marker = [gmsmarker markerwithposition:position]; marker.title = self.titlearray[i]; marker.map = mapview_; } can tell me how align title right ? you can use marker.title.textalignment = uitextalignmentright;

html - Why some HTML5 tags must have a starting and ending tag instead of self closing them with />? -

in html5 there tags must have starting , ending tag when content empty: <script></script> <!-- right way. --> <div></div> <!-- right way. --> <content></content> <!-- right way. --> <script/> <!-- wrong way. --> <div/> <!-- wrong way. --> <content/> <!-- wrong way. --> in xml difference doesn't exist: <node/> , <node></node> same entity. why tags script , div , content can't defined as: <script/> , <div/> , <content/> ? from w3c : a self-closing tag special form of start tag slash before closing right angle bracket. these indicate element closed immediately, , has no content. syntax permitted , used, end tag must omitted. in html, use of syntax restricted void elements , foreign elements. if used other elements, treated start tag. in xhtml, possible element use syntax. note conforming elements co

java - How to get GUI to edit androidmanifest.xml in Android Studio? -

i new android technology. installed android studio , want add application attributes in androidmanifest.xml sake of shared preferences. unlike eclipse, android studio giving xml editor, not gui edit manifest file. how gui in android studio, else should write xml manually? in advance.

java - what is the best way to solve the big number string to long? -

i working problem.the following code works small string in case have work long numbers.what best possible solution ? it gives error long string how approach solve best possible way. way uva424. there many solution online .i solve way portion of code import java.util.scanner; public class integerinquiry { public static void main(string args[]) { scanner input = new scanner(system.in); long total = 0; while (input.hasnext()) { string = input.next(); if(i.equals("0")) break; int size = i.length(); if(size <=100 ){ long = long.parselong(i); total = total+a; } } system.out.println(total); } } for big numbers can use bigdecimal scanner input = new scanner(system.in); bigdecimal bigdecimal = new bigdecimal(0); while (input.hasnext()) { string = input.next(); if (i.equals("0")) break; bigdecimal = bigdecimal.add(new bigdeci

html - Changing a select drop-down list to an unordered list -

i created drop-down menu select , option tags, these not allow me link other web pages, read had create un-ordered list because create drop-down incorrectly. here's code looks like: https://jsfiddle.net/pferdefleisch/q7hnj/1/ <select id="one"> <option value = "catalouge"> <a href = "catalouge.html">product catalouge</a> </option> <option> vacuum components </option> <option> valve components </option> <option> roughing components </option> <option> vacuum measurement </option> <option> glass components </option> <option> electrical feedthroughs </option> <option> motion , manipulation </option> <option> thin film products </option> </select> css: #one { margin: 10px; padding: 10px; width: 20%; font-family: palatino linotype; font-size: 15px; -moz-appear

apache - how create clean urls using htaccess -

hi want create clean urls htaccess file not create effect. original url - http://example.com/abc/def/?page=1 required url - http://example.com/abc/def/page/1 i using following htaccess file. want place file in def directory rewriteengine on rewriterule ^([a-za-z0-9]+)$ page?id=$1 rewriterule ^([a-za-z0-9]+)/$ page?id=$1 if def indeed directory, use following inside it: rewriteengine on rewritecond %{the_request} ^get\ /(.+?)/?\?(page)=(\d+) [nc] rewriterule ^ %1/%2/%3? [r=301,l] rewritecond %{request_uri} ^/(.*)/page/(\d+) rewriterule ^(page)/(\d+)/?$ /%1/?page=$2 [nc,l]

wildfly - installation of kie-drools-wb-distribution-wars-6.3.0.Final-wildfly8 -

i trying deploy "kie-drools-wb-distribution-wars-6.3.0.final-wildfly8" on wildfly 9.1 in standalone mode while starting(enable ) of getting following stack trace. please find attachment of screen shot of error , server log error [org.uberfire.java.nio.file.api.filesystemproviders] (msc service thread 1-4) can't initialize filesystemproviders: java.util.serviceconfigurationerror: org.uberfire.java.nio.file.spi.filesystemprovider: provider org.uberfire.java.nio.fs.jgit.jgitfilesystemprovider not instantiated @ java.util.serviceloader.fail(serviceloader.java:232) @ java.util.serviceloader.access$100(serviceloader.java:185) @ java.util.serviceloader$lazyiterator.nextservice(serviceloader.java:384) @ java.util.serviceloader$lazyiterator.next(serviceloader.java:404) @ java.util.serviceloader$1.next(serviceloader.java:480) @ org.uberfire.java.nio.file.api.filesystemproviders.buildproviders(filesystemproviders.java:65) @ org.uberfire.java.nio.fil

ios - Swift Error, it replace the last item only -

i have code needs find , delete string in textview. string saved in array. problem deletes string last item in array. instead, need delete items in textview. code : for value in values! { print("array value= \(value)") newstring = reasonview.text.stringbyreplacingoccurrencesofstring("\(value)", withstring: "", options: nsstringcompareoptions.literalsearch, range: nil) } how can resolve that? thank in advance! you replacing in reasonview.text , result discarded... try this: newstring = reasonview.text value in values! { print("array value= \(value)") newstring = newstring.stringbyreplacingoccurrencesofstring("\(value)", withstring: "", options: nsstringcompareoptions.literalsearch, range: nil) }

iis 7.5 - Reporting PHP 500 Errors -

i have rather old procedural php site running on iis7.5 server - it's on windows box because runs alongside classic asp site. the classic asp site has customised 500 error page uses server.getlasterror output details of error prompted page. these details emailed me. in php, i've found error_get_last() , should similar, i'm not sure how set up. have experience of using error_get_last() on iis7.5 server? can output error_get_last() below? $error = error_get_last(); if ($error !== null) { $errno = $error["type"]; $errfile = $error["file"]; $errline = $error["line"]; $errstr = $error["message"]; //send email... } thanks. no. can't. 500 error php script means script killed , barfed on floor. there's no error left, because script dead. other script fires handler 500 not able internal error caused 500 - it's independent script own error queue. at best have error handler script par

javascript - Unable to select rows programatically in drawCallback() of DataTables -

i using latest datatables select extension. trying select multiple rows programatically after table rendered. trying achieve in drawcallback() below: var table = $('#example').datatable({ "select": { "style": 'multi' }, "columns": [ { "data": "name" }, { "data": "position" }, { "data": "office" }, { "data": "age" }, { "data": "start_date" }, { "data": "salary" } ], "rowid": "name", "drawcallback": function( settings ) { var api = new $.fn.datatable.api( settings ); api.rows(["[id='bradley greer']", "[id='ashton cox']"]).select(); } }); but, getting uncaught typeerror: cannot read property 'style' of undefined error. here link live version - http://live.data

java - hash value for a line object -

here reference implementation of line object, confusion line 40 line 43, question is, if 2 lines different, or results of slope/intercept happens same, have issues (e.g. treat different lines same because of same hash values)? since think same hash value means same line. if current implementation hash value have issue mentioned, appreciate if provide insights implementation hash value in case. 1 public static line findbestline(graphpoint[] points) { 2 line bestline = null; 3 hashmap<line, integer> line_count = new hashmap<line, integer>(); 4 (int = 0; < points.length; i++) { 5 (int j = + 1; j < points.length; j++) { 6 line line = new line(points[i], points[j]); 7 if (!line_count.containskey(line)) { 8 line_count.put(line, 0); 9 } 10 line_count.put(line, line_count.get(line) + 1); 11 if (bestline == null || 12 line_count.get(line) > line_count.get(bestline)) { 13 bestline = line; 14 } 15 } 16 } 17 return bestline; 18 } 19 20 public class line { 21 private st

c# - Extended ASP.NET user not saving into database -

Image
i want make music website /with educational purposes/. wanted use asp.net identity user, wanted add properties. doing code first. made model layer extending identity user this: public class user : identityuser { //some data want add goes here public async task<claimsidentity> generateuseridentityasync(usermanager<user> manager, string authenticationtype) { var useridentity = await manager.createidentityasync(this, authenticationtype); return useridentity; } } so far good. next implemented data layer repository , unit of work patterns , on top of them services layer /mvc project/. ran , registered user , redirected user. though okay decided check database. saw tables, provided asp.net, empty. tried register same user , noticed there user email, already. i checked connection strings , fine. running out of ideas... i totally mistaken somewhere, can find it. attach project if wants see code. source code so happens yes, b

audio - Creating an application that overwrite lock and unlock sound on Android -

i want create application able override lock.ogg , unlock.ogg android phone without needing root phone. don't know how code these nor if it's possible programmatically on android studio here's basic idea: perform file searching obtain ogg files stored in phone. when user has confirmed sound, app copy file (so original file's name not overwritten), rename copied file lock.ogg/unlock.ogg. the problem me other implementing ogg explorer, have code destination of new ogg file /system/media/audio/ui/ overwrite previous lock , unlock sound. is possible using android studio? i'm newbie on android studio.

nat - Is it possible to map 1:1 port range iptable DNAT rules -

i want following rules forward tcp packets 127.0.0.1:32770 172.17.0.36:1000 , forward packets 127.0.0.1:32771 172.17.0.36:10001 , forward packets 127.0.0.1:32772 172.17.0.36:10002 iptables -t nat -a docker ! -i docker0 -p tcp -m tcp --dport 32770:32771 -j dnat --to-destination 172.17.0.36:1000-1002 but can forward packets 127.0.0.1:32770-32771 1 of 172.17.0.36:1000-1002

lapack - cblas.h on openSuse 13.1 -

i want use blas , lapack libraries on opensuse 13.1 installed blas-devel , lapack-devel packages , staic versions well. there no header files installed. no blas.h or cblas.h , same lapack. know how header files installed? thanks, z blas , lapack fortran libraries, need c interfaces: lapacke-devel , cblas-devel. remember, there no cblas package in opensuse 13.1, need use science project repository .

c# - Update user info in View Identity -

i have extension class includes method this: public static string getname(this iprincipal user) { if (user.identity.isauthenticated) { claimsidentity claimsidentity = user.identity claimsidentity; foreach (var claim in claimsidentity.claims) { if (claim.type == "name") { return claim.value; } } return ""; } else return ""; } after call action update user table include name , name called @user.getname() not update although column in database has change. if user logout system , login again, name display in view changed last update. i have solution logout , login again after class action update user info. there other solutions without logout? when user logout , login again, authentication cookie regenerated latest change , user see latest update. can update au

parse.com - Make a ListView with Parse data -

i tried add parse ui-widget able use parse query adapter, didn't work , messed whole app trying. so, question if there other ways create listview data parse? mean, if query adapter important, why move it's not importable anymore, if it's way make listviews? i don't know problem , cloned parseui-widget , put compile project(':parseui-widget') in dependencies on buil.gradle , can work parsequeryadapter. think can work without parse adapter, whole problem. sorry bad english.

Storage of large amount of global variables in MapReduce in java -

if need use more 1 reducer reduce job our global variables stored considering 1 reducer cannot have memory global data of job. are stored in hdfs , accessed each reducer? or we need explicitly. no. not stored in hdfs. need not explicitly. each of reducer run in separate jvm , reducer instance have it's own variables maintained in jvm heap memory area. each of reducer have own instance of global or local variables. object creation , storage same normal java program. there nothing special happen mapper or reducer objects.

In SugarCRM 7.5 Professional, how can you add custom relationship field? -

in sugarcrm 7.5 when open contacts , view record in opportunities subpanel can link opportunity record , set contact_role (opportunity role) custom relationship field existing in opportunities_contacts in database. now need same functionality working 2 custom modules many-to-many relationship between them , access_rights custom relationship field. two custom modules created using module builder , deployed: c_accounts, c_users. the many-to-many relationship between c_accounts , c_users created in studio. in custom/metadata/c_accounts_c_usersmetadata added 5 => array ( 'name' => 'access_rights', 'type' => 'varchar', 'len' => 36, ), and quick repair & rebuild. accepted sql query , access_rights field added relationship table in database. next, added both custom modules custom/extension/modules/{module}/ext/vardefs/account_user_access_rights.php and able see field in studio subpanel

c# - Subscribe to event in dll from another application -

i've been looking on possible solution, none seem come close need. have windows form outputs class library (dll). reference dll console application , launch gui in dll. want able subscribe control event , ever code in console application. have no problem when want read or write properties in dll directly console app. example: mydll.myclass myobj = new mydll.myclass(); myobj.textbox1.text = "hello world!"; however, subscribe textchanged event in dll , output new text console app. along lines of: public void textbox1_textchaned(object sender, eventargs e) { console.writeline(myobj.textbox1.text); } is there way subscribe directly event? or other event? set modifier of textbox1 public subscribe textchanged event: myobj.textbox1.textchanged += textbox1_textchaned; the following code in console app works me. i'm referencing windows form application rather dll, don't think there should difference: class program { static window

ios - SceneKit, flip direction of SCNMaterial -

extremely new scenekit, looking here: i have scnsphere camera @ center of it i create scnmaterial, doublesided, , assign sphere since camera @ center, image looks flipped vertically, when having text inside totally messes things up. so how can flip material, or image (although later frames video), other suggestion welcome. this solution, btw, failing on me, normalimage applied material (but image flipped when looking inside sphere), assigning flippedimage results in no material whatsoever (white screen) let normalimage = uiimage(named: "text2.png") let ciimage = ciimage(cgimage: normalimage!.cgimage!) let flippeciimage = ciimage.imagebyapplyingtransform(cgaffinetransformmakescale(-1, 1)) let flippedimage = uiimage(ciimage: flippeciimage, scale: 1.0, orientation: .left) scenematerial.diffuse.contents = flippedimage scenematerial.specular.contents = uicolor.whitecolor() scenematerial.doublesided = true scenematerial.shininess = 0

java - Eclipse Luna - Cannot watch variables in HashMap, errors during the evaluation -

Image
here test code : import java.util.hashmap; import java.util.map; public class tester { public static void main(string[] args) { map<string, integer> map = new hashmap<string, integer>(); map.put("abc", 1); //breakpoint here } } normally in debug mode, when mouse hovering above variable, value displayed. seems of variables in hashmap not display value when mouse hovers. in put method of hashmap , of members of map evaluation errors: why there many <error(s)_during_the_evaluation> ? caused these errors? the reason beyond bytecode (.class files) used eclipse debugger doesn't contain information method parameters name. that's way jdk compiled default. the eclipse debugger implements workaround method parameters, naming them "arg0", "arg1", etc. , enabling inspect them in "variables" view. unfortunately, don't think there such workaround local method variables... some

c++ - Deallocating memory in a 2D array -

suppose have: int** myarray = new int*[100]; for(int = 0; < 100; i++){ myarray[i] = new int[3]; } what appropriate way deallocate array (which method below, if either correct way so)? 1. delete[] myarray; 2. for(int = 0; < 100; i++){ for(int j = 0; j < 3; j++){ delete myarray[i][j]; } } delete[] myarray; intuitively seems should 2. since want of memory allocated deleted, i'm not sure. you used 1 loop create it, should use 1 loop delete it. order reversed order of allocation: for(int = 0; < 100; i++) delete [] myarray[i]; // delete "rows" in every "column" delete [] myarray; // delete "columns" moreover: is deleting one-dimensional dynamically allocated array - used delete "rows" , "columns" above. only resembles how 1 delete 2d array of pointers e.g.: int*** myarray = new int**[100]; // (1) for(int = 0; < 100; i++) {

python - installing Pyodbc with Jython? -

platform: windows 7 (64 bit), jython version 2.7.10 "final release". using java.sql classes access ms access dbases. at point in future want move linux. @ point in future want move mysql/mariadb... i thought it'd use more pythonic way, , seemed pyodbc might way go. this attempt use pip install it: d:\apps\jython2.7.0\bin>pip install pyodbc downloading/unpacking pyodbc downloading pyodbc-3.0.10.tar.gz (68kb): 68kb downloaded running setup.py (path:c:\users\chris\appdata\local\temp\pip_build_chris\pyodb c\setup.py) egg_info package pyodbc warning: no files found matching 'tests\*' warning: no files found matching 'readme.rst' installing collected packages: pyodbc running setup.py install pyodbc building 'pyodbc' extension error: compiling extensions not supported on jython complete output command d:\apps\jython2.7.0\bin\jython.exe -c "import s etuptools, tokenize;__file__='c:\\users\\chris\\appdat

javascript - JQuery - Get a error mesage if there is no value -

Image
so have completed website wanted , i'm @ last point error message if movie isn't found. means have api returns json. if person writes invalid movie "ifeahaef" returns null , wonder if possible make in jquery error "no movies found!" right under search bar? right site looks and how want it i don't know if code necessary can post js in case, maybe easier see. function callajax(input) { var url = "http://localhost:1337/search/" + input; $.ajax({ type:'get', url: url, success: function(data) { console.log('success'); $('#title').html("title: " + data.title); $('#release').html("release: " + data.release); $('#vote').html("vote: " + data.vote); $('#overview').html("overview: " + data.overview); $('#poster').html('<img src="' + data.poster + '" width=250 height=450 />'); $('#trailer').html(&q

python - What are proper values for SITE_NAME configuration in Django settings? -

i'm working on edx-platform opensource mooc platform based on django 1.4. i'm improving translation of , keeps bother me default (and required) value site_name edx.org . while can change domain e.g. edraak.org still don't having site_name domain. it seems vanilla django expects domain name . is old naming issue ? or i'm misunderstanding. could please explain proper (i.e. expected/recommended django) setting value?

c# - Access custom property inside ContentTemplate of custom user control -

i have following custom user control: namespace myapp.controls { public partial class articlebutton: usercontrol { public articlebutton () { initializecomponent (); } public static readonly dependencyproperty titleproperty; static articlebutton () { titleproperty = dependencyproperty.registerattached ("title", typeof (string), typeof (articlebutton)); } [description ("the name of article."), category ("common properties")] public string title { { return "test"; } } } } and corresponding xaml : <usercontrol x:class="myapp.controls.articlebutton" name="uc" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlforma

awk - Mathematical operation on columns of two files -

i have file 2 columns. following operation: col1/ [ (1+0.214/(col2*col2))^2 ]. write awk command: awk '{print $1/(1+.214/($2*$2))*(1+.214/($2*$2))}' ab.txt > g1.txt but getting same numbers column1 in output. please tell me going wrong? thank you. it no surprise same numbers again because there 1 pair of parentheses missing. @ expression! calculate (y/x) * x (y divided x multiplied x). need y/(x*x) or in other words awk '{print $1/((1+.214/($2*$2))*(1+.214/($2*$2)))}' ab.txt > g1.txt don't worry! if had gotten penny every missing parenthesis, ...

deep learning - R: h2o: saving a deeplearning model: automatically generated long file name too long for windows -

i have no problems saving h20 glm model(as has shorter file name) having problems saving h2o deeplearning model using same saving procedure i tried: library(h2o) localh2o = h2o.init() <- runif(1000) b <- runif(1000) c <- runif(1000) d <- 5*a+2*b^2+c*a df1 <- data.frame(a,b,c,d) df1.hex <- as.h2o(df1) test.dl <- h2o.deeplearning(x = 1:3, y = 4, training_frame = df1.hex) dlmodel.path = h2o.savemodel(test.dl, dir = "file:///c:/", name = "modeldl") dlmodel.path but error: error in .h2o.dosaferest(conn = conn, h2orestapiversion = h2orestapiversion, : fs io failure: accessed path : file:///c://modeldl/modelmetrics_deeplearningmodel__9fe11910a85d1371379ac7d536d64359_-5064771152374762981_on_key_frame__c__users_store_appdata_local_temp_rtmpggylne_file1f18787f2989_csv_1.hex_2.deeplearningmodel__9fe11910a85d1371379ac7d536d64359.temporary.train.chunks8_-6759658083019717917.bin i using windows 10 computer. has been pointed out rha, f

php - GET will not passed -

this question has answer here: submitting form query string params , hidden params disappear 10 answers i have strange problem. parameters not passed. <!doctype html> <html> <body> <?php var_dump($_get); var_dump($_post); ?> <form action="test.php?ds=1" method="get"> <input type="text"> <input type="submit"> </form> </body> </html> if method 'get' form jumps 'test.php' without params. not 'test.php?ds=1'... nothing passed. if change method 'post' form jump 'test.php?ds=1' still passes no input. first, need give input name in order passed. best change "post" , add "ds" hidden input. <for

html - How do I make a contenteditable='false' div have the same height as a contenteditable='true'? -

i have div that's been used "input" using contenteditable , , works great when enabled. there's 1 scenario need disable "input" setting contenteditable='false' , makes div lose height (as can see in this jsfiddle ). <div contenteditable="true" class="visible-borders"></div> <div contenteditable="false" class="visible-borders"></div> do guys have solution that? wanted didn't involve min-height . , no, cannot change code use other contenteditable . i'm using else's code. this because contenteditable=false div has no content , nothing holding open, whereas content-editable element has default styling shows editable (specifically: -webkit-user-modify: read-write ) you give .visible-borders min-height. if (for unspecified reason) don't want use min-height, insert pseudo content: .visible-borders:before { content: "\00a0" } https://jsfiddl

Formatting XML File into a form using LINQ c# Visual Studio 2013 -

need here. trying input xml form in visual studio , have display xml formatting in tact. have gotten display 1 long line need formatting there. using label in form show text, not sure if best way or not way work this in form1.cs string formatxml(string xml) { xdocument.load("employee roster.xml"); xdocument doc = xdocument.parse(xml); return(this.label1.text = doc.tostring()); } i have tried string formatxml(string xml) { xdocument.load("employee roster.xml"); try { xdocument doc = xdocument.parse(xml); return(this.label1.text = doc.tostring()); } catch { return xml } i know there other threads on dont seem specify how define file asking form read(i.e. load method)

regex - Redefining the Word Character Class in Perl -

i need change behavior of \w character class in perl. match [a-za-z0-9_.] . is, want add . character class. possible? i need modify \w because want number of modules (e.g. getopt::long ) see things "foo.bar" valid word. this a) untested b) extremely nasty c) inconvenient should rather comment, alas can't write yet. i see 2 possibilities: write custom locale \w class uses lc_ctype under use locale determine characters considered "word characters". perllocale manpage mentions security aspect regular expression checks safe file names or mail addresses using "\w" may spoofed "lc_ctype" locale claims characters such ">" , "|" alphanumeric. unfortunately there doesn't seem way (at least on unixish oses, no idea windows) without installing system-global configuration. askubuntu has thread that. monkey-patch required functions. opens different can of worms if don't know respective ve

json - Node.js + Framework for RESTFul API -

i'm new node maybe can me in decision, want create restful api accessible web site , mobile application returning json response. i have decided use same api website , mobile applications maintain purpose, went disastrous platform 2 logic part separated. want use restful api without session scalability purpose, using oauth2 authentication , maybe memcache serve same json response hash algorithm used. i begin node+express.js+mongodb backend, have noticed express come lot of package control , use cookie, template engine , on... so question is: express.js right package purpose? or better not use framework? in opinion best way achieve speed of access , speed of serving without type of session , without type of cookie? i developed restful apis express. thing express don`t need use additional stuff session handling , template engines. in addition there modules enables set api fast. example if using mongoose have @ baucis . if still feel uncomfortable express, there m

python - How to add data(dict) to a specific fieldname(key) on a csv file? -

edit: sorry confusion i'll explain program for. it's keep track of users new weight record. file update when have exceeded previous weight record timestamp. want user able see time line of progress each lift using timestamp. why using lift['key']={data:dict} can reference each lift type , query date example lift['snatch']['5/25'] tell them maxed day. can't seem able write csv file properly. thank you time! happy friday! i've been researching days , can't seem figure out how add data specific fieldname highest level key in dict. the data want add dict in it's own. how vision in csv file: snatch <> squat <> jerk 10/25:150lbs <> 10/25:200lbs <> 10/25:0lbs so how when created file. how able update 1 field. say user squatted day , wants append data field . what have far: import time import csv lifts={} csv_columns = ['snatch','squat','jerk&#