Why is “import *” bad?

Why is “import *” bad?

It is recommended to not to use import * in Python. Can anyone please share the reason for that, so that I can avoid it doing next time? 1:Because it puts a lot of stuff into your namespace (might shadow some other object from previous i

JavaScript: client-side vs. server-side validation

JavaScript: client-side vs. server-side validation

Which is better to do client side or server side validation?In our situation we are using jQuery and MVC. JSON data to pass between our View and Controller. A lot of the validation I do is validating data as users enter it.For example I u

Sorting a vector of custom objects

Sorting a vector of custom objects

How does one go about sorting a vector containing custom (i.e. user defined) objects.Probably, standard STL algorithm sort along with a predicate (a function or a function object) which would operate on one of the fields (as a key for sorti

console.log() async or sync?

console.log() async or sync?

I am currently reading Async Javascript by Trevor Burnham. This has been a great book so far.He talks about this snippet and console.log being 'async' in the Safari and Chrome console. Unfortunately I can't replicate this. Here is the code

How to find out which .c file contains the .c functions of R internals, on Windows?

How to find out which .c file contains the .c functions of R internals, on Windows?

I want to view the source code of R's match.call function. As it is an internal function, I downloaded the R source code, went to ./src/main/names.c and looked for match.call there. Thus, I found out that the corresponding .c function is ca

Adding an enum as a class property in HBM

Adding an enum as a class property in HBM

I am trying to create a class in HBM file which contains an Enum as a field.The HBM is similar to this: and let's say that this is the Enum:public enum myEnum{ a, b, c;}The problem is that in the DB I expected to see the String val

How to use “setup.cfg” instead of setup.py with Python 2.7

How to use “setup.cfg” instead of setup.py with Python 2.7

It seemed to me, that instead of the whole plethora of named keyword-arguments forthe distutils.core.setup function, one can use a setup.cfg file in the same directoryas the setup.py file and all these keywords will be read from the setup.c

How do you divide your project into applications in Django?

How do you divide your project into applications in Django?

I am not really sure how to divide my Django projects into applications.What things should I consider when laying out a Django project? 1:James Bennett has written a blog entry about this,Django tips: laying out an application, section "

Uploading a file in classic asp

Uploading a file in classic asp

I've always used the following script to upload files in classic asp, but it stopped working giving me this error vbscript runtime error 800a01a8 object required 'Item(...)'I investigated a little and i think that the problem is in the fi

How to do Git Log see only merges to master branch?

How to do Git Log see only merges to master branch?

In my work process I need to provide a list of files to my server admin.The list comes from the merge of my working branch (Branch A) into Master branch.So I merge branch A into branch Master and then deploy Master.Right now the best I coul

Why does a perfect forwarding function have to be templated?

Why does a perfect forwarding function have to be templated?

Why is the following code valid:templatevoid foo(T1 &&arg) { bar(std::forward(arg)); }std::string str = "Hello World";foo(str); // Valid even though str is an lvaluefoo(std::string("Hello World")); // Valid because literal is rvalueBut not:

How to copy a “Dictionary” in Swift?

How to copy a “Dictionary” in Swift?

How to copy a "Dictionary" in Swift?That is, get another object with same keys/values but different memory address.Furthermore, how to copy an object in Swift?Thanks, 1:A 'Dictionary' is actually a Struct in swift, which is a value type.

Table layout panel scroll bar

Table layout panel scroll bar

given a table layout panel with 2 columns and many rows, how can i attatch a scroll bar to it as sometimes it grows much greater than the size of the form .Thank you 1:The TableLayoutPanel is an example of a ScrollableControl. You can th

how to change jQuery autocomplete plugin default querystring key? (term to that i want)

how to change jQuery autocomplete plugin default querystring key? (term to that i want)

jQuery autocomplete plugin sent request like thismysite.com/suggestion?term=Sadeghis there any way to change term querystring key to another? i can't find option that provide this for me ;) 1:I assume you're using jQuery UI AutoCompleteY

Change a string of integers separated by spaces to a list of int

Change a string of integers separated by spaces to a list of int

How do i make something likex = '1 2 3 45 87 65 6 8'>>> foo(x)[1,2,3,45,87,65,6,8]I'm completely stuck, if i do it by index, then the numbers with more than 1 digit will be broken down. Help please. 1:You can use a list comprehension in

How can it be that this == null?

How can it be that this == null?

EDIT: This is not a duplicate of this question as this one is a practical example working with Delegate.CreateDelegate and the other one is a theoretical discussion about IL. Nothing to do one with each other besides the words this and null

How can I find the screen/desktop size in Qt, so I can display a desktop notification?

How can I find the screen/desktop size in Qt, so I can display a desktop notification?

I want to code a notification window at the bottom right corner of the desktop, so it works like Skype notifications when someone comes online. Can someone help me get the screen size of the desktop, so I can place my notification window at

Is it possible in AngularJS to use data bindings inside a classic javascript function?

Is it possible in AngularJS to use data bindings inside a classic javascript function?

I've a question about Angularjs data binding feature.If i write:Hello {{name}}!and i've in the controller.js something like:$scope.name = 'Bruno';The result will be "Hello Bruno!"... and this is wonderful! Now i edited the template:Hello !a

Any tutorial for customize lock screen in Android [closed]

Any tutorial for customize lock screen in Android [closed]

I want to know that any tutorial or sample application for customize lock screen in Android? 1:Here are the links which will provide guide you on how to develop the lock screen in android 1) WidgetCatalog2) Lock Screen for Android3) Wid

Automating command/script execution using PuTTY

Automating command/script execution using PuTTY

These are the things I need to do:Open putty.exeEnter Username and password.Run a shell script.I am using UFT (VB Scripting). I am able to open PuTTY but not able to enter username and password or run any commands using UFT.Is there any oth

How to Have Search Engines Index Database-Driven Content?

How to Have Search Engines Index Database-Driven Content?

How can I make it so that content from a database is available to search engines, like google, for indexing?Example:Table in mysql has a field named 'Headline' which equals 'BMW M3 2005'.My site name is 'MySite'User enters 'BMW M3 2005 MySi

Dynamically change UITable cell height?

Dynamically change UITable cell height?

I need to resize the cell height based on the content size/length.tried several methods, which one gives the exact height without overlapping? 1:see this tutorial for change UITableViewCell Height Dynamically..Resizing-A-UITableViewCella

stream music with java

stream music with java

I am currently coding some chat program and now want to play music via a client command like:/music http://somewebsite.com/somesong.mp3So the link would be send from the client that sent the song, to the server. The server should then witho

ViewFlipper in app widgets

ViewFlipper in app widgets

I'm playing around building a new widget and was looking at the Android app widget documentation, in particular the section on which widget classes were supported. I noticed that ViewFlipper is supported, but I'm struggling to find any exa

Scala-way to handle conditions in for-comprehensions?

Scala-way to handle conditions in for-comprehensions?

I am trying to create a neat construction with for-comprehension for business logic built on futures. Here is a sample which contains a working example based on Exception handling: (for { // find the user by id, findUser(id) returns Future