Python Binary to decimal converter

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

Wrap a DIV with style around an integrated YouTube video

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:

Filter data from a foreign key on an SQL query

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

How can I make this method asynchronous?

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

Node.js fs.rename () error enoent

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

Replace duplicate items in a list in Python?

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,

Why does not this Joomla template work?

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: //

Divide large xml files into files without memory

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

MVCscaffolding generates a model template from the database

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

Java redirection output and output

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

Which is the best Java calendar ...?

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

Always empty $ _POST

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> <

How do non-static callbacks work from native code?

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-

The PHP () header called via AJAX does not work properly

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

AngularJS update from 1.5.0 to 1.5.8

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

Preparing a command with structured parameters

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

Content-based routing with RabbitMQ and Python

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

regex to get words in parentheses

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

Mobile Safari Autofocus text field

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

Pass the first line of the CSV file

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 =

Regex: Scrub HTML

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

Spinner / Ellipsize / Width

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

Accept HTTP Header

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