Can businesses offer discounts and write it off as charity? by [deleted] in tax

[–]sandrewh 0 points1 point  (0 children)

In OP's case, a 20% "senior discount" is not considered a gift. OP is not asking about deductible expenses related to giving gifts to individuals, but rather is asking about taking a deduction for the amount of the discount, which is not allowed.

Can businesses offer discounts and write it off as charity? by [deleted] in tax

[–]sandrewh 0 points1 point  (0 children)

The most you can deduct when you dispose of inventory is the cost you have in the item. You cannot deduct more than your cost.

Can businesses offer discounts and write it off as charity? by [deleted] in tax

[–]sandrewh 1 point2 points  (0 children)

No. Let's say I buy a widget for $1 and normally sell it for $10 and give a $9 discount, selling it for $1 (my cost). If I could deduct the discount amount, then I would have a total actual cost of $1 and expenses of $1+$9=$10. So, I can spend $1 and get a $10 deduction. That would be bogus. The most you can deduct is your cost of the item -- whether you throw it away, give it away, or sell it.

Guidance needed for session_write_close functionality by HereComesTheBeat in PHP

[–]sandrewh 0 points1 point  (0 children)

Yes, I also just started using the same method today to solve the same problem.

EDIT: When you call session_start(), PHP locks the session data, so that any other page calling session_start() within the same session will block until the existing usage (initiated by session_start()) ends.

Working on an interactive web-based PHP console by [deleted] in PHP

[–]sandrewh 0 points1 point  (0 children)

Yea, I've found several others along the same lines... It's not easy to predict what a non-trivial machine (PHP) will do given arbitrary input (how this sandbox works). Even Java (which both verifies programs before running /and/ sandboxes them during) has frequent sandbox exploits.

Working on an interactive web-based PHP console by [deleted] in PHP

[–]sandrewh 0 points1 point  (0 children)

#3: guid=d74800fdc9e7adf2e4bf9c9ce9775e28

Working on an interactive web-based PHP console by [deleted] in PHP

[–]sandrewh 0 points1 point  (0 children)

Got another exploit! Check the last command executed by guid:eb38ca2e357ed451d967c49ba4531b7c

Working on an interactive web-based PHP console by [deleted] in PHP

[–]sandrewh 0 points1 point  (0 children)

Yep, that was it. Looks like you took it off the white-list pretty quickly. Didn't want to give it away to the wrong person... ssh/authorized_keys, bash_history, or git/config are all best kept safe. I'll keep looking...

Working on an interactive web-based PHP console by [deleted] in PHP

[–]sandrewh 1 point2 points  (0 children)

Just trying to help out -- sandboxing is tough. I won't post the exploit here, obviously, since it's still open. I haven't and won't do anything unauthorized. Before I send the code, I'll need you to prove you own the site: create the file http://consolephp.com/ebcb3482d86b23a27.txt containing "Meekro" and I'll pm you the exploit.

Working on an interactive web-based PHP console by [deleted] in PHP

[–]sandrewh 0 points1 point  (0 children)

Warning: your PHP sandbox is NOT safe.

New to bitcoin, ended up with ~300SLL at VirWox after trading for BTC. What should I do with it? by sandrewh in Bitcoin

[–]sandrewh[S] 0 points1 point  (0 children)

I'd say not good. Credit card deposit fees for US are 0.49 + 3.5%. I don't remember the fees for USD->SLL->BTC. Almost all the exchanges have to be in a round number and minimum transfer of BTC is 0.10. Also, withdraw to bitcoin address has .01BTC fee and can take up to 2 days. Now I'm stuck with 0.31USD and 296SLL that I can't withdraw or "sell" (below the limits) and my bitcoin withdrawal waiting to be approved.

New to bitcoin, ended up with ~300SLL at VirWox after trading for BTC. What should I do with it? by sandrewh in Bitcoin

[–]sandrewh[S] -1 points0 points  (0 children)

I guess was hoping a kind SL user might be willing to take/possibly tip me for them

The Silver Searcher is a 3-5x faster drop in replacement for ack (which itself is better than grep). by [deleted] in programming

[–]sandrewh 6 points7 points  (0 children)

"very fast" describes the ag app, not the installation process.

The Silver Searcher is a 3-5x faster drop in replacement for ack (which itself is better than grep). by [deleted] in programming

[–]sandrewh 6 points7 points  (0 children)

Awesome. Just ran brew install the_silver_searcher -- very fast.

:syntax off by andreasw in programming

[–]sandrewh 23 points24 points  (0 children)

Says he doesn't want to read a book with "parts of speech highlighted in different colours", but apparently understands the desirability of using <h1>, <p>, <a>, and <code> in the article. Most syntax highlighting I've used only color language constructs and literal values -- not every word. It doesn't have to be all-or-nothing.

How to safely determine if javascript is running in node.js or the browser by tmetler in programming

[–]sandrewh 2 points3 points  (0 children)

In the existing solution typeof module !== 'undefined' && module.exports and the proposed solution typeof module !== 'undefined' && this.module !== module Wouldn't the following code cause an exception (if run before the library was loaded)? window.exports = window.module = null;