You need to parse your file line by line:import json data = [] with open('file') as f: for line in f: data.append(json.loads(line))Each line contains valid JSON, but as a whole, it is not a valid JSON value as there is no top-level list or object definition.Note that because the...
Python JsonHere's the Sticky Footer simplified code as of today because they're always optimizing it and this is GOOD: HTML <!DOCTYPE html> <html lang="en"> <head></head> <body> <!-- Fixed navbar --> <div class="navbar navbar-default navbar-fixed-top"...
Html Twitter bootstrap Twitter bootstrap 3 Css2You can simply omit the wildcard as it is optional in this case, but keep the space:$('#container :not(select)');Alternatively, use the .not() method to filter out the select after selecting all children:$('#container').children().not('select');If your problem is that children of select are still...
jQuery JavaScriptYou can either use the response.raw file object, or .iter_content(), and iterate over the response.To use the response.raw file-like object will not, by default, decode compressed responses (with GZIP or deflate). You can force it to decompress for you anyway by setting...
Python Python requestsTo easily setup file uploading in an Express.js server application you can use Multer.js Start by installing required node dependencies: npm init npm install -S express multer body-parser jade Setup basics for your Express.js application: // index.js start of file var express =...
Node.js File upload Express MulterYou can do two things to add animations, first you can let android animate layout changes for you. That way every time you change something in the layout like changing view visibility or view positions android will automatically create fade/transition animations. To use that set...
Android Java XMLYou can also setup a Kendo DataSource as an AngularJS Service using the Factory method and inject this into your Controller to conform to AngularJS best practices and patterns. Full source code and live demo: http://goo.gl/6Z9jop Customer.cshtml @{ ViewBag.Title = "Index"; } <div> ...
AngularJS KendoYou are missing a $scope.$apply(): $scope.isLandscape = false; // Listen for orientation changes window.addEventListener("orientationchange", function() { // Announce the new orientation number switch(window.orientation) { case -90: case 90: $scope.isLandscape...
AngularJS JavaScriptYou can certainly use the VideoWriter class, but you need to use the correct FourCC code that represents the the H264 standard. FourCC stands for Four Character Code, which is an identifier for a video codec, compression format, colour or pixel format used in media files. Specifically, when you...
C++ Opencv Image processingEvery view holder used by the RecyclerView has to subclass RecyclerView.ViewHolder and this class has a public field called itemView which contains the View associated with the ViewHolder. final View view = viewHolder.itemView; But just in general: Animations work differently in the...
Android Android recyclerviewAdding such animations to a ListView is no problem, I built this solution for a normal non-custom ListView in a few minutes, generally this sort of thing works on any ListView out of the box, it's all just in the adapter. The only thing missing in my answer is the swipe detection, unfortunately I...
Android Java XML Android listview AdapterIf the array contains strings, you can use the String's join method: var array = ["1", "2", "3"] let stringRepresentation = "-".join(array) // "1-2-3" This can be useful if you want to use a specific separator (hypen, blank, comma, etc). Otherwise you can simply use the description property,...
Array Swift iOSUsing wysihtml5 editor you can update the editor content in realtime but it's a bit tricky and you can't do it directly via the textarea element of jQuery. So, the following won't work -// doesn't work $('#textarea-id').val('new content');Instead, you will have to use the editor's api method...
jQuery Wysihtml5Gitignore specifies intentionally untracked files to ignore by git.It is very common in modern web PHP projects to use the following:Composer (PHP Dependency manager)NPM (node package manager)Bower (front-end package manager)Not to mention that multiple developers are working on the same project,...
PHP Git Npm Bower ComposerThe data is UTF-8 encoded bytes escaped with URL quoting, so you want to decode:url=urllib.unquote(url).decode('utf8') Demo:>>> import urllib >>> url='example.com?title=%D0%BF%D1%80%D0%B0%D0%B2%D0%BE%D0%B2%D0%B0%D1%8F+%D0%B7%D0%B0%D1%89%D0%B8%D1%82%D0%B0' >>>...
Python Decode UrllibTo access and communicate in two directions (parent to iFrame, iFrame to parent), in case they are both in the same domain, with access to the angular scope, try following those steps: *You don’t need the parent to have reference to angularJS library… Calling to child iFrame from parent 1.Get...
AngularJS Angularjs scope JavaScriptfunction checkRemoteFile($url) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$url); curl_setopt($ch, CURLOPT_NOBODY, 1); curl_setopt($ch, CURLOPT_FAILONERROR, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); if(curl_exec($ch)!==FALSE) { return...
PHP Curl Remote fileSince Ember 2.0 will just be a release that removes all of the deprecations, we should start writing our code in a more future-proof manner, since those deprecations are coming sooner, rather than later. One of the ways to future-proof your templates and controllers is by stopping the use of...
Controller Ember.jsWe will create a yearly calendar that highlighted the current day.Our calendar will be displayed as 4X3 boxes.First, we should define some vars that we will use in our code:$months=array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November',...
PHP Calender YearlyIf you need a quick way to "block" method calls to your classes, the NS_UNAVAILABLE macro helps inform clients of your intentions.Let's say you have a provider object that needs to be initialized with a delegate for proper use. You can use the macro to block calls to the init method to force the...
Osx Ns unavailable Objective-C iOSHow about this? Hsub = H[1:-1, 1:-1] The 1:-1 range means that we access elements from the second index, or 1, and we go up to the second last index, as indicated by the -1 for a dimension. We do this for both dimensions independently. When you do this independently for both dimensions, the...
Python Numpy Matrices Matlab toolboxUsually Meteor developers use classes to attach event handlers to templates. Abusing classes to attach event listeners is against the Separation of Concerns principle. Even the official Meteor Tutorial gets it "wrong" (it's not included to not confuse beginners). This quick tip shows an...
Meteor Meteorite Meteor.js javascript JavaScriptIn Bootstrap 3.1.1 they added modal-lg and modal-sm classes. You control the modal size using @media queries like they do. This is a more global way of controlling the modal size. @media (min-width: 992px) .modal-lg { width: 900px; height: 900px; /* control height here */ } Sample...
Twitter bootstrap Size Css2 Bootstrap modal JavaScriptThe code has been taken from https://select2.github.io/examples.html and adjusted for simplicity. <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <script src="//code.jquery.com/jquery-1.11.3.min.js"></script> <link...
jQuery Ajax Select Select2Here is a simple C# class that programatically creates an Excel WorkBook and adds two sheets to it, and then populates both sheets. Finally, it saves the WorkBook to a file in the application root directory so that you can inspect the results... public class Tyburn1 { object missing =...
Excel C# 4.0 Dataset