How to implement a property with a base value and a changed value?
What's a way to implement a flexible buff/debuff system?
Generic Parse Method without Boxing I am trying to write a generic Parse method that converts and returns a strongly typed value from a NamedValueCollection.  I tried two methods but both of these methods are going through boxing and unboxing to get the value.  Does anyone know a way to avoid the boxing?  If you saw this in production would you not like it, how bad is it for performance?  Usuage:  var id = Request.QueryString.Parse&lt;int&gt;("id");   Attempt #1:  public static T Parse&lt;T&gt;(this NameValueCollection col, string key) {     string value = col[key];      if (string.IsNullOrEmpty(value))         return default(T);      if (typeof(T) == typeof(int))     {         //return int.Parse(value); // cannot convert int to T         //return (T)int.Parse(value); // cannot convert int to T         return (T)(object)int.Parse(value); // works but boxes     }     if (typeof(T) == typeof(long))     {         return (T)(object)long.Parse(value); // works but boxes     }     ...      return default(T); }   Attempt #2 (using reflection):  public static T Parse&lt;T&gt;(this NameValueCollection col, string key) {     string value = col[key];      if (string.IsNullOrEmpty(value))         return default(T);      try     {         var parseMethod = typeof(T).GetMethod("Parse", new Type[] { typeof(string) });          if (parseMethod == null)             return default(T);          // still boxing because invoke returns an object         var parsedVal = parseMethod.Invoke(null, new object[] { value });         return (T)parsedVal;     }     // No Proper Parse Method found     catch(AmbiguousMatchException)      {     }      return default(T); } How do I resize my current ubuntu partition? How do I set my wireless network to be private instead of public? Trying to maintain good security settings on my laptop, I want my home network to be interpreted as private and the university network at school to be interpreted as public. However, my home network is currently showing as public.  Here is what my Network and Sharing Center looks like:    How do I change my home network from public to private on Windows 8 Consumer Preview? Do Stack Overflow and other Stack Exchange sites have an app I can use? I like using Stack Overflow (or any other Stack Exchange sites) and was wondering if there was an app I could install on my phone or other device that would allow me to use the site on-the-go or straight from my desktop.  Some systems to consider:   Windows 8 Android iPhone/iOS   What are some apps that I could install to my computer or phone to enhance my Stack Exchange experience? I have a set of Photoshop files which consist of a base image with a series of layers with colored overlays. The overlays are labeled using the layer names.  My task is to get these overlays as SVG paths, somehow preserving the labels. (If I can preserve the fill colors as well, that would be cool, but we can define arbitrary fill colors if needed.)  So far we have tried exporting the layers as Illustrator paths, and then exporting to SVG from Illustrator. This gets us reasonable SVG paths, but (a) we lose the labels, and (b) if a layer has more than one discrete section in its overlay, it is separated into several paths.  Is there a way to get these layers into SVG while retaining the labels? Or should we do our Export > Illustrator > SVG  route on a layer-by-layer basis?  We're working with CS5, if that's important.  ETA to answerers: We've long since finished this project and delivered the job, so I can't accept an answer, but feel free to pitch in your potential solutions for others. How do you get a bad transcript past Ph.D. admissions? Converting spoken word audio files into text I've been working on transcribing a lecture series from audio to text files.  There are just over 20 lectures, and each one is about an hour long.  Using VLC Player, I'm able to slow down the speaker's words to a rate that I can keep up with.  However, it's extremely slow going, and it takes so much concentration that I can barely get through a third of a lecture before I have to take an extended break.  The thought had occurred to me that I would be better served by using some kind of speech recognition software, and then proofreading the computer-generated result.  This is likely to be a one-time thing, so while I don't mind using commercial software to get the job done, it would be preferable if it wasn't too expensive (or free; free is always good).  Command-line solutions are fine, too (:  Any suggestions? Is there a single word to describe a solution that hasn't been optimized? I am working with some code, and I would like to describe the difference in its performance when it is optimized versus when it is not optimized. Unfortunately, I can't find a word to describe the code before it is optimized; "sub-optimal" might work, but I want to emphasize that this is the first iteration of the code. If "unoptimized" were a word, I would use that, but I haven't found any references to it in any dictionary.  Perhaps "raw" or "original"? Can I revert to the Mountain Lion style labels instead of Mavericks tags? How? I have a new computer with a Seagate ST500DM002 SATA internal hard drive.  I am trying to install Ubuntu 11.10 64-bit on it but the installer does not recognize/detect/see the hard drive. When I reach the Installation type step, the panel which is supposed to show devices and partitions looks empty.  sudo fdisk -l shows only /dev/sda1, the USB drive from which I am running the installation. I have already tried the following two solutions without any success:   sudo apt-get remove dmraid Switch the SATA mode in the BIOS from IDE to AHCI   I am sure it's not a hardware related problem as I have already successfully installed another operating system on the same computer.  The output of sudo lshw -class storage -class disk follows:    *-ide UNCLAIMED                 description: IDE interface        product: ASMedia Technology Inc.        vendor: ASMedia Technology Inc.        physical id: 0        bus info: pci@0000:06:00.0        version: 01        width: 32 bits        clock: 33MHz        capabilities: ide msi pm pciexpress cap_list        configuration: latency=0        resources: ioport:d040(size=8) ioport:d030(size=4) ioport:d020(size=8) ioport:d010(size=4) ioport:d000(size=16) memory:fe400000-fe4001ff   *-storage        description: SATA controller        product: 6 Series/C200 Series Chipset Family 6 port SATA AHCI Controller        vendor: Intel Corporation        physical id: 1f.2        bus info: pci@0000:00:1f.2        logical name: scsi1        version: 05        width: 32 bits        clock: 66MHz        capabilities: storage msi pm ahci_1.0 bus_master cap_list emulated        configuration: driver=ahci latency=0        resources: irq:44 ioport:f0b0(size=8) ioport:f0a0(size=4) ioport:f090(size=8) ioport:f080(size=4) ioport:f060(size=32) memory:fe705000-fe7057ff      *-cdrom           description: DVD-RAM writer           product: DVDRAM GH22NS70           vendor: HL-DT-ST           physical id: 0.0.0           bus info: scsi@1:0.0.0           logical name: /dev/cdrom           logical name: /dev/cdrw           logical name: /dev/dvd           logical name: /dev/dvdrw           logical name: /dev/scd0           logical name: /dev/sr0           version: EX00           capabilities: removable audio cd-r cd-rw dvd dvd-r dvd-ram           configuration: ansiversion=5 status=nodisc   *-scsi:0        physical id: 1        bus info: usb@1:1.2        logical name: scsi6        capabilities: emulated scsi-host        configuration: driver=usb-storage      *-disk           description: SCSI Disk           physical id: 0.0.0           bus info: scsi@6:0.0.0           logical name: /dev/sda           size: 14GiB (16GB)           capabilities: partitioned partitioned:dos           configuration: signature=0004e5a4   *-scsi:1        physical id: 2        bus info: usb@1:1.3        logical name: scsi7        capabilities: emulated scsi-host        configuration: driver=usb-storage      *-disk           description: SCSI Disk           product: Storage Device           vendor: USB Mass           physical id: 0.0.0           bus info: scsi@7:0.0.0           logical name: /dev/sdb           capabilities: removable         *-medium              physical id: 0              logical name: /dev/sdb   Any idea on what I could do to fix this problem? What is reflection and why is it useful? What is reflection, and why is it useful?  I'm particularly interested in Java, but I assume the principles are the same in any language. My new laptop came preinstalled with Windows 8. Naively, as I am, I just formatted the harddrive and installed fine old Ubuntu. Now I want to install Windows 8 for dual boot again, but I have no DVD and do download the ISO one needs a product key. That key is not on the back of the laptop anymore but somewhere on the mainboard.  Is there any way to recover the product key from the mainboard using Ubuntu? how to fill color in image in particular area? I am looking for a pipe symbol that can be made to vary in height automatically.  One of the common ways of writing "such that" in mathematics is with the pipe symbol (|). The pipe can be represented in LaTeX directly as the character | or as \vert, but neither of these expands vertically in math presentation mode. I can adjust it manually this way:  \[\mathcal{H}=\left\lbrace h(x)=\sum_{i=0}^{k-1}a_{i}x_{i}\mod m\ \Bigg\vert      \ a_{i}\in\mathbb{Z}_{m^{k}}\right\rbrace\]     but I am looking for a true variable-sized option, parallel to \lbrace etc.  The amsmath package provides \lvert and \rvert, but I do not find them expanding as expected, and the amsmath documentation specifies that they should be used as binary delimiters (one on each side of something else), rather than alone. Transferring through US airport. Do I need traveling visa? I've always wondered how to write the "A ? B : C" syntax in a C++ compatible language.  I think it works something like: (Pseudo code)  If A &gt; B    C = A Else    C = B   Will any veteran C++ programmer please help me out? When are you supposed to use escape instead of encodeURI / encodeURIComponent? How to create a bootable USB stick? I am looking at this:    I need to create a boot disk to test Ubuntu to make sure it will run on a PC (Compaq Mini CQ10-120LA) I was given. I can create the boot disk off of a Mac (in English) or Windows (but Windows is in Spanish and foreign to me).   Questions:     What format do I choose for the USB stick? (I wish the instructions stated this). What is Dash? (Will I know when I run the installer?) Can I do this from a Mac or Windows computer? Or only from Ubuntu? How to sum data.frame column values? What makes some laser beams visible and other laser beams invisible? What makes the beam of some lasers:    visible?  such as the ones used in clubs or such as the laser pointers sold at amazon which if pointed to the sky look like a solid visible beam of light crossing the sky (it reminds me of the lightsaber in Star Wars). invisible?  such as the ones used in pointers for presentations.