Questions

Recommended way to get hostname in Java

Which of the following is the best and most portable way to get the hostname of the current computer in Java? `Runtime.getRuntime().exec("hostname")` vs `InetAddress.getLocalHost().getHostName()`...

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

How to trigger jQuery change event in code

I have a change event that is working fine but I need to get it to recurse. So I have a function that is triggered on change that will "change" other drop downs based on a class selector (notice "drop...

8 Apr at 19:0

Getting the parent div of element

This should be really simple but I'm having trouble with it. How do I get a parent div of a child element? My HTML: ``` <div id="test"> <p id="myParagraph">Testing</p> </div> ``` My JavaScrip...

18 Oct at 20:31

Formula to determine perceived brightness of RGB color

I'm looking for some kind of formula or algorithm to determine the brightness of a color given the RGB values. I know it can't be as simple as adding the RGB values together and having higher sums be...

11 Apr at 14:32

How can I remove three characters at the end of a string in PHP?

How can I remove three characters at the end of a string in PHP? "abcabcabc" would become "abcabc"!

13 Oct at 18:2

The breakpoint will not currently be hit. No symbols have been loaded for this document in a Silverlight application

Ok, what I have: Visual Studio 2010 RC, W7 x64, started a new project type of Silverlight application. Hosting the Silverlight application in a ASP.NET Web Application Project. Silverlight Version 3...

24 Aug at 07:36

find -exec with multiple commands

I am trying to use find -exec with multiple commands without any success. Does anybody know if commands such as the following are possible? ``` find *.txt -exec echo "$(tail -1 '{}'),$(ls '{}')" \; ...

25 Feb at 17:18

How to convert latitude or longitude to meters?

If I have a latitude or longitude reading in standard NMEA format is there an easy way / formula to convert that reading to meters, which I can then implement in Java (J9)? Edit: Ok seems what I want...

20 Dec at 16:17

Determining complexity for recursive functions (Big O notation)

I have a Computer Science Midterm tomorrow and I need help determining the complexity of these recursive functions. I know how to solve simple cases, but I am still trying to learn how to solve these ...

7 Jun at 10:23

What is http multipart request?

I have been writing iPhone applications for some time now, sending data to server, receiving data (via HTTP protocol), without thinking too much about it. Mostly I am theoretically familiar with proce...

4 Feb at 14:7

Git: Create a branch from unstaged/uncommitted changes on master

Context: I'm working on master adding a simple feature. After a few minutes I realize it was not so simple and it should have been better to work into a new branch. This always happens to me and I ha...

9 Oct at 05:4

How to get current relative directory of your Makefile?

I have a several Makefiles in app specific directories like this: ``` /project1/apps/app_typeA/Makefile /project1/apps/app_typeB/Makefile /project1/apps/app_typeC/Makefile ``` Each Makefile include...

29 Feb at 14:11

Is there a simple, elegant way to define singletons?

There seem to be many ways to define [singletons](http://en.wikipedia.org/wiki/Singleton_pattern) in Python. Is there a consensus opinion on Stack Overflow?

7 Feb at 19:44

Launching an application (.EXE) from C#?

How can I launch an application using C#? Requirements: Must work on [Windows XP](http://en.wikipedia.org/wiki/Windows_XP) and [Windows Vista](http://en.wikipedia.org/wiki/Windows_Vista). I have see...

22 Sep at 22:4

How can I use mySQL replace() to replace strings in multiple records?

We have a database that has a bunch of records with some bad data in one column, in which an embedded editor escaped some stuff that shouldn't have been escaped and it's breaking generated links. I w...

7 Oct at 11:6

How to replace special characters in a string?

I have a string with lots of special characters. I want to remove all those, but keep alphabetical characters. How can I do this?

28 Sep at 15:26

How to resolve ORA-011033: ORACLE initialization or shutdown in progress

When trying to connect to an `ORACLE` user via TOAD (Quest Software) or any other means (`Oracle Enterprise Manager`) I get this error: > `ORA-011033: ORACLE initialization or shutdown in progress`

2 Oct at 08:14

How to use custom font in a project written in Android Studio

I was trying to use custom font in Android Studio as we did in Eclipse. But unfortunately could not figure out where to put the 'assets' folder!

30 May at 17:59

Encoding an image file with base64

I want to encode an image into a string using the base64 module. I've ran into a problem though. How do I specify the image I want to be encoded? I tried using the directory to the image, but that sim...

1 Feb at 09:32

How to get rows count of internal table in abap?

How do I get the row count of an internal table? I guess that I can loop on it. But there must be a saner way. I don't know if it makes a difference but the code should run on 4.6c version.

8 Sep at 14:50

How to call another controller Action From a controller in Mvc

I need to call a controller B action FileUploadMsgView from Controller A and need to pass a parameter for it. Its not going to the controller B's `FileUploadMsgView()`. Here's the code: ControllerA: ...

Define global constants

In Angular 1.x you can define constants like this: ``` angular.module('mainApp.config', []) .constant('API_ENDPOINT', 'http://127.0.0.1:6666/api/') ``` What would be the equivalent in Angular (...

28 Dec at 22:26

If '<selector>' is an Angular component, then verify that it is part of this module

I am new in Angular2. I have tried to create a component but showing an error. This is the `app.component.ts` file. ``` import { Component } from '@angular/core'; import { MyComponentComponent } fro...

12 May at 12:12

How to move the cursor word by word in the OS X Terminal

I know the combination + to jump to the beginning of the current command, and + to jump to the end. But is there any way to jump word by word, like +/ in Cocoa applications does?

1 Jan at 07:57