Date format retrieved from a service I'm working on getting Json objects from a service to a List View in Android... the date format looks like this "/Date(1354222800000+0300)/" ... how can I change it to a readable format?  for (int i = 0; i &lt; json.length(); i++) {      HashMap&lt;String, String&gt; map = new HashMap&lt;String, String&gt;();     JSONObject e = json.getJSONObject(i);     map.put("mDate", "" + e.getString("mDate"));     mylist.add(map);  }
How do I format a Microsoft JSON date? I'm taking my first crack at  with jQuery. I'm getting my data onto my page, but I'm having some trouble with the JSON data that is returned for Date data types. Basically, I'm getting a string back that looks like this:  /Date(1224043200000)/   From someone totally new to JSON - How do I format this to a short date format? Should this be handled somewhere in the jQuery code? I've tried the jQuery.UI.datepicker plugin using $.datepicker.formatDate() without any success.  FYI: Here's the solution I came up with using a combination of the answers here:  function getMismatch(id) {   $.getJSON("Main.aspx?Callback=GetMismatch",     { MismatchId: id },      function (result) {       $("#AuthMerchId").text(result.AuthorizationMerchantId);       $("#SttlMerchId").text(result.SettlementMerchantId);       $("#CreateDate").text(formatJSONDate(Date(result.AppendDts)));       $("#ExpireDate").text(formatJSONDate(Date(result.ExpiresDts)));       $("#LastUpdate").text(formatJSONDate(Date(result.LastUpdateDts)));       $("#LastUpdatedBy").text(result.LastUpdateNt);       $("#ProcessIn").text(result.ProcessIn);     }   );    return false; }  function formatJSONDate(jsonDate) {   var newDate = dateFormat(jsonDate, "mm/dd/yyyy");   return newDate; }   This solution got my object from the callback method and displayed the dates on the page properly using the date format library.
GRUB does not detect Windows I have finally installed Ubuntu on my second drive. When I start my computer GRUB only offers me to boot Ubuntu, not Windows 7. What needs to be done so that I can choose between Ubuntu and Windows in GRUB?  When I press F12 for boot menu at startup and I choose Windows Boot Manager it boots into Windows 7.    I ran command sudo fdisk -l and here is log ():  WARNING: GPT (GUID Partition Table) detected on '/dev/sda'! The util fdisk doesn't support GPT. Use GNU Parted.   Disk /dev/sda: 1000.2 GB, 1000204886016 bytes 255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors Units = sectors of 1 * 512 = 512 bytes Sector size (logical/physical): 512 bytes / 4096 bytes I/O size (minimum/optimal): 4096 bytes / 4096 bytes Disk identifier: 0xc3ffc3ff     Device Boot      Start         End      Blocks   Id  System /dev/sda1               1  1953525167   976762583+  ee  GPT Partition 1 does not start on physical sector boundary. Is Lambert Academic Publishing a reputable company? I was contacted by the Acquisition editor of Lambert Academic Publishing (LAP) to publish my bachelor's thesis as a printed book. Is LAP any good? I have no idea about it; I have just heard that it's a freelance publishing house. SED: insert text after the last line? This  inserts a tag to the beginning of a file:  sed -i "1s/^/&lt;?php /" file   How can I insert something to the end of each file with sed? For which values of $\alpha$ and $\beta$ does the integral $\int\limits_2^{\infty}\frac{dx}{x^{\alpha}\ln^{\beta}x}$ converge? I'm trying to find out for which values of $\alpha$ and $\beta$ the integral $\int\limits_2^{\infty}\frac{dx}{x^{\alpha}\ln^{\beta}x}$ does converge. I know that when $\alpha=1$ then $\beta$ must be greater than $1$. I tried to use integration by  parts but It didn't work, so I would appreciate some hints. Thanks in advance. Sum of the alternating harmonic series $\sum_{k=1}^{\infty}\frac{(-1)^{k+1}}{k} = \frac{1}{1} - \frac{1}{2} + \cdots $ Why does a monopole not radiate energy in electodynamics? I am writing an application that if the user hits back, it may resend the same information and mess up the flow and integrity of data. How do I disable it for users who are with and without javascript on? The dialog box in question here is the one you get with the context menu option "open with other applications". Wine seems to have inserted more than a dozen or so entries for each application I install, which makes it a pain to find the correct application:     What can I do to remove the duplicates?     Update: Neither of the two solutions really work. The bug is interesting, but the symptoms does not match my problem (I'm not having problem with uninstalling applications, but rather the things that are inserted after installing them), and with the other one, all references to the Wine application are removed, which actually makes the problem worse (although it may be an acceptable solution if nothing else can be found). So this is still an open question; any takers? Consequences of not showing up for one leg of journey Database general error: 2006 MySQL server has gone away Recently I started getting an error every time I try and add a content no matter what type.  This is the error that shows up in the browser:     Additional uncaught exception thrown while handling exception.        Original   PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT COUNT(cid) FROM {comment} WHERE status = :status; Array ( [:status] =&gt; 0 ) in comment_count_unpublished() (line 313 of /Applications/MAMP/htdocs/modules/comment/comment.module).        Additional      PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: INSERT INTO {watchdog} (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9); Array ( [:db_insert_placeholder_0] =&gt; 1 [:db_insert_placeholder_1] =&gt; php [:db_insert_placeholder_2] =&gt; %type: !message in %function (line %line of %file). [:db_insert_placeholder_3] =&gt; a:6:{s:5:&quot;%type&quot;;s:12:&quot;PDOException&quot;;s:8:&quot;!message&quot;;s:154:&quot;SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT COUNT(cid) FROM {comment} WHERE status = :status; Array ( [:status] =&amp;gt; 0 ) &quot;;s:9:&quot;%function&quot;;s:27:&quot;comment_count_unpublished()&quot;;s:5:&quot;%file&quot;;s:56:&quot;/Applications/MAMP/htdocs/modules/comment/comment.module&quot;;s:5:&quot;%line&quot;;i:313;s:14:&quot;severity_level&quot;;i:3;} [:db_insert_placeholder_4] =&gt; 3 [:db_insert_placeholder_5] =&gt; [:db_insert_placeholder_6] =&gt; ; [:db_insert_placeholder_7] =&gt;  [:db_insert_placeholder_8] =&gt; 127.0.0.1 [:db_insert_placeholder_9] =&gt; 1338336955 ) in dblog_watchdog() (line 154 of /Applications/MAMP/htdocs/modules/dblog/dblog.module).   I also get the following error in my php error file:     PHP Fatal error:  Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 2006 MySQL server has gone away' in /Applications/MAMP/htdocs/includes/database/database.inc:2136        Stack trace:   0 /Applications/MAMP/htdocs/includes/database/database.inc(2136): PDOStatement->execute(Array)   1 /Applications/MAMP/htdocs/includes/database/database.inc(664): DatabaseStatementBase->execute(Array, Array)   2 /Applications/MAMP/htdocs/includes/database/database.inc(2315): DatabaseConnection->query('SELECT expire, ...', Array, Array)   3 /Applications/MAMP/htdocs/includes/lock.inc(167): db_query('SELECT expire, ...', Array)   4 /Applications/MAMP/htdocs/includes/lock.inc(146): lock_may_be_available('theme_registry:...')   5 /Applications/MAMP/htdocs/includes/theme.inc(447): lock_acquire('theme_registry:...')   6 /Applications/MAMP/htdocs/includes/bootstrap.inc(427): ThemeRegistry->set(Array)   7 [internal function]: DrupalCacheArray->__destruct()   8 {main}         thrown in /Applications/MAMP/htdocs/includes/database/database.inc on line 2136   I am having a little trouble deciphering these error messages. Could anyone help me understand what's going on here? Help! My master database is corrupt, I can't even bring the SQL instance online! What are my options to get my server back up?   I do have a backup of master, but the  asks me to start the instance in single-user mode, which I can't do!  (Note: I'm leaving this question unspecified as to SQL version, so as to be a more widely-applicable reference. There are some similar questions on DBA.SE, but none that involve the server unable to start.) I have two layers, one (A) has point features and the other (B) has polygons.  How do I produce a new table with some (the ID) or all the fields from the A table and some (the area code) or all from the B table where the B polygon contains the A point?  I am using QGIS. How long can you say "the late so and so"? When you refer to the deceased, you say "the late so and so." How long can you say that? Is JFK referred to as the late John F. Kennedy? How about Abraham Lincoln? Clean way of building simple taxonomy browser of arbitrary depth xcode4 doesn't support Perforce? Some compound words are written without hyphens (nonaggression, nonbeliever), some with hyphens (well-intentioned), and others with spaces (post office).  Is there a rule or good guide as to which option should be used? Permutation with prime order, fixed point Let $M$ be a finite set and $\varphi$ a permutation of this set with prime order $q$. How do I show that $\varphi$ has a fixed point if $q$ is not a divisor of $|M|$? Does anyone know how prove the following?   Suppose that $f,g$ are holomorphic functions on a non-empty open connected set $\Omega \subset \mathbb{C}$ and that $|f|^2+ |g|^2$ is constant on $\Omega$. Show that $f$ and $g$ are constant on $\Omega$. If i click on Ubuntu Software, it doesn't open. I have a fresh install of Ubuntu 20.04. I tried try to upgrade all packages, but it doesn't fix this problem.  If I try to run killall software-center there is no process with this name, and software-center returns command not found. If I try to reinstall it with apt I have these results:  $ sudo apt-get --purge --reinstall install software-center Reading package lists... Done Building dependency tree        Reading state information... Done Package oracle-java8-installer is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package 'software-center' has no installation candidate I had a bunch of errors in the output of sudo apt-get update:  duplicate entries and 404 not found errors.  Figured those out, I hope: I removed PPAs that didn't have any packages associated with them, then I removed out a duplicate entry in /etc/apt/sources.list.  It seems I have royally buggered it up.  Now most of the lines say Ign when I do sudo apt-get update.  How do I go about straightening out what I have screwed up?  I need to get rid of these Igns that are all over the place.  There are about 50% (eyeball guess) Igns!