paycheck tax withholding ?

Question: I received my first paycheck  and 200 in taxes were taken out but I never received a w-4 or i9
Which is what I am used to were I can claim 0 5.
So how can these taxes be taken out if I never received those forms of any kind
Comment: May be some default values used instead...Until you fill out the form itself and pass it to the employer
Answer: The IRS instructions cover this situation.  In the absence of a valid completed W-4, an employer must withhold at the highest rate - single with 0 allowances.  This is covered in the first paragraph of the following document:
Topic 753 - Form W-4 – Employee's Withholding Allowance Certificate

If an employee fails to give you a properly completed Form W-4, you must withhold federal income taxes from his or her wages as if he or she were single and claiming no withholding allowances.

The I-9 should have no effect on your tax withholding, since it only certifies that you have the right to work in the United States, not that you have any specific tax condition.
A new W-4 can be filed at any time.  The above document specifies the maximum amount of time before the new document must be accepted.
If you are certain you have not been given a W-4 or I-9 to complete, you may wish to inquire further of your employer, and save those pay stubs.  Without proper documentation, your employer may act shadily and may not be making proper payments to the IRS on your behalf or his own.
Comment: I seriously doubt there is any scamming going on - probably they are just slow with the forms, or they offer it on the internal website and the OP didn't realize it yet. Either way, the amount of taxes owed is independent of W-4 anyway; it just defines the _pre-payments_, OP will get back any overpayments.
Comment: Looks like I beat you to it by 2 minutes. But your answer is a little more thorough so I merged in the quote into your answer and deleted mine.
Comment: Thank you! Yeah I asked if I could get a w4 and he said "he dosnt subcontract insurance". This was in a text
Comment: What kinda scam could he be doing by not giving me the forms to fill out like i9 or w2.
Comment: Ok I see . Thank you again I will find out. I wonder what will happen if he refuses to give me these forms
Comment: @JD You may want to consider reporting your employer to the IRS if you have proof that they are not providing all required tax forms.

paycheck tax withholding ?


Where can or who can help me change my old dollar bill?

Question:  Hey everyone? I've been having some difficulties exchange my old dollar bill. Can anyone please help me? They said it was old. But it is still im a good shape though.
Comment: Neither bill looks real. I presume this is some example photo, not a photo of real $100 bills.
Comment: Do you know anyone who will be traveling to the US anytime soon?  The bill is perfectly usable in the US; maybe they'll exchange it for you.
Comment: No I don't know anyone who's traveling anytime soon. ☹
Comment: I'm not sure if it's because of the photo orientation but your old $100 seems much larger than the new $100. How sure are you that your old bill isn't counterfeit money?
Comment: Any US bank, and most (but not all) US retailers will accept the older bills.
Answer: On the plus side, the left signature of the Treasurer of the United States, William Alexander Julian matches the bill's date. The right signature of the Secretary of the Treasury, Henry Morgenthau, Jr. also matches.
Based on pictures of other 1934 series $100 bills online, including from some dealers, there are some features which don't appear to match.
The text below Franklin's picture should say, "will pay to the bearer on demand."
The text on the upper left that starts, "This note is legal tender..." doesn't match what other bills have. The statement is much longer.
One site said to check for raised text on the bill. That's the only security feature at the time. They did state that the raised text could be worn off but then I would expect more general wear on the bill.
Comment: Who says it's supposed to be series 1934? The picture matches the 1963 series a lot better, including the two differences you point to.
Comment: @HenningMakholm by checking when the Treasurer and Secretary of the Treasurer who signed the plate were in office. I assumed OP was asking about the top bill which is (supposedly) much older than the bottom one.
Comment: The resolution is not good enough for me to decode those signatures -- what do you make them out to be? The bottom note looks like the 1996 series, which is indeed newer than the 1963 series.
Comment: @HenningMakholm added to the answer.
Answer: If you live anywhere near a tourist area, you could ask some US Americans there to exchange it for you. Be aware they may think it's a scam, especially if you're a complete stranger to them.


Trouble WIth Immediate Shutdown in Ubuntu 13.10 with Cinnamon

Question: Just installed Ubuntu on my family's computer. I thought the Cinnamon desktop environment would be better for my parents who have only ever used Windows. Everything works great until I try to shut down. Shutting down while in Cinnamon desktop brings up a prompt window that says it will shutdown in 60 seconds and gives the option to either suspend or cancel. The suspend button does not suspend the computer. Allowing the timer to countdown merely logs the current user out.
Under power management, I have selected Shutdown Immediately for Power button action. I still get the same prompt. I have tried toggling between the other options, but regardless of what option is selected, the shutdown button always brings up the suspend or cancel prompt with no way to shutdown immediately.
I would prefer not to use the power button for this as it is partially concealed with the computer desk.
The fastest way to shutdown is to log out (which says it will log out in 60 seconds but also has log out and cancel buttons, so I can immediately log out) and then shutdown. I would prefer to have it automatically shut down.
Any and all suggestions are appreciated. Thank you!
UPDATE:
I also cannot suspend using the button to lock screen. This particular keyboard has a dedicated button for it, and the button works just fine...
Answer: I was having the same issue. Installing consolekit then shutting down completely and rebooting fixed it.
<code>sudo apt-get install consolekit
sudo shutdown -h now
</code>
Comment: Is it still working? Because shortly after, it just stopped connecting to the internet. Seems to work fine with Unity, but I tried installing Cinnamon, LXDE, and KDE, all stopped connecting to wifi after reboot.


How can I add login and logout sounds to OS X 10.8.x?

Question: I would like to add login and logout sounds to my Mac. How can I do this?
Answer: Save a script like this as ~/Desktop/test and make it executable with chmod +x ~/Desktop/test.
#!/bin/bash

afplay /System/Library/Sounds/Blow.aiff

You can then add a LogoutHook key to /var/root/Library/Preferences/com.apple.loginwindow.plist with sudo defaults write com.apple.loginwindow LogoutHook ~/Desktop/test. It can be deleted with sudo defaults delete com.apple.loginwindow LogoutHook. You can run a script at login by adding a LoginHook key or by using launchd.
See also these questions about running scripts on logout and login and Daemons and Services Programming Guide: Customizing Login and Logout.
Answer: Just write this  Shutdown   maybe that will work
Shutdown


My Samsung Galaxy S4 was stolen

Question: My Samsung Galaxy S4 was stolen and doesn't have a lock. It was deactivated but I'm worried about the fact that whoever has the phone has access to everything from pictures, videos, my Facebook, contacts, etc. The phone's been deactivated but what can I do about the pictures on the phone? I have a 4 year old daughter and I'm afraid of the pictures on there falling into the wrong hands...I have no other accounts set up to help with privacy but would really like the phone tracked or wiped out...Is that possible?
Answer: You can try to erase the device from Andriod Device manager at
http://www.android.com/devicemanager
Note that this will work only if:

The phone has your account still logged in
The phone is connected to the internet at the time of sending the erase request or after. [Wifi or Mobile Network]
the new user hasn't reset the device.

My Samsung Galaxy S4 was stolen


Drawing 3D points in Java

Question: My question is - how to draw 3D points in java? I would like to make some plot in simply way. I' ve tried to used it:
http://jmathtools.berlios.de/doku.php
but there is no documentation.
Answer: The Java 3D API is an application programming interface used for writing three-dimensional graphics applications and applets.
for more details go there http://download.java.net/media/java3d/javadoc/1.4.0/javax/media/j3d/doc-files/intro.html
example
http://download.java.net/media/java3d/javadoc/1.4.0/javax/media/j3d/doc-files/HelloUniverse.html

Drawing 3D points in Java


Poisson GLM with nonstationary data

Question: My main goal is to model some count data. The dataset is a time series dataset that if I were to perform linear regression, I would difference to make sure the data became stationary. However, if I want to use Poisson GLM, would I still difference it or try to make stationary? My main concern is if I were to apply a transformation, I wouldn't be modeling counts anymore, rendering Poisson irrelevant. In addition, differencing can lead to negative values, and Poisson is only for positive values.
Answer: If you need to model longitudinal data where the outcome is a count, I'd recommend using a mixed model approach or a Generalized Estimating Equations (GEE) approach.  Both of these methods will account for the serial correlation of your outcomes and you will not have to worry about transformations or taking differences of measurements.  A search on this site for GEE/Poisson or Mixed Models/Poisson will lead you in the right direction.
Comment: I'm just trying to keep it in GLM though. Not differencing time series data might make predictions pretty bad. At the same time, out of all of the GLM family options, Poisson makes the most sense

Poisson GLM with nonstationary data


Is there a shell which supports fuzzy completion as in Sublime Text?

Question: I'm using bash and I was wondering if there is any plugin in bash or other shell which allows me to do this
cat tfnislong.txt + [tab] completes to cat ThisFileNameIsSoLong.txt just like tab completion in Sublime Text.
Comment: @daviewales Display all 269 reasons?
Comment: Why not just do `cat Th` + `tab`?
Answer: I know of https://github.com/mgalgs/fuzzy_bash_completion which is a bunch of shell functions used with complete.
I think we could probably do a little better though, be more concise. Time to bust open your .bashrc or .profile...
The basic hook we use is this:
complete -o nospace -o filenames -F fuzzypath cd ls cat
-F option means use a shell function for the tab-completion, where the options are set in the COMPREPLY variable. So for example:

function fuzzypath() {
    if [ -z $2 ]
    then
        COMPREPLY=( `ls` )
    else
        DIRPATH=`echo "$2" | gsed 's|[^/]*$||'`
        BASENAME=`echo "$2" | gsed 's|.*/||'`
        FILTER=`echo "$BASENAME" | gsed 's|.|\0.*|g'`
        COMPREPLY=( `ls $DIRPATH | grep -i "$FILTER" | gsed "s|^|$DIRPATH|g"` )
    fi
}

where DIRPATH is everything before the last / on your path that you're typing and BASENAME is where your cursor is currently.
FILTER is where the fuzzy-ness comes in. Basically, take BASENAME and insert a .* between every char to produce our fuzz regex.
The rest is just combining the regex with ls to produce COMPREPLY. You may find more clever things to do here, maybe with find.
I also found http://fahdshariff.blogspot.com/2011/04/writing-your-own-bash-completion.html to be useful.
Comment: This approach has the same problem I encountered in a short version I wrote: if you hit tab and there are multiple matching results, they are listed as expected (which is good). But then the fuzzy search string you've typed so far will be replaced by the common prefix of the matching results (which can be bad because it takes your search process back to square one if that common prefix is also shared by other items not in the matching results).
Answer: You may find fzf useful. It's a general purpose fuzzy finder written in Ruby that can be used with any list of things: files, processes, command history, git branches, etc.
Its install script will setup CTRL-T keybinding for your shell. The following GIF shows how it works.
Comment: FZF is great! Thanks a lot for contributing. This saved me weeks of work..I was starting to write fuzzy completion for Bash when I luckily found FZF. It works perfect, I just had to remember to save cursor position before calling `fzf` .. (tput sc) and later restore it with `tput rc`..
Answer: To go along with your other answer, you might want to look into zsh.  It's backwards compatible with bash so you can use it as a drop in replacement, but it supports significantly expanded features and one of them is greatly enhanced context aware tab completion.
zsh Completion FAQ expands on the use cases, but I do believe that per your example, you would be most interested in the COMPLETE_IN_WORDfunction.  It is not quite the desired behavior, but it's close.  The main point is that there are a lot of ways to extend upon the base functionality in a maybe more approachable way than using bash.
Here is a fuzzy match extension that would approximate what you want more specifically;  zsh-fuzzy match
For some ideas you could take a look at the popular oh-my-zsh framework that has a number of functions for managing zsh and extending it.  It's more than you want, most likely, but under the plugins you'll note auto-completion scripts for a variety of roles.  To get an idea of the capabilities.


Can I do anything else with aspersions other than cast them?

Question: My wife is always accusing me of casting aspersions and I'd like to do something else with them. Please advise.

Dictionary-example-sentences all use it in tandem with casting:
Oxford Learners:

I don't think anyone is casting aspersions on you

Merriam-Webster:

casting aspersions on her integrity

Dictionary.com

casting aspersions on a campaign rival
Comment: Thank you for your effort. Please avoid
discussion, debate, or giving answers
in comments.
The comment thread is reserved for *helping to improve the post*: friendly clarifying questions, suggestions for improving the post,
relevant but transient information, and explanations of your actions. A welcoming place for discussion of posts (or anything else) is our [English Language & Usage Chat](https://chat.stackexchange.com/rooms/95).
Answer: You can also sprinkle them. [aspersion: (n) An attack on somebody's reputation or good name, often in the phrase to cast aspersions upon (Dict.com)]     (label) ...a sprinkling of [aspersions]
Merriam-Webster: "sprinkle" def: scatter or pour small drops or particles of a substance over (an object or surface).
Maybe a sprinkling of aspersions will make them appear more tiny vs. this casting aspersions upon her.
Perhaps a sprinkling of aspersions sounds less inoffensive; somewhat harmless, or innocuous--somehow. Seem like a piddling of aspersions. Maybe because there's less of them. I don't know.  Sometimes, if I apply a sprinkling of aspersions on my wife instead of casting, she thinks them funny.  Try a sprinkling of aspersions instead.  If that doesn't work, you can always go back to casting aspersions upon her, or even try dusting or powdering her with aspersions. See if that works.
Good luck!
Comment: Point in fact @ᴇʟᴇvᴀтᴇ, a "sprinkling" of aspersions is actually a _blessing_...
Comment: Thank you. I plan to moisten the air with my next set of aspersions and see if that helps.
Comment: Perfect. That's my get-out-of-jail-free card.
Comment: @ᴇʟᴇvᴀтᴇ ...and might I sprinkle aspersions on you, for brightening up my day with this question.
Answer: You can heap aspersions on someone. Of course you can also throw them.
You can lay aspersions upon someone too.
I suppose it would also be possible to say, with some license, that someone went about pissing aspersions— on the free press perhaps.  With similar latitude you could say that someone went about spluttering aspersions or training a steady stream of aspersions, as the case may be.
Answer: The manner in which you are using aspersion(s) here is only in the metaphorical sense of the word. An "aspersion" is either the act of sprinkling, or that which is sprinkled. E.g 1846   W. Maskell Monumenta Ritualia Ecclesiae Anglicanae I. 209   St. Peter..baptized five thousand on one day; but this must have been by aspersion. (OED).
It is only when you get to OED senses 5 and 6 that you see reference to the innuendo sense. And in only a few of the examples given, as you will see, are they "cast".

The action of casting damaging imputations, false and injurious charges, or unjust insinuations; calumniation, defamation.

1633   G. Herbert Temple: Sacred Poems 89   Who by aspersions throw a
  stone At th' head of others, hit their own.
1781   W. Cowper Friendship xvii   Aspersion is the babbler's trade,
  To listen is to lend him aid.
1873   E. M. Goulburn Thoughts Pers. Relig. iv. xi. 347   Imperious
  aspersion of God.

A damaging report; a charge that tarnishes the reputation; a calumny, slander, false insinuation. Esp. in the phr. to cast
  aspersions upon.

1596   Spenser View State Ireland Pref. 2   Which may seeme to
  lay..any particular aspersion upon some families.
a1661   T. Fuller Worthies (1662) Bristol 37   As false is the
  Aspersion of his being a great Usurer.
1692   King James II Let. 2 Apr. (BL Stowe 158 f. 61)    Even that
  precatuion [having witnesses at the prince's birth] was not enough to
  hinder Us from the malicious Aspersions of such as were resolved to
  deprive Us of Our Royal Right.
1749   H. Fielding Tom Jones IV. xi. vii. 155   I defy all the World
  to cast a just Aspersion on my Character.
1859   'G. Eliot' Adam Bede I. i. v. 113   Vindicating myself from the
  aspersions.
Comment: @WS2 But normally-aspirated engines don't aspire to anything.
Comment: @EdDaniel Those are related to the sense of the verb "aspire" meaning, simply to breathe, from the Latin *aspirare*.  It is a different sense which incorporates the idea of "breathing desire toward" - meaning: *To have a fixed desire, longing, or ambition for something at present above one; to seek to attain, to pant, long*. (OED)
Comment: Is that like `aspiration`?
Comment: @DavidRTribble No. An "aspiration" is something to which you aspire.
Comment: This should be the accepted answer.
Answer: The answers already given are good, but I wanted to add a method for finding answers. Try Google N-grams using the part-of-speech marker like so:
In the search bar: *_VERB aspersions
or use this link:
https://books.google.com/ngrams/graph?content=*_VERB+aspersions
That will give you the top-10 most common choices of verb to precede "aspersions" in the indexed books. Most of them are conjugations of "cast" but there are also: "lay", "throw", "make" and "contain".
You could also find out what kind of aspersions people were casting using: cast *_ADJ aspersions
Apparently, they were serious, moral, defamatory, unjust, foul and grave.
Answer: You could probably book them for a gig. Your wife might refute them. Someone else might vindicate her against your aspersions.
Comment: I like the lateral thinking involved in this answer :)
Answer: I think what's posted pretty much covers YOUR aspersions. If the aspersions come from someone else, you can resent them.
Answer: I'm NOT siding with your wife. You can retain them (keep them to yourself), and you can also verify them (check them). After those two, you might be able to reword them into a persuasive format.
https://www.thefreedictionary.com/aspersion
Comment: Your reference doesn't support any usage of "retain", "verify" or "reword" in collocation with "aspersions".
Comment: Well, for mercy's sake. I'll have to retain my aspersions for the moment. I need to check them all for veracity there are so many of them. In lieu of them, though, I didn't think collocation was required because it wasn't stated.  My bad.


Can I mine diamonds with TNT

Question: I have been playing mcpe on the raygun seed. I marked my spawn and I have a truck load of TNT and one flint and steel. While I was mining after a really long time I noticed I had no pick! I was already next to the diamonds and no I am wondering. Can I get diamonds usingTNT?
Comment: If you do decide to try this, use only one TNT block, or else the additional blocks will destroy any dropped diamonds.
Answer: Assuming the same laws of TNT in the PC/Mac game apply to the Pocket edition, then yes, you can!
However, there are two things to keep in mind:

75% of the diamonds will be instantly "vaporized" in the explosion instead of dropped as items
You cannot use a Fortune enchantment when using TNT

Using those numbers, while using a Fortune III pickaxe to mine diamonds will net you an average of 2.5 diamonds per ore block, using TNT to mine will net you 0.25 diamonds per ore block.
So, although you can mine any ore with TNT, it's definitely not efficient (but could theoretically help out in a pinch).
Answer: Assuming the same laws of TNT in the PC/Mac game apply to the Pocket edition, then no, you cannot. By placing TNT, you will end up destroying the resources, so don't risk it.

However, since it will wind up destroying most dropped items, it is of no use in breaking blocks to collect their resources.

This is off the Minecraft Wiki under the TNT page: https://minecraft.wiki/w/TNT
I suggest trying to find some iron and then mining it otherwise you will lose those precious diamonds. Do not try using TNT. If you have already, unlucky :(
Comment: This is *wrong*. See IQAndreas' answer for the correct answer.
Comment: @Arperum Technically, the answer isn't wrong, it's just [_something something_](http://english.stackexchange.com/q/143023/5438).
Comment: @IQAndreas 25% off is quite a way off in my eyes.
Answer: With the TNT update, yes. Tnt will now drop every material it blows up.
However, two things to think about:
One: TNT will blow up any item on the ground. So your first tnt will drop everything. And if the diamonds are not picked up before the second TNT explodes, they will disappear.
Two: You can use a Machine Bore to mine diamonds very efficiently with TNT: I suggest searching Ilmango tunnel bore machine on youtube for a more detailed explanation.
Comment: Java Redstone != Bedrock Redstone, that machines for java
Answer: No you cannot, you will just blow up your items.
Comment: How does this answer differ from the one already provided?

Can I mine diamonds with TNT


Managing multiple spiders with scrapy

Question: I am creating an aggregator and I started with scrapy as my initial tool set.
First I only had a few spiders, but as the project grows it seems like I may have hundreds or even a thousand different spiders as i scrape more and more sites.
What is the best way to manage these spiders as some websites only need to be crawled once, some on a more regular basis?
Is scrapy still a good tool when dealing with so many sites or would you recommend some other technology.
Comment: Take a look at [Scrapyd](http://doc.scrapy.org/en/latest/topics/scrapyd.html)
Answer: You can check out the project scrapely, that is from the creators of scrapy. But, as far as I know, it is not suitable for parsing sites containing javascript (more precisely, if the parsed data is not generated by javascript).

Managing multiple spiders with scrapy


ubuntu 16.04 won't shutdown : Reached target Shutdown[ok] also ubuntu 14.04 won't shut down : killing all procces [fail]

Question: I had ubuntu 14.04 (DELL laptop INSPIRON N-4110 )
shutdown and reboot worked correctly and without any problem
but after a long time I wasn't able to reboot or shutdown my machine.
and that was the log message was shown by pressing Esc during shutdown:
killing all procceses  [fail]
and I tried all the tips I saw in askubuntu and others(like changing the grub and shutdown - h now etc none of them have worked ! )
then I clean installed ubuntu 16.04 (current)
but issue is not going to solve.
now the log shows:
[ok] Reached target Shutdown
[135.486156] ata2.00: exception Emask 0x0 SAct 0x0 SErr 0X0 action 0x6 frozen
[135.846776] ata2.00: cmd a0/00: 00:00:00:00/00:00:00:00:00/s0 tag 4 pio 16392 in
[135.846776] get event status notification 4a  01 00 10 00 00 00 00 00res 40/00:00:00:00
[135.848020] ata2.00:status: { DRDY }
[141.182090] ata2.00 revalidation failed  (errno=-5)

I checked bug #1464917 and did instructions also but nothings changed .
UPDATE:
after updating to 16.04.1 (boot install) Ubuntu will shutdown if i do it fast when OS is coming up but after a while it's not going to power off again and
Esc key won't work and does not show me log any more
UPDATE(PROBLEM SOLVED) :
It was a certain hardware problem and solved by changing Hard Disc
Answer: Maybe the swap is still active when reaching "Target shutdown";
My solution was to force swap deactivation before reboot :

 swapoff -a
 swapoff /dev/md6

after that, the reboot went fine for me without any pause.
Comment: I have exactly the same annoying problem. Where do you put these two lines?


Is it possible to get a negative infinite differential entropy without delta function and limit?

Question: If $f(x)=\frac{1}{x\ln{x}^2}, x\ge e$, $h(X)=+\infty$. But if I hope to let $h(X)=-\infty$, can I find such a function $f(x)$ without using limit and delta function?
Comment: Did you try constructing a series of uniform distributions with changing heights and widths?
Answer: There's no avoiding some kind of limit, because the differentiable entropy itself is defined in terms of an integral (a limit) and the very meaning of "$=\infty$" refers to a diverging sequence.  But let's see what we can do with a minimum of fuss.
For $n=0,1,2,3,\ldots,$ let
$$x(n) = \sum_{i=1}^n \frac{e^{-i}}{i^{3/2}}.$$
For each $n\ge 1$ and $x(n-1) \lt t \le x(n)$ define
$$f_0(t) = e^n$$
and otherwise define $f_0(t) = 0.$
Compute that
$$C = \int_\mathbb{R} f_0(t)\,\mathrm{d}t =\sum_{n=1}^\infty e^{n}\frac{e^{-n}}{n^{3/2}}\lt \infty.$$
(In fact, $C=\zeta(3/2)\approx 2.6124.$)
Since $f_0 \ge 0$ everywhere and is obviously measurable, the function
$$f(t) = \frac{1}{C} f_0(t)$$
is a probability density function.  (Alas, $f$ is no fun to plot: it rises incredibly rapidly as its argument approaches $0.4284407\ldots$ and so looks just like a spike there.  But the spike gets so skinny so quickly that it still has finite area.  It's not a delta function, though: $f$ is a genuine function, as you can see from its explicit construction.)
The entropy is
$$-H(f) = \int_{\mathbb{R}}\log(f(t))f(t)\,\mathrm{d}t = \log(C)+\frac{1}{C}\sum_{n=1}^\infty n e^n\frac{e^{-n}}{n^{3/2}} = \log(C)+\frac{1}{C}\sum_{n=1}^\infty\frac{1}{n^{1/2}},$$
which diverges (compare it to the integral of $x^{-1/2}\mathrm{d}x$): that's what it means for the (negative of the) entropy to be infinite.

Comments
This $f$ is a step function, which makes it discontinuous.  The construction can be modified to make $f$ continuous--or even continuously differentiable of any order--by using a probability density function $g$ defined on $[0,1]$ which is sufficiently differentiable at the endpoints $0$ and $1.$  (A Beta$(a,a)$ distribution for large $a$ will work.)  In the construction multiply $f_0$ by a scale, shifted version of $g.$  That is, replace $f_0$ by the function
$$f_0(t) = e^n\, \frac{1}{x(n) - x(n-1)} g\left(\frac{t - x(n)}{x(n)-x(n-1)}\right).$$
Exploit the inequality $x(n) - x(n-1)\lt 1$ (for $n\gt 1$) to establish that the measure of the set $f_0^{-1}[e^n,\infty)$ relative to the interval $x(n)-x(n-1)$ exceeds the measure $\pi$ of the set $g^{-1}[1,\infty),$ which must be positive.  This easily shows the summation in the entropy calculation (for the modified construction) exceeds $\pi$ times the summation in the original calculation, whence the modified entropy diverges too.
One problem remains: At the point $\lim_{n\to\infty} x(n),$ where the spike soars to infinity, $f$ cannot be continuous.  Address this with an additional modification: instead of defining $f_0$ on the intervals $[x(n-1),x(n)],$ define it on the intervals $[n+x(n-1), n+x(n)].$  This just pushes the probability around and thereby doesn't change the entropy at all.  However, it also pushes the problem at the spike off to $+\infty.$  The graph of $f$ looks like an infinite comb with teeth of exponentially increasing heights (and more than exponentially decreasing widths): see the figure.  With the preceding modification, each tooth is continuous and merges continuously with the $0$ values between the teeth.
The figure shows the effects of this second modification on the original step function and a smoothed version.  Note the semilogarithmic scale.
Answer: To augment the wonderful answer given by whuber, it is worth noting an additional aspect of dealing with continuous functions defined on the real numbers or subsets of the real numbers.  Given a function of this kind, one can define an "extension" function on the closure of the domain (which is a subset of the extended real numbers) which explicitly gives each boundary value a function output equivalent to its limit value.  This allows you to work with a function where the limit values are defined explicitly.  It also gives a representation of the function that is closer to how these things look in mathematical/statistical computing platforms, where there are explicit values representing positive and negative infinity.

How does this work: Suppose you have a continuous function $H: \mathcal{D} \rightarrow \mathbb{R}$ that is defined on some subset of the real numbers.  Continuity of the function means that limits of the function are defined at the boundary points of the domain $\mathcal{D}$ (with some limits possibly being infinite).  It is natural to define an extension function on the set of extended real numbers as follows.  Define the extension function $H_*: \text{closure}(\mathcal{D}) \rightarrow \bar{\mathbb{R}}$ by:
$$H_*(x) = \lim_{a \rightarrow x} H(a).$$
For all $x \in \mathcal{D}$ we have $H_*(x) = \lim_{a \rightarrow x} H(a) = H(x)$ (which follows from continuity of the function), but the function is also defined at values on the boundary $\text{closure}(\mathcal{D}) - \mathcal{D}$.  In this way, one can now write limits of the function $H$ explicitly with the function $H_*$.

An example: Consider the real version of the logarithm function $\log: (0, \infty) \rightarrow \mathbb{R}$.  This is a continuous function with well-known limits at the boundaries, so we can extend it to $\log_* : [0, \infty] \rightarrow \bar{\mathbb{R}}$ as:
$$\log_*(x) = \begin{cases}
-\infty & & & \text{for } x = 0, \\[6pt]
\log(x) & & & \text{for } 0 < x < \infty, \\[6pt]
+\infty & & & \text{for } x = \infty. \\[6pt]
\end{cases}$$
Most mathematical/statistical software has explicit elements for positive and negative infinity, so it gives you the extended version of the logarithm function --- i.e., you can put in the inputs zero or positive infinity and you will get the outputs negative or positive infinity.  Indeed, the extended logarithm function used here is the one used in statistical software.  For example, using R you get:
log(0)
[1] -Inf

log(Inf)
[1] Inf

Note: For explanatory convenience, I have denoted the extended functions using different notation than the initial functions, but in practice they are usually denoted with the same notation.  For example, the extended logarithm function would usually just be denoted as $\log$ irrespective of its domain.
Comment: This is interesting, but for computing the entropy don't we really need an extension of the function $x\to x\log(x)$? In that case, its value ought to be *zero* at $x=0.$ I am concerned that this approach loses the subtleties of analyzing the entropy.  Please note, too, that the density defined in my answer is everywhere finite: no infinities are involved. (Although the density function itself is not continuous, it is possible to modify it into one that is continuous--and still finite!--everywhere. I have edited my answer to sketch such a modification.)
Comment: Indeed --- the $\log$ example I used was just for illustration.  Honestly, I'm not really sure if this material is applicable here, but I gave it because the title of the question suggests that the questioner is interested in representing functions that take infinite values.
Comment: My best guess--at which I arrived after posting my analysis--is that one can represent a delta distribution as a weak limit of densities converging to a point and then try to extend the definition of $H$ *via* continuity to generalized functions, and in this sense can construct examples with $H=-\infty;$ but the OP wishes to avoid such constructions in favor of an actual density (that is, a distribution that is absolutely continuous w.r.t. Lebesgue measure) if possible. Such distribution functions can equal $+\infty$ only on a set of measure zero.


How do I copy mp3s and then edit the ID3 tags of the copies without altering the tags on the originals?

Question: I made a playlist for my brother, using tracks (.mp3) that I have on my Macbook and usually listen to with iTunes. I want to put these tracks onto a USB stick to give to him. I don't have the USB stick yet but I thought I'd get the tracks ready to put onto the stick, by copying them all into a separate folder on Finder and editing the ID3 tags so that their "album" field contains the name of the playlist and their track numbers match their positions within the playlist. I thought this would be simple enough (I grew up with Windows), so just made a new folder (under "Documents") and copied them out of iTunes into here. I then realized that it's impossible to edit ID3 tags through Finder. After overcoming my initial frustration with this, I thought that instead of downloading some third-party software I'd just copy these files into iTunes and edit their ID3 tags there. I made a new playlist within iTunes, dragged the files from the folder in Documents into this playlist and edited all the ID3 tags appropriately. When I was done I deleted the mp3s out of the folder in Documents and dragged the edited tracks from iTunes into this folder to replace them. This meant that I had exactly what I wanted (the tracks with the new ID3 tags) in the folder in Documents.
However, I then realized that something hadn't worked as I'd expected. I thought I'd duplicated the files that had initially been in my iTunes when I'd copied them into the folder in Documents, and then had added these new (but identical) files into iTunes, which I'd then edited (meaning that their ID3 tags were no longer identical to the originals). However, it turns out that somehow iTunes, presumably recognising the files to be identical, had somehow merged them? Either that or it had never actually duplicated them in the first place? I'm really not sure how it works. Either way, the end result is that the original files have disappeared from my iTunes and from my computer; now I only have the ones with the new ID3 tags. I tried to "undo" what I'd done in iTunes, but it was impossible (the editing of the ID3 tags didn't appear in the list of actions that could be undone, for some reason).
My questions are thus: firstly, is there a way to revert the files' ID3 tags to what they were before, other than manually? (It will be really annoying to have to go and look up the album titles and track numbers for each track and edit them manually.) And secondly, what did I do wrong? How do I achieve my simple goal of copying (i.e. duplicating) a group of mp3s and editing the ID3 tags of the copies without changing the originals?
Answer: As to your second question, I would try Tagscanner (https://www.xdlab.ru/en/). You can tell it the location of the files you want to edit tags for. So there is no danger of editing the set wrong files. It also has a batch mode. Read the documentation, as with many powerful tools, it has a lot of features that can seem overwhelming to new users. It also has a preview mode for changes that allows to to see the changes you are making before committing them.
Answer: To revert your files, hopefully you can just restore from your Time Machine backup.
iTunes stores all of its media files in one library which is by default, in your home folder under Music > iTunes. If you change a file, then you change the library. One possible workaround is to export the library to another location, then set that new location as the iTunes library. Then edit the files in the new library.
A better solution would be to manually find the file in the default library, then duplicate it (File > Duplicate). Work on the duplicate file with something other than iTunes.
There are many programs out there that will edit id3 tags. I personally like Audacity because of its solid reputation.
Answer: I had just this problem myself, i loaded an compilation and it dumped the songs outside of the album. It is really easy in itunes. Select the song you want, click file in the top bar of itune and scroll down to "get info". Form here you can easily edit the tags, and album artwork. If you click the album alome you can alter its tags but not touch the songs in it.


Where did the term "Double Standard" originate?

Question: Is it from someone flying two flags (standards are a type of banners or flag) and say riding both sides of the fence?   I'm guessing here as I can find nothing on this. but it sounds logical to me.
Comment: I doubt it. Standard is more likely talking about a behavioral standard.
Comment: The usage didn't start to take off until the 60s. Accortding to Google Books there are an estimated 9220 hits for [*"applying double standards"*](https://www.google.com/search?q=%22applying+double+standards%22&btnG=Search+Books&tbm=bks&tbo=1&gws_rd=ssl), but [*the earliest of those is 1950*](https://www.google.com/search?q=%22you+were+applying+double+standards+to+the+people+who+worked+for+you%22&btnG=Search+Books&tbm=bks&tbo=1&gws_rd=ssl). So I agree with @Scimonster - it doesn't look like a long-established naval usage. Just an ordinary literal collocation.
Answer: 'Double standard' as two equivalent standards
The earliest matches for "double standard" in a Google Books search across the years 1800–1900 relate to currencies based on both gold and silver. For example, The Opinions of Sir Robert Peel, Expressed in Parliament and in Public, Second Edition (1850) includes these consecutive excerpts on the topic of "A Joint Gold and Silver Standard":

The notion of a double standard is totally fallacious, and would be found impracticable in effect ; nor has it ever been for a moment entertained by Mr. Locke, or any others who have advocated a silver standard.—Mr. M. Attwood's Motion on the Currency, June 8, 1830.
Now, if we proceed to alter the currency, the first question would be, shall we have a double standard of gold and silver conjointly, or shall we simply alter our standard from gold to silver? I cannot see any advantage derivable from the institution of a double standard. You cannot make a double standard without first defining the ratio which is to exist between the nominal value of the two metals. To say that every man should pay his debts in silver or gold, whichever he may please, without defining the relative value, would be absurd and impracticable. ... —Mr. Cayley's Motion for the Adoption of a Silver Standard, June 1, 1835.

Mentions of a "double standard" in connection with bimetallism occur as early as March 19, 1821, and continue until as late as 1900, the last year of the search period I used. The term also comes up in connection with corn gauged by weight and measure (1834), with sugar gauged by grain and whiteness (1834), with duty to "the Charter and the King" (1843), with obedience to "the Book of Scripture ... and the Book of Nature" (1848), with Iceland's old double monetary valuation standard of wadmal (wool) and silver (1874), and with milk gauged by solids and fat (1896).
The essential feature of bimetallism is that it attempts to establish a constant ratio of equivalence between gold and silver, so that both metals have a consistent relative value and are, in that sense, interchangeable—just as, in the United States today, four metal quarters and a paper one-dollar bill are interchangeable (or exchangeable). So the double standard doesn't imply that one standard unfairly benefits the metal to which it applies at the expense of the metal subject to the other standard, but that the two standards are in balance and are fair to both metals.
One of the more interesting abstract uses of the term double standard arises in "Origin, Nature and History of Oaths," a review of James Tyler, Oaths, Their Origin, Nature and History, in The Law Magazine (November 1834):

The chief objection, however, to the use of oaths is, that it establishes a double standard of veracity : it recognizes the principle that it is possible by some human contrivance to increase the obligation to tell the truth ; a principle in our opinion utterly false, and fraught with the most pernicious consequences. A person who deliberately made a statement in a court of justice knowing it to be false, would, in our opinion, commit the same moral offence, whether he had forsworn himself or not : we can discern no difference between the guilt of the liar and the perjurer.

Here again, the point is not that the two standards put witnesses to very different levels of obligation (although that is clearly the implicit logic of the pro-oath movement), but that morally they are equivalent and entail the same level of obligation and, therefore, that the second standard—requiring witnesses to swear an oath—is unnecessary.
Not terribly surprisingly, the entry for double-standard in Charles Morris, The American Dictionary and Cyclopedia, Volume 4 (1900) refers exclusively to bimetallism:

double-standard. In economics the phrase Double Standard is used to signify a "Double Standard of Monetary Value." It implies the existence of what is known as the Gold Standard on the one hand, and the Silver Standard on the other. Wherever the Double Standard in its integrity is in use, a creditor is bound to accept payment of any sum in coins of either of the metals, gold or silver, which the debtor may choose to tender.

'Double standard' as separate and unequal standards
One of the earliest instances of double standard in the sense of separate and unequal systems of appraising human conduct turned up in a Google Books search appears in Frances Harper, "A Double Standard" (1895), a poem that focuses on the severe imbalance in the standards by which society judges a woman and a man involved in a love affair. The poem concludes with this quatrain:

No golden weights can turn the scale
Of justice in His sight;
And what is wrong in woman's life
In man's cannot be right.

Another early instance of double standard in connection with separate and unequal standards for men and women appears in Newton Riddell, A Child of Light: Or, Heredity and Prenatal Culture Considered in the Light of the New Psychology (1900), who devotes an entire chapter to "Heredity and the Double Standard":

Nature and law are always consistent. Whatever is inconsistent is abnormal. The social ethics which fosters in man what it condemns in woman is wholly inconsistent and therefore abnormal. The conditions which give rise to the double standard are as truly the product of dissipation as are those that produce drunkenness, vice and crime. The double standard is most demoralizing. As a factor in obstructing human progress, in perverting man's nobler instincts, in destroying domestic happiness, in filling the world with misery and in robbing offspring of good inheritance, it has no equal.

Riddell goes on to explain that the fundamental element of the "double standard" he has in mind involves social attitudes toward chastity.
The Wikipedia article quoted in Josh61's answer cites an even earlier instance of the use of double standard with regard to morality. From a review of Josephine Butler, "The Unjust Judgments Prevalent in Society, on Subjects of Morality," in The Ecclesiastical Observer (May 1, 1872):

The Christian religion sets up an equal standard of morality for both sexes ; it proclaims an absolute rule of personal purity on all alike, and as if to correct, with scourging, the falsehood of the existing double standard, Christ threw the whole weight of His authority into His rebukes of male profligacy, while with infinite tenderness, He restored the slave of man's lust to her place among the free.

Perhaps the most striking aspect of double standard as used by Butler, Harper, and Riddell is that the doubleness that the term refers to is grossly and brazenly unequal, whereas proponents of previous varieties of double standards sought emphasize the equivalence of the alternative measures offered as dual standards.
Butler, Harper, and Riddell notwithstanding, double standard in the sense of applying unequal criteria to assess the same behavior or work didn't appear in a Merriam-Webster Collegiate Dictionary until the Seventh Edition (1963):

double standard n 1 : BIMETALLISM 2 : a set of principles that applies differently and usu. more rigorously to one group of people or circumstances than to another
Answer: The term standard, as you mention, originates from 'military banner' which later evolved to mean weight,  measure: (from Etymonline)
Standard:

"weight, measure, or instrument by which the accuracy of others is determined," late 14c., from standard (n.1) "military standard, banner," a particular use in English of this word, but the sense evolution is "somewhat obscure" [OED]. The standard weights and measures were set by royal ordinance and were known as the king's standard, so perhaps metaphoric, the royal standard coming to stand for royal authority in matters like setting weights and measures. Hence the meaning "authoritative or recognized exemplar of quality or correctness" (late 15c.). Meaning "rule, principal or means of judgment" is from 1560s. That of "definite level of attainment" is attested from 1711 (as in standard of living, 1903.

BUT:
the expression   double standard appears to  have its origin in the concept of moral standard  ('expected' behaviour) around 1870, (from Wikipedia):
Double standard:

is the application of different sets of principles for similar situations. A double standard may take the form of an instance in which certain concepts (often, for example, a word, phrase, social norm, or rule) are perceived as acceptable to be applied by one group of people, but are considered unacceptable—taboo—when applied by another group.
The concept of a double standard has long been applied (as early as 1872) to the fact that different moral structures are often applied to men and women in society.

Reference:

"Unjust Judgments on Subjects of Morality". The Ecclesiastical Observer (London: Arthur Hall and Co.) XXV: 167–170. April 1, 1872.
Josephine E. Butler (Nov 27, 1886). "The Double Standard of Morality". Friends' Intelligencer and Journal (Philadelphia: Friends' Intelligencer Association). XLIII (48): 757–758.


Button Focus effect with inkscape

Question:

These two images are pause-buttons for a program. The first one shows the button in its default state and the second one when it is being focused on.
I am wondering how the person, who made these buttons, did the focus effect? I looked all over the Internet but couldn't find a tutorial or a hint on how to do something like that.
I recreated the first button with Inkscape. It has a background layer (the gray background as seen in the first picture ) and a button layer which contains the pause symbol (just two rectangles). But now I am clueless on how to proceed.
I hope I am in the right place with my question. Also if this is somehow not possible with Inkscape, I can only use Gimp. I have no photoshop :(
Comment: http://ionflux.org/en/inkscape_glow_tutorial_01.html
Comment: @Ryan Thanks, looks like it will help. I will check it out.
Answer: For the round glow effect, use a radial gradient. You can do that in the fill and stroke area by clicking the circle.
The glow of the actual pause sign can be achieved using a blue box below the pause shaped the same. You assign a light blue to it and blurring int a bit. If you want the glow not to start directly at the border of the pause sign but with a small gap, you can add a border to the pause sign in the same color as the background.

Button Focus effect with inkscape


Remote Halogen Light Dimmer switch

Question: A 2-in-1 ceiling fan and halogen bulb remote switch has stopped operating the light bulb (either on/off or dimmer) but still operates the fan properly.
Any ideas?
Answer: If like the one we have the light is remote controlled from a small keypad or rotary control.
This operates either wirelessly or wired. The actual dimming is done in the housing where the lamp and fan motor are located. The solid state device that does the dimming has failed. Why? The light that was in the fan....you did replace it didn't you ? probably became a short circuit when the filament failed like tungsten lamps do. This short caused more current in the control device can handle so it became a fuse and failed. This is seldom a user replaceable part. You can obtain a replacement control module.
You'll need the manufacturers name and model number.  Do a web search for Fan Parts. If the site you find listing the fan model included photos find the comparable control be appearance. There is a good chance thats the one you need. You will find the price to be about $40.
If you aren't comfortable with tools or wiring or standing on a ladder ask the dealer to reccomend a repair person.
If the control IS NOT wireless it might be a module mounted the wall switch box and that's a pretty easy fix and less exspensive. Be safe and call an electrician rather than risk fire or electrocution.

Remote Halogen Light Dimmer switch


python code not running right, same thing in java does

Question: I was trying to solve Project Euler problem 10 using python, but my program gave a wrong result. Since I am a complete noob to python and I could not find any fault in my (apparently brute-force) logic, I wrote a program in java (almost translated it), and it gave a different result, which turned out to be right.
Here is the python code:
from math import *

limit = 2000000

def isPrime(number):
    if number == 2: return 1
    elif number % 2 == 0: return 0
    elif number == 3: return 1
    elif number == 5: return 1
    elif number == 7: return 1
    else:
        rootOfNumber = sqrt(number)
        tag = 3
        while tag < rootOfNumber:
            if number % tag != 0:
                tag += 2
            else:
                break           ###
        if tag >= rootOfNumber: ###EDIT: it should by only tag > rootOfNumber here
            return 1            ###       Thats what the problem was.
        else:
            return 0

sum = 2 # 2 is an even prime, something we are not iterating for
for i in range(3, limit, 2):
    if isPrime(i) == 1:
        sum += i

print(sum)
print('done...')

The equivalent java code is:
public class Prob10{
static int limit = 2000000;
static long sum = 2L; // 2 is an even prime, something we are not iterating for

public static void main (String[] args) {
    for(int i = 3; i < limit; i+=2) {
    if( isPrime(i) )
        sum += i;
    }
    System.out.println(sum);
}

private static boolean isPrime (int number) {
    if (number == 2) return true;
    else if (number == 3 || number == 5 || number == 7) return true;
    else {
        double rootOfNumber = Math.sqrt(number);
        int tag = 3;
        while (tag < rootOfNumber) {
            if (number % tag != 0)
                tag +=2;
            else
                break;
        }
        if (tag > rootOfNumber)
            return true;
        else
            return false;
    }
}

}

I think I am doing some silly mistake or missing some subtle point.
p.s. I know my isPrime implementation is not too good. I am not printing the outputs because it may spoil the problem for others.
Any comments about (bad) style in the python program are welcome.
Comment: Some comments about the Python code: 1) Don't use 1 or 0 as makeshift bool values, use True and False instead. 2) Relatedly, use checks in the form of `if func()` instead of `if func() == 1)`. 3) Use a `l = [2, 3, 5, 7 ...]` and then `if number not in l` for checking for known values in a simpler way. That also gives you the benefit you can add other known primes to the list dinamically should the need arise, making some algorithms that may use isPrime (there are a lot of these in Euler) faster.
Comment: Can you please write what was the output you were looking for and what result you got?
Comment: @Jack_of_All_Trades The output should have been 142913828922, but the python output is 143042032103
Answer: Try running with your code for example isPrime(49). You should figure out your problem from there. You have replaced a > with a >= in if (tag > rootOfNumber)
.Also as some coding style, you could just replace the first lines with:
if i in (2, 3, 5, 7): return 1
elif number % 2 == 0: return 0
else:
    ......

Comment: +1: (As told by you) turns out I was not considering perfect squares, and ***on top of that*** I have used `>` in the java version and `>=` in python version. My bad.
Answer: After a quick skim it appears to me that this line in the Python version is superfluous and it might be the cause of the problem:
elif number % 2 == 0: return 0

Comment: I commented the line and ran the program, but the output is same. I don't think this line is changing anything in the wrong way.
Answer: Why don't you return False for return value of 0? That would make it more simple.
Comment: +1: I will from now on. Right now, I was more focused on **just** getting the right result.


Blank space inserted at end of sentence

Question: We need to limit the content in Tridion to 160 characters. We don't have a period at the end of the second sentence which puts our content at exactly 160 characters. However, Tridion is inserting a blank space at the end of the second sentence. How can we remove this space?
Comment: Can you elaborate on the requirement? Why is the limitation there? Must it apply to the content itself or to what is published?
Comment: Hi Lorraine and welcome to Tridion Stack Exchange. More information could help the community offer better solutions. If I had the issue, I'd use backspace, shift + arrow keys, or the source tab to find any extra spaces in the Component field. If that didn't work, I'd have IT or your developers fix the issue since you're following the instructions provided.
Answer: I decided to try to give you a generic answer to your generic question. Not because of giving a solution to a problem, but to try to explain where change in content can happen.
Generally, mismatch can happen at 3 stages:

during saving of the component
during publishing (rendering) of the component
during presenting (querying) of content

Related to first case, if you enter one string, and another is saved, then this can be caused either by XSLT which edits (formats) your content pre-save, or by some event system which also edits component during save. You should take a look at both.
Related to second case, there is option that your content is not rendered properly. It is possible that your output during rendering is having blank space if you for example missed it in dwt, or in JSON or XML output, depending on your concrete implementation. For this to fix, you should compare content in saved component to an output and make sure that whats in component is shown as a result of templating.
Third case happens when you have published correct output as a result of component presentation, but on your website it's presented faultily. It can happen for example if you use DXA, have a correct model, but your view has an extra space somewhere. For you to debug this, you need to check what's published in broker database, filesystem or somewhere else to what's presented on website.
In any case, debugging these issues is kind of where the fun of working with Tridion lies. Based on the info which you provided, where you stated that you have a constrain where its not possible to add more that 160 chars in some text field, it looks to me like you have an event system which is not working correctly, or some custom XSLT, so please start from there.

Blank space inserted at end of sentence


Ice cream technique - what should I mix into what?

Question: I have a homemade non-dairy ice cream recipe that involves a snow of egg whites and sugars, whip, and the egg yolks. At this point, the recipe says "mix together slowly with yolks". In which order should I mix the 3 components? I assume that I should be folding the egg whites into the whip... What is the "correct" way to do this? (That will ensure that the yolks don't sink to the bottom in the freezer :) )
Comment: When you say whip what do you mean? Cool whip?
Comment: @GdB- Miracle whip.
Comment: What does it say right before that step? "mix together slowly with yolks" implies that it just said what you should be mixing with the yolks.
Comment: Most ice cream recipes call for only egg yolks. In my experience including the whites results in very strange freezing. I've ended up with solid blocks of frozen flavored milk by including whites. That said, it looks like some recipes on the internet do use the whole egg.
Comment: @gdb - richwhip that has been whipped :)
Comment: @jefromi - it was a recipe that was copied down in a rush. It's not so correct. I was just wondering what would be the best technique
Answer: I usually beat two whole eggs with an electric mixer and then slowly mix the sugar into the eggs before adding the cream, milk, and flavoring. I've never had a problem with the egg whites that way. In your case I'd do the same but treat the beaten egg whites and Rich Whip as the "additional dairy" to be added after the egg yolks and sugar are slowly mixed together.
I've never actually tried whipping egg whites for an ice cream recipe -- my guess is that any air it contributed would be immediately removed once the ice cream machine started turning. It's the ice cream machine's job to incorporate air into the mix anyway. But it might be worth a try.


Cell with no form using NotebookWrite

Question: Is there a way to create a cell with no form? Usually a cell is either an input cell or an output cell, for example if you do NotebookWrite[InputNotebook, "test"] and hit Ctrl+E, the cell is in the input form Cell["test", "Input"]. However, if you do CreateDocument["test"], there is no form related to the cell, i.e., Cell["test"].
Is there a way to create a cell with no form using NotebookWrite[]?
Comment: Is `NotebookWrite[EvaluationNotebook[], Cell["test"]]` or `CellPrint[Cell["test"]]` what you are after?
Comment: `NotebookWrite` works in this case, thank you. I am actually trying to manipulate the notebook from a palette, using `CellPrint` always prints the cell in the message box instead of the `InputNotebook[]`
Answer: When you evaluate CreateDocument["test"] you get a new notebook with a single text cell whose content is "test".
I believe you would get the same result with
nb = CreateDocument[];
NotebookWrite[nb, Cell["test"]]

The second argument to NotebookWrite is the "data" you want to write to nb. If you specify that you want a text cell, then that's what you'll get.  As the documentation states, if you provide some data that is not a Cell construct, and one is needed, then it will wrap the data in a Cell construct.
Comment: @albert-retey: The difference is the style of the text cell.  Both `Cell["test"]` and `Cell["test", "Text"]` are text cells, but the latter has a named style.
Comment: There is a difference between a `Cell` with no assigned style as the OP wants (for what reason?) and a `"Text"` cell, which you might make clearer in your answer. You can easily see that with `NotebookWrite[nb,Cell["test"]]` vs. `NotebookWrite[nb,Cell["test","Text"]]`. What these two cases look like depends on the active stylesheet, of course...
Comment: yes, my porposal was that you explain in your answer what exactly it is that you refer to with "text cell". I **guess** you call a "text cell" one that has a string or `TextData` as content as opposed to an expression cell which has `BoxData` as content, which -- as you mentioned -- hasn't anything to do with its style, which can be "Text" or not. It probably also is worth mentioning that some functions (e.g. `CellPrint` and `NotebookWrite`) expect low level `Cell` expression as arguments while others (like `CreateDocument`) accept higher level stuff like `TextCell`...
Comment: @AlbertRetey I wanted this because of the alignment issues actually. The cells generated by `NotebookWrite[]` does not line up with other cells given by `CreateDocument[]`, and when I looked at the cell structure, the only difference is that the cells given by `CreateDocument[]` does not have a style
Answer: There are two things that I think need to be distinguished to understand the different behavior of NotebookWrite[InputNotebook[], "test"] and CreateDocument["test"]:
Cell Representation
There are two levels of abstraction for expressions representing cells in Mathematica. The older lower level representation is what NotebookWrite and e.g. the notebook option DockedCells expect exclusively. That are expressions with head Cell which need either a string, a TextData or a BoxData expression as first argument, the style of the cell as second and as many cell-options as you want after that. If you want the cell to show 2d-formatted content, you have to supply the corresponding boxes wrapped in BoxData as the first argument. It seems common to refer to cells which have a string or TextData in the first argument as text cells while cells which have a box-formatted expression wrapped in BoxData are refered to as expression cells.
There is also a newer form of cell-reperesentation, namely TextCell and ExpressionCell and they are very similar to Cell but make explicit what their content is meant to be and do some automatic conversion of the first argument if and when necessary. It might be of interest that if not just given a string as first argument, TextCell still creates an expression cell. Some functions as CellPrint and CreateDocument will accept these in their arguments (as well as the lower level Cell) and at some point they are  automatically converted to the corresponding lower level Cell expressions that you see in the frontend when e.g. hitting Ctrl+Shift+E.
Most functions which accept cells in their input do some automatical conversions to cells when they find just strings, and obviously what NotebookWrite does is in that case is different than what CreateDocument does. If you want the two to create the same thing, then you should -- as others have suggested -- explicitly tell them what you want and use a specific cell expression instead of just a string.
Cell Styles
Independent of their content (text cell containing string vs. expression cell containing boxes) there are the cell styles which control how a cell will look and behave. I honestly don't know what exactly the documented behavior is for cells with no style given, so to some extent I think one is asking for some arbitrariness if one creates such cells.  The look and behavior of a cell is controlled by the stylesheet of the notebook in which the cell lives. So by explicitly stating which style the cells you generate should be will make them look alike and e.g. their content should be nicely aligned.
But you can overwrite every setting that affects a cell through its style by explicitly setting options for the corresponding cell. That is what happens if you use the Cell or Format menus of the frontend to manipulate a selecte cell but can just as well done programmatically. Making use of that you can create cells which will show their content nicely aligned even if they have different (or no) styles defined, e.g.:
cellmargins = {{10, Inherited}, {Inherited, Inherited}};
nb = CreateDocument[Cell["line 1", "Section", CellMargins -> cellmargins]];
SelectionMove[nb, After, Notebook];
NotebookWrite[nb, Cell["line 2", CellMargins -> cellmargins]];
NotebookWrite[nb, Cell["line 3", "Text", CellMargins -> cellmargins]]

the above does set the left cell margins of all cells to 10, which will overwrite the settings for their corresponding style. Of course you could use the same mechanism to make content of cells with the same style not be aligned. You might have noticed the usage of Inherited for the other alignment values which will leave those at the style-specific settings. You could even do such an alignment a-posteriori once the content of a notebook has been created in any way. The following will enforce larger left margins in the notebook that just has been generated:
SelectionMove[nb, All, Notebook];
SetOptions[NotebookSelection[nb],
 CellMargins -> {{50, Inherited}, {Inherited, Inherited}}]

Comment: I think it's worth noting that `Paste[…]` seems to accomplish the same thing as `NotebookWrite[EvaluationNotebook,…]`, except that `Paste` can handle the higher-level constructs like `EvaluationCell`. When I discovered that, it saved me a *lot* of grief.

Cell with no form using NotebookWrite


Angular: Filtering content of a table with a search input and specific filter options

Question: This is what I'm working on right now. I have a datatable with some options to filter his content:

The HTML component:

Thief: The Dark Project

There are {{fanmissions.length}} available Fan Missions. The last released is Veniam in Sunt Pariatur and the last updated is Ullamco Ad in Elit.

    <form>

        <input class="form-control" [(ngModel)]="searchinput" name="searchinput" placeholder="Search a Fan Mission..." type="text">

    </form>

      <button type="button" class="btn btn-secondary" data-game-short="tdp">Thief: The Dark Project</button>
      <button type="button" class="btn btn-secondary" data-game-short="tg">Thief Gold</button>
      <button type="button" class="btn btn-secondary" data-game-short="tma">Thief II: The Metal Age</button>

          #
          Fan Mission
          Game
          Version
          NewDark
          First release
          Last update

          {{fanmission.index}}

            {{fanmission.details.author.join(', ')}}

            {{fanmission.name}}

          {{fanmission.details.game.short}}
          {{fanmission.details.version}}

          <ng-template #newdarknotrequired>	</ng-template>
          {{fanmission.details.firstreleasedate | date:'yyyy/MM/dd'}}
          {{fanmission.details.lastupdatedate | date:'yyyy/MM/dd'}}

What I have to do:

Filter items writing a value in the search input. The filter has to be able to filter by ID (fanmission.index):number, Name (fanmission.name):string, Author (fanmission.details.author):string[], Game abbr (fanmission.details.game.short):string, Game fullname (fanmission.details.game.name):string, Version (fanmission.details.version):string, First release date (fanmission.details.firstreleasedate):Date and Last release date (fanmission.details.lastupdatedate):Date.
Filter items clicking on one of the three filter options. Thief: The Dark Project ("fanmission.details.game.short": "tdp"); Thief Gold ("fanmission.details.game.short": "tg") and Thief II: The Metal Age ("fanmission.details.game.short": "tma"). When I click on Thief: The Metal Age, only items which have TDP in Game column should be visible. Only ONE option can be active at once. When I click on an active option, it has to be inactive and stop to filter the datatable.
Big heading at the top have to change and take the fullname of the game when one of the three filter options (buttons) is active. When I click on one of the these buttons (ex. Thief: The Dark Project), the items are filtered by game fullname and the big heading shows the game fullname (Thief: The Dark Project).
The paragraph below the big heading (game/filter title) have to be updated when using filter options. When I don't use any filter, the paragraph has to return the total amount of items in my database, the last published (this one which has the most recent date) and the last updated (this one which has the most last update date). When I search an item (search input), the amount of available itmes have to be present in this paragraph. The latest updated and the first item visible also have to be indicated in the paragraph with his respective name.
Each table head order the datatable content ASC/DESC. When I click on one of the the head columns, this one has to order the items present in the database ASC/DESC.
When there is no result searching by specific word (search input) the table has to indicate : No result found.

I need to create custom Pipes and apply them to my ectm-list.component.
Please, consider to see my project on GitHub in order to have an idea how it is structured: http://www.github.com/jonathanlinat/enhanced-cheapthiefmissions/
Can someone help me to achieve this big task?

1. Filter items writing a value in the search input
At this moment, I can only filter by NAME. This is my Pipe:
@Pipe({
  name: 'EctmFilterFMsBySearch'
})
export class EctmFilterFMsBySearchPipe implements PipeTransform {

  transform(value: any, arg: any): any {
    if (value != null && arg != null) {
      var filteredfanmissions = value.filter((fanmission) => fanmission.name.search(new RegExp(arg, "i")) >= 0);
      if (filteredfanmissions != 0) {
        return filteredfanmissions;
      }
    } else {
      return value;
    }
  }

}

As you can see here...
value.filter((fanmission) => fanmission.name.search(new RegExp(arg, "i")) >= 0);

...I need to change fanmission.name by applying the listed ones at the top of my post. How can I achieve that? Do I need to use a loop?
Comment: Start by reading this: https://angular.io/docs/ts/latest/guide/pipes.html#!#no-filter-pipe. Then consider **not** using pipes to implement this.
Comment: @JB Ok.. so, what do I have to do exactly if I can't use pipes? Can you give me a concrete example how to achieve what I'm looking for? I watch many Angular tutorials on Youtube and devs use this kind of approach to filter content.
Comment: You could use a service oriented structure, updated url: https://angular.io/guide/pipes#appendix-no-filterpipe-or-orderbypipe
Answer: I faced the same scenario in developing one of my application, i dont prefer using filter as a pipe. Rather you can use it as a service and pass in the column name and the input text as a variables to the function. Then you can return fanmission."column name i.e name/id".search(new RegExp(arg, "i")) >= 0)


What is the minimum size conduit/mast required for a 100 amp overhead service?

Question: What is the minimum size conduit/mast required for a 100 amp single phase 240 volt overhead electrical service?
Answer: Although you're probably safe by using the NEC as a minimum, this is going to vary somewhat based on jurisdiction and power company. You should contact your local inspection authority and your power company.
Answer: Service mast size will be specified by the local utility, though 2" rigid metal conduit is common. National Electrical Code (NEC) only has this to say...

National Electrical Code 2011
Article 230 Services
Overhead Service-Drop Conductors
230.28 Service Masts as Supports. Where a service mast is used for the support of service-drop conductors, it shall be of adequate strength or be supported by braces or guys to withstand safely the strain imposed by the service drop. Where raceway-type service masts are used, all raceway fittings shall be identified for use with service masts. Only power service-drop conductors shall be permitted to be attached to a service mast.

The local utility will not connect service conductors to a service point that does not meet their standards, so only they can tell you what they expect.


Multithreading for a mixed-genre game in Python?

Question: So here's the situation.  I'm making a game that mixes two genres; arcade shooter and puzzler.  They don't intertwine TOO much; all the interaction that really goes on is that every time an enemy is destroyed, a block is created.   The blocks aren't even a part of the main collision detection system; they have their own more suited to their needs.  What I want to ask is this; might it be a good idea to have the arcade shooter portion run on one thread, and the puzzle game portion run on another?
Answer: Probably not, unless you want to create extra work for yourself.
Threading is an optimization, which adds significant complexity to the program, and if you don't move the right thing on to another thread it won't even add much performance. The only way to know what the right thing to optimize is, is to use a profiler.
If you do want to use threads to improve performance a task based approach is what I'd recommend.
For example, let's say that for example once you've finished writing the game you find that the arcade game code takes 20ms / frame, and the puzzle game code takes 2ms / frame. That gives a total frame time of 22ms. In that case at best moving the puzzle game to another thread saves you 10% of the frame time. However if you could split the arcade game across two threads that could gain you up to 10ms.
The task based approach has the potential for even better performance, because it can easily scale to more than two threads.
It's also worth noting that games are generally not easy to split across multiple threads, and there's much better ways to optimize Python code than using threads - for example rewriting the expensive parts of the code in a lower level language like C/C++ can give huge gains.
Comment: Would you mind elaborating on that?
Comment: I've added some more detail, is that clearer now?
Comment: Yes, much more so.  Perhaps I'll come back to this issue when I actually write a game in C++.  Thanks!
Answer: In addition to what Adam has already said in his answer (and especially the second paragraph), it's worth noting that Python does not scale well with threads at all, because there is a global lock shared across all Python threads so that only one can run at a time, except under certain conditions. So the answer to any question like "Multithreading for XYZ in Python?" is almost always 'No'.
I'll add one thing - multithreading can indeed be used as a way to improve code organisation. But this is almost exclusively to allow a linear process to run in parallel with other processes that don't share many resources. Your situation doesn't seem to resemble this in that neither process is linear, and that you are likely to have many shared resources (eg. screen, input devices, sound system). As such it is probably better to go with the usual time-sliced approach.
Comment: OK, so red light for gameplay.  A simple addendum; I'm going to add online high scores, and I was wondering if multithreading might be a good idea for that.  One thread could be used to play an animation or handle input or something, and the other would be used to actually try to retrieve the scores.  I'm using a high-level platform to get the scores (i.e. I'm playing with HTTP and JSON, not sockets).  What about that?
Comment: You could put a slow network operation like that in another thread, if the API is suited to that. Whether you actually get any benefit from it will depend a bit on how it's implemented.
Comment: Mind elaborating on that?  (Bear in mind I have very little Web/network programming background.)
Comment: If the networking API expects to pause while it makes the connection, then that would hold up your program and is a good candidate for a separate thread. However, most people who make network APIs don't want to force people to add threads, so they usually include some other way that avoids the pause - in which case, you shouldn't add threads into the mix and complicate matters.
Answer: First: Threads and processes are different on different platforms, and there is an advantage to using processes on Linux and a disadvantage on Windows.  So your intended platform may drive which one you should use.
The general rule of thumb is that if you are hardware-bound, you should split blocking tasks off into their own thread.  If you are computation-bound, you should split high computation tasks off into their own process.
Second: Adding concurrent processes of any sort adds complexity because you are inherently creating an asynchronous condition that requires synchronization.  In other words, you must share data and time across the various tasks.  Unfortunately, the programmer must explicitly identify and create a design for these tasks to communicate with each other.
Third: Testing and especially debugging becomes much harder because the tasks run independently of each other and obtaining state information for each task and the system itself is much more complex.  This often means that you must increase your verbosity for logging and traces.
The general consensus is that you should not optimize your code too early.  In other words, design your code as modular as possible, but do not add the extra complexity of threading until you realize that you must.


Cartoon where monsters are captured by wrist devices, turned into orbs, merged, and used for battle

Question: It's a show where they use wrist things that launch 3 pronged claws from their wrist area to capture and when captured the monster turn into orbs. They merge them and send them to battle. The MC worked for a battle team were he was being bullied and then a evil org manifest to merge 3 monsters into one.
Comment: Hi, welcome to the site. Is this an animated show? And in roughly which year did you watch it? Also, what do you mean by an "evil org?" An evil organisation?
Comment: Maybe but relevant, but https://scifi.stackexchange.com/q/198036/23243 has monsters captured into orbs on the wrist. Suggested (but disputed) answer of *Bakugan*.
Answer: This is almost definitely Battleclaw. Wrist launchers that shoot a claw. Combining caught creatures(in this case they make dual affinity or triple affinity later).
From TVTropes:

Battleclaw is the story of a boy named Tyee (Pronounced "Tie-yee") who aspires to Be The Very Best at the eponymous Battleclaw, a sport that involves catching colorful creatures called Jinlins using an Energy Grappler and then Combining them into one, dual-attribute monster who then does battle with other Battleclaw players.
After his uncle reneges on his promise to let him join his own team, Tyee winds up with a Ragtag Bunch of Misfits called Team Gogo after pulling a Legendary Battleclaw from a stone.
Tyee had better hone his skills, because the Battleclaw of the Ancient Fire Lord Mo Yan recently fell into the hands of his uncle, and the Ghost of Mo-Yan demands the power of the Jinlins in order to regain his former power! It's up to Tyee and the rest of Team Gogo to stop Mo Yan from returning to life!
Answer: From your description, my 18 year old son believes it to Digimon:
A group of young teens is unexpectedly sent to the mysterious Digital World and paired up with their own powerful, morphing monster called the Digimon. Together the entire group set out on an adventure to fight evil and save the world.
Comment: Capturing creatures and then battling with them in a quest to save the world is a collection of very common tropes. Can you address the *specifics* here (orbs, combining creatures, three tentacles capturing the monsters, etc)?
Comment: Also, when quoting a text from another site, please provide a link to the relevant web page, and type `>` before the first word in each quoted paragraph, so that it'll be highlighted as a quote.


Is instantiation of properties causal?

Question: Strange question here but can an object instantiating a property be a cause of it instantiating another different property? For example; I instantiate the property of being hairy and warm blooded which causes me to instantiate the property of being a mammal (or something like this).
Comment: Your example involves a relationship that is analytic and therefore not caused. How about this example? The property that my stomach is empty is the cause for the property that I am hungry.
Comment: On the [standard theories of causation](https://plato.stanford.edu/entries/causation-metaphysics/index.html#TokeCaus), it is events that are causal relata rather than properties. However, there are theories that make substances (agent causation) and/or their properties into such relata, e.g. Shoemaker's, see his [Causality and Properties](https://link.springer.com/chapter/10.1007/978-94-017-3528-5_7):"*What makes a property the property it is, what determines its identity, is its potential for contributing to the causal powers of the things that have it.*"
Comment: @DavidGudeman Yes like that, is that even valid? The properties themselves can't be causal because they are abstract, and the instantiation relation is also abstract. So it cannot be causal?
Comment: Since it's a strange question, perhaps you could explain more about what prompted you to ask? What is at stake in this issue? Also, I don't think that being hungry or having an empty stomach are abstract, they seem pretty concrete to me.
Answer: The word 'cause' has a number of meanings. One refers to a physical process through which an effect is produced. In physics and philosophy the word 'causal' is typically used to refer to such processes- they are distinguished by having a temporal aspect, with the cause preceding the effect. Cause can also be used to refer to reasons and logical relationships more generally, regardless of whether there was a physical process with an outcome.
You seem to be conflating those two uses of the word 'cause' in asking whether being warm and hairy 'causes' you to be a mammal. The answer is clearly no in the first sense of the word cause that I outlined above.
If I have five apples and I give one away, I cause the number of apples to become four, even and a square. My physical action has three logical consequences. You could if you like consider the number being four to be the 'cause' of it also being even and being a square, but you would be using the word 'cause' in quite a different sense.
Answer: YES, for at least two reasons:

If the property is provided by an analytic predicate (cannot be a synthetic predicate: it would be unrelated information), like "John is a bachelor", then such definition causes John to be not married. For example: if John is a bachelor (cause), then, he's married (consequence).

For Hume, causality is the habit of constant conjunction; so, if you get the habit of listening that all A's are B's and all B's are C's, then you assume that any A becoming B (cause) is then (consequence) a C. For example: since I know that A is B, then, I know that A is C.

But also, NO, for at least one reason:

Properties do not cause effects: is its usage that produce effects. the statement "A is B" has no relationship whatsoever with C until is rationally (by Reason) interpreted using Logic (the rules Reason follows). Only when reason starts it's logical process, the observer can deduce "then, A is C".
Answer: Generally no. As others have mentioned, it can be argued you are conflating physical causality with metaphysical necessity. If I mist and blow water into the atmosphere on a cold day on a mountain for skiing, I can cause snow to form. I might even say that I caused the mountain to appear white. But what is awkward is to say that I caused the snow to appear white. Whiteness as a qualia seems inextricably bound to the being of snow in a way that water being snow is not. It should be noted that there is a quasi-causal position however. From metaphysical explanation (SEP):

That metaphysical explanation is like causal explanation is a view with quite a few proponents today (though see Taylor 2018 for some problem cases for this view). Mostly those who think it is, also think that all or most metaphysical explanations track or are grounding relations (see §3 above). According to these philosophers, more precisely, metaphysical explanation is like causal explanation because grounding is like causation (Fine 2012; Schaffer 2016, 2017; A. Wilson 2018). In what sense grounding is like causation varies among proponents of this view. According to Schaffer, grounding and causation, although similar (because both species of the kind directed determination relation), are distinct. According to Wilson, grounding and what he calls "nomic causation" are both kinds of causation (although of a rather different sort than ordinary causation; see §2). On both accounts, metaphysical and causal explanation are alike because grounding and causation resemble each other. One might however think that metaphysical explanation is like causal explanation simply because the relations those explanations track play the same role vis-a-vis explanation.

So strictly speaking, it is not indefensible to see metaphysical necessity in causal terms as long as one is careful about drawing a distinction with actual physical causliaty.

Is instantiation of properties causal?


Pros and cons of using storyboards

Question: I am planning to learn to develop applications using Story Boards. Can anyone please post some advantages and disadvantages while using StoryBoards?
Comment: What i meant to ask was if its really necessary to use Story Boards or  are there any cons in using this..
Answer: When to use Storyboard and when to use XIBs
What are the benefits of using Storyboards instead of xib files in iOS programming?
iphone-sdk-development
I think these links are helpful and related to your question. Personally, I believe storyboards are better then nibs because they eliminate the need to code your transitions between views (unless you use custom transition with CA), and they have all the capabilities of nib files too.
Hope this helped.
-----------EDIT-----------
Here are some more links I found:
This one speaks about some of the cons of using storyboards.
UIStoryboard on iOS 5: The Good, The Bad, and the 'This Plain Sucks'
This one is mostly about the benefits.
What are the advantages of iOS 5.0 storyboarding over traditional UI layout?
Answer: It's mostly cons. Don't use Storyboards. Here's is a list of their problems, copied from iraycd:

Storyboards fail at runtime, not at compile time: You have a typo in a segue name or connected it wrong in your storyboard? It will blow up at runtime. You use a custom UIViewController subclass that doesn't exist anymore in your storyboard? It will blow up at runtime. If you do such things in code, you will catch them early on, during compile time. Update: My new tool StoryboardLint mostly solves this problem.
Storyboards get confusing fast: As your project grows, your storyboard gets increasingly more difficult to navigate. Also, if multiple view controllers have multiple segues to multiple other view controllers, your storyboard quickly starts to look like a bowl of spaghetti and you'll find yourself zooming in and out and scrolling all over the place to find the view controller you are looking for and to find out what segue points where. Update: This problem can mostly be solved by splitting your Storyboard up into multiple Storyboards, as described in this article by Pilky and this article by Robert Brown.
Storyboards make working in a team harder: Because you usually only have one huge storyboard file for your project, having multiple developers regularly making changes to that one file can be a headache: Changes need to be merged and conflicts resolved. When a conflict occurs, it is hard to tell how to resolve it: Xcode generates the storyboard XML file and it was not really designed with the goal in mind that a human would  have to read, let alone edit it.
Storyboards make code reviews hard or nearly impossible: Peer code reviews are a great thing to do on your team. However, when you make changes to a storyboard, it is almost impossible to review these changes with a different developer. All you can pull up is a diff of a huge XML file. Deciphering what really changed and if those changes are correct or if they broke something is really hard.
Storyboards hinder code reuse: In my iOS projects, I usually create a class that contains all the colors and fonts and margins and insets that I use throughout the app to give it a consistent look and feel: It's a one line change if I have to adjust any of those values for the whole app. If you set such values in the storyboard, you duplicate them and will need to find every single occurrence when you want to change them. Chances are high that you miss one, because there's no search and replace in storyboards.
Storyboards make you do everything twice: Are you building a universal app that runs both on iPad and on iPhone? When you use storyboards, you will usually have one storyboard for the iPad version and one for the iPhone version. Keeping both in sync requires you to do every UI or app-workflow change in two places. Yay. Update: In iOS 8 and Xcode 6, you can use a single Storyboard for iPhone and iPad.
Storyboards require constant context switches: I find myself working and navigating much faster in code than in storyboards. When your app uses storyboards, you constantly switch your context: "Oh, I want a tap on this table view cell to load a different view controller. I now have to open up the storyboard, find the right view controller, create a new segue to the other view controller (that I also have to find), give the segue a name, remember that name (I can't use constants or variables in storyboards), switch back to code and hope I don't mistype the name of that segue for my prepareForSegue method. How I wish I could just type those 3 lines of code right here where I am!" No, it's not fun. Switching between code and storyboard (and between keyboard and mouse) gets old fast and slows you down.
Storyboards are hard to refactor: When you refactor your code, you have to make sure it still matches what your storyboard expects. When you move things around in your storyboard, you will only find out at runtime if it still works with your code. It feels to me as if I have to keep two worlds in sync. It feels brittle and discourages change in my humble opinion.
Storyboards are not searchable: A project-wide search in Xcode is not really a project-wide search when you use storyboards. They are not included in the search. So when you remove a custom class from your code or rename it, you will have to manually go through the storyboard or look at its raw XML to make sure it is on par with your code changes. No sir, I don't like it. Update: Storyboards are searchable in Xcode 6.
Storyboards are less flexible: In code, you can basically do anything you want! With storyboards you are limited to a subset of what you can do in code. Especially when you want to do some advanced things with animations and transitions you will find yourself "fighting the storyboard" to get it to work.
Storyboards don't let you change the type of special view controllers: You want to change a UITableViewController into a UICollectionViewController? Or into a plain UIViewController? Not possible in a Storyboard. You have to delete the old view controller and create a new one and re-connect all the segues. It's much easier to do such a change in code.
Storyboards add two extra liabilities to your project: (1) The Storyboard Editor tool that generates the storyboard XML and (2) the runtime component that parses the XML and creates UI and controller objects from it. Both parts can have bugs that you can't fix.
Storyboards don't allow you to add a subview to a UIImageView: Who knows why.
Storyboards don't allow you to enable Auto Layout for individual View(-Controller)s:  By checking/unchecking the Auto Layout option in a Storyboard, the change is applied to ALL controllers in the Storyboard. (Thanks to Sava Mazăre for this point!)
Storyboards have a higher risk of breaking backwards compatibility: Xcode sometimes changes the Storyboard file format and doesn't guarantee in any way that you will be able to open Storyboard files that you create today a few years or even months from now. (Thanks to thoughtadvances for this point. See the original comment)
It's McDonald's: To say it in Steve Jobs' words about Microsoft: It's McDonald's (video)!

Pros and cons of using storyboards


Can Someone Walk Me Through How to Playback Midi files from 3.5 disk on Casio Celviano AL-100 R

Question: I have the above captioned digital piano.  I would like to play back midi files from the computer on the piano.  How do I do this?
Comment: I'm sure this would be e better question for Casio's customer support site.
Answer: you hook up a midi cable from pc's midiout to keyboard's midiin (or usb cable if that's how your keyboard connects midi) and use "midi sequencer" software.  also called "digital audio workstation" (DAW) software.  Which one?  That is a decision you need to research cuz there are tons and tons of em.  And nobody will want to help you including me :(
But it's no different for that keyboard than any other keyboard.  Well there are differences in control changes and sounds.  But any sequencer or daw software will do that.
Good luck :)
Oh just saw the 3.5" disk thing.  Unless the keyboard has a disk drive for em, you're gonna have to get the midi files off of that archaic format onto your PC.  If it DOES have a disk drive, you're gonna have to go to the manufacturer's website, download the manual, and read for days until you figure it out.  Again, nobody will want to help you with that including me :)
Sorry, but that's life...


Zfs on centos, can't create files?

Question: I'm running centos7... have 4 x 3tb hdd's, so I installed zfs as it looks like the best solution. I installed and setup via root, but the local user can't seem to write files / folders. And google won't yield any results as to why it wouldn't let different users have write permissions?
So my question is, how can I give the local user permission to write files on the pool?
Comment: You need to provide more information. Show some file permissions, paths and errors. Please update you question with adequate information.
Answer: It's the same as any other mountable filesystem.  If you want users to be able to write to it then either chown/chgrp/chmod the mountpoint (after it has been mounted).
Better yet, create a subdirectory and give them write access to that.
Or, since this is ZFS, create them a zfs filesystem instead of just a sub-directory and grant access to that rather than to the entire pool.
e.g. if your zpool is called 'tank', you might do something like this:
<code>zfs create tank/data
chgrp users /tank/data
chmod g+rwsx /tank/data
</code>
That will give all members of group 'users' read, write, and execute permissions on that directory.  the setgid bit will makes sure that all files & subdirectories created below /tank/data will be group 'users'.
If you want a more specific or detailed answer than that, you'll have to provide more information.
Comment: Thanx for the reply, I was away from my machine at the weekend - so I was googling the hell out of it with no avail... I'm a noob to linux as I setup a server for fileshares etc but have never dealt with groups etc. The owner and group for the file system is root, I changed the user group and added the permissions but still can't touch a file from the clip as user (not root). Does selinux get in the way of this at all or do I need to change the owner to the user as opposed to root?
Comment: impossible to say what the problem is without more information.  please edit your question and paste the text ([NOT an image](https://unix.meta.stackexchange.com/questions/4086/psa-please-dont-post-images-of-text)) of your terminal session, showing at least the output of `ls -ld /path/to/your/zfs-filesystem` (or `stat ...` instead of `ls -ld ...`) and what happens when you try to write to or create a file.   the output of, e.g., `zfs get all tank/data` may also be useful.

Zfs on centos, can't create files?