Questions

"Too many values to unpack" Exception

I'm working on a project in Django and I've just started trying to extend the User model in order to make user profiles. Unfortunately, I've run into a problem: Every time I try to get the user's pr...

25 Sep at 22:56

round() for float in C++

I need a simple floating point rounding function, thus: ``` double round(double); round(0.1) = 0 round(-0.1) = 0 round(-0.9) = -1 ``` I can find `ceil()` and `floor()` in the math.h - but not `ro...

16 Mar at 01:55

What is the maximum characters for the NVARCHAR(MAX)?

I have declared a column of type `NVARCHAR(MAX)` in SQL Server 2008, what would be its exact maximum characters having the MAX as the length?

End of File (EOF) in C

I am currently reading the book C Programming Language by Ritchie & Kernighan. And I am pretty confused about the usage of EOF in the `getchar()` function. First, I want to know why the value of EOF...

23 May at 11:54

Can we pass parameters to a view in SQL?

Can we pass a parameter to a view in Microsoft SQL Server? I tried to `create view` in the following way, but it doesn't work: ``` create or replace view v_emp(eno number) as select * from emp whe...

How to remove an HTML element using Javascript?

I am a total newbie. Can somebody tell me how to remove an HTML element using the original Javascript not jQuery. `index.html` ``` <html> <head> <script type="text/javascript" src="myscripts.js" > ...

16 Nov at 14:24

How to restore to a different database in SQL Server?

I have a backup of from a week ago. The backup is done weekly in the scheduler and I get a `.bak` file. Now I want to fiddle with some data so I need to restore it to a different database - . I have...

24 Nov at 14:14

lvalue required as left operand of assignment

Why am I getting ``` lvalue required as left operand of assignment ``` with a single string comparison? How can I fix this in `C`? ``` if (strcmp("hello", "hello") = 0) ``` Thanks!

28 May at 15:8

Ajax request returns 200 OK, but an error event is fired instead of success

I have implemented an Ajax request on my website, and I am calling the endpoint from a webpage. It always returns , but executes the error event. I tried a lot of things, but I could not figure out t...

17 Apr at 18:36

How to gzip all files in all sub-directories into one compressed file in bash

> [gzipping up a set of directories and creating a tar compressed file](https://stackoverflow.com/questions/3341131/gzipping-up-a-set-of-directories-and-creating-a-tar-compressed-file) [This p...

23 May at 12:2

How to write log file in c#?

How would I write a log file in c#? Currently i have a timer with this statement which ticks every 20 secs: ``` File.WriteAllText(filePath+"log.txt", log); ``` For everything that i want logged i ...

19 Nov at 08:20

How to use DISTINCT and ORDER BY in same SELECT statement?

After executing the following statement: ``` SELECT Category FROM MonitoringJob ORDER BY CreationDate DESC ``` I am getting the following values from the database: ``` test3 test3 bildung test4 ...

18 Jul at 00:39

Android screen size HDPI, LDPI, MDPI

I have a background that I need fit in all screen sizes. I have three folders, `hdpi`, `ldpi` and `mdpi` for drawables, but in the emulator there isn't any referense to what resolution `hdpi` is and ...

14 May at 18:24

Change Bootstrap tooltip color

What I'm trying to do is change the color to red. However, I also want to have multiple other colors so I don't simply want to replace the original tooltip's color. How would I go about doing this? ...

19 Oct at 17:4

How to get docker-compose to always re-create containers from fresh images?

My docker images are built on a Jenkins CI server and are pushed to our private Docker Registry. My goal is to provision environments with docker-compose which always start the originally built state ...

6 Feb at 22:14

"The Controls collection cannot be modified because the control contains code blocks"

I am trying to create a simple user control that is a slider. When I add a AjaxToolkit SliderExtender to the user control I get this (*&$#()@# error: ``` Server Error in '/' Application. The Control...

27 Nov at 19:51

clearing a char array c

I thought by setting the first element to a null would clear the entire contents of a char array. ``` char my_custom_data[40] = "Hello!"; my_custom_data[0] = '\0'; ``` However, this only sets the f...

20 Dec at 23:24

How do I run git log to see changes only for a specific branch?

I have a local branch tracking the remote/master branch. After running `git-pull` and `git-log`, the log will show all commits in the remote tracking branch as well as the current branch. However, bec...

24 Jul at 11:34

How to change the Eclipse default workspace?

Where can I change the default workspace in Eclipse?

8 Feb at 14:4

How to get the path of the batch script in Windows?

I know that `%0` contains the full path of the batch script, e.g. `c:\path\to\my\file\abc.bat` I would `path` to be equal to `c:\path\to\my\file` How could I achieve that ?

7 Mar at 09:40

How can I select item with class within a DIV?

I have the following HTML: ``` <div id="mydiv"> <div class="myclass"></div> </div> ``` I want to be able to use a selector that selects the inside `div`, but specific for the `mydiv` container. H...

how to display employee names starting with a and then b in sql

i want to display the employee names which having names start with a and b ,it should be like list will display employees with 'a' as a first letter and then the 'b' as a first letter... so any bod...

17 Sep at 22:6

How to use jQuery to select a dropdown option?

I was wondering if it’s possible to get jQuery to select an `<option>`, say the 4th item, in a dropdown box? ``` <select> <option></option> <option></option> <option></option> <option...

How to find the users list in oracle 11g db?

How to find out the users list, which is all created in the `oracle 11g` database. Is there any `command` to find out the users list which we can execute from the Command line interface!

24 Dec at 11:10

How can building a heap be O(n) time complexity?

Can someone help explain how can building a heap be complexity? Inserting an item into a heap is , and the insert is repeated n/2 times (the remainder are leaves, and can't violate the heap property)...