Is there a clever way to do the following string manipulation in C#?  I have any kind of string and im looking for a specified delimiter. The code should divide the string in words before and after delimiter and also include the delimiter. The delimiter could be several times in a row and also could be in the start or the end.   // PSEUDO CODE string = "Hello****wide****world"; delimiter = "****";  // result should be a list&lt;string&gt; like {"Hello","****","wide","****","world"}
I'm splitting a string by three different characters but I want the output to include the characters I split by. Is there any easy way to do this?
Italic citation reference for author name using natbib Take most recent (or concatenate) edit comments when editing during grace period Same as title, want to kill alt-tab, etc. Berlin Public Transport Ticket Validity I have purchased an AB zone Berlin 7 day transport ticket and validated it on Sunday 17th April so hopefully it will be valid until Sunday 24th.  I validated the ticket at about 10:00am so I guess 1000 is the time I validated? But what are the numbers 15 and 6 and letters 'So' correspond to? How (if checked by a guard) can they tell if the ticket is valid? And how can I as a customer tell when it is validated to? What is polarisation, spin, helicity, chirality and parity? Polarisation, spin, helicity, chirality and parity keep confusing me. They seem to be related, but exactly how they are related is unclear to me. Can someone maybe give a short overview about what these quantities mean and how they are related? What are the values for e.g. basic particles like electron or photon? Is it legal to run windows on a mac? I understand that it is Illegal to run OSx on a windows machine or PC for that matter, but is it illegal to do the reverse? Why or why not? Is there evidence to suggest that Supreme Leader Snoke is Darth Plagueis? In Episode III,  explains to Anakin the power of the Dark Side to save people from death. He mentions  - the Sith who discovered this. Sidious then claims he died, which seems odd, given that kind of power.   Then in Episode VII (The Force Awakens) we find a Sith Lord who has appeared from no where. There seems to be two loose ends that fit nicely together.   My question is: Is there evidence to suggest that Supreme Leader Snoke is Darth Plagueis? Formula field is too big to execute (5,480 characters) I got an error when i am trying to add fomrula in formula field.  Error: Compiled formula is too big to execute (5,480 characters). Maximum size is 5,000 characters  My formula is   (ED__c+Service_Tax__c+Total_Site_Work_Price1__c+Total_Selling_Price_Based_on1__c )*WCTper__c   In this formula ED__c, Total_Site_Work_Price1__c, Total_Selling_Price_Based_on1__c are also Formula fields. And these formulas are also contain fomrula fields.  How can i calculate the formula..? How can I list permissions of every component in a file path? Sometimes it is necessary to determine on which directory in a path access rights are limited. Here is an example:  $ ls /sys/kernel/debug/usb/devices ls: cannot access /sys/kernel/debug/usb/devices: Permission denied $ cat /sys/kernel/debug/usb/devices cat: /sys/kernel/debug/usb/devices: Permission denied   Neither ls nor cat shows where the user rights were limited.  What is the simplest way of showing the access rights for every component (directory and the file) in the path? I am mainly interested in solutions for Unix-like systems. Support for hardware components How can I find out if Ubuntu supports a particular hardware component, that is, if it works in Ubuntu?  I am going to put together a computer and I am choosing components.   How do I know if Ubuntu supports this or that motherboard, or this or that sound card, or this or that graphics card, etc? How do I know that there is no conflict in Ubuntu between this and that hardware component?   What resources are there to help with such situations?  I know that there are computers with Ubuntu pre-installed and that there are  for whole computers but this is not what I'm looking for. I'm looking for resources to find out support for particular hardware components and conflicts among particular hardware components. How do I eliminate the vertical realignment when using arrayrulecolor with cmidrule? I'm using consecutive \cmidrule commands in conjunction with \arrayrulecolor to alternately hide and unhide horizontal rules in a table.  However, when \arrayrulecolor is used with \cmidrule, some odd vertical spacing is introduced. I'd like to eliminate it.  (I'm using longtable, so a colorbox, minipage, or anything else tied to a page won't work.)  Below is an image that introduces the challenge. The first block shows a \toprule.  My goal is to create a shaded border around the table, so I've added a dummy column.  The second rule shows a \cmidrule that skips the first column.  The third block shows how I can use a \cmidrule to fill in the whitespace with a shorter \cmidrule.  Finally, I want to recolor this short \cmidrule to the background color and restore the color later.  Note the jagged vertical skipping in case 4 compared to case 3.  Why would \arrayrulecolor change vertical alignment?  How can I eliminate the jagged edges?    Here is the code:   \documentclass[11pt]{article}  \usepackage{longtable} \usepackage{booktabs} \usepackage{color} \usepackage{xcolor} \usepackage{colortbl}  \setlength{\aboverulesep}{0pt} \setlength{\belowrulesep}{0pt} \setlength{\extrarowheight}{0.25ex}  \newcolumntype{L}{&gt;{\columncolor[gray]{0.8}}l} \newcolumntype{C}{&gt;{\columncolor[gray]{0.8}}c} \newcolumntype{R}{&gt;{\columncolor[gray]{0.8}}r}  \begin{document}  \textsf{ \begin{longtable}{LLLLL}  &amp; \multicolumn{3}{@{}L}{\small {\tablename\ \thetable{}} - demonstration of odd vertical alignment with arrayrulecolor} &amp; \\%  &amp; \multicolumn{3}{@{}L}{\small {case 1: the line below is a toprule}} &amp; \\% \toprule  &amp; \multicolumn{3}{@{}L}{\small {case 2: the line below is a cmidrule that spans the middle 3 columns.  Note the whitespace!}} &amp; \\%  &amp; \multicolumn{3}{@{}L}{\small {The challenge: hide the widespace giving the appearance of a spacing around a longtable.}} &amp; \\% \cmidrule[\heavyrulewidth]{2-4}  &amp; \multicolumn{3}{@{}L}{\small {case 3: the line below is 3 cmidrules, 1 each for the first and last columns and 1 for the middle}} &amp; \\%  &amp; \multicolumn{3}{@{}L}{\small {note how the cmidrules align vertically ... perfect!}} &amp; \\% \cmidrule[\heavyrulewidth]{1-1}\cmidrule[\heavyrulewidth]{2-4}\cmidrule[\heavyrulewidth]{5-5}  &amp; \multicolumn{3}{@{}L}{\small {case 4: Now, lets try recoloring the first and last cmidrules}} &amp; \\%  &amp; \multicolumn{3}{@{}L}{\small {how do I eliminate the odd vertical alignments?}} &amp; \\% \arrayrulecolor[gray]{0.80}\cmidrule[\heavyrulewidth]{1-1}\arrayrulecolor[gray]{0.0}\cmidrule[\heavyrulewidth]{2-4}\arrayrulecolor[gray]{0.80}\cmidrule[\heavyrulewidth]{5-5}\arrayrulecolor[gray]{0.00} \endfirsthead  &amp;  Arizona State University &amp;  &amp; ASU &amp;\\   &amp;   Baylor University &amp;  &amp; BAYLOR &amp;\\   &amp;   Boston University &amp; 164988 &amp; BU &amp;\\   &amp;   Brown University &amp; 217156 &amp; BROWN &amp;\\   &amp;   California Institute of Technology &amp; 110404 &amp; CALTECH &amp;\\   &amp;   Carnegie Mellon University &amp; 211440 &amp; CMU &amp;\\   &amp;   Case Western Reserve University &amp; 201645 &amp; CASE &amp;\\   &amp;   Columbia University &amp; 190150 &amp; COLUMBIA &amp;\\   &amp;   Cornell University &amp; 190415 &amp; CORNELL &amp;\\      &amp; Yale University &amp; 130794 &amp; YALE &amp; % \label{tab:schools} \end{longtable} }  \end{document} How do I properly install a system app given its .apk? I removed a system app (com.android.mms) and I have the .apk needed to restore it, however it won't install through the standard channels (running the .apk gives me "application not installed"). What's the proper way to install a system app's .apk? I know it is not recommended, but is it at all possible to pass the user's password to scp?  I'd like to copy a file via scp as part of a batch job and the receiving server does, of course, need a password and, no, I cannot easily change that to key-based authentication. Irreducibles are prime in a UFD Flattening a shallow list in Python Is there a simple way to flatten a list of iterables with a list comprehension, or failing that, what would you all consider to be the best way to flatten a shallow list like this, balancing performance and readability?  I tried to flatten such a list with a nested list comprehension, like this:  [image for image in menuitem for menuitem in list_of_menuitems]   But I get in trouble of the NameError variety there, because the name 'menuitem' is not defined.  After googling and looking around on Stack Overflow, I got the desired results with a reduce statement:  reduce(list.__add__, map(lambda x: list(x), list_of_menuitems))   But this method is fairly unreadable because I need that list(x) call there because x is a Django QuerySet object.  Conclusion:   Thanks to everyone who contributed to this question.  Here is a summary of what I learned.  I'm also making this a community wiki in case others want to add to or correct these observations.  My original reduce statement is redundant and is better written this way:  &gt;&gt;&gt; reduce(list.__add__, (list(mi) for mi in list_of_menuitems))   This is the correct syntax for a nested list comprehension (Brilliant summary !):  &gt;&gt;&gt; [image for mi in list_of_menuitems for image in mi]   But neither of these methods are as efficient as using itertools.chain:  &gt;&gt;&gt; from itertools import chain &gt;&gt;&gt; list(chain(*list_of_menuitems))   And as @cdleary notes, it's probably better style to avoid * operator magic by using chain.from_iterable like so:  &gt;&gt;&gt; chain = itertools.chain.from_iterable([[1,2],[3],[5,89],[],[6]]) &gt;&gt;&gt; print(list(chain)) &gt;&gt;&gt; [1, 2, 3, 5, 89, 6] A novel where a woman from "future" of 1999 speaks leet-speak I'm trying to remember the name of a novel/series I read back in the mid-eighties.  I can't remember the author other than that it was a known older author.  I initially thought maybe Saberhagen or Harrison, but can't find it in their bibliographies.  It involved a collection of 4-5 people from different times/places.  The distinctive bit I can remember was that one of them (not the main character) was a cyberpunkish woman from the "future" of 1999 who spoke in futuristic dialect of English that the other characters, including the protagonist, from the "present" (from the eighties) could not understand.  Unfortunately, I don't remember much else of the plot other than that they were making their way through ruins. How to edit 'etc/hosts' file in non-rooted phone? Does the Force wane as you age? @Valorum said     ...not to mention the sheer strain that comes from continually using the Force at an advanced age.   To my feeble mind, this doesn't make sense. Approaching 900 years old, Yoda is still as strong as any whippersnapper in terms of Force power and usage. Despite his old age, Obi Wan shouldn't have any problems with using his Force powers.  This got me to thinking, does the Force begin to leave you as you age? Is it a flow of Force power that goes down based on (I hate to say this) a decrease in midichlorian count as you approach your expiration date? To what extent are child actors exposed to the violent aspects of the movie they perform in? Some movies feature child characters put in violent situations. This can range from crude language to extreme horror (e.g. torture, gore, etc.). As an example,  and its sequel has plenty of those scenes. It looks like a paradox that children can be actors in movies that are definitely not for children.  Do the directors usually try and avoid exposing the very young actors to the violence of such scenes, e.g. by clever dubbing and editing? Are there laws that require them to do so, just like there are ratings that prevent children from seeing some movies? How do I make Units efficiently? I just blew almost all my money on a really cool lookin' ship. How do I regain solvency without spending a lot of time fiddling around in my inventory?  At the moment I've found a sequence of steps that'll turn 50 carbon and 100 Plutonium into ~5000 Units (by creating Suspension Fluid and then turning it into Electron Vapor). Are there better recipes or sequences of recipes I should look for? Or should I just drop the whole thing and go mine a particular mineral?