Questions

Most Useful Attributes

I know that attributes are extremely useful. There are some predefined ones such as `[Browsable(false)]` which allows you to hide properties in the properties tab. Here is a good question explaining a...

23 May at 12:10

How to detect when an @Input() value changes in Angular?

I have a parent component (), a child component () and an ApiService. I have most of this working fine i.e. each component can access the json api and get its relevant data via observables. Currentl...

Pushing to Git returning Error Code 403 fatal: HTTP request failed

I was able to clone a copy of this repo over HTTPS authenticated. I've made some commits and want to push back out to the GitHub server. Using Cygwin on Windows 7 x64. ``` C:\cygwin\home\XPherior\Cod...

1 Apr at 23:31

How do you roll back (reset) a Git repository to a particular commit?

I cloned a Git repository and then tried to roll it back to a particular commit early on in the development process. Everything that was added to the repository after that point is unimportant to me s...

29 Jun at 00:6

How to grep Git commit diffs or contents for a certain word

In a Git code repository I want to list all commits that contain a certain word. I tried this ``` git log -p | grep --context=4 "word" ``` but it does not necessarily give me back the filename (unles...

3 May at 22:37

Git: How to squash all commits on branch

I make new branch from `master` with: ``` git checkout -b testbranch ``` I make 20 commits into it. Now I want to squash those 20 commits. I do that with: ``` git rebase -i HEAD~20 ``` What ab...

19 Dec at 17:22

How to convert a byte array to a hex string in Java?

I have a byte array filled with hex numbers and printing it the easy way is pretty pointless because there are many unprintable elements. What I need is the exact hexcode in the form of: `3a5f771c`

2 May at 19:55

How do I display a decimal value to 2 decimal places?

When displaying the value of a decimal currently with `.ToString()`, it's accurate to like 15 decimal places, and since I'm using it to represent dollars and cents, I only want the output to be 2 deci...

19 Oct at 15:46

How do you pass a function as a parameter in C?

I want to create a function that performs a function passed by parameter on a set of data. How do you pass a function as a parameter in C?

29 Jul at 19:9

Fastest Way of Inserting in Entity Framework

I'm looking for the fastest way of inserting into Entity Framework. I'm asking this because of the scenario where you have an active `TransactionScope` and the insertion is huge (4000+). It can potent...

3 Jul at 13:36

How can I access my localhost from my Android device?

I'm able to access my laptop web server using the Android emulator, I'm using `10.0.2.2:portno` works well. But when I connect my real Android phone, the phone browser can't connect to the same web s...

3 Jul at 01:55

Can I underline text in an Android layout?

How can I define text in an Android layout `xml` file?

11 Oct at 04:16

How to convert Decimal to Double in C#?

I want to assign the decimal variable "trans" to the double variable "this.Opacity". ``` decimal trans = trackBar1.Value / 5000; this.Opacity = trans; ``` When I build the app it gives the following ...

How can I capitalize the first letter of each word in a string?

``` s = 'the brown fox' ``` ...do something here... `s` should be: ``` 'The Brown Fox' ``` What's the easiest way to do this?

29 Jul at 00:23

RESTful Authentication

What does RESTful Authentication mean and how does it work? I can't find a good overview on Google. My only understanding is that you pass the session key (remeberal) in the URL, but this could be h...

Shuffle DataFrame rows

I have the following DataFrame: ``` Col1 Col2 Col3 Type 0 1 2 3 1 1 4 5 6 1 ... 20 7 8 9 2 21 10 11 12 2 ... 45 13 14 15 ...

How to display line numbers in 'less' (GNU)

What is the command to make [less](https://linux.die.net/man/1/less) display line numbers in the left column?

6 Dec at 10:34

In C#, what is the difference between public, private, protected, and having no access modifier?

All my college years I have been using `public`, and would like to know the difference between `public`, `private`, and `protected`? Also what does `static` do as opposed to having nothing?

28 Nov at 19:19

What is the best collation to use for MySQL with PHP?

I'm wondering if there is a "best" choice for collation in MySQL for a general website where you aren't 100% sure of what will be entered? I understand that all the encodings should be the same, such ...

23 Feb at 03:50

What is the Python equivalent of static variables inside a function?

What is the idiomatic Python equivalent of this C/C++ code? ``` void foo() { static int counter = 0; counter++; printf("counter is %d\n", counter); } ``` specifically, how does one impl...

7 Jun at 21:38

How can I rename a project folder from within Visual Studio?

My current solution for renaming the project folder is: - - - Is there a better way?

makefile:4: *** missing separator. Stop

This is my makefile: ``` all:ll ll:ll.c gcc -c -Wall -Werror -02 c.c ll.c -o ll $@ $< clean : \rm -fr ll ``` When I try to `make clean` or `make make`, I get this error: ``` :makefi...

5 Jun at 05:20

Are strongly-typed functions as parameters possible in TypeScript?

In TypeScript, I can declare a parameter of a function as a type Function. Is there a "type-safe" way of doing this that I am missing? For example, consider this: ``` class Foo { save(callback: F...

5 Oct at 14:40

Fastest method to replace all instances of a character in a string

What is the fastest way to replace all instances of a string/character in a string in JavaScript? A `while`, a `for`-loop, a regular expression?

5 Sep at 16:43

How to get the current time in YYYY-MM-DD HH:MI:Sec.Millisecond format in Java?

The code below gives me the current time. But it does not tell anything about milliseconds. ``` public static String getCurrentTimeStamp() { SimpleDateFormat sdfDate = new SimpleDateFormat("yyyy-M...

7 Feb at 12:36