I would like to place some (PHP)functions in a helper files, which requires across modules and themes.  Do I have to create a new module or I can place a simple helper file with list of common functions, what is the best practice for these kind of functions in drupal 8 ?
Let's say I use a  with a lot of code inside. To improve readability and reusability I'd like to use helper/private methods. However, a Drupal .module file is not a class.  The idea is to split big methods from this file into more readable and reusable smaller methods.  What is the correct way to call helper/private methods from a Drupal .module file?
Is the EmDrive, or "Relativity Drive" possible? In 2006, New Scientist magazine published an article titled 1 [] about the  [] which stirred up a fair degree of controversy and  that New Scientist was engaging in pseudo-science.   Since the original article the inventor claims that a "Technology Transfer contract with a major US aerospace company was successfully completed", and that papers have been published by Professor Yang Juan of The North Western Polytechnical University, Xi'an, China. 2   Furthermore, it was  that the Chinese were going to attempt to build the device.  Assuming that the inventor is operating in good faith and that the device actually works, is there another explanation of the claimed resulting propulsion?  Notes:  1. Direct links to the article may not work as it seems to have been archived. 2. The abstracts provided on the  website claim that they are Chinese language journals which makes them very difficult to chase down and verify. Does an increasing sequence of reals converge if the difference of consecutive terms approaches zero? How to Send Byte array To Server Change keyboard layout (English UK) on command line to English US I woke up this morning to find that I suffered a massive drop in reputation points across the network because lots of users had been removed.  What happened to those users? Was there a database cleanup? What off-camera flash solution should I use with an entry-level Nikon? Is there a robust command line tool for processing csv files? I work with CSV files and sometimes need to quickly check the contents of a row or column from the command line.  In many cases cut, head, tail, and friends will do the job; however, cut cannot easily deal with situations such as  "this, is the first entry", this is the second, 34.5   Here, the first comma is part of the first field, but cut -d, -f1 disagrees. Before I write a solution myself, I was wondering if anyone knew of a good tool that already exists for this job.  It would have to, at the very least, be able to handle the example above and return a column from a CSV formatted file.  Other desirable features include the ability to select columns based on the column names given in the first row, support for other quoting styles and support for tab-separated files.  If you don't know of such a tool but have suggestions regarding implementing such a program in Bash, Perl, or Python, or other common scripting languages, I wouldn't mind such suggestions. Does Blender support any form of collaborative editing? How does commands like ls know what its stdout is?  It seems ls is operating different depending on what the target stdout is. For example if I do:  ls /home/matt/tmp    the result is:  a.txt b.txt c.txt   However if I do  ls /home/matt/tmp | cat   the result is (i.e. new line per result):  a.txt b.txt c.txt   The process is passed a file descriptor 1 for stdout right? How does it determine how to format the result? Does the file descriptor reveal information? MonoTouch.Dialog: How to set limit of number of characters for EntryElement Preloading images with jQuery How to add “jQuery” onclick functionality for a column each row in jQgrid to display different popups for different rows Am I Running as a Service I am currently writing a little bootstrap code for a service that can be run in the console. It essentially boils down to calling the OnStart() method instead of using the ServiceBase to start and stop the service (because it doesn't run the application if it isn't installed as a service and makes debugging a nightmare).  Right now I am using Debugger.IsAttached to determine if I should use ServiceBase.Run or [service].OnStart, but I know that isn't the best idea because some times end users want to run the service in a console (to see the output etc. realtime).  Any ideas on how I could determine if the Windows service controller started 'me', or if the user started 'me' in the console? Apparantly  is not the answer. I thought about using commandline args, but that seems 'dirty'.  I could always see about a try-catch statement around ServiceBase.Run, but that seems dirty. Edit: Try catch doesn't work.  I have a solution: putting it up here for all the other interested stackers:      public void Run()     {         if (Debugger.IsAttached || Environment.GetCommandLineArgs().Contains&lt;string&gt;("-console"))         {             RunAllServices();         }         else         {             try             {                 string temp = Console.Title;                 ServiceBase.Run((ServiceBase[])ComponentsToRun);             }             catch             {                 RunAllServices();             }         }     } // void Run      private void RunAllServices()     {         foreach (ConsoleService component in ComponentsToRun)         {             component.Start();         }         WaitForCTRLC();         foreach (ConsoleService component in ComponentsToRun)         {             component.Stop();         }     }   EDIT: There was another question on StackOverflow where the guy had problems with the Environment.CurrentDirectory being "C:\Windows\System32" looks like that may be the answer. I will test today. GTA V for PC exited unexpectedly I recently ordered the GTA V PC from Steam and when I finished installing and launch the game. It gave me "Grand Theft Auto V has exited unexpectedly". I tried "safe mod" and every option available, but none of them work. I checked some forums and found a lot of people having the same problems. What could be the possible cause? I'm using a laptop with these specs:  CPU: i7 4700m GPU: AMD HD8970M RAM: 8GB  I'm pretty sure my laptop is way beyond the minimum specs. Does someone know how can I enter the game? What could be the reason, that private keys are not unlocked? Since I updated to Ubuntu 17.10 a while ago, my private keys – the which I use for example to access my server via ssh – are not unlocked programmatically after login anymore.    My understanding is, that usually the seahorse client should take care of this, by asking you whether or not to store the key's password when typing them in for the first time.  My first guess was, that seahorse-daemon wasn't running for some reason, but it is:  user@Zeus:~$ ps aux | grep seahorse user    19170  0.0  0.1 432636 26564 ?        Ss   00:07   0:00 seahorse-daemon   My second guess was, that for some reason I have to delete all related passwords stored in seahorse under »Passwords->login«:    I was hoping to force the client to ask me again and then storing them again. But this didn't help either. The client does not pop up to ask me...  Then I found this question, which could be related, but did not help me:    As the management of other passwords work as expected (for example passwords for nautilus, Chromium, Nextcloud etc.) I assume the problem has to do something with ssh-agent...  Can anybody hint me in the right directions, how to solve this problem? Has anything changed in the way how GNOME handles passwords? Maybe some new fancy program failed being installed during the upgrade process?   UPDATE When I add the private key to the authentication agent again with:  ssh-add ~/.ssh/id_rsa   and try to log in, I will be asked to unlock the key only once, after that the key gets unlocked programmatically. But this works only until the next reboot. After a fresh start, I have to add the key again... Singular values of the data matrix and eigenvalues of the covariance matrix Modified files in a git branch are spilling over into another branch I am working on a git repository with a master branch and another topic branch. I have switched to topic branch and modified a file. Now, if I switched to master branch that same file is shown as modified.   For example:  git status in git-build branch:  # On branch git-build # Changes to be committed: #   (use "git reset HEAD &lt;file&gt;..." to unstage) # #       modified:   cvsup_current #   Switch to master branch  [root@redbull builder_scripts (git-build)]# git co master M       builder_scripts/cvsup_current Switched to branch "master"   git status in master branch  [root@redbull builder_scripts (master)]# git status # On branch master # Changes to be committed: #   (use "git reset HEAD &lt;file&gt;..." to unstage) # #       modified:   cvsup_current #   Why is that the file is shown as modified in master branch even though it was modified in git-build branch?   My understanding was that the branches are independent of each other and when I change from one branch to another the changes do not "spill over" from one branch to another. So I am obviously missing some thing here.   Anyone got a clue stick? Caption above subtables with subcaption package breaks numbering of following table Should Emergency Funds be Used for Infrequent, but Likely, Expenses? Say we break down non-monthly costs into the following three categories.   High level of predictability: This would include oil changes that may be needed every 2 to 4 months depending on usage, car insurance (if paid every 6 month), car registration, etc. Medium level of predictability: There are some expense which one can reasonable assume will occur on an infrequent basis.  For example, car repairs, house repairs, or even doctor visits during flu season. Low level of predictability: For example, losing a job, significant medical expense, etc.   Which of these categories are emergency funds meant to cover?  I think it is pretty clear that a high level of predictability costs should not use emergency funds while a low level of predictability should.  But medium level of predictability costs seem different, and it left me wondering what is generally defined as an "emergency".  While you do not know when these costs will occur or how much they will be, you could devise some pretty good rules of thumb on frequency and cost. Say you know your 2007 Volvo should have a repair cost averaging out to $100 per month.  Conceptually you could save $100 each month and when your car breaks, not have to spend any emergency funds on the repair.  Is doing this "double-saving" and not suggested if you already have the 6 month emergency fund saved up?  Note: this is a question on how to save money for expenses.  It is not a question about if you should spend emergency fund money to fix a car when you have no other money set aside. Add a confirmation before moving comments to a chat