Convert an ASCII file with octal escapes for UTF-8 codes to UTF-8

Question:
I have a text file which is an ASCII file itself, but contains octal escape sequences representing codes in utf-8:
\350\207\252\345\212\250\346\216

Is there some program or command that can convert such ASCII file to
a text file actually encoded in utf-8?
By the way, this site is "Online ASCII(Unicode Escaped) to
    Unicode(UTF-8) converter tool", and this site is "Online Unicode(UTF-8) to ASCII(Unicode Escaped) converter tool". Do they
make the conversion in my question? If not, what kinds of
conversion do they make?
Comment: @Peter.O: I don't know how to put this. but in "\xxx", "\" and "x" are characters encoded in ASCII. download this as a text file: http://paste.ubuntu.com/11885151/
Answer: If you have these escape sequences in a shell variable, in dash, mksh or bash:
printf %b "$string_with_backslash_escapes"

This isn't POSIX: the %b specifier is POSIX but it requires a 0 after each backslash. This also interprets other backslash escapes: \n as a newline, \t as a tab, etc.
Here's a perl one-liner that converts octal escape sequences only.
perl -pe 's[\\(?:([0-7]{1,3})|(.))] [defined($1) ? chr(oct($1)) : $2]eg'

http://www.rapidmonkey.com/unicodeconverter/reverse.jsp interprets octal values as Latin-1 characters, I don't know why Unicode and UTF-8 are mentioned in the page. I have no idea what http://www.rapidmonkey.com/unicodeconverter/advanced.jsp does.
Answer: Using just Bash:

220.127.116.11 ANSI-C Quoting
Words of the form $'string' are treated specially. The word expands to
string, with backslash-escaped characters replaced as specified by the
ANSI C standard. Backslash escape sequences, if present, are decoded
as follows:
…
nnn the eight-bit character whose value is the octal value nnn (one to three digits)

Demonstration in a UTF-8 terminal:
$ echo $'\350\207\252\345\212\250\346\216'
自动?

The last character displays as a question mark because the sequence is malformed: only two of the three required bytes are present.

The website you linked to performs RFC 5137 encoding/decoding.
If you enter \u81ea\u52a8 in the "ASCII (Unicode Escaped)" text area, you'll get 自动 as output, because 自 is Unicode Character U+81EA (whose UTF-8 representation is e8 87 aa in hex, or 350 207 252 in octal) and 动 is Unicode character U+52A8 (whose UTF-8 representation is e5 8a a8 in hex, or 345 212 250 in octal).
Comment: Does the posix shell definition currently (2018) define $'string'?  Or is this currently a non-posix extension? If so, please provide a pointer.
Comment: @Juan I quoted the Bash manual. I don't believe that it is part of the POSIX standard.
Comment: Thanks.  I've seen other non-bash shells that support that syntax (mksh, freebsd 9.x+ /bin/sh).  So I thought it might be a posix feature (or a movement to make it so).
Answer: Python in the interactive shell can do at least some of this. But the sequence above appears to be corrupted:

wilmer@ruby:~$ python
Python 2.7.10 (default, Jul  1 2015, 10:54:53)
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> unicode("\350\207\252\345\212\250\346\216", "utf-8")
Traceback (most recent call last):
  File "", line 1, in
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 6-7: unexpected end of data
>>> unicode("\350\207\252\345\212\250", "utf-8")
u'\u81ea\u52a8'
>>> print unicode("\350\207\252\345\212\250", "utf-8")
自动
Comment: thanks. do you know that what kinds of conversion the two online tools in my second part make? Some examples of their conversions will be clear.
Comment: My guess is that that page converts from hexadecimal Unicode escape sequences, whereas your bit above is UTF-8 (so two \xxx bits per actual character).
Comment: (1) "the sequence above appears to be corrupted". Does two "\xxx"'s in my ASCII file represent a character? If yes, does six "\xxx"'s represent three characters? If yes, why the last line of code only print out two characters? (2) what is the difference between "hexadecimal Unicode escape sequences" and "UTF-8 (so two \xxx bits per actual character)"?
Comment: @Tim UTF-8 uses a variable number of bytes per character. Look it up. In the sequence you gave, the first three bytes represent one character, the next three represent one character, and the last two are a valid prefix of several three-byte sequences that would represent one character.
Answer: Simplest way is ascii2uni -a K, for example:
cat escaped.txt | ascii2uni -a K > unescaped.txt

Answer: I want to add that with some software it may be enough to just select, copy, paste the escaped text. For example, Wireshark shows UTF-8 text as a sequence of octal-escaped bytes, but when you copy & paste it into Gedit, you get normal text, e.g. \341\203\231 becomes კ.
Comment: This is not an answer but can rather better be inserted as a comment.


Is this kind of scheme integral?

Question: Let $X\rightarrow Spec(R)$ an irreducible projective scheme over a dvr. Suppose the generic fiber $X_{\eta}$ is smooth (over the field $Frac(R)$) and irreducible. Is it true that $X$ is integral (i.e. reduced)?
Comment: For smthg related to your question, see Prop 4.3.8 p. 137 in Liu book (this shows eg that if you assume that $X$ is flat over $R$ and $X_\eta$ is integral, then so is $X$).
Answer: Let $R = k[t]$ ($k$ a field) and let $X$ be the scheme which is $\mathbb{P}^{2}_{k[t]}$ with an embedded point lying over $0.$  Then $X$ is irreducible, but not reduced.  However, the generic fiber $X_{\eta}$ is $\mathbb{P}^{2}_{k(t)},$ which is smooth over $k(t)$ and irreducible.

Is this kind of scheme integral?


Would searches from a proxy simulating local country searches be considered legitimate and boost CTR?

Question: I have a website and would like to know if searches from a proxy simulating local country searches would count as legit in the eyes of Google thus boosting the CTR? And would this boost the site's ranking in SERPS?
Answer: Whether it will count as legitimate or not is something under Google's control, however you should avoid such practices as google is a data company and it has multiple data gathering points, for example Google Analytics.
When you will use a proxy address, it is likely that Google will already know where this address has been used previously and on which websites. Like most services Google would have already identified that proxy address as a spam and abusive address and may not consider it as a legitimate user.
Your focus should be on the best practices in SEO. All the best


Looking offline map / gps / turn by turn software

Question: Anticipating some travel to Europe, I've secured a netbook and usb gps. I'm concerned that I won't always have access to free wifi and a phone data plan is not an option. Is there any decent (preferably free, but not required) mapping software which supports usb gps (nmea compatible of course) and potentially turn-by-turn directions? Windows or Linux
Answer: Check out the links and reviews at Laptop GPS World.
Quoted from the review part:

The GPS software listed here works on
  Microsoft Windows based computers. Use
  it for your laptop, netbook, notebook,
  tablet PC, Ultra Mobile PC (UMPC),
  CarPC, etc. You are welcome to write
  your review, or add your comments to
  an existing review. Please, share your
  thoughts in the forums here at Laptop
  GPS World.

ALK CoPilot / TravRoute CoPilot (forum) - Three versions available:USA/Canada, Europe, and Australia
DeLorme Streets Atlas (forum) - The program has street-level coverage of USA and Canada
Destinator - Destinator is software used in PNDs and PPCs. There is no stand-alone PC version sold, but it may be purchased along with Centrafuse 'front-end', which does run on Windows-based computers. Three versions are available: USA/Canada, Europe, and Australia. Additional map data can be purchased for the following countries: Mexico, Malaysia, Singapore, South Africa, Turkey, Brazil, Saudi Arabia, Oman, Bahrain, Kuwait, Quatar, UAE
Centrafuse w/Destinator - review by malaki68
Garmin Mobile PC (forum) - USA/Canada, Europe, (additional maps *may be added for many parts of the world)
Garmin nRoute (forum) - maps can be purchased for many parts of the world
Garmin nRoute - review by Sam Penrod at gpsinformation.net
iNav iGuidance (forum) - Seamless street-level map of USA/Canada(including Alaska, Hawaii, Puerto Rico, and US Virgin Islands)
MapAsia MapKing - maps available for several countries of Asia
Mapfactor PC Navigator / Directions PC Navigator (forum) - Three versions: Europe, Europe-Truck, and USA/Canada
Microsoft AutoRoute (forum) - Europe
This is the same software as Microsoft Streets and Trips, but it includes Europe instead of North America. Microsoft AutoRoute 2007 is the last vesion. The product has not been updated since, but you may buy the more expensive version of Microsoft MapPoint 2009 instead. Look for Microsoft MapPoint reviews bellow.
Microsoft Streets and Trips (forum) - Canada, USA (including Alaska, Hawaii, Puerto Rico, and US Virgin Island), and some coverage of Mexico
Microsoft MapPoint (forum) - There are two separate versions: one contains map of North America (same coverage as Streets & Trips), and the other is for Europe.
Navigon NavigatoR (forum) - Europe (the USA/Canada version doesn't seem to be sold anywhere)
Sygic Driver (forum) - USA/Canada, Europe, Australia, Brazil, Hong Kong, Thailand
Comment: Hijacking your post JP, sorry ;-)
Answer: Mappoint Europe is a good program if you are going to be driving in Europe.
Map Point Here
If you are planning on driving CONUS I suggest something like Delorme Street Atlas.
Street Atlas USA here
Both of these apps allow you to load the maps to your hard disk so you can drive around with your GPS.
Enjoy the trip!
Answer: During a road trip across the US, I used a netbook with Ubuntu NBR installed. All the planning and routing where done with Openstreetmap data shown in tangoGPS (prerendered map, gps track) and Navit (Routing).
They are great programs - and everything, including map data was free (as in beer and in speech).


Google Maps's route view: What's the correct term for this "string of beads" element?

Question:
What would you call this vertical sequence of stops?
Answer: I would call it a vertical timeline.
The "string of beads" is just googles way of showing the user that this is a distance he needs to walk instead of using public transportation etc.
Answer: This is more specific than your question asks, but I would also consider that an itinerary UI. Useful for conveying times, locations, and travel information in a timeline fashion (as stated by Pectoralis).


LED security light adding a switch

Question: I have this LED solar security light. Now I want to put this in the back of a shipping container and I want to have a switch all the way in the front of the shipping container.
I have no previous knowledge on electrical wiring so if anyone could tell me what to do, I would greatly appreciate it. The current switch has an on mode, an off mode and a motion detection mode (which is not working by the way).
See pictures below
https://i.stack.imgur.com/2fxjJ.jpg
Thank you :)
Comment: That's cheap Cheese junk, and since it's broken, it's not worth trying to save.  Get something more suitable to your current need.
Comment: Hello, and welcome to Home Improvement. I'm guessing this is theoretically off-topic here, but let us know if the current answer works for you. And, you should probably [take our tour](//diy.stackexchange.com/tour) so you'll know how best to participate here.
Answer: You have two sets of wires to extend.

The solar panel wires, I assume you will want to have the cable exit at the door end of the container, so you don't have a potentially leaky hole in the side. (NEVER put a hole in the roof). That needs 2 wires.
The switch wires.  The switch has 3 modes: Off, always-on, and motion sensor.  Off needs no wires, but the others need 1 each plus a common. That's 3. Noting there only 2 wires, clearly it's using the light's metal chassis as a "common", much like is done in automobile wiring.

Look carefully at the solar panel wiring.  If one of its wires is also attached to the machine chassis, that'd be good news, it means that wire can be shared with the chassis-side of the switch, and we can do all this with common-as-dirt 14/3 UF cable.  Otherwise you'd need exotic 14/4, or dual 14/2.
This is a low voltage device, so there's no particular risk, other than destroying the device.
14/2 or 14/3 UF cable comes with a bare wire for safety earthing. Since we're not using it for dangerous mains voltage, we'll use it for common/chassis.
For the switch, I would not use a mains-voltage 3-way (2-way) switch. I would use an electronics store rocker or toggle SPDT switch, with "chassis" on common and each of the other two wires on the ends.
These devices will not like having a balky, inflexible #14 wire attached to them. Have the last 1' or so going to the device use a smaller wire like a #20 stranded wire, and tie it to the #14 with a wire nut, probably orange.

LED security light adding a switch


How to pass hash as password to ssh server

Question: I have a hashed password <code>$6$salt$hash</code>. I want to ssh to a linux server with this hash. How could I do that? Do I need to change cipher spec? Is that possible?
Comment: Why do you want to do that? Are you trying to achieve passwordless login (for which you should be using keys?)
Comment: If you're passing a "hash" then the hash is the password
Comment: Is there any reason to not be using SSH keys  instead? Public key - private key approach. Seems to accomplish the same goal (not having raw password on the wire). Not trying to be "that guy" that answers "How to do X" with "Don't do X, do Y", but it seems a strictly better approach.
Comment: There _are_ techniques to authenticate with a password without the server needing to know your password, but SSH unfortunately does not use them, to the best of my knowledge.
Answer: You will not be able to do that.
The password is verified by the SSH server (or better by PAM library or similar authentication backend on other platform) by taking the received password, hashing it and comparing it to the stored hashed one. There is no way to bypass this process and make the server use the hash directly for comparison.
Comment: If you could do this, the consequences would be very bad. If anyone got a hold of your hashed passwords they can just enter them and login.
Comment: Well, you could I suppose - your password just becomes the hash.
Answer: I'm going to go out on a limb and guess that this is part of a penetration testing training programme. In which case, you can't get into the system using that hash directly, but you can pass that hash to a cracking programme, such as HashCat, which will attempt to crack the password it represents (and is much faster than online brute force).
If it's for a penetration testing training programme, the password will likely be something easily cracked, such as the "enterprise standard" password of "Password123!".
Comment: My guess isn't a total stab in the dark - I had a quick spy at some of the OP's other questions, and they seem to be working through some pen testing training materials. We do all have to start somewhere, so it's good to ask questions. But based on my experience of the industry, I wouldn't be at all surprised if the OP is out on a client site two weeks from now, as a "trained pen tester", so you may be right to weep.
Answer: I agree with Steffen that the server will store a hash of the 'password' and verify your password by hashing it and seeing if it matches the stored value. However, I don't see why you couldn't be storing a hash of the hash resultant of the password in the server and hash the password on your side before passing it to the server.
The server would hold only: Hash(Hash(Password))
and you would be required on your side to pass: Hash(Password)
I am sure, depending on how secure your side is, this is at least a little more time consuming from a cybersecurity measure for an attacker to crack the password if taken from server side or via transmission, but cumbersome.
Comment: OP wants to gain access to the server using the hashed password, he can't change the password on the server to `Hash(password)`. This wouldn't work very well as a way of strengthening the password either, as OP would need to keep track of the salt, he'd be better off just using a better password.
Comment: I agree that it wouldn't be the best solution, especially after hashing hashes has the potential to dilute the hash. I was just trying to think of a way to allow him to hash the password before transmission.
Comment: "Diluting the hash" isn't a concern, the concern is that the hash essentially _becomes_ the password, and it's much easier to just remember a better password in the first place. SSH already supports public key authentication anyway if you don't like sending your password to the server.
Comment: @AndrolGenhald Well, "diluting the hash" _is_ still a concern.
Comment: @wizzwizz4 Not if it's only a couple of hashes, or if it's a proper KDF that includes the salt in each iteration.
Comment: @AndrolGenhald But that's not what's being shown in the answer.
Comment: @wizzwizz4 The answer just says `Hash`. I assumed it was referring to a "generic hash function", in which case 2 iterations (1 client and 1 server) doesn't cause any concern about reduced entropy due to collisions or a short cycle. It could also be referring to sha512crypt mentioned in the question, in which case the salt is used in multiple iterations, even though it's [not necessary](https://crypto.stackexchange.com/a/12817).


Is there a way to see how much memory my app will take up while it's in the simulator?

Question: I'm designing an iPhone application and writing a paper on it.  I was wondering how I can see how much virtual/real memory my application will take in the iPhone.  I am currently running it in the simulator.
Answer: No, this cannot be done accurately. You can get consistently good values for most of the APIs you use using the Allocations instrument, but there are differences in execution environments which make exact figures impossible.
Answer: Yes, you want to Profile you app. In Xcode, hold down the "Run" button and select Profile. A window should pop up asking you to select an Instrument to profile your app with. For memory usage, you can analyze your apps using either Allocations or Leaks. I would do some googling for instructions on how to use these two instruments.


A song in only 100x18 pixels

Question: Below is a very small image (only 100x18 pixels) which represents a song. What song am I looking for?
Comment: rot13(Zvffrq bccbeghavgl sbe gurer gb or jbeqcynl vaibyivat "YnFfb").
Comment: Is it sad that I still know all the words?
Answer:
 This is Do Re Mi from the film "The Sound of music

 The first picture is a deer,

 The second a ray

 The third is 2 arrows pointing at a person, thus "Mi"

 Two locations represents Far

 The fifth is a needle, representing So

 Sixth is a note, representing La

 The last is a cup, representing Tea
Comment: Well done, and very fast! Don't forget the long arrow below all icons ;)
Answer: You are looking for the song

 Do-Re-Mi from The Sound of Music.

The icons in the image represent the items to which

 the notes in the sol-fa scale are compared.
Answer: The first image is

 a Doe. A deer. A female deer.

The second is

 a Ray. A drop of golden sun.

Next is

 Me. A name a I call myself.

Then

 we go Far, a long, long way to run.

After that is

 Sew, a needle pulling thread.

Then comes

 La, a note to follow Sew.

Finally,

 some Tea, a drink with jam and bread.

And the arrow

 brings us back to Doe. Oh oh!

I told you I knew all the words

A song in only 100x18 pixels


Updating Windows Azure Mobile Service Table Entries

Question: I am trying to update a column in Azure Mobile Services on Windows Phone 8 app. The table stores user data and I want to find the user having a specific email and password and then update a column of it. Currently I have:
IMobileServiceTable<Item> table = App.MobileService.GetTable<Item>();

        var account = table
            .Where(Item => Item.Email == _email_ && Item.Password == _pass_).
            Take(1).ToListAsync();

        List<Item> list = account;
        list[0].Pursue = pursue;      // the value I want to assign

Name of the column I want to update is 'Pursue'. What should I do after this phase?
table.UpdateAsync(account);

I tried the line above but I get an error (Also the change is applied to 'list'). Any suggestions? Thanks.
Comment: What is the error you're getting?
Answer: I finally figured it out. I added async keyword when defining the class (required to use await).
IMobileServiceTable<Item> table = App.MobileService.GetTable<Item>();

        var account = table
            .Where(Item => Item.Email == _email_ && Item.Password == _pass_).
            Take(1).ToListAsync();

        List<Item> list = await account;
        list[0].Pursue = pursue;

        await table.UpdateAsync(list[0]);


Small Wire gauges

Question: I would like to determine the wire gauge of small, Cu, multi-strand wire. Between 18 and 32 AWG. I can count the # of strands and measure the diameter of the wire strands with a micrometer. But what I can't do is figure out the AWG. Is there an app that takes as input # strands and strand diameter and spits out the AWG?
Answer: I don't know about an app, but it's pretty easy to google for a wire construction chart such as this one.

Alternately, measure the diameter of one of the strands (assuming they are all equal), calculate the cross-sectional area per strand, multiply by the number of strands and calculate the AWG from the total cross-sectional area, as so:
AWG = \$ 36 - 4.3124(\ln(n\cdot\frac{\pi}{4}\cdot d_s^2) + 4.3686) \$
n = number of strands
ds = diameter of one strand in mm
Comparing with the chart, 7/38 (ds = 0.101mm) would be 29.6 gauge, which agrees well with the AWG 30 in the chart.
Answer: You can easily figure it out yourself;
Find the cross-sectional area of a single strand, multiply that area times the number of strands in the wire, and correlate that total area with the AWG for that area via a copper wire table.

Small Wire gauges


Transferring Data from Quickbooks to FinancialForce

Question: We are using Quickbooks Enterprise (running on a local server, not hosted) and we are considering using Financial Force.  Can someone explain or point me to the procedure(s) & tool(s) that I can use to transfer our data from QBE to FF?  Thanks!
Comment: is this a one-time migration or a recurring integration?
Comment: One time migration - seems FF prefers that they assign a FF Partner & we pay for same.  Very little wiggle room - SFDC is also launching a migration tool, that is also only available to FF Partners.
Comment: you basically need to map QB CSV output to FF CSV input in the absence of any particular migration tool provided by FF. Lots of excel work + Data Loader -
Answer: In general, you'd normally be looking for an ETL tool and there are a number of vendors that offer them for Quickbooks in the App Exchange.
The fact that your server is local could make that problematic unless you want to connect your server as an endpoint with Salesforce. Otherwise, I'd expect you to need to export the data from Quickbooks as CSV files, then import it into Salesforce using Dataloader or another tool of your choice. It's also conceivable that you could "back-up" your QuickBooks data to the cloud via the net (like uploading to a "data pool"), then have a Salesforce integration tool send it to Salesforce for you from there (not certain it would be worth the effort).
I'd recommend talking with vendors Quickbooks integration vendors on the App Exchange and/or other integration vendors to get their recommendations for how to connect your server's database with Salesforce, then decide what solution fits your budget.
Comment: Thank you for your input.  In this case, we have an internal Tech Team, so I'm looking for tools/apps/methods for us to do it ourselves.  Data Loader is an obvious first choice, but was hoping others could say tool 'X' is the best and we used same to do this task :)
Comment: Ahh, gotcha. From the phrasing of your question, I didn't at all get that was the type of question you were asking. Quicken has a published API. The question becomes, do you want to use SOAP or REST and write your own integration or do you want to use one that's already available from the App Exchange? Even at this, it's still a very broad question to try and answer.
Answer: Getting data into FinancialForce is essentially getting data into Salesforce. Some of the objects you want to populate are FF objects, but others are standard SF objects.
So are you asking about the best Salesforce ETL tool? Is budget an issue? Flexibility? Underlying language?
I've used Talend to get data into and out of SF tons of times and its incredibly powerful. It's also a bit flaky and lacks robust documentation, but as I was using Talend's free version, that's par for the course. If people understand ERD's, and can handle a bit of scripting, they can handle Talend.
You can pay for other tools like Informatica, but the price-tag for a one-time data migration might be a bit much.
I'd say something like data loader isn't in fact your first choice. Data loader is fine for one or two objects, but chances are you'll want to run this integration again and again, building it up iteratively. You're better spent putting the hours into a migration template/script than the hours into a manual migration.
Or you could build Apex scripts in Salesforce that suck the data in (presuming you can directly access QB Enterprise, or cleanly and repeatedly export the data to an accessible structure).
Other options besides FinancialForce are Accounting Seed and Breadwinner. Sage Live might some day be a great option, but as of Dec 2015, I'd let someone else be the guinea pig.


Serpentine Belt

Question: So I have a 2000 Dodge Durango and I had just gotten it up and running again after some repairs irrelevant to this but I got it down the road and it was driving fine for about 20 minutes and then the vehicle started to overheat well I figure this has happened before I'll just wait for it to cool down turn back on and drive till I can get to the nearest gas station (less than half a mile)... as soon as I hit that off ramp I started smelling burning rubber and thinking it was my brakes trying to lock up because my abs and brake light were on I hurried up and pulled into the gas station. Come to find out my tensioner broke and the serpentine belt was rubbing on my alternator and tensioner arm. I got it fixed a couple days later no problem but when I started it up, it was shifting really at random rpm levels. Low, high, it didn't matter. The more I ran it, it started to backfire if I tried to speed up, it would shoot up to 5 thousand, backfire, let off gas and it would shift. And if I stopped the engine, it eventually would turn of completely.
Comment: Can you please explain your "some repairs" comment?  I suspect that the serpentine belt issue is unrelated to the real problem that is causing the symptoms you describe.
Comment: Your battery may have been going flat due
to the alternator not working which would cause the ECU to do crazy things.  Could you restart the engine?
Answer: Though I want to know what "some repairs" entails, this screams voltage voltage voltage to me. Belt breaks, alternator doesn't charge, battery voltage drops. 90% percent of the sensors on your car run on a 5 volt reference signal, drop the signal voltage, then you drop the return voltage as well, so the ECM sees weird numbers coming back and makes all of its calculations incorrectly. Fully charge up your battery before continuing with any other diagnosis.
P.S. Chrysler products in my experience are more finicky than some other brands with their electronics

Serpentine Belt


Check if a property is animated or has a driver

Question: Using python, how can I check to see if some property (like context.object.location) has any keyframes, or has a driver attached?
Comment: This usage of the api might give some pointers http://blendersushi.blogspot.de/2013/06/python-driving-arrays-like-boss.html
Answer: A keyframe check could be done like this:
import bpy

def has_keyframe(ob, attr):
    anim = ob.animation_data
    if anim is not None and anim.action is not None:
        for fcu in anim.action.fcurves:
            if fcu.data_path == attr:
                return len(fcu.keyframe_points) > 0
    return False

print(has_keyframe(bpy.context.object, "location"))

But don't think there is an easy way to test for drivers.
Comment: drivers can be done similarly with ob.animation_data.drivers - thanks :)
Comment: Nice, I didn't know you could access drivers that easily. You could extend my `has_keyframe()` function so it handles single properties as well (e.g. `location.x`), but it should work for array properties already.
Answer: What we call "drivers" are technically "driven f-curves" attached through a Python object's animation_data attribute, just like action data. In an object, those attributes are present in the object itself, its data (whatever type it is), shape keys, particle settings, materials and textures. So we need to check those places to know if there's any driver.
The following sample code is adapted from my driver-copying operator, it merely prints the data paths of available animation and driver f-curves:
import bpy

def main():
    obj = bpy.context.active_object

    # Collect places where animation/driver data possibly present.
    keyable_list = [getattr(obj.data, 'shape_keys', None)]
    for ms in obj.material_slots:
        if not ms:
            continue
        keyable_list.append(ms.material)
        for ts in ms.material.texture_slots:
            if not ts:
                continue
            keyable_list.append(ts.texture)
    for ps in obj.particle_systems:
        keyable_list.append(ps.settings)
    keyable_list.append(obj)
    keyable_list.append(obj.data)

    # Print data paths of available animation/driver f-curves.
    for keyable in keyable_list:
        if not keyable or not keyable.animation_data:
            continue
        action = keyable.animation_data.action
        for fc in keyable.animation_data.drivers:
            print(fc.data_path)
        if action:
            for fc in action.fcurves:
                print(fc.data_path)

main()

I'm keeping it simple, but it's possible to extract only the name of the attribute using e.g. regular expression, if one needs to.
Comment: Good answer - but a bit over complicated for my needs - thanks anyway :)
Comment: @GregZaal: Great if you've found a solution. If a code doesn't capture all drivers in an object, just note that there are several places in the object that contains `animation_data`.


Cite only by DOI in rebuttal

Question: I have to write a rebuttal for a machine learning conference in which I included a lot of new references (to prove broad interest). The rebuttal has a page limit of one, and my reference list is too long for that. Is it ok to cite the paper by only using the DOI in the rebuttal, if I cite the works in full in the actual submission in the final version?
Answer: Make it easy for your reviewers to get what you are saying. Just a DOI is really hard for a reviewer because they have to walk to the computer, look up the DOI, and all that.
If you don't want to provide the full reference, just say "see Schneider et al., cited in the paper". That way, there is an easy place to go to to find the full title and reference.
Comment: Rebuttal systems are web-based systems, so when a reviewer consults the rebuttal, they have a web browser running and are only one copy-paste away from the referenced publication. See Anonymous Physicist's answer.
Comment: The papers are new references though (mostly because they were published after I submitted my paper), so I can not do that, unfortunately.
Comment: I don't understand -- why can't you cite these new papers? They may have been published after your paper was submitted, but since you're in the process of revision, I see no reason why you can't add new citations. Indeed, I would think that you *should*: After all, that would be useful for your readers!
Answer: Yes, that's fine.  Contrary to Wolfgang's answer, the DOI is the easiest way for a reviewer to find your reference.  They can simply use the DOI resolver.  The advantage of DOIs is that they always find the document in one step.  Traditional citations do not necessarily do that.

Cite only by DOI in rebuttal


Integrating BuildBot into JIRA

Question: We have a BuildBot setup for our continuous build. Additionally, we happen to use JIRA for all our bug-tracking and task needs.
What I was trying to accomplish (and have found little to no information on) is integrating build numbers (from builds generated) into JIRA. Specifically, I need two fields:

Found In Build (dropdown listing previous builds to a certain threshold allowing QA to simply select the build number)
Resolved In Build (another dropdown allowing Engineers to select a future build that will contain the fix)

Ultimately I would like these fields to be required fields as well, but that is the simpler task to accomplish.
After researching this for several days, I have not been able to find any reference, plugin or even a hint on how to accomplish this; your help is needed.
Please post complete answers rather than code-snippets, that way your efforts will not go unused/misunderstood.
P.S. JIRA Version: 5.2 BuildBot: 0.8.4p2
Comment: Probably you should ask in buildbot mailing list which is the official support channel they have
Answer: This is not a direct solution, but bamboo is tight integrated to jira and display automatically this informations and others in jira and vice versa.

Integrating BuildBot into JIRA


syslog port for serial comm port

Question: I have Cisco 3750 switch which is connected via console comm5 port to my laptop and in the same laptop I have installed a kiwi Sys log server. I have done all the configurations to log all my messages to the server but it isnot logging anything ? The default port number to which server is listening to is UDP 69 ? Is it the port number issue or something else ?
Comment: UDP/69 is the default port for TFTP, not for syslog. The serial console port on a Cisco switch cannot be used for syslogging, it's used for console access, so this will not work as you expect it to work.
Comment: Default port for syslog server is UDP/514. You will need L3 connectivity between your laptop and switch to obtain logs.
Comment: @Tahreekhan, connect your laptop to switch using patchcord, set IP address on switch, set address from same network as switch on your laptop network card settings, configure syslog to your PC host, run syslog software on laptop.
Comment: how to get that L3 connectivity ?
Comment: Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you can provide and accept your own answer.
Answer: The serial console connection does not provide network connectivity and syslog requires a network connection. In other words, the switch can't talk to a syslog server running on the same machine as the terminal unless there's an additional network connection.
You need to connect and configure both laptop and switch to enable them to talk to each other. In the most basic configuration, both use the same subnet (e.g. 192.168.0.1/24 and 192.168.0.2/24) but it's also possible to connect them across one or more routers.
The only thing you can do on the serial console is to set your terminal software to log output to a file. Additionally, you can instruct the switch to output desired log items to the console with e.g. logging console informational. This isn't syslog, of course, but something similar.

syslog port for serial comm port


What is the axiological basis of the preference of truth to falsity?

Question: Axiologically speaking, why is truth the preferred logical value by humans? In general, why do we prefer true statements to false ones? What about the value of true makes a statement "right," while false is "wrong?" Specifically, why do true statements seem to be valued higher than false statements and why does our day-to-day language seem to favor factual statements?
Comment: Here is Peirce's answer:"*Facts are hard things which do not consist in my thinking so and so, but stand unmoved by whatever you or I or any man or generations of men may opine about them. It is those facts that I want to know, so that I may avoid disappointments and disasters. Since they are bound to press upon me at last, let me know them as soon as possible, and prepare for them.  This is, in the last analysis, my whole motive in reasoning. Plainly, then, I wish to reason in such way that the facts shall not, and cannot, disappoint the promises of my reasoning.*"
Comment: Does this answer your question? [How are the assumptions underlying logic chosen?](https://philosophy.stackexchange.com/questions/56585/how-are-the-assumptions-underlying-logic-chosen)
Comment: This is not quite the same as Conifold's link, as related it is. You are not asking about all assumptions, but particularly about truth across various models.
Comment: Maybe useful: Jan Wolenski, [Semantics and Truth](https://books.google.it/books?id=L5PHDwAAQBAJ&printsec=frontcover)
Comment: I was specifically looking for answers from a more mathematical/formal logic perspective, and while there are some good answers here they don't quite answer the question that was in my head. Should I ask a new question, or edit this one and invalidate the current answers?
Comment: @conifold- What is a 'fact'. Before you respond think about the interconnected flow that is the human experience of the extended world, there are simply no isolated 'facts'. Any fact is an artificially constructed interpretation from experience.
Answer: The short answer from a naturalized epistemology is obvious. Truth in the state of affairs of the physical world has survival value and is a strategy for biological organisms with cognition to survive in accordance with evolution. The obvious proof of this would be what I call argument by defenestration. If you want to know what a person believes, ask them to do something that has value-laden consequences. If a person tells you the world is a simulation or that they believe in incarnation, ask them to prove it by throwing themselves out a window (not high enough to kill themselves as that would be unethical). Just high enough to sustain a reasonably painful injury. If they don't, it's likely their beliefs are in conflict.
Truth in perception means one is free of illusions. Truth in memory means one is free of confabulation. Truth in reason means one is free of fallacy. Lastly, truth in testimony means one is free of deception. Generally speaking, a human who is free of illusion, confabulation, fallacy, and testimony is better adjusted to survival in the world historically speaking. In fact, an arms race in deception is largely suspected to be the guiding force in self-deception among some evolutionary psychologists. From the WP article:

Evolutionary psychology approaches self-deception as an adaptation that can improve one's results in social exchanges.

Ferreting out truth from deception is a survival imperative in social transactions historically.
Comment: Great point in the argument from survival, as I would like to call it!
Answer: Every false statement corresponds to a fact that the statement is false. More precisely, the concept of falsity depends on a prior concept of truth (false = antitrue, but to make truth into mere antifalsity would be metaphysically confused).
Axiologically, goodness is similar to truth, and evil to falsity (not just the absence of good, but its opposite). So the concept of good is logically prior to the concept of evil. There is an illusion in standard deontic logic, which is an inference from the formal interchangeability of the definitional scheme to the actual possibility of justifiably ordering deontic concepts using evil/the forbidden first---but this is abstract evil (it is wrong to base one's concepts of ethics on the concept of wrongness).
If, moreover, goodness is something like "acting according to the truth" (Kant says somewhere that this is analytically true but otherwise vacuous), then focusing on false statements would be congruent with focusing on evil.
Comment: Good grief- That sounds like a religious fairy tale. Goodness is tantamount to truth! It is perfectly reasonable for you to hold to that as part of your personal belief system, but it is not philosophy
Answer: U can't really reason or understand or define about an unknown thing or known thing using false statement can you? Even when using proof by contraction u are still trying to validate a truth statement, people value truth more cause truths work like staircase, you proof step 1 then you can further proofs things in that staircase, like maths uses this axiomatic reasoning, whereas false statements are false because of true statements, for example if you have a bag which have digits 1-8 and i say that bag contains digits more than 8, but you know that it's not true therefore it's false, we can always make assumptions but we can't tell about false statements until we have truth statements, and their is nothing life absolute truth or false, it true or false in a certain system but can be false somewhere else.


Why does it change shape when i apply the scale?

Question: I just noticed that the scale whas wrong on my canle. So i applyed the scale on it and it went fine. Then when i did the exact same thing on the wax it suddenly became a "muchroom". why does it do that and how do i fix it?
Answer: It's because your modifiers act on original mesh scale 1.
Say you have a 1m diameter pipe mesh with 0.1 m thickness with the Solidify Modifier.
If you make it 2m diameter (scale it to 2 without applying it), you now have a 2m diameter with a thickness of 0.2m despite the Solidify Modifier still showing a thickness of 0.1m. The new scale and thickness are shown in the Viewport, but the modifier shows the values valid for a scale of 1)
And if you now apply the scale, the new thickness would be 0.1m because that's what the modifier is set to.
NOTE:
Scale is for the object and the modifier values are for the mesh. Object is separate from mesh (you can change the mesh that is used in your object anytime)
Comment: Your last paragraph is a bit misunderstandable... it sounds like object scale and mesh are independent from each other, but of course they are not. If you scale an object in _Object Mode_ the mesh is scale with it of course. And in the same way the modifier is scaled. But overall your answer is definitely correct and the solution for her problem.
Comment: @GordonBrinkmann Try this: get default cube (object 1) and copy it (object 2). now make the mesh of object 2 from Cube.001 to cube. now scale the object 1 and apply it. you will get an error. now on the object 2 change mesh to Cube.001 and apply the object 1 scale and after that change object 2 from Cube.001 to cube. see that the object 2 is now changed in scale?
As you see scale dose not affect the mesh unless it is applied to the mesh. a 1m tall mesh is always going to be in 1m tall mesh in every object even if the object is 10m tall.
Comment: But yes I see what you mean as user expect that what you see is what you get.
Comment: Thanks for explaining that, didn't know I could learn such a basic thing after 20+ years in 3D modeling :D No seriously, I know that. I just wanted to say that this can be misunderstood by users that don't have as much experience. Especially when they are scaling non-multiuser objects they might not get these errors. By the way, duplicating the cube with Alt+D makes the second cube automatically use the same mesh as the first one... no need to switch meshes or anything.
Comment: srry, was trying to clarify what I meant. No assumptions about you were made. but yeah I was going for manual change in mesh cause that way new user would change it manually and see that it is a different thing. it's my 3rd year into 3d and I did not know that 1-2 years ago and I wished I knew that sooner. hence the example.
Comment: thank you so mutch!


Are questions about the Samsung Gear S3 smartwatch on topic here?

Question: I've been trying to find an appropriate StackExchange site to come to, to ask questions about using, configuring, and troubleshooting my Samsung Gear S3 smartwatch. This seems to be the closest fit so far. Would it be on-topic here?
Comment: Note: The Gear S3 is a Tizen-based smartwatch. So, it's not on-topic for [Android.SE].
Comment: Tizen has been voted off-topic on more sites than just Android.  The watch seems borderline for IoT.SE but this is probably the closest fit available.
Answer: I'd say yes. We already have some questions about smart watches. It might be dependent on the specific question how welcome it is but I consider wearables and smart watches part of the Internet of Things.
Answer: Generally, no.
A smart watch is just a very compact computer - somewhere between a mini-PDA and (for those with their own mobile radio) a mini-smartphone.
As such, it would only be on topic here when used for an IoT purpose.
The simplest was to tell if a question would be on topic would be to consider if it would be on topic if you replaced "smartwatch" with "phone" or "laptop"
On Topic:

Using a smart watch to control the lights in your home.
Using a smart watch as a bicycle computer

Off Topic:

Transferring calendar events from phone to smart watch.
Backing up personal data from a smart watch

Getting sidetracked into general smart watch user support would be as far from the mission of this site as getting sidetracked into everyday smart phone, laptop, or TV support would be.


Python and OpenCV - questions regarding findFundamentalMat's behaviour

Question: Sorry if the title is kind of ambiguity. It is quite hard to express my question in short, understandable way.
So, I am in the middle of a 3D reconstruction project. The pipeline is more or less the same with the standard pipeline where

Undistort image
Detect points with keypoint detector
Track the points across frames (optical flow)
Calculate the fundamental matrix

and so on. The only different part is at step 2 where I use a Line Segment Detector and track it across frames.
So, if I am using a keypoint detector, giving two frame of images, I will get two set of keypoints (each set corresponds to each frame). But as for my situation, I have four set of keypoints (each two set correspond to each frame since a line has a start point and an end point).
In order to calculate the Fundamental matrix, I need to concatenate the two sets of point of each frame.
One way is by just  vertically concatenate it: np.vstack([start_point, end_point]).
The other way is by :np.hstack([start_point, end_point]).reshape(-1, 2). Means, it is concatenated 'alternately', i.e.
[[start_point[0],
  end_point[0],
  start_point[1],
  end_point[1],
             ...]]

Both will end up with a same shape. But fair enough, they produce a quite different results. From my observation, the vstack produced a more '3D-like' result while the hstack produced a more 'planar-like' result for the reconstruction.
The question is why is this? And which one supposed to be better?
Below is sample code to give a view of this question:
import numpy as np
import cv2

np.random.seed(0)

def prepare_points(pts_frame1, pts_frame2):
    # Prepare the four sets of points
    (p1_f1, p2_f1) = pts_frame1
    (p1_f2, p2_f2) = pts_frame2

    v_stacked_f1f2 = (np.vstack([p1_f1, p2_f1]), np.vstack([p1_f2, p2_f2]))
    h_stacked_f1f2 = (np.hstack([p1_f1, p2_f1]).reshape(-1, 2),
                      np.hstack([p1_f2, p2_f2]).reshape(-1, 2))

    return (v_stacked_f1f2, h_stacked_f1f2)

pts_frame1 = np.random.random_sample((60, 2)).astype("float32")
pts_frame2 = np.random.random_sample((60, 2)).astype("float32")

# Emulate the two sets of points for each frame where
# the first set is the start point, while
# the second set is the end point of a line
pts_frame1 = (pts_frame1[::2], pts_frame1[1::2])
pts_frame2 = (pts_frame2[::2], pts_frame2[1::2])

(v_stacked_f1f2, h_stacked_f1f2) = prepare_points(pts_frame1, pts_frame2)

F_vstacked = cv2.findFundamentalMat(v_stacked_f1f2[0], v_stacked_f1f2[1],
                                    cv2.FM_RANSAC, 3, 0.99)[0]
F_hstacked = cv2.findFundamentalMat(h_stacked_f1f2[0], h_stacked_f1f2[1],
                                    cv2.FM_RANSAC, 3, 0.99)[0]

print("F_vstacked:\n", F_vstacked, "\n")
print("F_hstacked:\n", F_hstacked, "\n")

# F_vstacked:
# [[ 3.31788127 -2.24336615 -0.77866782]
# [ 0.83418839 -1.4066019  -0.92088302]
# [-2.75413748  2.27311637  1.        ]]

# F_hstacked:
# [[  7.70558741  25.29966782 -16.20835082]
# [-12.95357284  -0.54474384  14.95490469]
# [  1.79050172 -10.40077071   1.        ]]

Answer: The findFundamentalMat function process the points formats like this: 2*N, where N is the number of points. So I think "F_hstacked" is correct.
There is another thing that is unclear to me, why do you want to use only the end points of the line to estimate the motion? Is that accurate then feature points? As you cannot exactly figure out where (the pixel) is the end point of each line.


Logic Gates: Realize OR gate using ONLY XOR gates

Question: I am doing some revision for my exams and one of the questions that frequently asked in last year question paper is how to realize a OR gate using only XOR gates. I am trying to do from last 1 hour and also searched on Internet. But failed. Hope to get some help here.
Answer: You can't derive an OR (or AND, NOR, NAND) gate from only XOR (or XNOR) gates, because they are not universal gates.

Here is an argument against XOR and
XNOR as universal gates.
An XOR gate
is a parity generator. Cascading
parity generators always produce
parity generators. AND and OR are not
parity functions.
An XOR gate can be
used as an inverter. An XNOR gate is
an XOR followed by an inverter, so it
is also a parity generator.

To be an universal gate, a gate needs to satisfy both the following conditions:

You should be able to create an inverter using the gate.
You should be able to block the input (i.e. setting N - 1 inputs to 0 or 1, the remaining input is ignored)
Comment: I noticed you indented the middle part of your answer. Is this a quote from something, and if so, where?
Answer: Tie both input lines to only one input pin of the XOR gate, leaving the other input pin as always being false, thus producing an OR gate.
Comment: "Tying both input lines" is called wired-or in electronics design - and a) is usually not permissible (can actually damage hardware) and b) would be an OR gate :)


Allowing exceptions (whitelist) through Google Cloud Platform IAP

Question: My GCP project has an instance running a Jenkins server behind an IAP-protected load balancer.
Adding the IAP protection has caused me 2 related issues that I didn't manage to resolve (and I guess both could be resolved in a similar manner):

I used to have a physical Jenkins slave (that must be physical as it's connected to special hardware) that was connected to the cloud Jenkins server. Now that the cloud server is protected by IAP, the on-premises Jenkins slave can no longer cannot to it as the slave JNLP app doesn't know how to authorize with the Google login interface. (EDIT: I got around this specific issue eventually by creating an SSH tunnel for the slave directly to the Jenkins server machine)
I used to have a BitBucket-Cloud repository that POSTs to the Jenkins server via BitBucket's webhook functionality. BitBucket also doesn't know how to authorize with IAP so it too doesn't work anymore.

It seems that Google supports authorization programmatically but in both cases I have no programmatic control over the entity that needs to communicate with the Jenkins server.
Is there any way to get around this issue? I have several directions in mind, but I'm not sure what's the best way to do it / if it's even possible:

Is there any way to simply white-list specific URL's in IAP so they don't require any authorization? For example, allow authorization-free access for everyone to  https://my.jenkins.domain.com/bitbucket-scmsource-hook/notify so BitBucket can webhook? (I know it's not optimal security-wise)
Is there any way to white-list access from specific IP's? Allow all requests from BitBucket Cloud and all requests from the physical slave to go through without IAP requiring their authentication. It's obviously also not optimal security wise.
Maybe create another parallel IAP-less load-balancer that also routes to the Jenkins server which I will specifically configure to white-list the URL/IP's as I described above and black-list everything else, and have BitBucket and the physical slave connect to it instead of the regular load-balancer. Same security issues considerations as the solutions above, very complicated, required another domain name. Not optimal at all. But it's the only practical solution I can think of.

What do you think? Do you have better, simpler, more secure ideas? Maybe I'm missing some obvious way to do this? I couldn't find anything in the IAP documentation regarding how to achieve something like this.
Answer: So the top answer here is basically what you're after. I have a separate small VM with an Nginx Reverse Proxy that is solely used to handle webhooks. It routes to the same Jenkins Backend as my Google IAP load balancer.
I'm using GitHub for my webhooks but I imagine it probably works similar for Bitbucket.
Actually, I would have a Jenkins job that would run periodically (daily?) that would grab the CIDR entries from here and update your firewall rule for your Other load balancer.


My signature was forged on a bill of sale for a vehicle

Question: I know for fact my signature was forged on a bill of sale for a vehicle. The buying party also knew my signature was forged as it was done right in front of them. Can the buying party also be held accountable for the forgery though I lost no money nor gained any money.
Comment: I don't understand how this happened without failing to affect you. If your vehicle was taken and sold without your permission then its still theft, regardless of whether you got the money. Can you explain the circumstances a bit more?
Answer: It's hard to say. I think the forged signature might not be a crime by itself, but whoever did this had some reason - instead of a sales agreement that states (with signatures) that Mr. X sold a car to Mr. Y, there is now an agreement that states (with forged signatures) that Mrs. Jones sold a car to Mr. Y.
I could imagine that somewhere along the line some crime has happened and the forged signature is used to obscure the crime. We'd have to know what exactly happened. (For example, if Mr. X was your ex-husband and the car was your car and your ex-husband kept the money from you, that would quite clearly be a crime, but you said you lost no money).
Answer: Forgery is typically a felony; but it's not certain that the act in question satisfies the requirements of a forgery statute. In Washington, that is RCW 9A.60.020. Signing another person's name is not necessarily forgery. First, there has to be an intent to injure or defraud, then the document must be "falsely made, completed, or altered". That in turn means "to transform an incomplete written instrument into a complete one by adding or inserting matter, without the authority of anyone entitled to grant it", thus you can sign on behalf of a party with their permission; if you have pure intentions but no permission, it still is not legal forgery. It is possible that this violates a vehicle-sale specific law, RCW 46.12.750, since the bill of sale may function as an assignment of title for purposes of obtaining a certificate of title. The requisite form in Washington doesn't have the perjury warning that you find in California, where the signature is more meaningful. So it would depend on your jurisdiction.
It's not clear whether anyone was actually harmed by the act (which I take to have been signing your name to a bill of sale). Some actual harm would be required, in order for there to be a successful lawsuit. Criminal prosecution is possible (but unlikely) even if there was no harm.
Answer: It sounds like this is in the USA, so I'm going to assume that.
If I understand you correctly, the Forger needed your permission to sell the vehicle, but couldn't get it. The Forger and the Buyer have therefore entered into a conspiracy, probably a criminal one as it sounds like the forgery itself was a crime.
The Buyer does not have good title (and wouldn't have good title even if they were unaware of the forgery). If you have a part share in the ownership of the vehicle then you still have that, regardless of any money you may have been given. You can probably sue for the return of the vehicle. Given that the Buyer does not have "clean hands" you probably even get to keep any money you were given.
Also if the Buyer knowingly uses the forged signature to prove title to someone else then they are probably guilty of a separate fraud at that point.


Is it correct to speak of New York dialect?

Question: Is it correct to speak of New York dialect, or should I use a different term when referring to the particular pronunciation used in New York?
Comment: @Jonik: Why didn't you write that as an answer?
Comment: Because I first meant it as cheap quip w/ Wikipedia link and didn't consider it worthy of that. (Only later I edited in the 2nd sentence about NY accent.) But it's an answer now; let's see how it'll do. :-P
Answer: In discussing English, we don't usually make a big distinction between dialects and accents. For day to day discussions, people will probably understand and appreciate "New York accent", and if you're talking to linguists, "New York dialect" or "New York English" will probably be better. But there's no very firm distinction between the two.
Comment: As the focus is on "pronunciation", I think 'New York accent' is  better even if we are talking to linguists. A change of dialect normally not only includes pronunciation differences, but also differences in vocabulary, spelling, and sometimes even grammar!
Comment: Well, there *are* some lexical and grammatical differences between New York and other dialects. Take "I'm waiting on line at the store" for example.
Answer: Wikipedia, for example, goes on about the New York dialect for pages, so I don't see why it wouldn't be "correct". :-) Then again, if you particularly want to point to the pronunciation, then maybe New York accent might be a slightly preferable term.
Answer: Do you mean New York City? If so, I think it'd be more correct to speak of accents (Brooklyn accent, etc.). Also note that Long Islanders also have a distinct accent that isn't normally associated with the city (e.g., "kwafee" for coffee, "drua" for "drawer").
Comment: Here's a quote from from the New Yorker to that effect: "'The fact is—but don't write this, because it will enrage people—Brooklynese is exactly the same whether it's spoken in the Bronx, Queens, and Staten Island or in Brooklyn. Or the Lower East Side.' The city's dialect, he said, is much more indicative of one's social status than of one's neighborhood."

http://www.newyorker.com/archive/2005/11/14/051114ta_talk_seabrook
Comment: There actually isn't very much evidence for by borough by borough differences in NYC. In *The Social Stratification of English in New York City*, Bill Labov hypothesizes that what people attribute to being borough differences are just an easier way to talk about class differences.
Comment: It's worth noting that such a speech pattern is *typically referred to* as a "Brooklyn accent".
Answer: There used to be distinct New York neighborhood accents (you can hear them in old movies), but my guess is they've been mostly homogenized. Here are some examples of stereotypical accents:

Bronx: Groucho Marx. Harpo also.
Brooklyn: Three Stooges, e.g., "woik" for "work".
Midtown/Upper West Side: Humphrey Bogart (is that the generic New York accent?)
Garment District: hard "G", as in "Long G-eye-land"

The weird diphthong Mipadi identified as from Long Island seems to stretch from there down to Philadelphia. In Philly they say "fwawth" for "fourth" and "twawk" for "talk".
Comment: Do you have a link or some other reference to Harpo Marx talking?
Comment: @JoFrhwld - if you substitute "ethnicity" for "social class difference", I might agree with that. New York, for most of its history, was a blend of many immigrant populations, most of whom started out as working class. Lots of Irish started in Brooklyn, which probably explains "woik", but lots of Irish also ended up on the Lower East Side, where they still say "woik". However, I doubt you'd have heard "woik" from working class people in the Garment District or Harlem, where there were never many Irish.
Comment: See my comments to mipadi. There has never been good evidence for any neighborhood by neighborhood differences as distinct from social class differences. However, you're right as far as the vowel sound in "talk" goes. That feature extends as far south as Baltimore, but not as extreme as in NYC.


Lavender subsitute for Grilled Eggplant Nicoise

Question: Is it okay to tear open some lavender tulsi herbal tea bags?
Comment: It would certainly be safe, but it might not taste very good.
Comment: @SAJ14SAJ Why not?
Comment: Because it is old, dry, and flavor balanced to be tea.
Comment: @SAJ14SAJ Are there any substitutes then?
Comment: See Jefromi's answer... but you have to ask yourself, what does kind of ingredient is something?  If it is a signature ingredient, then you cannot substitute for it without losing the identity of the dish; if it is not, then omitting it or substituting for it just doesn't matter.
Comment: @MarkE Just in case you didn't already know, tulsi is basil, so you'll be adding both basil and lavender if you use the tea.
Answer: You can certainly try it. I don't know if the tulsi flavor will be what you want or not, though.
I also don't think I've ever heard of eggplant niçoise with lavender (and couldn't find a recipe with it) so it's probably also fine without it if you don't think the flavor's going to be what you want.
Answer: Quite often teas go through a fermentation process that changes and intensifies the flavors. Herbal teas often mix a dried but non-fermented main aromatic like lavender with some sort of green or black tea which is fermented. A good example of this is mint tea, which is generally dried mint mixed with green tea. I wouldn't use mint tea as a substitute for fresh mint, it's never going to work the same.
Ripping open a tea bag and sprinkling it on a tuna salad isn't likely to win you any awards when people start crunching into bitter dried leaves. To be honest it would be hard to think of a more effective way to ruin it. Just add some fresh basil leaves instead, or ask around where you can gather some fresh lavender, it grows all over the place.


What's different about photographing at sunrise vs. sunset?

Question: I usually get better light at sunrise (compared to sunset). I do though hate to wake up early in the morning to use that light ;)
What are the biggest differences between sunrise and sunset?
Comment: I'm glad you asked this question as I was witness to a sunrise on Monday for the first time in quite a few years, and I was actually surprised at how different it was in character (being notably cooler, and brighter in intensity). I had always considered the two fairly symmetrical.
Comment: The "Which one do you prefer?" part beggs of a discussion. If you wish to chat about the merits of sunrise and sunset, and discuss personal preferences, a better place to do it would be the Photographic Memories chat. There is a link to it on our sidebar. -->
Answer: Sunrise light is cooler (color temperature-wise) because there are less particles in the air, which is what gives sunsets their multicoloured nature.
Comment: Yes, but the thermals generated by the sun warming up the land cause the particles to rise into the air more actively. They tend to settle in the night when it cools.
Comment: The coldest part of the 24 hour day is just before sunrise, which has a variety of effects.
Comment: These particles in the air coming from traffic pollution, industrial complexes, power stations etc.
Comment: most of which work 24/7...
Comment: I suspect that really depends on geography more than anything else. A thermal effect would definitely be more pronounced in the evening, but if your location has stronger night/morning winds, or if you are on a coast line, those circumstances will have much larger effect on the particulates in the air and thus the color of the light than any minor thermal-based effect.
Answer: Sunrise can be a better time to shoot for few reasons too:

There are considerably less people about if you are shooting scenery, landscape and/or nature shots.
There is often moisture about which can potentially be used to create some unique images .. check out http://www.thetrueshot.com/Photographs/Pages/Drops_Of_Life.html#0 which was shot early in the morning to catch a dew drop before it dried in the sun.
The images from sunrise are often not seen by most people due to the time of day.  Yes, it can be a pain to get up very early, especially in the summer months, but sometimes getting up at 4am can provide great results that no one else has ...    http://www.thetrueshot.com/Photographs/Pages/Sunrise.html#10

These factors will certainly help to make them more unique and hence more marketable if you happen to be selling them.
Personally I shoot at both sunrise and sunset time of the day, as each has its own unique qualities.  I find sunset very colourful and the ability to include people in the image can add interest too.
Answer: The sun is in a different place!
I know, that sounds obvious, but, as someone living in a coastal city, I though it ought to be mentioned. In the east, if you want the sun over the ocean, that's a sunrise. If you want a sunset over the water, you need to find a west coast. (Any continent will do.)
Of course, this extends to non-oceanic photos as well. The light in many landscapes is rooted in geography. The morning sun and evening sun show the same mountains very differently -- not in the same human-schedule way a city street may be transformed (working class people early in the morning, yuppie parents with kids during the day, and then the nightlife) -- but still, uniquely.
Comment: West coasts don't have to be on the west side of the continent. You can find west coasts in places like Florida, Latvia, India, and lots of islands all over the world. Some also have the added plus of an east coast.
Comment: Also on south-facing and north-facing beaches, the sun coming in from the left will give a different "feel" to a picture than one coming in from the right.
Answer: Sunrise is near the coolest part of the day. As a result, it typically has less wind, and thus less dust. Also, it tends to have somewhat less moisture in the ground than would otherwise be there.
All of this causes a few unique affects

There will be somewhat reduced haze, making images appear sharper.
The lesser amounts of dust will make the sunrise somewhat cooler in color temperature.
Most likely, there will be somewhat lower levels of pollutants, because not as much stuff is used earlier in the morning.

All of these add to a unique look for sunrise.
I'm going to spare you the details about the location of where the sun is when the sunrise/set occurs.
Answer: Sunrise shots can require more scouting ahead of time, because you are getting someplace in dark or twilight and it can be difficult to visualize how light will strike the area when it comes up.
Sunset gives you the luxury of having more time to analyze the scene in front of you on the spot, and is I think easier to visualize how the sun will shift as it goes down.
Also, after a lot of shooting both sunrise and sunset it seems like the light stays more "interesting" for longer around sunrise (both before and after) than sunset.   I'm not sure why this is, but after a lot of different shoots it sure seems like I have a lot more time to spend on a sunrise than sunsets in general.
The light that first comes up at sunrise is often quite sharp compared to a sunset though, and can really cut through haze.
Answer: Due to temperatures at sunrise, low fog is more common, allowing you to take pictures like this one.
Answer: Sunrise and Sunset are also very different when it comes to shadows and back light.
Never forget that the sun rises in the east and sets in the west. Therefore the shadows and light will be a completely different although in both cases the sun is low over the horizon.
So if you want to have the sun in your picture and you are on an east coast beach you have to get up early if you like it or not :-)
Answer: Most humans need much more convincing for participating in a shoot during sunrise than during sunset. Applies to models, stylists, assistants etc. On the other hand, wildlife is usually more active during sunrise.
If you need to have a natural-light shot made in a certain day, shooting during sunrise leaves you a second chance in case something goes wrong. In case of a sunset, being late means too late.
Chances of catching rays shining through mist are higher in mornings.
Answer: Light from the sun enters the earth's atmosphere and encounters a plethora of obstacles. The atmosphere is jam-packed with water vapor and dust plus a variety of additional materials. The solar light rays skip over some, depending on their size. Many are hit by light photons. Collisions scatters and filters the light. The blue sky you love and adore is due to the fact that blue and violet light rays, because they have a shorter wavelength, are more likely to collide and be scattered. The now-dispersed blue and violet are responsible for our blue skies.
When we take pictures during the hours of say 9 AM and 4 PM, our subjects will likely be illuminated from two directions -- direct sun light and blue scatter light. This mix adds a blue cast to our subjects.
Now our atmosphere extends upwards for miles (kilometers).  When the sun is low (near the horizon), which happens at sunrise and sunset, the travel distance in the atmosphere is an extra 20 miles (45 kilometers). This added light path distance places more obstacles in the light's path. This extra distance filters out some of the blue and green, permitting a higher percentage of red light to bathe the earth. Now our photographs replicate the rosy hues of sunset and sunrise.
At sunset, due to the activity of life, more dust and pollutants are present in the atmosphere. Because of this fact, the sunset is more likely intense ruddy or crimson.


Will renaming a solution in Visual Studio break everything?

Question: I'm using Visual Studio 2005 and I'm wondering what will happen if I rename my solution file from prefs.sln to someOtherFilename.sln, will completely mess things up? Pretty simple question, but I wanted to ask before I went ahead and did anything.
Answer: It will still work. I've never had an issue renaming a Solution file.
Incidentally, you can rename a Project file as well, but when you do that, some settings may not make sense to a future developer - things like the default project Namespace come to mind.  Everything still works, but it's something to bear in mind when you run across error messages and issues trying to reference classes within the project.
Answer: Theoretically, it shouldn't break anything. Practically, you should be using source control and never be afraid to do things like that.
Answer: Why not just try it? Renaming is easy to undo. =)
But it should be safe to do. As far as I know, the solution file name is not used anywhere (unlike the project file names, which are used in the solution).
Answer: Renaming the solution should be a safe operation as the solution file is just a "repository" to keep track of all the resource belong to the solution (Project,etc)
If you are using a source control software it is a different matter
Answer: You can do that without any problem if you're doing that inside Visual Studio. If you are not using TFS SourceControl this can be done directly from the file system as well.
Things are different for projects. You can still do that from inside Visual Studio, but if you just rename the csproj file, the project name doesn't change and all the references in the solutions containing the project will be broken. Furthermore the name of the dll or the exe are not changed and the same applies to the default namespace, and this is something that you could dislike.


Gradient elliptic estimate

Question: Consider the half space $\Omega=\{x=(x_1,...,x_N)\in\mathbb{R}^N:x_N>0\}$. Let $u\in C^2(\Omega)\cap C(\overline{\Omega})$ a positive bounded solution of
$$
\begin{eqnarray*}
\Delta u+f(x_N,u)=0, & \mbox{in} & \Omega\\
u=0, & \mbox{on} & \partial\Omega
\end{eqnarray*}
$$
Here $f:[0,\infty]\times[0,M]\rightarrow\mathbb{R}$, $M=\sup_{\Omega}u$, for any t-finite interval $f$ is Lipschitz in $u$ on $[0,M]$ and
$$
f(x_N,u)\leq f(\infty,u)<0, \ \ \mbox{in} \ \ \Omega.
$$
Then
$$
|\nabla u|\leq C,
$$
where $C$ depends only on $\max f(x_N,u)$. How can I obtain this estimate? Thank you.
Answer: A more general form of the problem is:
$$\Delta u = g$$
with $g > 0$, $u \geq 0$ and $u(x',0) = 0$ for all $x' \in \mathbb{R}^{n-1}$.
Here are some things we can say:
1) If $0 < g < K$ then by $W^{2,p}$ estimates and Sobolev embedding we have an interior $C^{1,\alpha}$ estimate (for any $\alpha$), giving in particular the (scaling-invariant) estimate
$$|\nabla u|_{B_{r/2}(x)} \leq \frac{C}{r}\|u\|_{L^{\infty}(B_r(x))}$$
for all $B_r(x) \subset \Omega$, where $C$ depends only on $K$.
2) If $0 \leq u \leq M$ for some $M$ apriori, then using barriers of the form
$-C(|x-(x_0',-1)|^{2-n}-1)$ for any $x_0'$ and $C$ large depending on $M$ we easily obtain
$$0 \leq u \leq C(M)x_n.$$
Of course, we must have this apriori bound since quadratic growth like $x_n^2$
is allowed otherwise.
Thus, 2) gives a boundary gradient bound, and when coupled with the scaling invariant interior estimate of 1) we get a full gradient bound.
3) As a remark, if $g$ is bounded we in fact get that $u_n$ is $C^{\alpha}$ up to the boundary by a boundary Harnack inequality of Krylov, which involves using the Harnack inequality to "improve" the trapping planes from 2) at smaller scales. Philosophically, ellipticity gives that the nice boundary and boundary data have some influence when we step in.
4) As another remark, if $g \geq \delta > 0$ then $u$ must have quadratic growth. Indeed, if not, the rescalings $u_R(x) = \frac{1}{R^2}u(Rx)$ satisfy the same conditions but go to $0$ on $B_2^+$, hence the function $\frac{\delta}{2n}(|x-e_n|^2 - \frac{1}{2})$ would lie above $u_R$ in $B_2^+$ for $R$ large, contradicting that $u \geq 0$.
Comment: Connor, thank you for your patience and attention. I didn't understand some steps of your proof. First, observe that I have no information about the signal of $f$, and you assumed $g>0$. Second, could you explain me how to obtain the estimate $0\leq u\leq C(M)x_{n}$ using the barrier function? Finally, can you re-explain the steps $3$ and $4$? Thank you very much.
Comment: Since you wrote $f(x_N,u) < 0$ it seems to me you do have an equation of the form $\Delta u = g$ with $g > 0$.
Comment: The barriers in 2) lie above $u$ and are $0$ at $(x_0',0)$, and along $(x_0',t)$ for $t > 0$ it is easy to check that the barrier centered at $(x_0',-1)$ lies below $Ct$. For the other questions feel free to shoot me an email.

Gradient elliptic estimate


What health and ergonomic factors should an all-day computer user take into account?

Question: Many computer users don't think much about the detrimental (and beneficial?) effects of using a computer for 7+ hours per day.  What should be considered when creating and sustaining a good working environment for computer use, in order to help prevent health issues? (anything from RSI to tiredness, neck pain, the fog of confusion)
Answer: Much of this may not be possible because we don't have total control over our workspaces.

sit up straight
get a good chair
get a good desk and keep it clean
lay your keyboard and mouse out where you can get and use them without reaching or stretching
put it all in a quiet location
make sure there are no harsh, loud lights or visual distractions
ensure the computer is quiet or silent
get a display that doesn't flicker
set the display size to something you can read without straining
make sure the display is at a level/orientation that you can look at without straining
get a keyboard and mouse you are comfortable with -- I'm not a fan of "ergonomic" keyboards, but if you like them and can use them, great.  The bottom line is: If it hurts, STOP USING IT.
same for wrist-rests and the like -- if you like them and they work for you, get one that you can use.  I find my wrists are less likely to hurt if I am forced to keep them off the available rests.

If you get into a situation that hurts, tell your boss.  In many juristictions you can make it a workman's-compensation or job health-and-safety issue if it is a real problem.
Comment: Great list, but one complaint:  if it hurts, it may be too late - the damage is done.  Prevention is the key here.
Answer: Sit up straight!!
Comment: If at least I remembered to follow this one, I would be a happier person :-)
Comment: me too :) i'm terrible at remembering but know it would fix my problems lol
Answer: If you don't have an adjustable and comfortable chair, buy one yourself if your company refuses to provide one for you, though I would probably leave a company like that.
Pick a comfortable keyboard with a handrest.
If you have a second screen, don't keep it on the same side all the time, or put it above your normal screen or you will eventually develop neckpains due to always looking to the side in the same direction.
Try to do some hand exercises like these if you get pains in your wrist.
If you have a raisable desk, stand at your desk instead of sitting a day a week or so.
Get a soft movable wrist rest for your mouse, movable so that you can place it under your elbow if you start feeling pain there.
Keep your monitor at the right height so you're sitting somewhat straight when you're in your chair.
Also, if you have glasses, there are certain coatings for the glass (like anti-reflective) that makes working with a computer all day easier.
Make good use of your company massage therapist and ergonomist if they have any.
Answer: Get up and move away from your desk on a regular basis.  Exercise is important, but taking physical breaks are also important.
Answer: Get the most comfortable and adjustable chair you can find/afford. Having a rested back/legs will go a long way towards keeping you focused. Pain/discomfort = distraction.
Answer: Excercise a lot! I go to the gym twice every week, ride my bicycle to work, and run every time I can. Make sure to workout your abs and back muscles as these are the ones that are supposed to keep your posture good.
Also, do some stretching (text in Swedish but images are self-explaining) if needed.


Find the sum of the series $\sum_{n=1}^{\infty}\frac{1}{n3^n}.$

Question: I m stuck in finding the sum $\displaystyle\sum_{n=1}^{\infty}\frac{1}{n3^n}.$ Please give me some hint.
Comment: Integrate the Maclaurin expansion for $1/(1-x)$. I can add more detail in an answer below if necessary. Here is a similar problem for reference: http://math.stackexchange.com/questions/1706647/computing-the-series-sum-n-1-infty-frac1n2-2n/1706667#1706667
Answer: $$
\sum_{n=1}^\infty \frac{1}{n 3^n} = \sum_{n=1}^\infty \frac {x^n} n \quad \text{where } x = \frac 1 3. \tag 1
$$
\begin{align}
\frac d {dx} \sum_{n=1}^\infty \frac{x^n} n  \overset{\text{ ? }}{=} \sum_{n=1}^\infty \frac d {dx}\,\frac{x^n} n = \sum_{n=1}^\infty x^{n-1} = \frac 1 {1-x}.
\end{align}
So the sum is an antiderivative of $\dfrac 1 {1-x}$, evaluated at $x=1/3$.  Which antiderivative of that function is it?  It is the one that is equal to $0$ when $x=0$, because the expression in $(1)$ above is equal to $0$ when $x=0$.
PS suggested in "Dr. MV" 's comment: $\displaystyle \frac d {dx} \sum_{n=1}^\text{something} g_n(x) = \sum_{n=1}^\text{something} \frac d {dx} g_n(x)$ when $\text{"something''}$ (the number of terms being added) is finite.  But this equality doesn't always hold when $\text{"something''}$ is $\infty$. That is why the $\text{"?''}$ surmounts the $\text{"}=\text{''}$ above.  However it is true when the sum is a convergent power series, provided $x$ is in the interior (not on the boundary) of the disk of convergence.
Comment: Michael, solid answer; just a suggestion that might be useful to some readers ... consider explaining the reason that a question mark appears over the first "equals" sign in the second line.  The validity of interchanging orders of operation (e.g., UC of the series obtained by differentiating term by term along with convergence of the original series at a point) is a key to the development.  ;-)) - Mark
Answer: Here, we use a standard "trick" for evaluating certain types of series.  The key of the development relies on the observation that
$$\int_0^x t^{n-1}\,dt=\frac{x^n}{n} \tag 1$$
Then, summing both sides of $(1)$ over $n$, we obtain for $|x|<1$
$$\begin{align}
\sum_{n=1}^{\infty}\frac{x^n}{n}&=\sum_{n=1}^{\infty}\int_0^x t^{n-1}\,dt\\\\
&=\lim_{N\to \infty}\sum_{n=1}^N \int_0^x t^{n-1}\,dt\\\\
&=\lim_{N\to \infty} \int_0^x \sum_{n=1}^N t^{n-1}\,dt\\\\
&=\lim_{N\to \infty}\int_0^x\frac{1-t^N}{1-t}\,dt\\\\
&=\int_0^x \lim_{N\to \infty}\left(\frac{1-t^N}{1-t}\right)\,dt\\\\
&=\int_0^x \frac{1}{1-t}\,dt\\\\
&=-\log(1-x)
\end{align}$$
where the Dominated Convergence Theorem guarantees the validity of the third to last equality.  Now, set $x=1/3$.
Answer: $$\sum_{n = 1}^{+\infty} \frac{1}{n3^n} = \sum_{n = 1}^{+\infty}\frac{3^{-n}}{n}$$
This has the form of the well known series
$$\sum_{k = 1}^{+\infty}\frac{a^{-k}}{k} =  - \log\left(\frac{a-1}{a}\right)$$
Thence
$$\sum_{n = 1}^{+\infty} \frac{1}{n3^n} =  -\log\left(\frac{3-1}{3}\right) = - \log\frac{2}{3} = \log\frac{3}{2}$$


Gnome Xmonad broken after upgraded to 14.10

Question: After upgraded to 14.10, gnome-settings-daemon cannot be loaded properly /usr/share/gnome-session/sessions/xmonad.session.  is there anyone has the same problem?
Answer: Here's a more detailed solution based on Jianingy answer. It fixes a few issues I was having after upgrading to Ubuntu 14.10. The issues it's fixing include:

Multimedia keys not working
Display settings in Gnome-control-center not working

You need to add DesktopName=Unity to /usr/share/gnome-session/sessions/xmonad.session.
[GNOME Session]
Name=Xmonad/GNOME
RequiredComponents=gnome-settings-daemon;gnome-panel;xmonad
DesktopName=Unity

Also, regarding dbus-send changes in Ubuntu 14.10, you have to use --print-reply=literal instead of --print-reply=string. I have added that to my xmonad.hs and I define main as main = xmonad $ gnomeConfig2.
import XMonad.Config.Desktop
import XMonad.Util.Run (safeSpawn)

import qualified Data.Map as M

import System.Environment (getEnvironment)

data RescreenToggleState = RescreenToggleState Bool deriving Typeable
instance ExtensionClass RescreenToggleState where
  initialValue = RescreenToggleState True

gnomeConfig2 = desktopConfig
    { terminal = "gnome-terminal"
    , keys     = gnomeKeys <+> keys desktopConfig
    , startupHook = gnomeRegister2 >> startupHook desktopConfig }

gnomeKeys (XConfig {modMask = modm}) = M.fromList $
    [ ((modm, xK_p), gnomeRun)
    , ((modm .|. shiftMask, xK_q), spawn "gnome-session-save --kill") ]

-- | Register xmonad with gnome. 'dbus-send' must be in the $PATH with which
-- xmonad is started.
--
-- This action reduces a delay on startup only only if you have configured
-- gnome-session>=2.26: to start xmonad with a command as such:
--
-- > gconftool-2 -s /desktop/gnome/session/required_components/windowmanager xmonad --type string
gnomeRegister2 :: MonadIO m => m ()
gnomeRegister2 = io $ do
    x <- lookup "DESKTOP_AUTOSTART_ID" `fmap` getEnvironment
    whenJust x $ \sessionId -> safeSpawn "dbus-send"
            ["--session"
            ,"--print-reply=literal"
            ,"--dest=org.gnome.SessionManager"
            ,"/org/gnome/SessionManager"
            ,"org.gnome.SessionManager.RegisterClient"
            ,"string:xmonad"
            ,"string:"++sessionId]

Comment: If you have a new question, please ask it by clicking the [Ask Question](http://askubuntu.com/questions/ask) button. Include a link to this question if it helps provide context.
Comment: I have rephrased my answer. I was trying to give more details on how to fix the issue.
Comment: I tested this answer, while it does seem to fix gnome-control-manager, it did not cause my media keys to start working again.
Answer: OK, I found a solution.
First of all, Starting from 14.10. Many unity and gnome application configurations ( those *.desktop in /usr/share/applications and /etc/xdg/autostart ) start to include a "OnlyShowIn=Unity". Therefore we have to add a desktopname=unity to /usr/share/gnome-session/sessions/xmonad.session in order to let those applications run.
Second, cmd 'dbus-send --print-reply=string' now have to be 'dbus-send --print-reply=literal'. therefore, old xmonad gnomeConfig cannot register xmonad as a wm. we have to change the dbus-send command from =string to =literal.
Answer:
https://gist.github.com/bewest/46b849da04684f0ce401
http://blog.ezyang.com/2014/12/ubuntu-utopic-upgrade-xmonad/comment-page-1/

The --print-reply=string syntax causes an error.
The name of the application that needs to be "registered" is not xmonad, but xmonad.desktop.
I wound up creating a ~/.xmonad/hooks file with the following command in it:
dbus-send --session --print-reply --dest=org.gnome.SessionManager /org/gnome/SessionManager org.gnome.SessionManager.RegisterClient string:xmonad.desktop string:$DESKTOP_AUTO_START_ID

I also found the previous fix, setting DesktopName=Unity causes the gnome-control-center to be used properly.
Comment: How do you run the `~/.xmonad/hooks` script?
Answer: Here is a very simple way to workaround the "xmonad fails to register" problem (addressed in other answers by using xmonad hooks or writing gnomeRegister2): in the xmonad.desktop file, replace Exec=xmonad with Exec=sh -c "xmonad &". This results in a very fast startup -- I got the idea here -- but it might break other things.
The DesktopName=Unity part is still essential.
UPDATE (16 November 2015)
I regularly fight XMonad + Gnome when I upgrade Ubuntu. My config files are available on GitHub, in case anyone would like to see how I've most recently gotten XMonad and Gnome to play nice together.
As of 16 November 2015, the important files are

~/.xsession: https://github.com/ntc2/conf/blob/master/dot.xsession
Gnome *.desktop files: https://github.com/ntc2/conf/tree/master/dot.local/share/applications (I maintain my XMonad + Gnome config in my home dir, without having to edit any system *.desktop files; see my conf install script for where these files go).
Gnome *.session file: https://github.com/ntc2/conf/blob/master/dot.config/gnome-session/sessions/local-xmonad-session.session

For Ubuntu 15.04 and 15.10, the most important, and hardest to discover change was to add export XDG_CURRENT_DESKTOP=Unity to my ~/.xsession:
# Without setting this explicitly, it gets te value "Gnome", which
# makes `unity-settings-daemon` fail to start and we get
# `gnome-settings-daemon` instead. Not sure what this variable does,
# but I got the hint here:
# https://bugzilla.gnome.org/show_bug.cgi?id=729575.
#
# Setting to values other than "Unity" -- e.g. "default", which `env`
# tells me is the value of related variables, or "GNOME-Flashback",
# which is the `DesktopName` I might suspect here -- I get weird
# behavior, e.g. none of the dock items appear in the Gnome panel.
export XDG_CURRENT_DESKTOP=Unity

Also, to get graphical notifications on e.g. volume key presses and screen brightness adjustment, I needed to install the notify-osd package.
Answer: I mentioned it briefly in the gist, but I found in the XMonad docs, that the startup hook is executed automatically given, this config:

    , startupHook = execScriptHook "startup"

This causes the shell script to be run automatically, which I found easier than monkeypatching the haskell hook.
http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Hooks-Script.html

XMonad.Hooks.Script
Script Hook Interface
Provides a simple interface for running a ~/.xmonad/hooks script with the name of a hook.
Synopsis
Usage
This module allows you to run a centrally located script with the text name of a hook. The script is assumed to be located at ~/.xmonad/hooks.
For example, if you wanted to run the hook startup in your script every time your startup hook ran, you could modify your xmonad config as such:

 main = xmonad $ defaultConfig {
   ...
   startupHook = execScriptHook "startup"
   ...
   }

Now, every time the startup hook runs, the command ~/.xmonad/hooks startup will also.


I'm trying to install Lindo API For my Laptop (Ubuntu 20.04) but get stuck after exporting the tar.gz file

Question: After exporting the tar.gz file, there is one file named runlindo, which tyoe is executable (application/x-executable) yet it won't run. In addition, the readme from the developer doesnt give instructions on how to run the app. I've already tried the ./runlindo code but it gives
Please give the name of the lindo or mps file: runlindo

Input any desired options (e.g., -bar) one per line.
Enter a blank line to continue.
 Option:
LINDO API Version 14.0.5099.345 built on Mar  9 2024 04:28:08
Barrier Solver Version 0.0.000, Nonlinear Solver Version 3.17N
Platform Linux 64x86 (D)

Copyright (c) 2023 by LINDO Systems, Inc. Licensed material,
all rights reserved. Copying except as authorized in license
agreement is prohibited.

Loaded Mosek version 10.1.13
Number of users allowed=1
No expiration date
Lindo Staff

Reading model parameters from runlindo.par
Warning: Could not open file for problem I/O. (error:2002)
Reading model parameters from lindo.par
Reading runlindo in MPS format (unformatted)
MPS Reader: There is an error in the input model file.
Invalid free format, trying fixed format...

Error 2003: There is an error in the input model file.
Error line num: 0
Line          : ''

Answer: You've Already Installed Runlindo
This application is a Mathematical Solver.  You build Mathematical Models with other  software and export them as .lp files or .mps files.  See .lp FileType and Application Models Library.  The Application Solves the model, and no more.


Is it possible to query process information from Linux kernel directly?

Question: I know pgrep, top, and ps all query /proc filesystems. So far so good. Yet what got me thinking is that in the past there was no /proc filesystem. Even nowadays, Mac OS X, as far as I know, has no /proc filesystem, yet top still accesses process info, which sugggests to me such info should be coming from kernel directly. My question, however, is specific to Linux. Which libraries and/or syscalls can be used to query process information directly, bypassing /proc ?
Answer: It is possible to query process information from the Linux kernel directly — by reading files under /proc. This is the way it's done on Linux, Solaris and several other Unix variants.
Ancient Unix systems had a ps command that was setuid root and mapped some kernel memory (through /dev/kmem or similar) and parsed kernel data structures. This required ps to have privileges (dangerous) and to be tied to the exact kernel version (inconvenient).
On modern *BSD systems, ps works by calling the sysctl function, which in turn makes system calls to retrieve information formatted as structures defined by a binary format. MacOS uses the same mechanism.
Linux does not have this BSD interface. It uses procfs and sysfs to allow userland to retrieve information from the kernel. Where BSD marshals information in a binary format retrieved by a special-purpose system call, Linux marshals information as strings retrieved through ordinary file access to a special-purpose filesystem. It would be possible to use the same method as in ancient Unix systems, but nobody does it because it's such an inferior method (requires privileges and requires updating whenever the kernel data structures change).
Comment: In general, BSD `sysctl` actually does _not_ incorporate multiple processes, or even a single process, mapping any areas of shared memory.  Rather, it is just several thousand `get`/`set` system calls all rolled into one.  Specifically, the FreeBSD `sysctl` for `CTL_KERN`-`KERN_PROC` involves no memory mapping.
Comment: @JdeBP Oh, thank you. I thought that sysctl used KVM. It's documented as a libc function, not as a system call. So it's a system call on all *BSD then, marshalling a binary structure into the caller's memory?
Comment: The package that provides `ps` is called `procps` because it was an alternative, coexisting for a time with the older package called `kmem-ps`.
Answer: Before the advent of the /proc filesystem, psutils read the information directly via /dev/kmem, the kernel memory pseudo device. Obviously only certain versions of ps worked with any given kernel version, which was one argument in favor of /proc. (Being human readable, and easier access to kernel structures for things like perl scripts are arguably bigger benefits.)


Ugly graphical glitches in High Sierra 10.13.2

Question: recently I noticed that MacOS has become pretty unstable, in particular there is a new bug that is annoying me a lot.
Since the computer has been started, it starts to collect some glitches on the screen, some of them blink and is very annoying, the situation get worse until the computer block it self or the OS crashes, this happens after two days usually.
I was used to let my Mac powered on for weeks and now I have to restart it also three or four times in a week...
I noticed also that sometimes the OS crashes due to video player in Safari, it happened some times that I was watching a video on the internet and suddenly the OS crashed causing reboot.
I'll attach a picture of my screen to this message.
These problems occur on my iMac (21.5" min 2011 with High Sierra 10.13.2) but I saw some other graphical problem during login on another my Mac (MacBook Pro 13" mid 2015 same OS version).
There is a solution? Can I solve this problem without a clean installation of the OS?
Thanks very much and have a nice day!
Answer: That is not a software issue. Your graphics card is getting inappropriate power. You probably have a capacitor or transistor that is dying (if you're lucky; if you're REALLY lucky you might be able to pinpoint the exact component by visual inspection) or the graphics chip is nearing the end of its lifespan.
If there is a shop that does board-level repairs near where you live it might be repairable, usually using donor parts from other dead boards.
Most often, instead of just dying one day, the glitches might slowly degrade to something like this.
I think on the 2011 iMacs the dGPU was a mezzanine card? I don't know if you would feel it is worth it to repair, maybe you could find a replacement for cheap.
If this is the integrated graphics, I don't think there is anything that can be done.
As for the MacBook, that's a completely different machine in terms of architecture, and not just for the GPU. Probably unrelated, but you could provide more details on what the issues on that machine are like in another question.
Comment: Thanks for these information, hope that my Mac isn't going to die, anyway for now I found a fix, it seems that an utility I was using to control fan speed, called SmcFanControl, is not fully compatible with my macOS version, this was causing these glitches, avoiding using this app I solved my problem.


How to use Cauchy-Reimann equations to show that complex conjugate of a variable be treated as a constant

Question: Why can the complex conjugate of a variable be treated as a constant when differentiating with respect to that variable?
Comment: maybe this question can help http://math.stackexchange.com/questions/852978/meaning-of-fz-barz
Comment: What I'm really asking is if z = x+j*y and zbar = x-j*y. When z is differentiated with respect to any variable and nonzero, either x must change or y must change. But if either x or y changes, then zbar must also change, making it not possible to differentiate z with respect to given variable while keeping zbar constant with respect to that same variable.
Answer: The Wirtinger derivative $\frac{\partial }{\partial z}$ is a derivation, meaning that it is linear in $f$ and satisfies the Leibniz rule
$$
\frac{\partial }{\partial z}(fg)=f\frac{\partial }{\partial z}g
+ g \frac{\partial }{\partial z}f
$$
(Easy to derive from the standard Leibniz rule.) In addition, a direct calculation shows that
$$
\frac{\partial }{\partial z}\bar z=0
$$
Combined, the above facts imply that
$$
\frac{\partial }{\partial z}(\bar z f)=\bar z\frac{\partial }{\partial z}( f)
$$
for any real-differentiable function $f$. Repeated implication of the above shows that
$$
\frac{\partial }{\partial z}(\bar z^n f)=\bar z^n\frac{\partial }{\partial z}( f)
$$
for every integer $n$. Finally, real-analytic functions can be differentiated by taking the derivative of their power series term-by-term, which justifies computations like
$$
\frac{\partial }{\partial z}(e^{\bar z} f)=e^{\bar z}\frac{\partial }{\partial z}( f)
$$