convert a string or byte to a hex decimal in c#
How do you convert a byte array to a hexadecimal string, and vice versa?
Tags in spoilers are always visible, even if you don't put your mouse on the spoiler (on  for example). See the screenshot:      Looks a bit strange on this site too:        that needs ! I have this function:  $$ f(x,y) = \frac {xy}{|x|+|y|} $$  And I want to evaluate it's limit when $$ (x,y) \to (0,0)$$ My guess is that it tends to zero. So, by definition, if:  $$ \forall \varepsilon \gt 0, \exists \delta \gt 0 \diagup \\ 0\lt||(x,y)||\lt \delta , \left|\frac{xy}{|x|+|y|}\right| \lt \varepsilon $$ Then $$ \lim_{(x,y)\to(0,0)}\frac {xy}{|x|+|y|} = 0 $$ So:  $$ \left|\frac{xy}{|x|+|y|}\right| = \frac{|xy|}{|x|+|y|} = \frac{|x||y|}{|x|+|y|} \le 1 |y| \lt \delta $$  So for any $$\delta \lt \varepsilon$$ the inequality is true. Hence, the limit exists and is equal to zero.  . Am I wrong or is Wolfram|Alpha wrong? Anyone know of a custom GPS ROM for Samsung Galaxy 5? Possible Duplicate:          I recently bought a Samsung Galaxy 5 (model number GT-I5500) and I'm new to the android world.   I'm not satisfied with the performance of the GPS on my cell phone so I thought it would be interesting to use a custom ROM to see if it improves a bit.   Anyone knows of a ROM that was tested in this model? If $A$ is compact, is then $f(A)$ compact? Subspaces of separable normed spaces Let $X$ be a separable normed space. Is it true that every subspace is separable? If it was Hilbert space I would take the dense set and then their projections.  It sounds trivial but I cannot prove or disprove it...  Thank you. I'm on 10.9, and I had been using internet sharing successfully again for the first time since Lion. Today though, it just decided to stop working again.  Network layout:  Modem -ethernet-&gt; Router -ethernet-&gt; Mac Pro -ethernet-&gt; MacBook Pro Retina   The internet works fine on the Mac Pro, but it is no longer forwarding the proper DHCP settings to the MacBook.  Previously, the MacBook would get the IP address of 192.168.2.12, and was able to surf the web fine. (Though it wasn't able to connect to any AirPlay/AirPrint devices while on the ethernet interface)  Sometime today, a setting got messed up, and I'm not sure how to fix it or what setting it is.  The MacBook now has a "Self-assigned" IP of 169.254.121.24, even though it is set to use DHCP. The ethernet port on the Mac Pro that the MacBook Pro is connected to is showing a "Self-assigned" IP of 169.254.36.53, even though it is set up to use DHCP as well.  The internet sharing options appear to be correct: share connection from Ethernet 1 to Ethernet 2.  But alas, for no apparent reason, I'm not getting internet access. "When people do make changes" - which tense is this? Which tense are sentences like:   "When people do make changes good things happen" "Even if monkeys can play an important role, their actions can pose risk to the general public" After my suspension period, my reputation was not returned On Stack Overflow, I have a suspension period of 7 days which ends today. But my actual reputation has not been returned to me as one of the moderators said it would. I have a message like this by @Andrew Barber:     Once your suspension period is over, you will be returned to your   correct reputation level, minus the votes from the accounts which have   been deleted. At that time, you are more than welcome to return, and   continue contributing your knowledge, and gaining legitimate   reputation points. Just please keep our rules in mind when you do.      Regards      Andrew Barber, Stack Overflow moderator   Can any moderator here help me or tell me what the rules are of getting back my reputation?  How can I get the attention of a moderator so that they can resolve my problem? Showing a function on $[0,1]$ is the zero function How could I write my name, for example, to look like the \LaTeX logo? How could I write my name, for example, in a \LaTeX style? It is just interesting, as in Google all other things pop up when I try to search for an answer! In a certain case, the user will be asked to confirm if he/she wishes to leave the page, due to editing a post, even when he/she has stopped editing.  To reproduce:   Start editing a post (I've only experienced this with a question) Another user finishes editing the post before you and the message "This post has been edited" appears Clicking on the message bar will take you out of editing mode and will show you the updated post from the other user's edits Trying to navigate away from the page will then ask for your confirmation I took this photo of the blood moon this morning and I am finding many of my photos, especially landscape photos, have a significant lack of clarity. I'm not looking for a photo critique because I know this particular photo is crap. I'm looking to identify my source of failure to nail a significantly clear photo.     Setup  Canon EOS 70D with a 100-300 telephoto lens (I'm sorry I don't know the exact model. It's from Canon but not one of their professional quality lenses.)   Aperture: f/5.6 Shutter: 1 sec. ISO: 1000 Focal Length: 300mm Metering mode: Spot White Balance: I manually set the WB to 5500 kelvin, it looked fine in live view. Focus Mode: Manual Drive: 2 sec timer delay   Mounted on a decently stable tripod  Process  I turn on live view, and square up the target in the display. I then set my focal length, focus in using live view, adjust the focus as sharp as possible and take the pic. I've noticed that in this case, the picture was incredibly grainy, which doesn't translate to the final photo, but wonder if it has anything to do with it.  This particular shoot I found it difficult to balance out the variables with a dark sky and a moving moon that starts blurring after 1-2 seconds of exposure, which is why I had the aperture wide open and the ISO cranked up.  I can't tell where I'm failing:  Equipment:  The 70d takes great photos but the telephoto is not great when it's totally zoomed in. My wallet doesn't hold enough cash for a motorized mount to track objects in the sky.  Circumstance: I've seen great photos of the moon with the use of a camera and a tripod, so I know this is possible. Although, I keep seeing pictures of this big gorgeous moon over the landscape, and when I use my wide-angle, the moon shows up as a dot. What the hell are people doing to get the moon so big?  Beginner skill level: I know this is the biggest culprit, but being the beginner, I'm unable to know where to adjust. Pre-image of a measurable set A is always measurable? Let $f$ be a continuous function on a set $E$.  Is it always true that $f^{-1}(A)$ is always measurable if $A$ is measurable?  I say no.  We know that $\bar{\psi(x)}:=\frac{\phi(x)+x}{2}$ where $\phi$ is the Cantor (or Cantor-Lebesgue) function and $\bar{\psi}:[0,1] \rightarrow [0,1]$.  We know this function maps a measurable subset of $C$ (the Cantor set) into a non-measurable set $W$.  A few observations about $\bar{\psi(x)}$.  It is strictly increasing and continuous, so it has a continuous inverse $\bar{\psi(x)}^{-1}$.  Thus $\bar{\psi(x)}^{-1}(W)=c \subset C$; that is, $\bar{\psi(x)}^{-1}(W)$ is non-measurable, but c is.  Is this correct? Good refactoring support for C++ The Visual Studio refactoring support  for C# is quite good nowadays (though not half as good as some Java IDE's I've seen already) but I'm really missing C++ support.  I have seen  and am currently trying it out, but maybe one of you guys know a better tool or plugin?  I've been working with  now for a week or two and got totally addicted. Thanks for the tip, I'll try to convince my boss to get me a license at work too.  I've been bughunting for a few days since Visual Assist X kept messing up my Visual Studio after a few specific refactorings, It took me (and customer support) a week to hunt down but let's say for now that Visual Assist X is not a good combination with . I have a common scenario in app design, where I need to store an ordered list, and make the ordering easily accessible and adjustable via an application UI.    The ordering operations are simple and operate on only one item at a time - move to top, move to bottom, move up one position, or down one position.  These positioning operations may be interspersed in with typical add / edit / delete list operations.  For discussion, this is a single-user app and db store.  Because the objects can be highly complex, I'd like to avoid caching the entire list client-side, and tracking newly created objects in memory until a big save operation occurs.    I am using MS-SQL almost exclusively on these projects, and I'm wondering if there are db features, SQL features, or design patterns I should be using to better support the management of ordered lists.    My current approach is to use a DECIMAL column to store the list positions, which become fractional during the item move process.  Then I sort the list and re-generate integer positions to normalize list.  Following this operation, it's ready for another item move.   In an example implementation, I create a column named Seq for position tracking.  Once decimal place is enough for the .5 storage.   [Seq] [decimal](10, 1) NOT NULL   When an item is re-positioned in the app UI,    I UPDATE that record with new Seq value I retrieve the full table, sorted ascending by Seq and regenerate all Seq values in the table from a 1-based integer series   The new Seq value is easily calculated-    Move to top = 0 Move to bottom = MAX(Seq) + 1 Move up = subtract 1.5 from the current Seq value Move down = add 1.5 to the current Seq value   As lists get longer, updates get slower, since I'm doing N UPDATE statements, where N is the number of rows in the table, so it seems only suitable for small tables.    Is there some kind of in-built capability for managing an ordered list in SQL or MS-SQL? Is there a means to update multiple rows in one call?    A far more performant approach would be to allow more decimal places, and then position at the median of the two adjacent items, with no re-sequencing on the list.     Move to top = Min(Seq) - 1 Move to bottom = MAX(Seq) + 1 Move up = median of the 2 previous item Seq values Move down = median of the 2 following item Seq values   This approach only requires one SELECT (containing 2 rows max) and one UPDATE.    However with enough re-positions I imagine the field would run out of decimal places. For example, if I start with items at positions 10 and 11, and keep moving items down the list from position 9, they'd be given sequences of 10.5, then 10.25, then 10.125.  After 10 moves, the positions get lengthy... 10.0009765625.    UPDATE #1 - IMPROVED RE-SEQUENCING OF THE LIST  Regarding re-sequencing, I'm more caught up on row_number(), OVER, and WITH capabilities in MS-SQL.  It's nice to find that there's a much smoother way to re-sequence the list in a single UPDATE operation;  with OrderedItems as  (     select         ItemID,         Seq,         row_number() over (order by Seq asc) NewSeq     from          Items ) update OrderedItems set Seq = NewSeq How do I determine the size of my array in C? How do I determine the size of my array in C?   That is, the number of elements the array can hold? Asking on Multiple Sites: "Soft-Migration" See also:   Many of the newer sites have a certain degree of overlap. With the creation of Chem.SE, I noticed quite a few questions on Physics.SE which could have benefited from the chem community and vice versa. There also are a few that could benefit from bio.SE.. Now these questions don't warrant a migration. They can be double-posted, but this doesn't lead to a smooth experience. Even when cross-linked, changes to either post (new answers,new comments,etc) aren't effectively relayed to the other site, and the two questions are just that-- two, separate questions. One solution that came to my mind was a &quot;soft migration&quot; option for mods. By this, a question on site A stays on site A. But, it appears in the site B question list as well. Edits/answers should bump it. Basically, there will be a placeholder item in the questions list of site B. It shows the votes/views/answers of the post on site A, along with the tags (maybe stylized differently). These should be an unobtrusive way to quickly identify what the site is. The post should also be bumped whenever the post is bumped on Site A, and it should display the rep/time/etc of the bumping user as usual. Here's a quick mockup of what happens on the site B question list:  Without being obtrusive or in-your-face (stuff like [migrated] is sort of in-your-face), the post is elegantly shown to be on Physics.SE (well, if you know the icon, anyway). The tags are italicized to show that they link to a different site tags, and the &quot;bumping user&quot; (me) has his/her rep on that site shown. We can also add an indicator on the question on site A () that shows that it was soft-migrated. We can use tooltips as well on the icons to tell us why they're here. After all, half of SE documentation is in tooltips.  Now I know that these issues will probably be raised:  Rep: An avid user on Site B gets no Site B rep for giving a good answer on Site A. Frankly, I don't care about this to much, but others may.  Implementation: It may get complicated. Internally, I'd propose that none of the question data is copied, rather Site A pushes the vote/bump data whenever a vote/bump happens. The easiest way to then implement the soft merge would be to have a table of questions soft-merged &quot;to&quot; site B on site B itself, with columns for all the vote/etc data. The questions table should have an extra column for &quot;soft-migrated to&quot;--that way Site A can determine where to push new data to on every vote/bump. Now, all Site B has to do is take the JOIN of the questions table and the soft-merge table and display them in the new questions list (or any list, for that matter). With some extra formatting, maybe. Of course, I may be oversimplifying this and I don't really know what I'm talking about ;-)  Is there a need? : Yes, I would say so. Such questions can get awesome answers is both the communities participate, but our don't-cross-post-much policy deters this. In the end, this will result in better post quality, making the Internet better. Also, as area51 grows, we will see this problem more and more, and this will become more and more necessary.   Thoughts? Any better ideas? Waffles?  Update: Another use case for this would be to soft migrate all MSO  questions over to child metas, effectively solving I was browsing flight price at Singapore Airlines website, and a one-way flight from SIN to SFO cost this much:    That's quite expensive. I tried browsing around and found that a return flight from SFO to SIN and back to SFO cost much cheaper:    It's really weird because the second ticket includes the exact same flight that cost 1900+, but it's almost half the price. The reason for this counter-intuitive situation is explained in the answers this question   If I am located in Singapore and my intention is to fly one-way to SFO, is it safe to book the flight in the second picture and only board SFO-SIN leg? Will they deny me because I miss the SIN-SFO flight? Can decimal numbers be considered "even" or "odd"? I have this directory /foo/bar/. Inside, I have a python file named myfile.py. I made it executable by adding (at the top):  #!/usr/bin/env python   Then, I made it executable by issuing   chmod +x myfile.py   I edited my path by issuing  sudo nano /etc/paths   I added /foo/bar/ to it.  The problem is that although I can run myfile.py by typing ./myfile.py while I am inside /foo/bar/, it doesn't work from any other location. What am I doing wrong?  Thank you.