Browsing 7239 questions and answers with Jon Skeet

C#: base64url according to RFC4648

I'm looking for a (fast) standard implementation for base64url according to RFC4648 in C#. I found HttpServerUtility.UrlTokenEncode but it looks like this doesn't follow RFC4648...
Jon Skeet
people
quotationmark

Based on the comments, it sounds like HttpServerUtility.UrlTokenEncode does the right thing except for the extra character for padding. So you should be able to do: string customBase64 = HttpServerUtility.UrlTokenEncode(data); string... more 11/4/2014 12:45:11 PM

people

how much its feasible to add reference EXE instead of dll

a project which is completed in visual studio 2010 (vb.net) 3.5 .net name : fieldManager i want to embed above project in my another application which i will be developing in ...
Jon Skeet
people
quotationmark

It's entirely feasible - it used not to be supported within the "Add reference" dialog, but that was back in the VS2002/2003 days - I believe it's been fully supported since VS2005. You might consider whether it would be better to break... more 11/4/2014 11:11:35 AM

people

unable to deserialize all elements of this xml

Few elements of this XML does not deserialize and but it does not throw any errors either. <?xml version="1.0" encoding="utf-8"?> <TrialMWordsRecord...
Jon Skeet
people
quotationmark

The problem is in your XML. Look at what it's like for your working case: <WordsElements> <Words> <Name>ListMWords1</Name> <Value>Apple</Value> <Type>STRING</Type> ... more 11/4/2014 8:20:36 AM

people

Inner class construction in Java

I've read about class fromal parameters and the question then arises as to why the following code is ill-formed? class A: package org.gradle; public class A extends B.Inner{ ...
Jon Skeet
people
quotationmark

The "extra" parameter is effectively hidden from you - both when you declare it, and when you execute it. When you execute it, you provide a value in a different way - in your case, via s: s.super(); That's passing s as the hidden extra... more 11/4/2014 7:19:47 AM

people

18 digit timestamp to Local Time

I came across Sq-lite database.I found our date time is stored in 18 digit time-stamp. Please help me how to convert it to Local Time. (I tried to convert it(No.of milliseconds...
Jon Skeet
people
quotationmark

It looks to me like it's based at 1970 (the Unix epoch) instead of 1900, with 256000000 "ticks" per second. I haven't seen such a format before, but it seems to check out - for example, using Noda Time: using System; using... more 11/4/2014 7:05:11 AM

people

Java operator ? :

How can I change if(xmlComboBoxValues.get(0) == null){ cstmt.setNull(i++,java.sql.Types.NVARCHAR); } else { cstmt.setString(i++, (String) xmlComboBoxValues.get(0)); ...
Jon Skeet
people
quotationmark

You can't do that for two reasons: The methods have a void return type You can't use a conditional expression as a statement These are both symptoms of the same cause: you're misusing the operator. The purpose of the operator is to... more 11/4/2014 6:54:40 AM

people

Task.Factory.StartNew is not working in console c# application

I am having a console application which reads the messages from Console.OpenStandardInput(); I am doing this in a task. but it seems to be not working. static void...
Jon Skeet
people
quotationmark

You basically have a race condition between Console.ReadLine and your task. Both of them are trying to read from standard input - and I certainly don't know what you should expect when reading from standard input from two threads at the... more 11/4/2014 6:51:23 AM

people

Java compilation does not produce .jar

I have created the simple 'WordCount.java' file for implementing a simple hadoop program and upon compilation, it does not create a .jar file. The files created at...
Jon Skeet
people
quotationmark

I have created the simple 'WordCount.java' file for implementing a simple hadoop program and upon compilation, it does not create a .jar file. No, it wouldn't. The output of compilation of .java files (with javac) is a collection of... more 11/3/2014 10:14:31 PM

people

Parsing date in polish locale in Joda?

I have following date: eg. String rawDate = "pon, 17 lis 2014, 15:51:12"; and I would like to parse it. I call: DateTime time = new DateTimeFormatterBuilder() ...
Jon Skeet
people
quotationmark

Apparently Joda Time (or Java) treats the abbreviated form of poniedziaƂek is pn, not pon - so this code works (and is slightly simpler than yours): import org.joda.time.*; import org.joda.time.format.*; import java.util.*; public class... more 11/3/2014 10:11:21 PM

people

Simple Binary Search Program....Please tell me what is wrong in this specific code

Im a beginner. Here is a binary search code.Its showing array out of bounds error for main method. please look into the program and kindly tell me my mistake.ill be grateful for...
Jon Skeet
people
quotationmark

Currently your code does compile, and runs forever - because of this loop: while(mid>=0 && mid<=len) { // Code which doesn't modify mid or len } Assuming it gets into that loop at all (which it does), the condition is... more 11/3/2014 6:01:22 PM

people