Questions Tagged with #Hex

Hexadecimal (also base 16, or hex) is the base-16 positional numeral system, using the 16 symbols 0–9 and A‒F.

C++: Converting Hexadecimal to Decimal

I'm looking for a way to convert hex(hexadecimal) to dec(decimal) easily. I found an easy way to do this like : int k = 0x265; cout << k << endl; But with that I can't input 265. Is the..

Transparent ARGB hex value

The colors in this table is all not transparent. I guess the value for the A is set to FF. What is the code for transparency? For example this color FFF0F8FF (AliceBlue), to a transparent code such..

How do I convert hex to decimal in Python?

I have some Perl code where the hex() function converts hex data to decimal. How can I do it on Python?..

Converting A String To Hexadecimal In Java

I am trying to convert a string like "testing123" into hexadecimal form in java. I am currently using BlueJ. And to convert it back, is it the same thing except backward?..

How to convert a hex string to hex number

I want to convert a hex string (ex: 0xAD4) to hex number, then to add 0x200 to that number and again want to print that number in form of 0x as a string. i tried for the first step: str(int(str(item..

Convert hex string to int in Python

How do I convert a hex string to an int in Python? I may have it as "0xffff" or just "ffff"...

Python conversion from binary string to hexadecimal

How can I perform a conversion of a binary string to the corresponding hex value in Python? I have 0000 0100 1000 1101 and I want to get 048D I'm using Python 2.6...

bitwise XOR of hex numbers in python

how can we XOR hex numbers in python eg. I want to xor 'ABCD' to '12EF'. answer should be B922. i used below code but it is returning garbage value def strxor(a, b): # xor two strings of differe..

Write bytes to file

I have a hexadecimal string (e.g 0CFE9E69271557822FE715A8B3E564BE) and I want to write it to a file as bytes. For example, Offset 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 00000000 0C FE..

How to get a Color from hexadecimal Color String

I'd like to use a color from an hexa string such as "#FFFF0000" to (say) change the background color of a Layout. Color.HSVToColor looks like a winner but it takes a float[] as a parameter. Am I any ..

What is 0x10 in decimal?

I have the following code: SN.get_Chars(5) SN is a string so this should give the 5th Char. Ok! Now I have another code but: SN.get_Chars(0x10) I wonder what 0x10 is? Is it a number? If it's so, ..

Conversion hex string into ascii in bash command line

I have a lot of this kind of string and I want to find a command to convert it in ascii, I tried with echo -e and od, but it did not work. 0xA7.0x9B.0x46.0x8D.0x1E.0x52.0xA7.0x9B.0x7B.0x31.0xD2 ..

C++ cout hex values?

I want to do: int a = 255; cout << a; and have it show FF in the output, how would I do this?..

Python convert decimal to hex

I have a function here that converts decimal to hex but it prints it in reverse order. How would I fix it? def ChangeHex(n): if (n < 0): print(0) elif (n<=1): print(n) ..

What do numbers using 0x notation mean?

What does a 0x prefix on a number mean? const int shared_segment_size = 0x6400; It's from a C program. I can't recall what it amounts to and particularly what the letter x means...

How can I convert a hex string to a byte array?

Can we convert a hex string to a byte array using a built-in function in C# or do I have to make a custom method for this?..

Convert integer to hexadecimal and back again

How can I convert the following? 2934 (integer) to B76 (hex) Let me explain what I am trying to do. I have User IDs in my database that are stored as integers. Rather than having users reference ..

How to create python bytes object from long hex string?

I have a long sequence of hex digits in a string, such as 000000000000484240FA063DE5D0B744ADBED63A81FAEA390000C8428640A43D5005BD44 only much longer, several kilobytes. Is there a builtin way t..

Hexadecimal To Decimal in Shell Script

Can someone help me to convert a hexadecimal number to decimal number in a shell script? E.g., I want to convert the hexadecimal number bfca3000 to decimal using a shell script. I basically want the ..

Converting from hex to string

I need to check for a string located inside a packet that I receive as byte array. If I use BitConverter.ToString(), I get the bytes as string with dashes (f.e.: 00-50-25-40-A5-FF). I tried most funct..

Convert a String of Hex into ASCII in Java

I hope this isn't too much of a stupid question, I have looked on 5 different pages of Google results but haven't been able to find anything on this. What I need to do is convert a string that contai..

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

How to convert decimal to hexadecimal in JavaScript

How do you convert decimal values to their hexadecimal equivalent in JavaScript?..

How do I convert a single character into it's hex ascii value in python

I am interested in taking in a single character, c = 'c' # for example hex_val_string = char_to_hex_string(c) print hex_val_string output: 63 What is the simplest way of going about this? Any pr..

How to create a hex dump of file containing only the hex characters without spaces in bash?

How do I create an unmodified hex dump of a binary file in Linux using bash? The od and hexdump commands both insert spaces in the dump and this is not ideal. Is there a way to simply write a long st..

Java converting int to hex and back again

I have the following code... int Val=-32768; String Hex=Integer.toHexString(Val); This equates to ffff8000 int FirstAttempt=Integer.parseInt(Hex,16); // Error "Invalid Int" int SecondAttempt=Integ..

Integer to hex string in C++

How do I convert an integer to a hex string in C++? I can find some ways to do it, but they mostly seem targeted towards C. It doesn't seem there's a native way to do it in C++. It is a pretty simple..

Convert a string representation of a hex dump to a byte array using Java?

I am looking for a way to convert a long string (from a dump), that represents hex values into a byte array. I couldn't have phrased it better than the person that posted the same question here. But..

Why are hexadecimal numbers prefixed with 0x?

Why are hexadecimal numbers prefixed as 0x? I understand the usage of the prefix but I don't understand the significance of why 0x was chosen...

Hexadecimal to Integer in Java

I am trying to convert a String hexadecimal to an integer. The string hexadecimal was calculated from a hash function (sha-1). I get this error : java.lang.NumberFormatException. I guess it doesn't li..

Create a hexadecimal colour based on a string with JavaScript

I want to create a function that will accept any old string (will usually be a single word) and from that somehow generate a hexadecimal value between #000000 and #FFFFFF, so I can use it as a colour ..

Convert A String (like testing123) To Binary In Java

I would like to be able to convert a String (with words/letters) to other forms, like binary. How would I go about doing this. I am coding in BLUEJ (Java). Thanks..

How to get hex color value rather than RGB value?

Using the following jQuery will get the RGB value of an element's background color: $('#selector').css('backgroundColor'); Is there a way to get the hex value rather than the RGB?..

Converting an integer to a hexadecimal string in Ruby

Is there a built in way to convert an integer in Ruby into its hexadecimal equivalent? Something like the opposite of String#to_i: "0A".to_i(16) #=>10 Like perhaps: "0A".hex #=>10 I know ..

Convert integer to hex and hex to integer

So I have this query working (where signal_data is a column) in Sybase but it doesn't work in Microsoft SQL Server: HEXTOINT(SUBSTRING((INTTOHEX(signal_data)),5,2)) as Signal I also have it in Exce..

Generating a random hex color code with PHP

I'm working on a project where I need to generate an undefined number of random, hexadecimal color codes…how would I go about building such a function in PHP?..

Python Hexadecimal

How to convert decimal to hex in the following format (at least two digits, zero-padded, without an 0x prefix)? Input: 255 Output:ff Input: 2 Output: 02 I tried hex(int)[2:] but it seems ..

Decimal to Hexadecimal Converter in Java

I have a homework assignment where I need to do three-way conversion between decimal, binary and hexadecimal. The function I need help with is converting a decimal into a hexadecimal. I have nearly no..

Javascript: Unicode string to hex

I'm trying to convert a unicode string to a hexadecimal representation in javascript. This is what I have: function convertFromHex(hex) { var hex = hex.toString();//force conversion var str..

PHP convert string to hex and hex to string

I got the problem when convert between this 2 type in PHP. This is the code I searched in google function strToHex($string){ $hex=''; for ($i=0; $i < strlen($string); $i++){ $hex ...

Hex transparency in colors

I'm working on implementing a widget transparency option for my app widget although I'm having some trouble getting the hex color values right. Being completely new to hex color transparency I searche..

How to display hexadecimal numbers in C?

I have a list of numbers as below: 0, 16, 32, 48 ... I need to output those numbers in hexadecimal as: 0000,0010,0020,0030,0040 ... I have tried solution such as: printf("%.4x",a); // whe..

Convert hex to binary

I have ABC123EFFF. I want to have 001010101111000001001000111110111111111111 (i.e. binary repr. with, say, 42 digits and leading zeroes). How?..

C++ convert string to hexadecimal and vice versa

What is the best way to convert a string to hex and vice versa in C++? Example: A string like "Hello World" to hex format: 48656C6C6F20576F726C64 And from hex 48656C6C6F20576F726C64 to string: "Hel..

Convert from ASCII string encoded in Hex to plain ASCII?

How can I convert from hex to plain ASCII in Python? Note that, for example, I want to convert "0x7061756c" to "paul"...

byte[] to hex string

How do I convert a byte[] to a string? Every time I attempt it, I get System.Byte[] instead of the value. Also, how do I get the value in Hex instead of a decimal?..

How to get the background color code of an element in hex?

How do I get the background color code of an element? _x000D_ _x000D_ console.log($(".div").css("background-color"));_x000D_ <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery..

printf() formatting for hex

This is more of a curious query than an important question, but why when printing hex as an 8 digit number with leading zeros, does this %#08X Not display the same result as 0x%08X? When I try to use..

Python 3.1.1 string to hex

I am trying to use str.encode() but I get >>> "hello".encode(hex) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: must be string, not builtin_..

Programmatically Lighten or Darken a hex color (or rgb, and blend colors)

Here is a function I was working on to programmatically lighten or darken a hex color by a specific amount. Just pass in a string like "3F6D2A" for the color (col) and a base10 integer (amt) for the a..

How to convert a color integer to a hex String in Android?

I have an integer that was generated from an android.graphics.Color The Integer has a value of -16776961 How do I convert this value into a hex string with the format #RRGGBB Simply put: I would li..

Char array to hex string C++

I searched char* to hex string before but implementation I found adds some non-existent garbage at the end of hex string. I receive packets from socket, and I need to convert them to hex strings for l..

Java Convert integer to hex integer

I'm trying to convert a number from an integer into an another integer which, if printed in hex, would look the same as the original integer. For example: Convert 20 to 32 (which is 0x20) Convert 5..

Print a variable in hexadecimal in Python

I'm trying to find a way to print a string in hexadecimal. For example, I have this string which I then convert to its hexadecimal value. my_string = "deadbeef" my_hex = my_string.decode('hex') How..

What's a good hex editor/viewer for the Mac?

What's a good hex editor/viewer for the Mac? I've used xxd for viewing hexdumps, and I think it can be used in reverse to make edits. But what I really want is a real hex editor...

What's the correct way to convert bytes to a hex string in Python 3?

What's the correct way to convert bytes to a hex string in Python 3? I see claims of a bytes.hex method, bytes.decode codecs, and have tried other possible functions of least astonishment without ava..

How do I get the color from a hexadecimal color code using .NET?

How can I get a color from a hexadecimal color code (e.g. #FFDFD991)? I am reading a file and am getting a hexadecimal color code. I need to create the corresponding System.Windows.Media.Color instan..

How do you convert a byte array to a hexadecimal string, and vice versa?

How can you convert a byte array to a hexadecimal string, and vice versa?..

String.Format for Hex

With below code, the colorsting always gives #DDDD. Green, Red and Space values int he How to fix this? string colorstring; int Blue = 13; int Green = 0; int Red = 0; int Space = 14; colorstring = St..

Understanding colors on Android (six characters)

I am trying to understand how colors work in Android. I have this color set as the background of my LinearLayout, and I get a background gray with some transparency: <gradient android:startColor="..

How do you convert a byte array to a hexadecimal string in C?

I have: uint8 buf[] = {0, 1, 10, 11}; I want to convert the byte array to a string such that I can print the string using printf: printf("%s\n", str); and get (the colons aren't necessary): "00..

In Java, how do I convert a byte array to a string of hex digits while keeping leading zeros?

I'm working with some example java code for making md5 hashes. One part converts the results from bytes to a string of hex digits: byte messageDigest[] = algorithm.digest(); StringBuffer hexStri..

RGB to hex and hex to RGB

How to convert colors in RGB format to hex format and vice versa? For example, convert '#0080C0' to (0, 128, 192)...

Convert hexadecimal string (hex) to a binary string

I found the following way hex to binary conversion: String binAddr = Integer.toBinaryString(Integer.parseInt(hexAddr, 16)); While this approach works for small hex numbers, a hex number such as th..

Convert bytes to bits in python

I am working with Python3.2. I need to take a hex stream as an input and parse it at bit-level. So I used bytes.fromhex(input_str) to convert the string to actual bytes. Now how do I convert these ..

Converting Hexadecimal String to Decimal Integer

I wrote some code to convert my hexadecimal display string to decimal integer. However, when input is something like 100a or 625b( something with letter) I got an error like this: java.lang..

Convert string to hex-string in C#

I have a string like "sample". I want to get a string of it in hex format; like this: "796173767265" Please give the C# syntax...

Ascii/Hex convert in bash

I'm now doing it this way: [root@~]# echo Aa|hexdump -v 0000000 6141 000a 0000003 [root@~]# echo -e "\x41\x41\x41\x41" AAAA But it's not exactly behaving as I wanted, ..

Convert ascii char[] to hexadecimal char[] in C

I am trying to convert a char[] in ASCII to char[] in hexadecimal. Something like this: hello --> 68656C6C6F I want to read by keyboard the string. It has to be 16 characters long. This is my code..

Convert a hexadecimal string to an integer efficiently in C?

In C, what is the most efficient way to convert a string of hex digits into a binary unsigned int or unsigned long? For example, if I have 0xFFFFFFFE, I want an int with the base10 value 4294967294...

Convert hex string to int

I am trying to convert a string that is 8 characters long of hex code into an integer so that I can do int comparison instead of string comparisons over a lot of different values. I know this is fair..

How to convert numbers between hexadecimal and decimal

How do you convert between hexadecimal numbers and decimal numbers in C#?..

How to convert an int to a hex string?

I want to take an integer (that will be <= 255), to a hex string representation e.g.: I want to pass in 65 and get out '\x41', or 255 and get '\xff'. I've tried doing this with the struct.pack('c..

Printing hexadecimal characters in C

I'm trying to read in a line of characters, then print out the hexadecimal equivalent of the characters. For example, if I have a string that is "0xc0 0xc0 abc123", where the first 2 characters are c..

Convert decimal to hexadecimal in UNIX shell script

In a UNIX shell script, what can I use to convert decimal numbers into hexadecimal? I thought od would do the trick, but it's not realizing I'm feeding it ASCII representations of numbers. printf? ..

How to convert hex strings to byte values in Java

I have a String array. I want to convert it to byte array. I use the Java program. For example: String str[] = {"aa", "55"}; convert to: byte new[] = {(byte)0xaa, (byte)0x55}; What can I do?..

Need a good hex editor for Linux

I need a good HEX editor for Linux, and by good I mean: Fast Search/replace features Can display data not only in hex, but also binary, octal, etc. Can work with huge (> 1 gb) files without becoming..

How to convert hex string to Java string?

For logging purpose we are converting the logs to byte array and then to hex string. I want to get it back in a Java String, but I am not able to do so. The hex string in log file looks something lik..

Print a string as hex bytes?

I have this string: Hello world !! and I want to print it using Python as 48:65:6c:6c:6f:20:77:6f:72:6c:64:20:21:21. hex() works only for integers. How can it be done?..

C++ convert hex string to signed integer

I want to convert a hex string to a 32 bit signed integer in C++. So, for example, I have the hex string "fffefffe". The binary representation of this is 11111111111111101111111111111110. The sig..

How to switch text case in visual studio code

How does one switch the case of highlighted text in Visual Studio Code? VS allows this via CTRL+SHIFT+U and CTRL+U. Is there a command binding that I can set up to do this, or is it by default some ..

How to enable CORS in apache tomcat

I am trying to consume some web services which are cross domain. When I disable chrome's web-security it is working fine. I want it to work without this so I have tried adding cross-domain.xml and st..

How to change the link color in a specific class for a div CSS

In my Page the following CSS is set: a:link { color: #0094DE; text-decoration: none; } a:visited { text-decoration: none; color: #0094DE; } a:hover { text-decoration: underline; c..

How do I rename a file using VBScript?

I am trying to rename a file and was using the below code but it does not seem to work. Can someone please tell me why? What is the correct way to rename a file from VBScript? FSO.GetFile("MyFile.txt..

How to change the color of text in javafx TextField?

I want to change font color in TextField .I found -fx-background-color , -fx-border-color for changing the color of background and border but nothing for text . any ideas? thanks in advamce..

cd into directory without having permission

When cding into one of my directories called openfire the following error is returned: bash: cd: openfire: Permission denied Is there any way around this?..

Create a directory if it doesn't exist

In my app I want to copy a file to the other hard disk so this is my code: #include <windows.h> using namespace std; int main(int argc, char* argv[] ) { string Input = "C:\\Emploi NAm.do..

read word by word from file in C++

this function should read a file word by word and it does work till the last word, where the run stops void readFile( ) { ifstream file; file.open ("program.txt"); string word; char..

What's the algorithm to calculate aspect ratio?

I plan to use it with JavaScript to crop an image to fit the entire window. Edit: I'll be using a 3rd party component that only accepts the aspect ratio in the format like: 4:3, 16:9...

How to extract year and month from date in PostgreSQL without using to_char() function?

I want to select sql: SELECT "year-month" from table group by "year-month" AND order by date, where year-month - format for date "1978-01","1923-12". select to_char of couse work, but not "right" ord..

SQL DELETE with INNER JOIN

There are 2 tables, spawnlist and npc, and I need to delete data from spawnlsit. npc_templateid = n.idTemplate is the only thing that "connect" the tables. I have tried this script but it doesn't work..

How to create python bytes object from long hex string?

I have a long sequence of hex digits in a string, such as 000000000000484240FA063DE5D0B744ADBED63A81FAEA390000C8428640A43D5005BD44 only much longer, several kilobytes. Is there a builtin way t..

When should an Excel VBA variable be killed or set to Nothing?

I've been teaching myself Excel VBA over the last two years, and I have the idea that it is sometimes appropriate to dispose of variables at the end of a code segment. For example, I've seen it done i..

Android: where are downloaded files saved?

I am trying to develop a "document manager" I have the necessity of accessing the files downloaded from the internet, from Gmail, for other mail clients, from other internet sources... I would like ..

How to remove/delete a large file from commit history in Git repository?

I accidentally dropped a DVD-rip into a website project, then carelessly git commit -a -m ..., and, zap, the repo was bloated by 2.2 gigs. Next time I made some edits, deleted the video file, and comm..

JavaScript string newline character?

Is \n the universal newline character sequence in Javascript for all platforms? If not, how do I determine the character for the current environment? I'm not asking about the HTML newline element (&l..

open cv error: (-215) scn == 3 || scn == 4 in function cvtColor

I'm currently in Ubuntu 14.04, using python 2.7 and cv2. When I run this code: import numpy as np import cv2 img = cv2.imread('2015-05-27-191152.jpg',0) gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRA..

How can I format decimal property to currency?

I want to format a decimal value as a currency value. How can I do this?..

An unhandled exception occurred during the execution of the current web request. ASP.NET

I just ran my program and I got this error message An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the..

Usage of __slots__?

What is the purpose of __slots__ in Python — especially with respect to when I would want to use it, and when not?..

'mat-form-field' is not a known element - Angular 5 & Material2

I'm trying to use <mat-form-field> in an Angular project using Material2 but I've hit a wall. Getting the error message below. Uncaught Error: Template parse errors: 'mat-form-field' is not a ..

form serialize javascript (no framework)

Wondering is there a function in javascript without jquery or any framework that allows me to serialize the form and access the serialized version?..

How get sound input from microphone in python, and process it on the fly?

Greetings, I'm trying to write a program in Python which would print a string every time it gets a tap in the microphone. When I say 'tap', I mean a loud sudden noise or something similar. I searche..

Java error: Only a type can be imported. XYZ resolves to a package

I get the error: "Only a type can be imported. XYZ resolves to a package." Someone has explained the cause here but I am not sure what I supposed to do to fix this. FYI: I am using Eclipse. I have ad..

How can I roll back my last delete command in MySQL?

I accidentally deleted some huge number of rows from a table... How can I roll it back? I executed the query using PuTTY. I'll be grateful if any of you can guide me safely out of this.....

How to set Highcharts chart maximum yAxis value

I've been trying for two days to find a way to set the maximum value of the yAxis on Highcharts. I got a percentage column graphic, but the highest value in the series is 60, so it adjusts the axis t..

Getting the difference between two sets

So if I have two sets: Set<Integer> test1 = new HashSet<Integer>(); test1.add(1); test1.add(2); test1.add(3); Set<Integer> test2 = new HashSet<Integer>(); test2.add(1); test2..

How do I pass a string into subprocess.Popen (using the stdin argument)?

If I do the following: import subprocess from cStringIO import StringIO subprocess.Popen(['grep','f'],stdout=subprocess.PIPE,stdin=StringIO('one\ntwo\nthree\nfour\nfive\nsix\n')).communicate()[0] I..

Getting the Facebook like/share count for a given URL

I'm using the Facebook API to get the like/share count for given URLs. The strange thing is that it seems to be quite inconsistent in returning results. For example, this page returns results: https..

Maven Java EE Configuration Marker with Java Server Faces 1.2

I'm having a weird configuration problem with Maven in Eclipse. Although I can build the project and deploy it to tomcat without any errors, The Marker tab keeps showing the following message: [-] Ma..

How to redirect 'print' output to a file using python?

I want to redirect the print to a .txt file using python. I have a 'for' loop, which will 'print' the output for each of my .bam file while I want to redirect ALL these output to one file. So I tried ..

Display tooltip on Label's hover?

I have below HTML code ? <label for="male">Hello This Will Have Some Value</label> But actually i dont have enough space to show this much long label. So i thought of creating label as ..

How can I use iptables on centos 7?

I installed CentOS 7 with minimal configuration (os + dev tools). I am trying to open 80 port for httpd service, but something wrong with my iptables service ... what's wrong with it? What am I doing ..

Class has no member named

I have a problem with accessing a function from a class with the class object in my main function. I am just trying to make the object for the class and use that object to access the function inside t..

How to redirect output to a file and stdout

In bash, calling foo would display any output from that command on the stdout. Calling foo > output would redirect any output from that command to the file specified (in this case 'output'). Is t..

How can I change the size of a Bootstrap checkbox?

Wondering if its possible to change the size of checkbox as it's possible with buttons. I want it to be bigger, so it makes it easy to press. Right now its looking like this: Code: <div class=..

Async await in linq select

I need to modify an existing program and it contains following code: var inputs = events.Select(async ev => await ProcessEventAsync(ev)) .Select(t => t.Result) ..

Why isn't sizeof for a struct equal to the sum of sizeof of each member?

Why does the sizeof operator return a size larger for a structure than the total sizes of the structure's members?..

Installing specific package versions with pip

I'm trying to install version 1.2.2 of the MySQL_python adaptor, using a fresh virtualenv created with the --no-site-packages option. The current version shown in PyPi is 1.2.3. Is there a way to inst..

How to use setArguments() and getArguments() methods in Fragments?

I have 2 fragments: (1)Frag1 (2)Frag2. Frag1 bundl = new Bundle(); bundl.putStringArrayList("elist", eList); Frag2 dv = new Frag2(); dv.setArguments(bundl); FragmentTransaction ft = getFragmentMana..

Array of Matrices in MATLAB

I am looking for a way to store a large variable number of matrixes in an array in MATLAB. Are there any ways to achieve this? Example: for i: 1:unknown myArray(i) = zeros(500,800); end Where u..

Create a view with ORDER BY clause

I'm trying to create a view with an ORDER BY clause. I have create it successfully on SQL Server 2012 SP1, but when I try to re-create it on SQL Server 2008 R2, I get this error: Msg 102, Level 1..

Try reinstalling `node-sass` on node 0.12?

I would like to use google web starter kit. I installed node.js v0.12.0, node-sass & gulp. And then ran: $ sudo npm install When I typed gulp serve then got this error: Using gulpfile ~/web-s..

Convert string to Time

I have a time that is 16:23:01. I tried using DateTime.ParseExact, but it's not working. Here is my code: string Time = "16:23:01"; DateTime date = DateTime.ParseExact(Time, "hh:mm:ss tt", System.G..

jquery append div inside div with id and manipulate

after 2 hours of searching I decided to ask my question. I have a div: <div id="box"></div> I want to add a div inside the above div using jquery. I tried (following code is inside a ..

How do I query for all dates greater than a certain date in SQL Server?

I'm trying: SELECT * FROM dbo.March2010 A WHERE A.Date >= 2010-04-01; A.Date looks like: 2010-03-04 00:00:00.000 However, this is not working. Can anyone provide a reference for why?..

Force uninstall of Visual Studio

While uninstalling Microsoft Visual Studio Ultimate 2015 Preview, it throws an error quoting "Microsoft Visual Studio Ultimate 2015 Preview has stopped working" Message Content Include: A proble..

What's the difference between window.location= and window.location.replace()?

Is there a difference between these two lines? var url = "http://www.google.com/"; window.location = url; window.location.replace(url); ..

How do you get the current project directory from C# code when creating a custom MSBuild task?

Instead of running an external program with its path hardcoded, I would like to get the current Project Dir. I'm calling an external program using a process in the custom task. How would I do that? A..

Converting a column within pandas dataframe from int to string

I have a dataframe in pandas with mixed int and str data columns. I want to concatenate first the columns within the dataframe. To do that I have to convert an int column to str. I've tried to do as ..

What is the right way to check for a null string in Objective-C?

I was using this in my iPhone app if (title == nil) { // do something } but it throws some exception, and the console shows that the title is "(null)". So I'm using this now: if (title == nil..

Make absolute positioned div expand parent div height

As you can see in the CSS below, I want child2 to position itself before child1. This is because the site I'm currently developing should also work on mobile devices, on which the child2 should be at ..

Compiling LaTex bib source

I am writing my thesis in Latex, and I have the references in an own thesis.bib file which look as follows @Article{xxx, author = "D.A. Reinhard", title = "Case Study", year = ..

Filtering JSON array using jQuery grep()

I've searched many examples on this site but can't seem to fit them into my needs. I just need to filter some JSON results using grep(). Below is my JSON: var data = { "items": [ { "id..

How do I put variable values into a text string in MATLAB?

I'm trying to write a simple function that takes two inputs, x and y, and passes these to three other simple functions that add, multiply, and divide them. The main function should then display the re..

How do you make an element "flash" in jQuery

I'm brand new to jQuery and have some experience using Prototype. In Prototype, there is a method to "flash" an element — ie. briefly highlight it in another color and have it fade back to norma..

Efficient way to update all rows in a table

I have a table with a lot of records (could be more than 500 000 or 1 000 000). I added a new column in this table and I need to fill a value for every row in the column, using the corresponding row v..

standard_init_linux.go:190: exec user process caused "no such file or directory" - Docker

When I am running my docker image on windows 10. I am getting this error: standard_init_linux.go:190: exec user process caused "no such file or directory" my docker file is: FROM openjdk:8 EXPOSE..

How To change the column order of An Existing Table in SQL Server 2008

I have situation where I need to change the order of the columns/adding new columns for existing Table in SQL Server 2008. Existing column MemberName MemberAddress Member_ID(pk) and I want this or..

Regular expression for only characters a-z, A-Z

I don't know how to create a regular expression in JavaScript or jQuery. I want to create a regular expression that will check if a string contains only characters between a-z and A-Z with any arrang..

Writing your own square root function

How do you write your own function for finding the most accurate square root of an integer? After googling it, I found this (archived from its original link), but first, I didn't get it completely, a..

How to conclude your merge of a file?

After I merged a file in Git I tried to pull the repository but error came up: You have not concluded your merge. (MERGE_HEAD exists) How does one conclude a merge?..

position fixed header in html

I have a header (dynamic height) with a fixed position. I need to place the container div right below the header. As the header height is dynamic, I can't use the fixed value for top margin. How ca..

Can CSS3 transition font size?

How can one make the font size grow bigger on mouse over? Color transitions work fine over time, but the font size switches immediately for some reason. Sample code: body p { font-size: 12p..

How can I check whether Google Maps is fully loaded?

I’m embedding Google Maps into my web site. Once Google Maps is loaded, I need to kick off a few JavaScript processes. Is there a way to auto-detect when Google Maps has fully loaded, including til..

What is the correct way to represent null XML elements?

I have seen null elements represented in several ways: The element is present with xsi:nil="true": <book> <title>Beowulf</title> <author xsi:nil="true"/> </boo..

Storing Objects in HTML5 localStorage

I'd like to store a JavaScript object in HTML5 localStorage, but my object is apparently being converted to a string. I can store and retrieve primitive JavaScript types and arrays using localStorage..

eclipse stuck when building workspace

I am using eclipse 3.4.1 Java EE under Vista. It seems to like getting stuck when building my workspace. Canceling the build doesn't seem to do anything as well. Why is this happening and how do I fi..

SyntaxError: Unexpected Identifier in Chrome's Javascript console

I tested this javascript in Chrome's Javascript console and it returned SyntaxError: Unexpected Identifier. I got this code from a tutorial and was just testing Chrome's console so i expected it to ..

git stash blunder: git stash pop and ended up with merge conflicts

I did a git stash pop and ended up with merge conflicts. I removed the files from the file system and did a git checkout as shown below, but it thinks the files are still unmerged. I then tried replac..

Increase days to php current Date()

How do I add a certain number of days to the current date in PHP? I already got the current date with: $today = date('y:m:d'); Just need to add x number of days to it..

printf and long double

I am using the latest gcc with Netbeans on Windows. Why doesn't long double work? Is the printf specifier %lf wrong? Code: #include <stdio.h> int main(void) { float aboat = 32000.0; d..

Calculate the center point of multiple latitude/longitude coordinate pairs

Given a set of latitude and longitude points, how can I calculate the latitude and longitude of the center point of that set (aka a point that would center a view on all points)? EDIT: Python soluti..

How do I get cURL to not show the progress bar?

I'm trying to use cURL in a script and get it to not show the progress bar. I've tried the -s, -silent, -S, and -quiet options, but none of them work. Here's a typical command I've tried: curl -s ..

How to repeat last command in python interpreter shell?

How do I repeat the last command? The usual keys: Up, Ctrl+Up, Alt-p don't work. They produce nonsensical characters. (ve)[kakarukeys@localhost ve]$ python Python 2.6.6 (r266:84292, Nov 15 2010, 21:4..

java.lang.NullPointerException: Attempt to invoke virtual method 'int android.view.View.getImportantForAccessibility()' on a null object reference

I'm trying to put together a shopping list app, based on input fields, ArrayList, and ListView. The app will be based on Fragments. However, I have encountered a problem and I do not know how to solve..

What is thread Safe in java?

Possible Duplicate: What does threadsafe mean? I am very confused that any class is Thread safe. I am understanding that, if any class is thread safe then it has some specific on its method..

How to view method information in Android Studio?

In Eclipse, when you hover your mouse over a method, a window would appear with a description of what the method does, what the parameters mean and what it returns. Is there a way to get Android Studi..

Is there an eval() function in Java?

I have a string like the following: String str = "4*5"; Now I have to get the result of 20 by using the string. I know in some other languages the eval() function will do this. How can I do this i..

SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443

Since a few days I got an issue with Mac OS High Sierra 10.13.3 : When I run a git clone like git clone github.com/xxx.git failed it print: LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to..

API pagination best practices

I'd love some some help handling a strange edge case with a paginated API I'm building. Like many APIs, this one paginates large results. If you query /foos, you'll get 100 results (i.e. foo #1-100),..

How to display Woocommerce product price by ID number on a custom page?

I'm trying to display a price of a product in Woocommerce, on a custom page. There is a short code for that, but it gives product price and also adds an "Add to cart button", I don't want the button, ..

How to get a Static property with Reflection

So this seems pretty basic but I can't get it to work. I have an Object, and I am using reflection to get to it's public properties. One of these properties is static and I'm having no luck getting ..

Access cell value of datatable

Can anyone help me how to access for example value of first cell in 4th column? a b c d 1 2 3 5 g n m l for example, how to access to value d, if that would be datatable? Thanks...

Validation failed for one or more entities. See 'EntityValidationErrors' property for more details

I am having this error when seeding my database with code first approach. Validation failed for one or more entities. See 'EntityValidationErrors' property for more details. To be honest I don't..

Chart.js v2 hide dataset labels

I have the following codes to create a graph using Chart.js v2.1.3: var ctx = $('#gold_chart'); var goldChart = new Chart(ctx, { type: 'line', data: { labels: dates, datasets:..

In AVD emulator how to see sdcard folder? and Install apk to AVD?

I have created an Android emulator (Android Virtual Device), but I am unable to find out the SD card I have built during creation of this. How can I find the SD card and its content and also how to i..

How to check string length and then select substring in Sql Server

In a view, i have a column comments which may contain large string. I just want to select first 60 characters and append the '...' at the end of the selected string. For selecting first 60 characters..

invalid conversion from 'const char*' to 'char*'

Have a code as shown below. I have problem passing the arguments. stringstream data; char *addr=NULL; strcpy(addr,retstring().c_str()); retstring() is a function that returns a string. //more code..

align textbox and text/labels in html?

I cant figure it out. How do i align the textbox? I thought using float: left on the labels on the left (then doing it on the input when i notice the input was now on the left without that) but that w..

What is a segmentation fault?

What is a segmentation fault? Is it different in C and C++? How are segmentation faults and dangling pointers related?..

Create or write/append in text file

I have a website that every time a user logs in or logs out I save it to a text file. My code doesn't work in appending data or creating a text file if it does not exist.. Here is the sample code $m..

Error while trying to retrieve text for error ORA-01019

I have a question related to oracle. I have a machine which earlier had Oracle client installed on it. I was able to connect to my oracle server using the client. Now I recently installed oracle 11g ..

Resetting MySQL Root Password with XAMPP on Localhost

So for the past hour I've been trying to figure out how to reset my 'root' password for MySQL as I cannot log into PHPMyAdmin. I've tried changing the password in the config.inc.php file and searching..

UITextField border color

I have really great wish to set my own color to UITextField border. But so far I could find out how to change the border line style only. I've used background property to set background color in such..

Display the current time and date in an Android application

How do I display the current date and time in an Android application?..

How to convert .pfx file to keystore with private key?

I need to sign Android application (.apk). I have .pfx file. I converted it to .cer file via Internet Explorer and then converted .cer to .keystore using keytool. Then I've tried to sign .apk with jar..

Testing Private method using mockito

public class A { public void method(boolean b){ if (b == true) method1(); else method2(); } private void method1() {} private void ..

Installation Issue with matplotlib Python

I have issue after installing the matplotlib package unable to import matplotlib.pyplot as plt. Any suggestion will be greatly appreciate. >>> import matplotlib.pyplot as plt Traceback (mo..

What is content-type and datatype in an AJAX request?

What is content-type and datatype in a POST request? Suppose I have this: $.ajax({ type : "POST", url : /v1/user, datatype : "application/json", contentType: "text/plain", success..

Nginx serves .php files as downloads, instead of executing them

I am installing a website in a droplet (Digital Ocean). I have a issue for install NGINX with PHP properly. I did a tutorial https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx..

Can't find how to use HttpContent

I am trying to use HttpContent: HttpContent myContent = HttpContent.Create(SOME_JSON); ...but I am not having any luck finding the DLL where it is defined. First, I tried adding references to Micr..

CSS: how to position element in lower right?

I am trying to position the text element "Bet 5 days ago" in the lower right-hand corner. How can I accomplish this? And, more importantly, please explain so I can conquer CSS! ..

Using multiple .cpp files in c++ program?

I recently moved from Java for C++ but now when I am writing my application I'm not interested in writing everything of the code in the main function I want in main function to call another function b..

Using async/await with a forEach loop

Are there any issues with using async/await in a forEach loop? I'm trying to loop through an array of files and await on the contents of each file. import fs from 'fs-promise' async function printF..

How to match hyphens with Regular Expression?

How to rewrite the [a-zA-Z0-9!$* \t\r\n] pattern to match hyphen along with the existing characters ?..

How to run a shell script at startup

On an Amazon S3 Linux instance, I have two scripts called start_my_app and stop_my_app which start and stop forever (which in turn runs my Node.js application). I use these scripts to manually start a..

Can an Android NFC phone act as an NFC tag?

From what I have understood so far, an NFC phone will act as an NFC reader which will read data from an NFC tag. Now my question is, can we switch this around? Can we make an Android NFC phone behave ..

How to access custom attributes from event object in React?

React is able to render custom attributes as described at http://facebook.github.io/react/docs/jsx-gotchas.html: If you want to use a custom attribute, you should prefix it with data-. <..

CSS scrollbar style cross browser

How can I define a CSS scrollbar style cross browser? I tested this code, it only works in IE and opera, but failed in Chrome, Safari and Firefox. <style type="text/css"> <!-- body { ..

A server with the specified hostname could not be found

When I try to submit my app on the App Store through Xcode I got this error. A server with the specified hostname could not be found. Is this temporary error at Apple or something to do with X..

How to Git stash pop specific stash in 1.8.3?

I just upgraded Git. I'm on Git version 1.8.3. This morning I tried to unstash a change 1 deep in the stack. I ran git stash pop stash@{1} and got this error. fatal: ambiguous argument 'stash@1'..

Where does flask look for image files?

I am setting up a local server using flask. All I want to do currently is display an image using the img tag in the index.html page. But I keep getting error GET http://localhost:5000/ ayrton_senna_..

invalid byte sequence for encoding "UTF8"

I'm trying to import some data into my database. So I've created a temporary table, create temporary table tmp(pc varchar(10), lat decimal(18,12), lon decimal(18,12), city varchar(100), prov varchar(..

SQL Server : GROUP BY clause to get comma-separated values

Possible Duplicate: SQL group_concat function in SQL Server I am looking to create a query but somehow I am unable to do so. Can anyone please help me out here? The original data ID Re..

c# why can't a nullable int be assigned null as a value

Explain why a nullable int can't be assigned the value of null e.g int? accom = (accomStr == "noval" ? null : Convert.ToInt32(accomStr)); What's wrong with that code?..

Create PostgreSQL ROLE (user) if it doesn't exist

How do I write an SQL script to create a ROLE in PostgreSQL 9.1, but without raising an error if it already exists? The current script simply has: CREATE ROLE my_user LOGIN PASSWORD 'my_password'; ..

maven... Failed to clean project: Failed to delete ..\org.ow2.util.asm-asm-tree-3.1.jar

I use STS(spring tool suite) + maven plugin. Every time when I run my application using maven-clean I see following error: [INFO] Scanning for projects... [INFO] ..

How to set height property for SPAN

I need to make following code stretchable with predefined height <style> .title{ background: url(bg.gif) no-repeat bottom right; height: 25px; } </style> <span class="title">..

c# dictionary How to add multiple values for single key?

I have created dictionary object Dictionary<string, List<string>> dictionary = new Dictionary<string,List<string>>(); I want to add string values to the list of string ..

MySQL 1062 - Duplicate entry '0' for key 'PRIMARY'

I have the following table in MySQL version 5.5.24 DROP TABLE IF EXISTS `momento_distribution`; CREATE TABLE IF NOT EXISTS `momento_distribution` ( `momento_id` INT(11) NOT NULL, `..

How to set zoom level in google map

Here is the code I have written to add a marker to the google map by providing latitude and longitude. The problem is that I get a very highly zoomed google map. I have tried setting the zoom level to..

MSBuild doesn't copy references (DLL files) if using project dependencies in solution

I have four projects in my Visual Studio solution (everyone targeting .NET 3.5) - for my problem only these two are important: MyBaseProject <- this class library references a third-party DLL fil..

How to persist a property of type List<String> in JPA?

What is the smartest way to get an entity with a field of type List persisted? Command.java package persistlistofstring; import java.io.Serializable; import java.util.ArrayList; import java.util.Li..

Can Linux apps be run in Android?

Android is based on Linux; can native Linux applications be run on Android?..

Proper way to set response status and JSON content in a REST API made with nodejs and express

I am playing around with Nodejs and express by building a small rest API. My question is, what is the good practice/best way to set the code status, as well as the response data? Let me explain with ..

Hide div after a few seconds

I was wondering, how in jquery am I able to hide a div after a few seconds? Like Gmail's messages for example. I've tried my best but am unable to get it working...

Allow a div to cover the whole page instead of the area within the container

I'm trying to make a semi-transparent div cover the whole screen. I tried this: #dimScreen { width: 100%; height: 100%; background:rgba(255,255,255,0.5); } But that doesn't cover the wh..

How to Concatenate Numbers and Strings to Format Numbers in T-SQL?

I have the following function ALTER FUNCTION [dbo].[ActualWeightDIMS] ( -- Add the parameters for the function here @ActualWeight int, @Actual_Dims_Lenght int, @Actual_Dims_Width int..

Is there any difference between "!=" and "<>" in Oracle Sql?

I would like to know if there are any differences in between the two not equal operators <> and != in Oracle. Are there cases where they can give different results or different performance?..

jQuery or CSS selector to select all IDs that start with some string

How can I select all elements whose id starts with "player_"? I have multiple elements like this: <div id="player_290x3dfda">text</div> Every id has a unique stamp on it. How can I sel..

Checking if a key exists in a JavaScript object?

How do I check if a particular key exists in a JavaScript object or array? If a key doesn't exist, and I try to access it, will it return false? Or throw an error?..

How to make JavaScript execute after page load?

I'm executing an external script, using a <script> inside <head>. Now since the script executes before the page has loaded, I can't access the <body>, among other things. I'd like t..

How to open an elevated cmd using command line for Windows?

How do I open a elevated command prompt using command lines on a normal cmd? For example, I use runas /username:admin cmd but the cmd that was opened does not seem to be elevated! Any solutions?..

How do I delete everything in Redis?

I want to delete all keys. I want everything wiped out and give me a blank database. Is there a way to do this in Redis client?..

Convert integer to string Jinja

I have an integer {% set curYear = 2013 %} In {% if %} statement I have to compare it with some string. I can't set curYear to string at the beginning because I have to decrement it in loop. How c..

Hiding axis text in matplotlib plots

I'm trying to plot a figure without tickmarks or numbers on either of the axes (I use axes in the traditional sense, not the matplotlib nomenclature!). An issue I have come across is where matplotlib ..

How do I change data-type of pandas data frame to string with a defined format?

I'm starting to tear my hair out with this - so I hope someone can help. I have a pandas DataFrame that was created from an Excel spreadsheet using openpyxl. The resulting DataFrame looks like: print..

UnsatisfiedDependencyException: Error creating bean with name 'entityManagerFactory'

I have a database configuration class to connect my spring web service with the database. I'm using spring boot, to make it stand alone application. Here is my class @Configuration @EnableTransactio..

How to get the file ID so I can perform a download of a file from Google Drive API on Android?

I am working on an Android project and I am trying to make use of the Google Drive API and I've got most of it working but I am having an issue in how I perform a download. I can't find anywhere how..

Double.TryParse or Convert.ToDouble - which is faster and safer?

My application reads an Excel file using VSTO and adds the read data to a StringDictionary. It adds only data that are numbers with a few digits (1000 1000,2 1000,34 - comma is a delimiter in Russian ..

Replacing characters in Ant property

Is there a simple way of taking the value of a property and then copy it to another property with certain characters replaced? Say propA=This is a value. I want to replace all the spaces in it into u..

How to iterate through a list of dictionaries in Jinja template?

I tried: list1 = [{"username": "abhi", "pass": 2087}] return render_template("file_output.html", list1=list1) In the template: <table border=2> <tr> <td> Key <..

How to print table using Javascript?

I found this code to print in Javascript. function printData() { var divToPrint=document.getElementById("printTable"); newWin= window.open(""); newWin.document.write(divToPrint.outerHTML); ..

How to execute a command in a remote computer?

I have a shared folder in a server and I need to remotely execute a command on some files. How do I do that? What services need to be running on the server to make that work? Some details: Only C# ..

Linux command: How to 'find' only text files?

After a few searches from Google, what I come up with is: find my_folder -type f -exec grep -l "needle text" {} \; -exec file {} \; | grep text which is very unhandy and outputs unneeded texts such..

Where does Chrome store cookies?

Let's say I set a cookie using the setcookie() function in PHP: setcookie('name','foo',false,'/',false); I can see it in: chrome://settings/cookies However, I can not find the actual file store..

HTTP Ajax Request via HTTPS Page

I am having a site with some pages on HTTPS connection. From these HTTPS pages, I have to use a HTTP Ajax request for some errors retrieval like blank fields. But this error messages are not coming. I..

PHP header() redirect with POST variables

I'm working with PHP, and I'm making an action page which a form posts to. The page checks for errors, then if everything is fine, it redirects them to the page where the data has been posted. If not,..

How do I obtain a list of all schemas in a Sql Server database

I want to retrieve a list of all schemas in a given Sql Server database. Using the ADO.NET schema retrieval API I get a list of all collections but there is no collection for 'Schemas'. I could traver..

What is a practical use for a closure in JavaScript?

I'm trying my hardest to wrap my head around JavaScript closures. I get that by returning an inner function, it will have access to any variable defined in its immediate parent. Where would this be ..

How do I partially update an object in MongoDB so the new object will overlay / merge with the existing one

Given this document saved in MongoDB { _id : ..., some_key: { param1 : "val1", param2 : "val2", param3 : "val3" } } An object with new information on param2 and p..

C++ string to double conversion

Usually when I write anything in C++ and I need to convert a char into an int I simply make a new int equal to the char. I used the code(snippet) string word; openfile >> word; double l..

$_POST not working. "Notice: Undefined index: username..."

Possible Duplicate: PHP: “Notice: Undefined variable” and “Notice: Undefined index” So, I am currently learning PHP and was reading on a book about the md5 function for passwords, ..

Accessing Websites through a Different Port?

I am wanting to access a website from a different port than 80 or 8080. Is this possible? I just want to view the website but through a different port. I do not have a router. I know this can be done ..

Extracting text from a PDF file using PDFMiner in python?

I am looking for documentation or examples on how to extract text from a PDF file using PDFMiner with Python. It looks like PDFMiner updated their API and all the relevant examples I have found conta..

Create a new workspace in Eclipse

I don't see any menu item I can use to create a new workspace. What should I use to create a new workspace and move some of the projects from existing default workspace to a new workspace? I am us..

How to dynamically create generic C# object using reflection?

In C# I have the following object: public class Item { } public class Task<T> { } public class TaskA<T> : Task<T> { } public class TaskB<T> : Task<T> { } I want to ..

Vim: faster way to select blocks of text in visual mode

I have been using vim for quite some time and am aware that selecting blocks of text in visual mode is as simple as SHIFT+V and moving the arrow key up or down line-by-line until I reach the end of th..

What's the best way to check if a file exists in C?

Is there a better way than simply trying to open the file? int exists(const char *fname) { FILE *file; if ((file = fopen(fname, "r"))) { fclose(file); return 1; } ..

Failed to build gem native extension (installing Compass)

When I attempt to install the latest version of compass (https://rubygems.org/gems/compass/versions/1.0.0.alpha.17), I get the following error. ERROR: Error installing compass: ERROR: Failed to buil..

Simplest way to append data to a SQL Column

I'm sure i can figure something out using replace, etc, but just wondering if there is anything out there that lets you simply append data to a column rather than how the common Insert function works?..

Understanding events and event handlers in C#

I understand the purpose of events, especially within the context of creating user interfaces. I think this is the prototype for creating an event: public void EventName(object sender, EventArgs e); ..

How to reset the use/password of jenkins on windows?

Maybe a fool question, I installed jenkins on windows by default, have set no user/password, it worked at first, no need to login. But when launch the 8080 webpage now, it hangs the login page, I've t..

In Django, how do I check if a user is in a certain group?

I created a custom group in Django's admin site. In my code, I want to check if a user is in this group. How do I do that?..

Adding headers when using httpClient.GetAsync

I'm implementing an API made by other colleagues with Apiary.io, in a Windows Store app project. They show this example of a method I have to implement: var baseAddress = new Uri("https://private-a8..

How to pass arguments from command line to gradle

I'm trying to pass an argument from command line to a java class. I followed this post: http://gradle.1045684.n5.nabble.com/Gradle-application-plugin-question-td5539555.html but the code does not wor..

How to compare only date in moment.js

I am new to moment.js. I have a date object and it has some time associated with it. I just want to check if that date is greater than or equal to today's date, excluding the time when comparing. va..

Plotting a 2D heatmap with Matplotlib

Using Matplotlib, I want to plot a 2D heat map. My data is an n-by-n Numpy array, each with a value between 0 and 1. So for the (i, j) element of this array, I want to plot a square at the (i, j) coor..

android activity has leaked window com.android.internal.policy.impl.phonewindow$decorview Issue

I am working with Android application to show network error. NetErrorPage.java package exp.app; import android.app.Activity; import android.app.AlertDialog; import android.content.Context; import ..

How to run composer from anywhere?

I have just installed composer in my /usr/bin folder, so when from that folder I run php composer.phar I get the help info about composer. But, when I try to run the same from other folder I get Could..

How do I detect if I am in release or debug mode?

How can I detect in my code that I am in Release mode or Debug mode?..

Assertion failure in dequeueReusableCellWithIdentifier:forIndexPath:

So I was making an rss reader for my school and finished the code. I ran the test and it gave me that error. Here is the code it's referring to: - (UITableViewCell *)tableView:(UITableView *)tableVie..

Check if space is in a string

' ' in word == True I'm writing a program that checks whether the string is a single word. Why doesn't this work and is there any better way to check if a string has no spaces/is a single word....

Typescript export vs. default export

What is the difference in Typescript between export and default export. In all the tutorials I see people exporting their classes and I cannot compile my code if I don't add the default keyword before..

Upload file to FTP using C#

I try upload a file to an FTP-server with C#. The file is uploaded but with zero bytes. private void button2_Click(object sender, EventArgs e) { var dirPath = @"C:/Documents and Settings/sander.G..

Excel - extracting data based on another list

I have an Excel worksheet with two columns (name/ID) and then another list that is a subset of the names only from the larger aforementioned list. I want to go through the subset list and then pull th..

Commenting out code blocks in Atom

I have been moving from Webstorm and RubyMine to Atom and I really miss a feature from the Jetbrains editors where you select a code block and press CMD + - and it adds language specific comment chara..

What does 'COLLATE SQL_Latin1_General_CP1_CI_AS' do?

I have an SQL query to create the database in SQLServer as given below: create database yourdb on ( name = 'yourdb_dat', filename = 'c:\program files\microsoft sql server\mssql.1\mssql\data\yourdbd..

How can I add JAR files to the web-inf/lib folder in Eclipse?

I'm using Eclipse and I need to be able to add Java libraries (JAR files) into my web application's WEB-INF/lib folder. How do I achieve this?..

conversion from infix to prefix

I am preparing for an exam where i couldn't understand the convertion of infix notation to polish notation for the below expression: (a–b)/c*(d + e – f / g) Can any one tell step by step how th..

Facebook Architecture

I have been scrounging for articles/info about the architecture at Facebook, the challenges & ways they tackle them. What they use & why they use. How do they scale & what are the design d..

ASP.NET strange compilation error

I don't know what's wrong with my machine, but it's a while that I'm getting the following strange error from ASP.NET (for all my applications). Compilation Error Description: An error occurred duri..

Remove last characters from a string in C#. An elegant way?

I have a numeric string like this 2223,00. I would like to transform it to 2223. This is: without the information after the ",". Assume that there will be only two decimals after the ",". I did: st..

SQL Current month/ year question

So I have a table that has the month and year broken down, for example field called Month has the number 7 in it (this month) and the Year field has 2011. Theres also additional months years, etc. How..

Random color generator

Given this function, I want to replace the color with a random color generator. document.overlay = GPolyline.fromEncoded({ color: "#0000FF", weight: 10, points: encoded_points, zoomFa..


How do I get column datatype in Oracle with PL-SQL with low privileges?

I have "read only" access to a few tables in an Oracle database. I need to get schema information on some of the columns. I'd like to use something analogous to MS SQL's sp_help. I see the table I'm..

Select multiple columns from a table, but group by one

The table name is "OrderDetails" and columns are given below: OrderDetailID || ProductID || ProductName || OrderQuantity I'm trying to select multiple columns and Group By ProductID while having SU..

How can I capture the right-click event in JavaScript?

I want to block the standard context menus, and handle the right-click event manually. How is this done?..

Nested JSON: How to add (push) new items to an object?

I'm just starting with Arrays, Objects, and JSON - so hopefully there's just something simple I'm overlooking here. I'm encountering an error when attempting to add (push) a new item into my json obje..

Error: fix the version conflict (google-services plugin)

As per this SO thread, I know there are version conflicts, but issue still persists after new versions from Google. Error:Execution failed for task ':app:processDebugGoogleServices'. Please fix ..

ADB server version (36) doesn't match this client (39) {Not using Genymotion}

After installing the Android O preview on a test device my ADB stopped working and started giving me this error. adb server version (36) doesn't match this client (39); killing... adb E 03-27 08:01:55..

Querying DynamoDB by date

I'm coming from a relational database background and trying to work with amazon's DynamoDB I have a table with a hash key "DataID" and a range "CreatedAt" and a bunch of items in it. I'm trying to g..

array of string with unknown size

How is an array of string where you do not know where the array size in c#.NET? String[] array = new String[]; // this does not work ..

Add day(s) to a Date object

Possible Duplicate: How to add number of days to today's date? I'm confused, I found so many different approaches, and which of them is actually correct? So what is the correct way to..

How to move an element down a litte bit in html

That sounds weird I know, but I am having trouble getting a piece of text to move down a tiny bit so it's centered on the tab it's on. here's what it looks like: I want buy to be centered vertica..

How do I break out of a loop in Perl?

I'm trying to use a break statement in a for loop, but since I'm also using strict subs in my Perl code, I'm getting an error saying: Bareword "break" not allowed while "strict subs" in use at ...

How to parse date string to Date?

How do I parse the date string below into a Date object? String target = "Thu Sep 28 20:29:30 JST 2000"; DateFormat df = new SimpleDateFormat("E MM dd kk:mm:ss z yyyy"); Date result = df.parse(targe..

External VS2013 build error "error MSB4019: The imported project <path> was not found"

I am building a project through the command line and not inside Visual Studio 2013. Note, I had upgraded my project from Visual Studio 2012 to 2013. The project builds fine inside the IDE. Also, I com..