I am a complete noob in python but i have no idea why my code is not working. It says syntax error for the colons used on the end of the if and for loops. multi=1 dec=0 su=0 bn=input("Input Binary Number") for i in range (0,len(bn): if item in b
Should you always create an interface if there's a possibility that there might be something else that could use it, or wait until there's an actual need for it then refactor to use an interface? Programming to an interface generally seems like sound
I've embedded three YouTube videos onto a page, but I've wrapped them with a DIV and a CLASS called "videoplayer", but the DIV and the CLASS seem to be ignored because they don't display in the page. You can see it here: http://72.4.166.89/en/tu
I am relatively new to Lambda/Linq, however I want to retrieve all events from a specific calendar where the events are still in the future... If I use: EventCalendar eventCalendar; eventCalendar = db.Events_Calendars.Find(id); I can get all events a
I want to have a class "Utils", that will have several methods used all over my code. For example, I have a top bar with a textview and two ImageButtons that must display different texts and icons on different activities. I find myself writing s
I have a Python function of roughly the following structure, that computes some results and writes them to a file: results = [] with open(filename, "w") as output: for item in items: result = compute_stuff(item) write_result(item, result, output
I was wondering how i could make this method async, it gives me an error: The 'await' operator can only be used within an async method. Consider marking this method with the 'async' modifier and changing its return type to 'Task'. Here's my code: voi
after uploaded a file to my server i try to move it to another folder(same disk), and i got thie error {[Error:ENOENT,rename 'F\myproject\1b231234nsdifhoi2323'] errno:34, code:ENOENT, path:'F\\myproject\\1b231234nsdifhoi2323' } am on windows and use
For example if I have a list as follows: [3, 3, 3, 3, 3, 3, 100, 1, 1, 1, 1, 1, 1, 200, 3, 3, 3, 100, 1, 1, 1] How can I remove the duplicate elements and represent the same element followed by the number of times it's repeating? Example Output: [3,
I just installed Joomla on my pc. Everything works just fine. I installed a lot of templates and they all worked, but the template i really want to use doesn't. I want to use this template: http: //byjoomla.com/docman/bj-joomla-templates/bj-venus/dow
I have a XML like following <Jobs> <job> .... </job> <job> .... </job> .... </Jobs> Now what is best way to write each job node in a separate file without bringing the whole file in to memory using xmlreader and xmlwrit
Is it possible while using MVCscaffolding and t4 templates to automatically generate a model with all table data from database for example i have a table named Customers in my DB it has 3 fields: Id Name Number so can i make a t4 template that would
To excecute SENNA in the terminal I use the command: senna.exe < input.txt > result.txt Now I want to realize this in a java program. This is my code so far ProcessBuilder builder = new ProcessBuilder("senna.exe"); builder.redirectErrorStr
I need a well done gui swing java datechooser.. I only find some ugly datepickers from 199x does somebody know a nice gui datepicker?SwingLabs has SwingX project which provides suite of components including JXDatePicker (API) works with Date class, w
I'm trying to save a Google Maps Marker's coordinates to my database after the user placed the Marker. When I send the coordinates to the server, I always receive an empty $_POST array. Where did I go wrong? Here's my index.php: <!DOCTYPE html> <
I am trying to validate a date input field. I can prevent jquery datepicker to prevent from entering old dates using, $('#delivery_date').datePicker({ minDate: 0 }); But user can still enter date manually. How to prevent or validate this? // when the
I need to create a currency mask (right to left) in a input=number of my mobile app (Ionic + Cordova). If the user enter with 123456 value, the input should be 1.234,56 (adding "," and "." automatically). I don't know how to do this wi
It's a bit odd asking this question, because I have code that seems like it shouldn't work, but it does, and although I'm not complaining, I'd like to confirm why? LOL Simply, I have a C++ native DLL (no CLR/managed support at all) that takes a call-
I'm new to web development. Right now I'm working on a login feature on a site. I used Javascript/AJAX to fetch the username and password and send it to a PHP file for verification on the MYSQL database. That's what I'm about to make. My question is
I have the following bower.json file: { "private": true, "dependencies": { "angular": "~1.5.0", "angular-mocks": "^1.5.7", "bootstrap": "^3.3.6", "bootstrap-rtl": &q
I have this ADO.NET command object and I can set some parameters and execute it successfully. _mergecommand.Parameters.Add(new SqlParameter("values", SqlDbType.Structured)); _mergecommand.Parameters["values"].TypeName = "strlist&q
How do you send an sms message to a mobile phone from a web application using asp.net and c#?Most carriers provide an email suffix that can be used to send an SMS through email. Generally: [PhoneNumber]@[Suffix] You can contact individual carriers to
Is it possible with RabbitMQ and Python to do content-based routing? The AMQP standard and RabbitMQ claims to support content-based routing, but are there any libraries for Python which support specifying content-based bindings etc.? The library I am
We have a web application that retrieves a lot of data from a SOAP webservice and takes about 4 to 5 minutes to do so. To make sure users are not bothered by this, the data is cached like so: //using Nlog to log caching behaviour private Logger log =
I have regex which prints between parenthesis, infact I need only specific parenthesis, i mean car(skoda,audi) bike(hayabusa) I get output as: skoda audi hayabusa To get the cars and bikes in parenthesis I used: (r'^(\S+)\((.*)\)$') But i need to get
In Mobile Safari I am unable to focus onto a text field after setting a delay period. I'm attaching some example code showcasing the issue. If, onclick of the button, you trigger .focus(), everything works as expected. If you hang the focus on a call
I'm having an issue with my python csv parser and I don't know where the mistake happens : So this is my python : # -*-coding:Utf-8 -* import sqlite3; from datetime import datetime, date; conn = sqlite3.connect('info_max.sqlite3') conn.text_factory =
I have a bunch of HTML code where I want to remove all the HTML markup. I think this is possible with Regex (Regular expression). With search and replace, how would I do this? I tried <*> where I thought * was a wildcard, but apparently not. How wou
I've a spinner pointing on a CursorAdapter. I set this adapter with a specific view. I would like to fix the spinner's width, I tried a lot of stuff unsucessfully : layout_width="100dp" // to force spinner with a specific size KO reduce the layo
I have a problem with "Accept" header in http. I've writen http client, and when i set "Accept: image/png" I can read any file (like txt, html, etc...). I think i should be impossible if I set header "Accept" like above... I