Questions

jQuery get the id/value of <li> element after click function

How can I alert the id of the `<li>` item clicked? ``` <ul id='myid'> <li id='1'>First</li> <li id='2'>Second</li> <li id='3'>Third</li> <li id='4'>Fourth</li> <li id='5'>Fifth</li> </ul> ...

3 Apr at 20:2

How to change the default GCC compiler in Ubuntu?

I have installed gcc-3.3/g++-3.3 on ubuntu 11.04 which already has gcc/g++-4.4. So in my system both gcc-3.3 and 4.4 are available. I am able to call both compilers as I want. If I just call the comma...

28 Feb at 19:6

How can I remove the debug banner in Flutter?

I'm using `flutter screenshot` and I expected the screenshot to not have a banner, but it has. Note that I get a `not supported for emulator` message for profile and release mode.

How can I quickly delete a line in VIM starting at the cursor position?

I want to be able to delete the remainder of the line I'm on starting at the cursor's position in VIM. Is there an easy command to do this? To help illustrate, this is before the command. ``` The qu...

28 Nov at 13:28

How can I detect the encoding/codepage of a text file?

In our application, we receive text files (`.txt`, `.csv`, etc.) from diverse sources. When reading, these files sometimes contain garbage, because the files where created in a different/unknown codep...

26 Aug at 19:59

Combine two tables that have no common fields

I want to learn how to combine two db tables which have no fields in common. I've checked UNION but MSDN says : > The following are basic rules for combining the result sets of two queries by using UN...

20 Jun at 09:12

Convert double to BigDecimal and set BigDecimal Precision

In Java, I want to take a double value and convert it to a `BigDecimal` and print out its String value to a certain precision. ``` import java.math.BigDecimal; public class Main { public static...

5 Jan at 19:21

How to obtain Signing certificate fingerprint (SHA1) for OAuth 2.0 on Android?

I'm trying to register my android app following the steps in [https://developers.google.com/console/help/#installed_applications](https://developers.google.com/console/help/#installed_applications) w...

24 Jan at 20:1

How do I find the caller of a method using stacktrace or reflection?

I need to find the caller of a method. Is it possible using stacktrace or reflection?

8 Feb at 17:55

VB.NET: Clear DataGridView

I've tried - ``` DataGridView1.DataSource=Nothing ``` and ``` DataGridView1.DataSource=Nothing DataGridView1.Refresh() ``` and ``` DataGridView1.RefreshEdit() ``` None of them works.. I've w...

How to get the currently logged in user's user id in Django?

How to get the currently logged-in user's id? in `models.py`: ``` class Game(models.model): name = models.CharField(max_length=255) owner = models.ForeignKey(User, related_name='game_user', ...

What is the difference between HAVING and WHERE in SQL?

What is the difference between `HAVING` and `WHERE` in an `SQL SELECT` statement? EDIT: I have marked Steven's answer as the correct one as it contained the key bit of information on the link: > When ...

18 Jul at 07:26

bash: shortest way to get n-th column of output

Let's say that during your workday you repeatedly encounter the following form of columnized output from some command in bash (in my case from executing `svn st` in my Rails working directory): ``` ?...

6 Sep at 06:18

How to read and write INI file with Python3?

I need to read, write and create an file with Python3. ``` default_path = "/path/name/" default_file = "file.txt" ``` ``` # Read file and and create if it not exists config = iniFile( 'FILE...

21 Aug at 18:39

How to truncate float values?

I want to remove digits from a float to have a fixed number of digits after the dot, like: ``` 1.923328437452 → 1.923 ``` I need to output as a string to another function, not print. Also I want to i...

27 Oct at 00:22

Jenkins CI Pipeline Scripts not permitted to use method groovy.lang.GroovyObject

I am Using Jenkins 2 for compiling Java Projects, I want to read the version from a pom.xml, I was following this example: [https://github.com/jenkinsci/pipeline-plugin/blob/master/TUTORIAL.md](https...

How do you express binary literals in Python?

How do you express an integer as a binary number with Python literals? I was easily able to find the answer for hex: ``` >>> 0x12AF 4783 >>> 0x100 256 ``` and octal: ``` >>> 01267 695 >>> 0100 64...

13 Mar at 13:47

c#: getter/setter

I saw something like the following somewhere, and was wondering what it meant. I know they are getters and setters, but want to know why the string Type is defined like this. Thanks for helping me. `...

15 Jul at 15:3

HTML - how to make an entire DIV a hyperlink?

How do I make an entire `DIV` a clickable hyperlink. Meaning, I essentially want to do: ``` <div class="myclass" href="example.com"> <div>...</div> <table><tr>..</tr></table> .... </div> ...

29 Jun at 06:57

How do I mount a remote Linux folder in Windows through SSH?

I'm a blind student currently in a system admin/shell programming class. Although ssh works fine for executing commands like ls, pwd, etc editors do not work well with my screen reader and an ssh sess...

14 Jan at 16:50

How to install homebrew on M1 mac

I just got a new Mac, the M1 Macbook pro and I am trying to install homebrew, but every time I finish installing it, it tells me that it was not written to the path, and then when I try the advised wh...

17 Mar at 02:24

Imitating a blink tag with CSS3 animations

I really want to make a piece of text blink the old-school style without using javascript or text-decoration. No transitions, only *blink*, *blink*, *blink*! --- This is different from [that questi...

19 May at 10:36

Difference between natural join and inner join

What is the difference between a natural join and an inner join?

1 Jul at 19:2

Regular Expression: Allow letters, numbers, and spaces (with at least one letter or number)

I'm currently using this regex `^[A-Z0-9 _]*$` to accept letters, numbers, spaces and underscores. I need to modify it to require at least one number or letter somewhere in the string. Any help would ...

12 Aug at 18:58

Best Practices for securing a REST API / web service

When designing a REST API or service are there any established best practices for dealing with security (Authentication, Authorization, Identity Management) ? When building a SOAP API you have WS-Sec...