How to make a file chooser in kivy to support files with different languages (English, Hebrew)

Question: I am using kivy's file chooser and when there is a file of a folder with an Hebrew name, it prints gibberish...
I want to support different languages if possible.
Tried to change the font name in the file chooser, didn't work for me.
Can you help me find out what am I doing wrong?
Comment: Do you *see* gibberish in the file chooser, or does it *prints* gibberish when you print the selected file path?
Comment: Both. Currently I am more into fixing the user experience but I want to be able to show the user the correct name and to be able to get it so I can use the selected file
Answer: It's not only FileChooser - all instances of Label in Kivy use Roboto font as a default, which doesn't seem to support Unicode characters. Try running this code:
from kivy.app import App
from kivy.uix.label import Label

class TestApp(App):
    def build(self):
        return Label(text="עִבְרִית")

if __name__ == '__main__':
    TestApp().run()

There are several fonts shipped with Kivy, one of them is DejaVuSans. Let's use it:
from kivy.app import App
from kivy.uix.label import Label

class TestApp(App):
    def build(self):
        return Label(text="עִבְרִית", font_name='DejaVuSans.ttf')

if __name__ == '__main__':
    TestApp().run()

And now Hebrew is displayed correctly. It doesn't work for Japanese, though. For that language you have to look for another Unicode font, place it in the directory and pass to the font_name property.
Anyway. How to make FileChooser use a different font? The simplest way would be binding a method to on_entry_added event to change properties of a newly created item in the directory tree:
from kivy.app import App
from kivy.clock import Clock
from kivy.lang import Builder
from kivy.uix.boxlayout import BoxLayout

Builder.load_string("""
<MyWidget>:
    FileChooserListView
        id: filechooser
""")

class MyWidget(BoxLayout):
    def __init__(self, *args):
        Clock.schedule_once(self.update_filechooser_font, 0)
        return super().__init__(*args)

    def update_filechooser_font(self, *args):
        fc = self.ids['filechooser']
        fc.bind(on_entry_added=self.update_file_list_entry)
        fc.bind(on_subentry_to_entry=self.update_file_list_entry)

    def update_file_list_entry(self, file_chooser, file_list_entry, *args):
        file_list_entry.ids['filename'].font_name = 'DejaVuSans.ttf'

class MyApp(App):
    def build(self):
        return MyWidget()

if __name__ == '__main__':
    MyApp().run()

Comment: You can align filename to the right using `file_list_entry.ids['filename'].halign = 'right'` but you need to detect if it's actually in Hebrew first. Google says you can do it like [this](https://stackoverflow.com/questions/10664254/the-right-way-to-check-of-a-string-has-hebrew-chars)
Comment: Wow thanks you a kind stranger! one last thing if you may, when I use your solution the Hebrew text is reversed (Hebrew is written from right to left and kivy shows it from left to right) do you know a quick fix?
Comment: the halign wasn't working since it just moved the reversed Hebrew text to the right side. But with your help and the help of the link you sent, I made a working scrip for that. Thank you so much and I am uploading my solution as a new answer
Comment: @YotamHammer, I did some testing and there's one more thing: besides binding `on_entry_added` event you should also bind the same function to `on_subentry_to_entry` event, or the change only propagate to top-level directories. I updated the code in my answer.
Comment: Yes I saw this too and added it later. Thank you my programmer friend
Answer: This is my solution. Half of the credit goes to Nykakin:
from kivy.app import App
from kivy.clock import Clock
from kivy.lang import Builder
from kivy.uix.boxlayout import BoxLayout

Builder.load_string("""
<MyWidget>:
    FileChooserListView
        id: filechooser
""")

class MyWidget(BoxLayout):
    def __init__(self, *args):
        Clock.schedule_once(self.update_filechooser_font, 0)
        return super(MyWidget, self).__init__(*args)

    def update_filechooser_font(self, *args):
        fc = self.ids.filechooser
        fc.bind(on_entry_added=self.update_file_list_entry)
        fc.bind(on_subentry_to_entry=self.update_file_list_entry)

    def update_file_list_entry(self, file_chooser, file_list_entry, *args):
        file_list_entry.ids.filename.font_name = 'DejaVuSans.ttf'

        updated_text = []
        # to count where to insert the english letters
        english_counter = 0

        # the next statements used to split the name to name, extention
        splitted = file_list_entry.ids.filename.text.split('.')
        extention = ''
        if len(splitted) > 2:
            name = '.'.join(splitted)
        elif len(splitted) == 2:
            name = splitted[0]
            extention = splitted[1]
        else:
            name = '.'.join(splitted)

        # for each char in the reversed name (extention is always English and need to not be reversed)
        for char in name[::-1]:
            # if its in Hebrew append it regularly (reversed) and make sure to zero the counter
            if u"\u0590" <= char <= u"\u05EA":
                updated_text.append(char)
                english_counter = 0
            # if its an English character append it before the last english word (to un-reverse it) and increase the counter
            else:
                updated_text.insert(len(updated_text) - english_counter, char)
                english_counter += 1

        # add the extention in the end if exists
        if extention == '':
            file_list_entry.ids.filename.text = ''.join(updated_text)
        else:
            file_list_entry.ids.filename.text = ''.join(updated_text) + '.' + extention

class MyApp(App):
    def build(self):
        return MyWidget()

if __name__ == '__main__':
    MyApp().run()


Will soldering a cast brass finial to 38mm brass handrail tube discolor either metal?

Question: I am looking at soldering a cast brass finial to 38 mm brass handrail tube because the fit is too loose for using grubs-crews.
Can anyone tell me if a decorators-style propane torch be hot enough for this, and will the heat discolor the metal permanently?
I am used to soldering copper tube joints as big as this, but not heavy gauge and not brass.
Comment: Does the end of the finial slip inside of the tubing and if so how far? It may be better to use epoxy or other glue rather than solder.
Answer: I have silver soldered this size in the past for a large commercial ice maker. I did use an expander to stretch the copper to be a snug fit in the fitting (German ice maker US made compressor); after silver soldering, I cleaned up the pipe and manifold with a light (400 grit) sandpaper then sprayed with a clear sealer since this was used with food production and inspectors look for anything ugly.
Even though this is just a mechanical joint, I would use a swage tool to expand the copper for a snug fit, or your solder connection will be the same as a grub screw.
Answer: Solder doesn't really fill hole or gaps very well. In regards to discoloration, brass is usually a little better than copper but if it's a sheet type of brass I find can discolored quite a bit. Without expanding or shrinking or filling something as Ed Beal mentioned in his answer you will find it very difficult to fill with solder. Brass also seems to have a fairly high heat capacity, for example soldering copper into a brass fitting versus a copper fitting you need more heat for the brass. If you are able to contain the solder then you should be able to get a fairly good joint also using a solder with higher lead content may prove to be easier but also toxic. Lead solder may not be available anymore at hardware stores but you may find it at HVAC supply stores. I don't use it but some guys still use it on boiler systems. It's messy but melts at a lower temperature.


Moderately easy computer circuit to build?

Question: I have a project were I need to make a circuit, and I want to make a circuit that I can put into my computer, maybe in the PCI-E slot. I was thinking of maybe building a capture card or sound card, something that wouldn't need an extreme amount of soldering or small parts to be soldered on. Would any of this be possible? Or ideas for any other circuits that are more likely possible to build for my computer? thanks
Comment: Simple(r) ideas: Circuit which plugs into USB and is used to do RGB lighting inside CPU case. USB pcb which has a temperature sensor and microcontroller and controls fan speed depending upon internal temperature of CPU case. You also need to wire the fan to the same PCB.
Comment: [One button HDD backup](https://www.youtube.com/watch?v=BZnljKjJLvM). It's quite simple to do and useful as well.
Comment: Thanks for your ideas, I have made something similar to your RGB idea before, and wanted to challenge myself a bit more. But those ideas are great, keep any more coming if you think of them! :D
Comment: A USB sound card is quite feasible. USB input devices as well: rotary encoder knob, MIDI controllers, fancy simulation control panels. PCI-E really isn't accessible to amateur building.
Answer: The idea of building your own plugin board for a PC died about 20 years ago when mainstream motherboards stopped supporting the ISA bus. PCI, let alone PCI-E, is simply far too fast to be used as a starter project. Likewise, modern ICs such as A/D converters are increasingly supplied only in very small packages.
If you really want to roll your own circuits and communicate with your PC, I'd advise getting a USB to parallel converter, and get some older parts such as an A/D converter in a DIP package. The USB line will be able to communicate more than fast enough for your purposes.
Alternatively, use the USB interface to drive LEDs, as has been suggested. You seem to have made an LED project of some sort, but revisiting it with a USB link will be an excellent transition project. After all, you know how to drive the LEDs, and any problems you have you can be fairly sure it's the link that needs fixing (hardware or software). This will reduce the frustration factor when it doesn't work the first time. Unless you're an adrenaline junkie (and some are) it's best to increment your skills one skill at a time.


Can you make Arduino Uno send information through a WiFi module to a server?

Question: A lot of tutorials are about how to control Arduino through WiFi, but I need my Arduino to send information about motion sensor activity to a server. Is that possible?
Comment: The key words to search are "web request" together with arduino. I think there is a client library, that you can use. Depending on your used hardware
Comment: What do you want the server to do with your sensor activity? Have you looked into things like IoT ("internet of things")?
Answer:
Can you make Arduino Uno send information through a WiFi module to a server?

Yes, I can.
The simplest way is through an HTTP "GET" request. Every time you request a web page (and there are plenty of examples of that) you are sending data to the server to tell it both what web page to get (/foo/bar.php) and what data to submit to that web page (?baz=4).
It's then up to you to craft that GET request, such as:
GET /foo/bar.php?baz=4 HTTP/1.1
Host: example.com
Content-length: 0

and write the PHP web page (or whatever language you prefer to write web pages in) to do something meaningful with the "baz = 4" parameter.


If you apply for an IEC work permit with a letter of offer can you change jobs once you get there?

Question: I am applying for the IEC young professional work permit at the moment so that I can travel and work in Canada. What happens if I want to change jobs when I get out there, do I have to reapply for a different work permit? Or is the work permit open?
Answer: International Experience Canada (IEC) provides youth with the opportunity to travel and work in Canada.

Can I change employers if I have an International Experience Canada work permit?
If you have a work permit under the Working Holiday category, you can change employers whenever you want or need to.
Under the Young Professionals and International Co-op (Internship) categories, you can only change your employer if you have a valid reason.


What are the main differences between the Seventh Day Adventist church and the Worldwide Church of God?

Question: Both churches are what they call "Sabbath keepers".  What are the main differences in doctrine between the Seventh Day Adventist Church and the Worldwide Church of God, now known as Grace Communion International?
Comment: Do you want a comparison of the doctrines of Worldwide Church of God (WCG) before Herbert Armstrong's death, or do you want to compare against the current Tkach led Grace Communion International (GCI)? Frankly, they really aren't even the same church. GCI has repudiated effectively all of the doctrine taught by WCG and become a mainstream, Sunday-keeping church, little different than any random non-denominational church and nothing at all like the SDA church.
Comment: Thank you for that.  I was wondering about it because I have friends that still follow the old WWCofG and there seems to be two kinds of those.
Comment: The Wikipedia article is badly named.  It is about the Worldwide Church of God, but that organization ended when it was legally taken over, given new doctrines, and renamed to Grace Communion.  Grace Communion should have its own Wikipedia page, not simply steal the title of what is really the WWCG page.
Answer: It is true that both of these churches observe the seventh-day Sabbath, Saturday.  Some of the distinctions beyond this, however, include some key doctrinal points.  Note that this is not a full list, and I am answering with respect to the "Seventh-day Church of God" (as it seems to translate best from the local language where I am--I presume this to be the local equivalent of the Worldwide Church of God of this question) with considerable input from the "Church of God: A Worldwide Association, Inc." website.

Seventh-day Adventists
Church of God: A Worldwide Association

Officially believe in a Trinity consisting of God the Father, God the Son, and God the Holy Spirit--three co-equal, co-eternal beings; many members do not accept this, some have been disfellowshipped over disagreements on the Godhead
Do not believe in a Trinity, but believe in a "Family" of God consisting of the Father and the Son, both of whom have eternally existed, but the spirit is not a separate entity, or being (Binitarian)

Follow a health message, including the avoidance of unclean meats like pork, seafoods, etc. in accordance with Leviticus 11 and Deuteronomy 14
Officially follow the dietary guidelines of Leviticus 11 and Deuteronomy 14; Some congregations do not teach any dietary restrictions

Do not drink or smoke
Social drinking is allowed

Observe a "communion service" including footwashing and the partaking of the emblems of "wine" (non-alcoholic grape juice) and unleavened bread (crackers) once quarterly
Observe a "Passover"—foot-washing, unleavened bread and wine—are part of this service, once annually to commemorate Jesus' death

Sabbath is the seventh-day of the week, Saturday, and is observed from Friday evening at sunset to Saturday evening at sunset
Sabbath is the seventh-day of the week, Saturday, and is observed from Friday evening at sunset to Saturday evening at sunset

The feasts of the Old Testament are part of the "ordinances" that were nailed to the cross, and should no longer be followed (to follow them would indicate disbelief in Christ's atonement having fulfilled these types); the feasts are replaced by the communion service (last supper ceremony) and by campmeetings and other general assemblies of the church
The feasts are still binding and should be observed today, they contain lessons of salvation and will be observed even through the Millennium

Tithing is practiced in which 10% of increase is given to the church, to be used for the support of the ministry; Adventists have a stable system in which these tithes are centralized and ministers/pastors receive a steady monthly salary from the local conference; other expenses, such as church operating budget, maintenance, etc. are supported by freewill offerings, not tithes
Tithing is practiced and the funds go to assist in preaching the gospel, church maintenance, and care for needy members; a special tithe is collected at feast observances

Military service is at the discretion of individual members, but a status of non-combatant ("conscientious objector") is encouraged; as such, many join the medical corps to assist with healing services for those injured in battle; Desmond Doss, a congressional medal-of-honor recipient in the U.S. and the inspiration for the movie "Hacksaw Ridge," was Seventh-day Adventist
Christians should not serve in the military; even hating one's brother is tantamount to murder, and soldiers will have Sabbath problems, etc.; we should obey God rather than man--difficult to do when one must obey one's commanding officer

At the end of about 6000 years Jesus will return and take his people to heaven for 1000 years (the millennium), after which they will return to earth, with the New Jerusalem, to establish Jesus' kingdom on the earth made new (following the final destruction of the resurrected wicked)
At the end of "this present evil age," Jesus will return and establish his kingdom forever, beginning with a 1000-year period commonly known as the millennium; following this the second resurrection takes place and people have one last opportunity to become converted; the incorrigible will be raised in the third resurrection to receive their part in the lake of fire for a brief existence--and no further resurrection is to take place

Seventh-day Adventists study carefully and teach the great prophecies of the Bible, including those of Daniel and Revelation
Do not emphasize prophetic fulfillments

Again, this list does not propose to be complete--a complete comparison might require vastly more space (a book?).  This highlights some of the more noticeable features from my perspective.  Further, there seems to be a great consistency, worldwide, to Seventh-day Adventist beliefs and practices, whereas the "Worldwide" (Seventh-day) Church of God seems to have more regional variation, and the stated beliefs per the website may not accurately reflect the experience of a given member in an individual congregation.
Disclaimer: I do not presume to be fully accurate with this, particularly with the lesser understood (for me) second column in the table.  If you have points to add, please share them in the comments and I may be able to update the information in the table.  I am considerably more confident of the factual accuracy of the first column (left side of table).
References:
Church of God website
Adventist Beliefs website


Best way to assure uniqueness in filename with php

Question: I was wondering, without using any kind of user info (id, nickname, age, etc), what would be the best way to assure filename uniqueness using php in a large database with high traffic and most probably simultaneously between many users? I am using <code>$file = time()</code> for example but I would like to know if this should suffice whenever two users might go over this code at the same time (at a large large large scale, 10000 users at the same time and the same function ran 200 at the same time).
Comment: What database? Why don't sequences work? What about a [UUID](http://en.wikipedia.org/wiki/Universally_unique_identifier)?
Comment: you said you are using `$file = time()`. I'd rather use `microtime()` instead
Comment: I'd say `"slartibartfast"` plus a time stamp should work great. Or you know, a sane directory structure such that you're not that worried about giving a file a name that suggest what its contents are.
Comment: umm.. did you try reading the manual? http://ca3.php.net/uniqid
Answer: Use a GUID. This is the canonical solution to this problem. See https://en.wikipedia.org/wiki/Globally_unique_identifier. Also https://www.rfc-editor.org/rfc/rfc4122.
A GUID is a 128-bit identifier that you can use to uniquely identify just about anything you like. The large number of bits reduces the risk of collision to the point where it can be ignored. You'll never see one.
Find a reputable algorithm, or use a library function from your existing libraries. A quick web search found several in PHP.
Convert it to string in the usual way eg {21EC2020-3AEA-1069-A2DD-08002B30309D}. Problem solved.
Answer: If you don't want to hash the entire file to generate a unique id, a couple of other ways come to mind:

You can use an 'auto increment' column in a database.  Each insert gives you a unique id, managed by the database.  Then base your file name off of that.
You can create a unique identifier from the existing session id or remote ip address and the time.  You might even use the file size as well.  Concatinating them together should prevent file name collisions at a much better reliability than just using the time.
You can implement some other single process service that distributes unique id's upon request.  The requesting PHP script would request an id and wait until one was returned before proceeding.  Its unlikely simply distributing id's would be a bottleneck even at very high levels of traffic.
Answer: In simple terms a multitasking space there is something called an atom, a semaphore or a spin-lock.  They are somewhat different from each other and I won't get into the details of that, but they are all similar concepts to essentially ensure that only one thing at a time can happen in critical code.  They all rely on the system being designed so one physical resource is locked by a caller in such a way that it prevents any others from locking it until the caller releases it.  Then another caller can lock it while it does it's "critical" thing.  It is something that comes right down to one single CPU machine instruction being the lock.
Now having said all that, while it is possible to approach this sort of absolute lock with a time based value, and thus an approximation of a lock, the down side is that as the number of simultaneously executing processes increase, so does the probability of a collision.  Which is I think one of your concerns.  This is true no matter how fine a clock resolution you choose.
In terms of performance and scalability there is a big trade off between the first method above and the second, with the first method creating an absolute bottle neck that all processes must pass thru, and the second method almost no bottleneck.
So in terms of 'best way", well that depends..., on if you need a really absolute lock, or if just a very good lock that can fail within a certain statistical probability will suffice.
(One of the more cool pieces of software I wrote years ago was the guts of multitasking operating system.  Disk access was shared in common between all tasks so had to be absolutely single threaded for at time.  It was important to keep that locked section of code as thin as possible to keep the bottle neck as unblocking as possible.)

As a side note, there is an interesting similar hardware related problem with the possible collision of electrical signals which you might find interesting to read about to reflect light on your question.  It's called meta-stability.


Restore Verify Only option vs Manual Restore

Question: My question is related to best practices with SQL Server. I need to put together a document that lists our various databases and that the backups we have of these databases are valid and have been tested and we know that they will restore properly in case of a disaster recovery scenario. I'm using the Ola H. maintenance solution which backs up the databases with the RESTORE VERIFY option and gives a "succeeded" message to indicate that the backupset is valid. Is this enough to be confident or should we still be manually restoring these backups to a test server and running tests?
Comment: Schrodinger's backup: The condition of any backup is unknown until a restore is attempted (originally penned on twitter by @nixCraft).  `RESTORE VERIFY` doesn't restore any data, it only verifies the backup header.  @Kin's answer in the duplicate question does a great job of running through it all.
Answer:
Is this enough to be confident or should we still be manually restoring these backups to a test server and running tests?

To be 100% confident, a restore of database is required. You need a seperate server to do the restores. Since you are using Ols's backup solution, the entire restore and verify process can be automated using dbatools - Restore-DbaDatabase esp specifying parameter MaintenanceSolutionBackup
e.g. Below powershell script Scans all the backup files in \\server2\backups$ stored in an Ola Hallengreen style folder structure,
filters them and restores the database to the c:\restores folder on server1\instance1

Restore-DbaDatabase -SqlServer server1\instance1 -Path \server2\backups\$ -MaintenanceSolutionBackup -DestinationDataDirectory c:\restores\

Also refer to my answer : Understanding the impact/risk of turning off "verify backup integrity" on SQL backup
Comment: Why do you need a separate server? Just restore the databases as a different name, and put the files in a different drive or folder on the same server.
Comment: @JamesJenkins Not absolutely required to be a separate box, but most companies don't want to add the overhead of that IO and CPU work to their existing production servers.
Comment: We just began using the DBATOOLS PowerShell kit. This answer is the most applicable to my environment. I will proceed with this. The other answer "Understanding the impact/risk of turning off verify backup integrity on SQL backup" was also very helpful.
Answer: More than simply "insufficient", I would actually argue that running RESTORE VERYIFYONLY after every backup is, on modern hardware, practically useless and (therefore) a waste of time and IO. See the extended discussion here.
Literally all RESTORE VERIFYONLY does is make sure the destination backup file is physically readable, and that the header looks like a properly formed backup header. This isn't completely useless, but the fact that it reads the entire backup file off disk means it typically takes just as long as the original backup step.
Now this was arguably important when we were saving SQL backups directly to physical tape, but that is increasingly rare.
RESTORE VERIFYONLY doesn't validate that the backup in any way matches the content of the original database, nor does it make any attempt to validate that the remainder of the backup looks right, unless you add the WITH CHECKSUM parameter:

(24p) using RESTORE … WITH VERIFYONLY validates the entire backup
No. Using VERIFYONLY only validates the backup header looks like a backup header. It's only when you take the backup using WITH CHECKSUM and do RESTORE … WITH VERIFYONLY and using WITH CHECKSUM that the restore does more extensive checks, including the checksum over the entire backup.
)


Sharing ASP.NET MVC partial views between projects

Question: What is the best way to share a common Partial View between applications?
I've created a separate assembly containing my Partial View in an ascx file, some scripts that go with that view and an HtmlHelper extension method to make creating the partial view easier. However, when referencing that assembly from an ASP.NET MVC application, it can't find the partial view as the ascx file is not copied as well. Also, what is the best way of including the attached scripts with the application? The only way I can see at the moment is to copy the relevant files to the new application.
Answer: A nice question indeed.
I would suggest avoiding ascx files and generating HTML manually in your HTML helpers. TagBuilder class does a great deal of help here.
Answer: This post discusses how to embed a view in a DLL and render it from a different project. I guess it'll work for partials as well, but I haven't tried it.
Answer: This is an ongoing issue even with WebForms.  Sharing this stuff is not easy.
My prefered approach now is to create my controls either as mvc WebControls or as jQuery plugins.  That way I can pass around a versioned DLL or script file.
I lean heavily towards the WebControls solutions because, like I said, I can version it and put it in the company infrastructure framework.
I then (only) use PartialViews to render the webcontrols and add some basic flair, markup or content.
Answer: Our approach with WebForms has been to create an IIS virtual directory for shared user controls. Does this approach work with MVC?


Commutation relations (QFT curved spacetime Wald)

Question: So I'm currently reading Wald's QFT on curved spacetime. In section 2.3, he constructs the quantum theory of $n$ decoupled harmonic oscillators by choosing $\mathcal{H}$ as the set of positive frequency solutions and then choosing the Hilbert space to be $\mathcal{F}_s(\mathcal{H})$ - the symmetric Fock space of $\mathcal{H}$. He then defines the Heisenberg position operator to be
$$
q^\prime_{iH}=\xi_i(t)a_i+\bar{\xi}_i(t)a^\dagger_i
$$
where $\xi_i(t)$ is the solution with the $i$th harmonic oscillator excited and $a_i$ is the annihilation associated with said solution. Also, the momentum operator is defined as $p^\prime_{iH}=dq^\prime_{iH}/dt$. So the question is: how do I go about showing that, with these definitions,
$$
[q^\prime_{iH},p^\prime_{jH}]=i\delta_{ij}?
$$
And I ask this because, although Wald defined $[a_i,a^\dagger_j]$, I get terms like $[\xi_i(t)a_i,\bar{\xi}_j(t)a^\dagger_j]$ when I expand the equation above. And in all my ignorance, I don't know for certain what to do in this case.
Comment: If I understand the notation correctly, $\xi_i(t)$ and $\bar \xi_j(t)$ are numbers, not operators. In that case $$[\xi_i(t)a_i,\bar{\xi}_j(t)a^\dagger_j]=\xi_i(t)\bar{\xi}_j(t)[a_i,a^\dagger_j]$$ and the only remaining commutator is known. Does this solves the issue?
Comment: Actually, now I see that it's supposed to be a number indeed. I got confused with the notation.
Comment: Well, that is something I'm a little bit confused. It's stated that $\xi_i(t) \in \mathcal{H}$, so it's a curve in phase space. If I consider it as a "number", as you suggested, this actually solves the issue. And thank you.
Answer: I AM confused If we considero p as operator in a curved soacetime It would have a relation [p,p]. Proporcional tô the Riemann curvature tensor which vanishes..in flat space
?
I mean Heisenberg commutation relations would chance de tô tô Ricci identity no?
Thanks
Garcia


TortoiseHg in Vista 64-bit not showing the context menu

Question: I installed TortoiseHg (Mercurial) in my Vista 64-bit and the context menu is not showing up when I right click a file or folder.
Is there any workaround for this problem?
Comment: This has now been fixed in version 0.8 - http://bitbucket.org/tortoisehg/stable/wiki/ReleaseNotes#x64-support - workarounds are no longer necessary.
Answer: Update: TortoiseHg 0.8 (released 2009-07-01) now includes both 32 and 64 bit shell extensions in the installer, and also works with Windows 7. The workaround described below is no longer necessary.

A workaround to getting the context menus in Windows Explorer is buried in the TortoiseHg development mailing list archives. One of the posts provides this very handy tip on how to run 32-bit Explorer on 64-bit Windows:
TortoiseHG context menus will show up if you run 32-bit windows explorer; create a shortcut with this (or use Start > Run):
%Systemroot%\SysWOW64\explorer.exe /separate

(Source: http://email@example.com/msg01055.html)
It works fairly well and is minimally invasive, but unfortunately this doesn't seem to make the icon overlays appear. I don't know of any workaround for that, but file status can still be viewed through TortoiseHg menu commands at least. All other TortoiseHg functionality seems intact.
The icon overlays are now working with TortoiseHg 0.6 in 32-bit explorer! Not sure if this is a new fix or if I had some misconfiguration in 0.5; regardless this means TortoiseHg is fully functional in 64-bit Windows.
Comment: No longer valid for Windows7 RC
Answer: In order to be able to use an extension in Explorer, the "bitness" of the extension needs to match the bitness of the operating system.  This is because (at least under Windows) you can't load a 32-bit DLL into a 64-bit process -- or vice versa.  If there's no 64-bit version of HgTortoise, then you can't use it with Explorer on a 64-bit Windows OS.
Answer: I upgraded to Windows 7 RC and the 64bit workaround seems to have stopped working
Comment: I opened an issue @ bitbucket and tortoisehg's team has replied... true 64bit support should be available soon.

You can temporarily work around this by using something like FreeCommander instead of Windows Explorer.
Answer: According to the TortoiseHg FAQ the context menus will work in 64-bit Vista if you start a 32-bit instance of explorer by creating a shortcut with the following settings (as suggested in the answer above):
Target: %windir%\syswow64\explorer.exe /separate
Start In: %windir%\syswow64\

Comment: I checked and the FAQ has now been updated and suggests creating a shortcut to run a 32-bit explorer session rather than using a 64-bit file manager.  I've updated my answer to reflect this, although this makes it the same as accepted answer.
Answer: You could always install the command line hg and use it in a pinch.  It's a bit faster, too.
Answer: I can verify that xplorer2 does show the HG tortoise context menu in 64bit Vista.
Answer: As detailed in the TortoiseHg FAQ, you need to run a 32-bit Windows Explorer instance for the context menu and overlays to work under 64-bit Vista.
My personal preference is to create a shortcut similar to the following for each project I'm actively using with TortoiseHg:
  %windir%\syswow64\explorer.exe /separate /root,C:\projects\frobnicator

This launches explorer with the C:\projects\frobnicator folder already opened. (You can omit the /root option and just use the same shortcut for all projects if you don't mind clicking your way to the target folder every time you launch it.)
Answer: I've just noticed that the context menu and icons work from a file open dialog from some apps (on Vista). I now just use Notepad++'s file open dialog, since I use Notepad++ all the time.
It seems to have to be the simple open dialog, not the new one Notepad has, for example.
Maybe someone can check if this trick works in Windows 7.


Hyper-V Virtualisation Disabled in Firmware

Question: I'm on windows 8 and i've been trying to use hyper-v to set-up a virtual machine.
When I go into the "Turn Windows Features On or Off" the box to select Hyper-V platform, it is grayed out and when I hover "Hyper-V Cannot be installed: Virtualization is disabled in the firmware"
Can I enable it and how?
Comment: This is more a question for SuperUser. The hw feature can be found in your BIOS settings (often: F2) under OS security.
Answer: Your host computer must support hardware virtualization, however, this feature is currently disabled.
Enabling  in BIOS
To successfully run Parallels virtual machines, you should enable hardware virtualization in BIOS of the host computer.In BIOS, the hardware virtualization feature is usually called VMX, VT, Virtualization Technology, Virtual Machine Extensions, or Vanderpool Technology. It can be often found under the "Security" or "CPU Features" screen, however, the location of this feature depends on the motherboard of the host computer. You can use these general guidelines to enable hardware virtualization:
Restart the physical computer and press Del to enter BIOS setup before the primary operating system boots up.

Select Advanced BIOS Features and press Enter:

After it is Enabled in Bios..
Follow these steps
Enabling in Windows
Hyper-V is installed in the add features section of the add or remove programs dialog. To get there we need to open a run box by pressing Win+R, now type appwiz.cpl and press enter. You could also get to the Programs and Features box through Control Panel or the Start search, but this is easy and geeky.

You can now launch the Hyper-V manager from the Metro dashboard.
Comment: This is actually working! I am able to install Windows 8.1 Emulators now! Thank you!
Answer: For Asus motherboard I also had to disable BIOS->Advanced->Boot->Fast Boot->Disable. Only then Windows started seeing changes in BIOS
Answer: Yes, you need to enable "Virtualization technology" in bios.

reboot your system then entered in the bios setting.
find the option for "Virtualization technology" then enable it.
save the setting and exit/reboot. Done :)

For eg. I have "Gigabyte UEFI bios" this feature is available under the "Bios feature" setting.
hyper v enable
Comment: Welcome to superuser: How is this different than the most pop. answer. Maybe more detail would provide a more rounded answer. If not this is a comment you will over time get the right to comment in the mean time please take a couple of minutes and read:- [help] .Answering: [answer], again welcome to superuser and please continue.Thankyou


Associativity of arrow composition counter example?

Question: I'm trying to achieve a working understanding of category theory.  One of the problems I'm having is that many of the concepts seem too straight-forward or obvious so it's hard to see why they're meaningful.  For example, the associativity law for arrow composition.  I'm having trouble imagining a situation in which it wouldn't be true.  Does anyone have an example of this?
Comment: Well, isn't that why it's an axiom? Or as you asking why it needs to be required? I'm sure you can easily concoct artificial examples yourself.
Comment: Usually, if something is an axiom, that means it has some particular significance or meaning in the system.  It can sometimes be helpful to show counter-examples to rules to clarify why they're considered important or meaningful.  Simply stating the rule isn't always enough to really illustrate why the rule exists.
Answer: Take any set with a non-associative binary operation which has an identity element (examples). This corresponds to a "non-associative" category with one object.
Here is a nice way of formulating associativity: Let $C$ be a "category" where we don't require associativity. For each object $X$ we define $\hom(X,-) : C \to \mathsf{Set}$  by $Y \mapsto \hom(X,Y)$ on objects and $f \mapsto (g \mapsto f \circ g)$ on morphisms. Then, $\hom(X,-)$ is a functor for all $X$ iff the composition law of $C$ is associative.
The one-object version of this is: Let $X$ be a set with a binary operation $*$. Then this operation is associative iff $(X,*) \to (\mathrm{End}(X),\circ)$, $x \mapsto (y \mapsto y * x)$ is multiplicative.
Answer: It is easy to cook up a simple example. For example, suppose that we want to define a category with objects $w$, $x$, $y$ and $z$ and morphisms

$a : w \to x$,
$b : w \to y$,
$c,c' : w \rightrightarrows z$,
$d : x \to y$,
$e,e' : x \rightrightarrows z$,
$f : y \to z$,

plus the identity morphisms. Consider a composition law partially defined as follows:

$d \circ a = b$,
$f \circ d = e$,
$f \circ b = c'$,
$e \circ a = c$.

Then $f \circ (d \circ a) = f \circ b = c'$ while $(f \circ d) \circ a = e \circ a = c$. Hence one does not have associativity for any composition law completing the partially defined one above.
Of course, if you are wondering why this axiom is included in the definition of category, you may simply try to prove any basic category facts without it, and see what happens...
In most categories you will meet in practice, the morphisms will be coming from maps of underlying sets (e.g. abelian groups, topological spaces), so associativity will be automatic. Exceptions are things like categories of correspondences/spans or cobordism categories.
Comment: Wish I could give answer checks to both of you :P.  Thanks for responding.  Your answer was also really helpful.  I chose Martin's answer since he gave a specific example in which associativity is necessary in order to have a structure preserving map.


Need help with signing user-generated NFTs with Metaplex Certified Collection

Question: Problem:
Our users are able to create NFTs during their experience with our dApp. However, we require these newly created NFTs also to be recognized as part of the same Metaplex Certified Collection. This is required because we want the NFTs to be recognized as part of our official collection on MagicEden and other marketplaces, and also be verifiable on chain for their authenticity. But to do this, we have to sign the transaction using the authority keypair of the Metaplex Certified Collection. Using the authority keypair to sign the NFTs in the frontend would risk exposing the private key in the front-end code which can compromise it. The transaction is then signed by the future owner of the NFT as well (the current connected wallet). How to execute signing by the authority keypair without compromising the private key?
Context:
This is for an application where users can engage with the app and create new NFTs. We want to support Metaplex Certified Collections in our app.
Proposed solution:
Write the process of NFT generation as a backend service and send the transactions in a serialized format to the frontend. In the backend, the authority keypair of the Metaplex Certified Collection can also sign the transaction without any compromise of the private keys. Once the serialized transactions are received by the frontend, the connected wallet can sign the serialized transactions at once, pay the necessary fee and send the transaction to the chain for confirmation.
Is there a more efficient way to solve this problem than the proposed solution? We are looking for a safe, risk-averse way to solve for this. Would appreciate your help on this.
Answer: You can use transaction.partialSign on your backend to partially sign the transaction with your keypair and then the user can decode serialized transactions and sign with his keypair.
transaction.partialSign(metaplexCertifiedCollectionKeypair);


Is Hard Disk Drive a part of motherboard?

Question: After doing research on Google, I couldn't find answer to this question.
Is Hard Disk Drive a part of motherboard or not?
When talking about Tower Case System Unit, the HDD is seperate from the motherboard but connected to it. So, does it mean that HDD is the part of motherboard?
Comment: I'm voting to close this question as off-topic because this question shows that the asker has not attempted even the most basic research before asking the question.
Comment: if HDD is a part of the motherboard then you can never replace it, upgrade it or put another HDD into the CPU case
Comment: The question is basically: if the hard drive is not part of the motherboard, is it part of the motherboard?  It makes no sense.
Answer: No. The Hard Drive (HDD) is a separate part from the motherboard. The hard drive connects to the motherboard typically using SATA, which is like USB, but for internal interface devices (CD-Drive/HDD/RGB Controller)
Answer: A hard-drive is never part of a motherboard.
However, there are SSD hard-drives that connect directly to the motherboard and work way faster than SATA cables.
Check out NVMe PCIe M.2.
I have one, and Windows 10 loads in less than 2 seconds since power on. It's also due to fast memory and processor, but it's 100% contributed by this hard drive too.
Comment: Even in cases such as you describe, the SSD is not "part of the motherboard". Connecting directly to PCIe does not make it "part of the motherboard". RAM DIMMs aren't considered "part of the motherboard" either.
Comment: no, it doesn't hurt. I just thought it's important to not leave wiggle room for misunderstanding.
Comment: I completely agree, and I stated that in my answer. However it's still a closer step to what the OP has described. Besides I thought for the reference it won't hurt posting this here.


hash with file instead of array

Question: Is it possible to use hash function but with File instead of Array, and it's gonna be saving the record in a file position and then search will fseek to that position, but I'm not sure how to open a file with let's say 1000 line, do you think that method could work?
Comment: You are attempting to find a technical solution to a problem.  The approach that you are using is likely to have some issues.  What is the original problem that you are trying to solve?
Comment: If you have an algorithm that works within a single slab of linear memory, you have something can be translated to a random-access file. You're going to have a hard time if you have variable-width records, handling collisions, rehashing, etc. You _can_ implement a rudimentary system, but I would strongly recommend looking at a lightweight solution like SQLite3, leveldb (or possibly Berkley DB if you can accept copyleft).
Comment: Nothing really, I was just thinking if that is possible. for example can that be good enough to be used instead of a DB, I don't mean replace db, but for example if you want to use simple key with some data in a file.
Comment: You can even use a database for that - Depends on the problem.
Answer: Sure, if you have a hashing function that can neatly map your data.  Two things to keep an eye on:

Does your OS/file system support sparse files?  Can you seek beyond the end of the file and write a new record without intervening data?
How are you going to handle hash collisions?  Will each record have some kind of header that contains a pointer to the next bucket in an overflow chain, or will you just overflow into the next available slot?  If you just go to the next slot, how will you tell if it's available?

I'd recommend reading up on ISAM files, they're pretty close to what you're looking to do.
Comment: I'm using Linux and I think it does support it, and made also think about how to delete or replace data, that won't be I guess

hash with file instead of array


How to export all Sharing Setting Name, Rule Criteria and User/Group Shared with value in an Org

Question: How to take export entire Sharing Setting Name, Rule Criteria and User/Group Shared-with value in an Org in csv/excel.
Step by step process explanation will be helpful.
Answer: Sharing rules are metadata and can be fetched using the Metadata API. You can see examples of what it looks like here.

So, if your application is Apex, you will need to use the Apex Metadata API wrapper
If your application is third party, then use the native SOAP or REST Metadata API

Converting this to a CSV form is beyond the scope of this answer so, if your solution is apex-based; give it a whirl and if you run into issues dealing with the Metadata API data structure and converting to CSV, post your code using Edit


Effects of friction on motion of objects

Question: I ran into this problem studying exercises for my exam. The coefficient of kinetic friction is 0.5, the mass is 7.3kg and the force is applied at an angle of 45°. The problem says to find the force F that will move the box at a constant speed along the horizontal floor. What I don't understand is the 'constant speed', this means not accelerating but the body has to at least accelerate a little to even start moving. The question also doesn't specify the value of this constant speed. Am I right to think it is impossible to solve this without more information?
Comment: The question assumes that the body is already moving with constant speed and so the net horizontal force on the body is zero.  Note that because the force$F$ has a vertical component the normal reaction on the block is not $mg$
Comment: @Farcher if I understand correctly,           Fsin45+R=73N, where R is normal reaction and taking g=10m/s^2. And Fcos45=f if the net horizontal force is zero. Am I going in the right direction?
Answer: Why complicate things when you DO NOT need the value of the speed to solve it ?
Constant speed here is assuming that the box is already in a state of a motion of a=0 and v!=0 at t=0.
From t=0 onwards, F and the frictional force, f=µ·mg. (here 36.5) and
F (at an angle θ=45°) start acting on the block.
Direction of F·cosθ is opposite to that of f, which can be used to cancel the effect of friction.
To maintain the constant motion, F·cosθ should be equal to f ie. F/sqrt(2) = 36.5
F= 36.5 · 1.414 = 51.611
Comment: v!=0 at t=0? What does that mean?
Comment: Welcome on Physics SE :) Thank you for your contribution. You might want to visit the help centre to see how to better typeset formulas.
Comment: See [here](https://physics.stackexchange.com/help/notation) for help on math formatting. In short, enclose math with dollar signs. For example `$ x^2+1$` renders as $x^2+1$. Next use the special keywords for fractions (example $\frac{x}{2}$ is `\frac{x}{2}`), square root (example $\sqrt{x}$ is `$\sqrt{x}$` and finally for functions use roman (non italisized characters). For example $\sin^2(x) +\mathrm{g}(x)$ is `$\sin^2(x) +\mathrm{g}(x)$`.


Youngnuo 568iii off camera HSS

Question: I have got 568iii recently and not being able to set-up off camera high speed sync without the on camera flash. HHS works in Nikon's commander mode with the built-in flash to trigger 568iii. Since I didn't want to  depend on the on camera flash, I got a rf603n ii to communicate with flash. But HHS sign doesn't come up  with the 603ii transmitters on when I go to higher shutter speed. Is there any way I can use the radio frequency to trigger HHS on 568iii with my current gears.( D750, youngnuo 568iii and rf603ii. )
Answer: The Yongnuo RF603 series of transceivers do not offer High Speed Sync (HSS) functionality. So that eliminates what you want to do on the transmitter end.
The Yongnuo YN-568EX III flash does not have an internal radio receiver, so that eliminates using a radio transmitter without adding a radio receiver as well. But not just any radio transmitter/receiver set will do. You need one that supports Nikon's Auto FP (HSS).
The typical solution for using the YN-568EX III flashes to do off camera HSS is to use a YN622 set of triggers. The YN622 series supports HSS (and E-TTL, and several other things) that the manual-only RF603/RF605/YN560 radio protocol does not support. You can either use two YN622N transceivers, one serving as the transmitter on the camera and the other serving as the receiver attached to the flash's hot foot, or you can use a YN622N-TX (transmitter only, but with an LCD screen that makes it much easier to navigate the menu and set up multiple flash groups) on the camera with a YN622N receiver on your D750.
The latest versions of each:

YN622N-TX
YN622N II
Comment: Thanks a lot Michael.. I realized it later today when I used a Godoy transmitter and HSS worked fine. So if I would like new flash and what would you recommend for off camera HSS?

Youngnuo 568iii off camera HSS


Polarized light in single mode fiber

Question: In single mode fiber the light propagates in two orthogonal planes. Input  will be linearly polarized light, which state of polarization will be on output and why? And if there will be some different state of polarizatin on output what will happen?
Answer: In standard single-mode fiber, the polarization will tend to drift as the signal propagates (due to slight and varying birefringence of the glass, possibly stress-induced, coupling one polarization to the other).
For short lenths (1 m or so) polarization is typically maintained fairly well. For long distances (1 km or more, I'd guess, but I don't have a lot of experience with this issue) the output polarization is typically pretty well randomized.
There is also readily available "polarization maintaining" (PM) single mode fiber, that is designed to allow a signal to propagate while maintaining its polarization. It does this by having a deliberately introduced birefringence in a well-defined direction.
This does mean that if you launch a signal into PM fiber but not aligned with the preferred axis, it will have strong dispersion between the two polarizations, which could even lead to a single input pulse generating two output pulses.
Answer: It is my experience that in experiments with limited length (<3 meters) of single mode fibers the output polarization given a linear input polarization is elliptical. The reason for this is that the fiber is often bent causing strain in the fiber material leading to birefringent behaviour of the fiber.
I would not call the output polarization randomized as two orthogonal input polarizations can be mapped back using the right combination of a quarter waveplate and a half waveplate. In other words once you find the effective birefringence of your fiber you can retrieve your input polarization state.
A good source for theory on this might be :"Optical Fiber Birefringence Effects – Sources, Utilization and Methods of Suppression" by Petr Drexler and Pavel Fiala.

Polarized light in single mode fiber


List of unregistered views

Question: We have a large number of unregistered views that still have tags.  We are wanting to remove these tags and views.  Does anyone know of a way to create a list of views which are unregistered with tags?
Answer: One way is to compare the view_tag and the view_object files present in the ClearCase registry.
Any view uuid found in view_object which isn't in view_tag is an unregistered view.

List of unregistered views


Screen dims when looking at Dark Screens

Question: I am using Ubuntu 14.04 on a Dell Inspiron 11.  It uses Intel's Integrated graphics cards.  The problem I'm having is when ever I bring something up on the screen that is dark (such as a terminal screen) my computer dims, and its a real pain as it makes it hard to view some items.  From what I've found it appears to be related to some type of dynamic contrast, but for the life of me, I can't figure out how to turn it off.
Answer: After a little bit of research, I found a way to disable this action.
I have an HP 3105m on xubuntu, with the fglrx driver.
In my situation, this only occurs when I go from being plugged in, to unplugging my power. Since it was triggered by a power change, I immediately thought acpi was the cause of action.
Now, I don't know how different it will be with other drivers, but I might as well put what I did out there.
What triggers this is an event file in /etc/acpi/events/, in my case there was a file named fglrx-ac-aticonfig pointing to a script in /etc/acpi/ named fglrx-powermode.sh
EDIT: You could aso just comment out everything in /etc/acpi/events/fglrx-ac-aticonfig, That may work better.
In this file I commented out the lines executing /usr/bin/aticonfig with su
In my case the line looks like this:
su $user -c "/usr/bin/aticonfig --set-powerstate=$powermode --effective=now" &>/dev/null

All I did was comment that out, and the problem disapeared.
I'm not sure what it looks like with intel drivers, but it may still apply on your end.
EDIT:
Turns out that doesn't work.
If you're using fglrx, open amdcccle, go under "PowerPlay" and uncheck "Enable VariBright"


Can no longer open multiple VLC players

Question: Since upgrading to 14.04 I seem to be limited to one VLC player only ?!? ( went slowly up each upgrade from 12.04)
Comment: I have always been able to get multiple players when opening files from a file window.  New files now only open up into the VLC player that was already open. It is beyond frustrating to work a certain way for years, only to have core functionality in my process so drastically removed with no reasoning I can fathom. Short story is: I am now restricted to one VLC player (and one Videos player) maximum and that is all i can get.  I would sometimes have six to eight players open as i worked with different aspects of art and research projects.  Please help me with some good news. Thank you.
Answer: In versions 2.1.x playing multiple VLC instances and different streams in each is as easy as clicking tools -> Preferences... (or just press ctrl+p)(note this does not exist on the Mac version):
in Interface tab scroll down to playlist and instances
untick checkbox Allow only one instance
untick checkbox use only one instance when started from file manager
Press Save.
Source: https://wiki.videolan.org/How_to_play_multiple_instances_of_VLC/
Comment: Thankyou jahedev.  Yes I feel suitably thick :) I must have looked at that tab a half dozen times and just blanked out completely evry time. Good thing I have a sense of humour and can laugh at myself.  Thanks again.

Can no longer open multiple VLC players


Thermodynamic process "in thermal equilibrium with the surroundings"

Question:
"During this process, the system is always in thermal equilibrium with the surroundings."

Does this statement mean the process is adiabatic? I would say yes: since the temperature of both systems is the same (because of thermal equilibrium), there will be no heat exchange. Is this correct?
Comment: Related: https://physics.stackexchange.com/q/623394/226902
Answer: They are talking about a reversible process.  In any process, the temperature of the system always matches the temperature of the surroundings at the interface.  However, in an irreversible process, even though the temperatures at the boundary may match, there are temperature gradients within the system, and the temperature varies with distance from the boundary (i.e., the temperatures within the system are not uniform).  This results in a heat flux at the boundary.  In a reversible process, the process is carried out very slowly, so that the temperature gradient at the boundary is very low.  This means that, to transfer a significant amount of heat, the process has to take place over a much larger time span.  So there is finite heat transfer in the reversible case too, but it occurs a very long time (approaching infinity).  The reversible process is thus not necessarily adiabatic.  Of course, if the boundary is insulated (adiabatic process), the temperature gradient at the boundary is going to be zero, and no heat transfer will occur.
Answer: Not necessarily, just because two systems have the same temperature does not mean there is no heat flow. This just means there is no net flow of heat.
Comment: In order to have heat flow, there must be a temperature difference.
Answer: Your question is an excellent one because you have identified what seems to be an inconsistency.
Heat is defined as energy transfer due to temperature difference. As @Chester Miller points out the highlighted statement is talking about a reversible process. A reversible process is an idealization in which the temperature difference approaches zero in the limit so that the process can be reversed returning both the system and its surroundings to their initial states.
But in order to be heat transfer, there must be a temperature difference. This simply tells us that all REAL processes are irreversible.
So you might ask, what is the usefulness of a so-called reversible process if it can never be realized. The answer is it sets an upper limit to the maximum possible efficiency (that of the Carnot cycle) of any thermodynamic process against which to judge real processes involved in cycles by.
Hope this helps.
Answer: No! In fact, in order to maintain constant temperature in the system some heat will have to flow between system and surroundings. Here is an example:
Suppose we compress a gas. If we conduct the process adiabatically, the gas will heat up. To keep its temperature constant then, we must cool it, i.e., remove some heat and pass it to the bath. In practice we would have to conduct the expansion slowly to give enough time for the gas temperature to equalize with the bath.
The misconception that gives rise to your question comes from the intuitive expectation that heat only flows between systems with finite $\Delta T$ between them. It is possible, however, in the limiting sense, to transfer heat between two systems whose temperature difference is $dT>0$, i.e., a vanishing differential, as long as this differential is positive.


How do I give different IP addresses for people from different networks?

Question: One website I often visit have a configuration that if you are from a specific ISP you would go to a specific IP that is from that ISP, so the connection would be the best for users from different ISP. I heard that this could only be done on DNS, but exactly how is something I wan to know.
Answer: What do you want to do?
If you want to spread the requests to your website one solution could be Anycast. By this every client will connect to a different server, which may be used for load balancing. Another solution would be DNS round robin.
If you want to offer different mirrors which are located in different countries to offer your clients more speed, I don't think there is a solution concerning DNS. You will have to choose a mirror server on one of your main servers, which are resolved by DNS, based on the client's IP address. You can then redirect your client from that main server to the chosen mirror.
Comment: -1: Anycast is the exact opposite of every client resolving a different IP. Anycast works at the IP level; every client connects to the same IP, which is advertised from multiple locations. Users will connect to the 'closest' (from a network toplogy point of view) instance of a service, while still only having one DNS record for it.
Comment: That's not quite what I meant. "By this every client will resolve a different IP." This is not true - with anycast, every client connects to the *same* IP, but that IP is advertised from multiple locations. It would in fact be a valid solution for this problem, as anycast would let users connect to whichever instance of the service was closest to their ISP. However, there are constraints; the OP will need provider independent address space, and will most likely have to advertise /24 netblocks, as most ISPs won't accept /32 routes via BGP.
Comment: +1 for everything else after the Anycast reference. That part i think is too custom and not in use for regular HTTP/TCP communications.
Comment: You're right, anycast is wrong, because he wants to choose one of more IP addresses; but it's a possible solution for load balancing.
Comment: Thnk's for that hint, I've corrected the anycast part.
Answer: Bind has views, which allows you to serve different answers to different people based on their IP address. I'm sure other DNS servers have similar features. For example, PowerDNS has a GeoIP backend that might be suitable.
If you are large enough to have your own PI address space, I believe you can use BGP to advertise the same range from two different networks, and clients would use the one nearest to them. I can imagine that clients would get upset if routes changed to the other site and you used server side state. You'd also have consistency issues to deal with.
If you're physically close enough to that ISP, you could ask to peer with them, so users from that ISP would have a dedicated network connection to use.
Answer: There are domain lookup based techniques used by many multi-national organizations
for the purpose of load balance and sometimes region/language specific support.

Google has country specific TLDs while others use different methods
depending on how their service provision works (who is running the service,
how much would they like to invest in maintaining and managing the service, etc).

If you see a redirect to a TLD or domain prefix that is is region specific,
a domain based divert was made for you. A TLD based divert is likely to be uniquely registered for each country where-as, a prefix based divert (say, country.sitename.com) is more likely diverted internally by the company owned assets.
If the resolved IP address changes with the redirect, you are looking at a domain
based 'balance' across the company servers.
To find where you are coming from -- there are various ways, one quick way: www.ip-adress.com


Tomatoes not flowering or producing

Question: I planted 15 tomato plant of different varieties on May 30th. There was excessive heat and humidity in the Washington DC area, above 90 degrees in July and August. I tilled the ground with composted horse manure and used granular fertilizer a few times. The Husky Cherry tomatoes have plenty of flowers and tomatoes are growing and turning red every day but not the other varieties like, Roma, 'Bonnie' Better boy, Big boy and Celebrity. It is now September and I do not have many tomatoes growing on the other varieties. I may have used too much nitrogen? Or the excessive heat and humidity has caused the flowering to halt or pause https://www.thespruce.com/tomato-blossom-drop-1402964. Is anyone in this area having the same problems with their tomatoes? In just the past week the weather has cooled into the 80's. And I now see more flowering and tomatoes are growing, plus there is more wind. I read the wind helps with pollinating and flowering. I have also been using Tomato blossom set spray. I went to Butler's Orchard https://www.butlersorchard.com/ in Gaithersburg Maryland on 9/10 and their tomato plants are full of green tomatoes, it looks like they may be turning red in about 4 weeks. Their cinnamon apple pie is amazing!
Answer: It could very well be the heat and humidity, but there are a few other options as well--what comes to mind first for me is that May 30 is a little late to transplant out tomato plants--usually I transplant around May 1 or even a little earlier (into unheated high tunnels in southern Michigan), so in DC the tomato season could start even earlier than that. Looks like your last frost date is around the end of March, so with a couple pieces of row cover (Agribon or similar) on hand for any unseasonably cold nights, you could definitely get your tomatoes in the ground earlier next year for an earlier harvest, say early to mid-April, depending on if it's a warm spring or not.
By transplanting earlier the plants get an earlier start on growing and producing fruit, and the plant gets a chance to grow nice and big and robust before it starts to set flowers--the bigger the plant before it sets flowers, the more nutrition there is available to help the fruit grow and ripen. Some people even prune off the first one or two flowering branches of their plants to let the plant really bulk up before letting it start  growing fruit.
Depending on variety there are 20-50 days of ripening time between flower set and the fruit being ripe, so depending on when your tomatoes set flowers, yours could be right on schedule according to their internal clocks!
Without knowing what kind of fertilizer you added I can't say if it's a problem of too much nitrogen or not (although that can certainly affect fruit set), but from the photos you shared it doesn't look to be the case. Usually plants with too much N are super lush and green and full of bigger-than-usual leaves, and yours don't look to be suffering from N overdose to me. Probably what you added was a good amount.
There are other nutrients that can affect flower set/fruit set, among them potassium and calcium. Here's a good general sheet about potassium's role in tomato growth: https://www.yara.us/crop-nutrition/tomato/role-of-potassium/
And here's a short overview of calcium's: https://sustainablefarming.com.au/wp-content/uploads/2019/03/Organic-Ca-Tomatoes-SFS-Technical.pdf
There's also the watering schedule--tomatoes seem to do best for me with a consistent schedule of a little water every day, so that they always have moisture around their roots and therefore the plants are able to access all the water-soluble nutrients and micronutrients whenever they need them. On hotter days they need more water, because the plant transpires more to help keep itself cool. I don't know what kind of watering setup you've got, but this one (https://www.veggiegardener.com/threads/watering-tomatoes-using-a-2-liter-soda-bottle.1886/) is a great free option for tomatoes.
The ground cover you have over them is also really good idea--that really helps them to preserve moisture, although during the heat of the summer I would either change it out for a white plastic one, or just cover the black plastic with some hay or straw, to help keep the soil around the roots cool--excess heat in the soil can also be stressful to the plant especially with the temps we've had.
Good luck with your tomatoes, looks like they're coming along well--you should be able to harvest quite a few. If you want your plants to concentrate their energy on ripening the fruits that are full-size, you can prune the top 6-12 inches off the plants. They will stop growing and producing flowers (more or less, except for the cherry tomato varieties) and put their energy into ripening the fruits that they already have. The plants will keep growing and producing as long as the nighttime temps stay consistently above  50 degrees F, (and as long as they don't succumb to diseases), and when it gets too cold you can harvest the green, blemish-free tomatoes, remove the stem, and lay them out on a piece of cardboard upside-down, in a sunny window, and the tomatoes will continue to ripen slowly over the next few weeks. They won't be as delicious as the ones you pick ripe off the vine, but hey, a fresh, home-grown tomato in December is still better than one from the grocery store!
Comment: Note that plastic is an absolutely terrible ground cover, as it totally blocks both the oxygen exchange between the atmosphere and the soil (essentially sterilizing it) and water. Even with holes poked into it, it just is an awful ground cover. Avoid non-shredded cardboard, non-shredded newspaper, and landscape fabric for the same reasons (esp. oxygen exchange).  In all cases (especially for homeowners), an organic mulch is the way to go (cocoa bean hulls, rice hulls, pine straw, marsh hay, etc.). This also helps feed the soil as it breaks down.
Comment: Part1 - I usually do plant tomatoes the first week of May. I lost many plants to frost when planting in April in Washington DC. Yes, I did get a late start this year. Thanks for the information @Gwarems about potassium and calcium. I just bought some from Amazon! I do water every day and twice a day when it is above 90 degrees. I learned that from my dad. I used black plastic on the ground to stop weeds, but now I see that Butler's farm (u-pick farm in my area) does this as well and they only have a small hole cut just enough for the root and the drip line is under the plastic.
Comment: Part2 - In just the past few days I have seen more tomatoes growing and more flowers. The temperature here has come down into the 80's and there is more wind. I would like to water bath 50 or so jars to make my favorite tomato sauce and soup during the cold winter. The taste is fantastic. Store bought tomatoes in the winter here have no flavor at all.
Answer: It looks like you're square foot gardening. With that in mind, I'm guessing the real problem is one of these:

The soil (the composition and the amount of it)
The plants are too close together (except for the dwarf indeterminate cherry: Husky Cherry Red F1, which is a vareity known to do well in containers, which have limited soil). Yes, you can grow big tomatoes that way, and you are actually doing it (you do have some big fruits), but for ideal results, I'd recommend more space between your plants for those varieties, unless you're willing to fertilize a lot.

Roma and Celebrity F1 can set fruit just fine in very hot temperatures (much better than many varieties and just as well, in my experience, as Husky Cherry Red F1); so, that's not the problem. Humidity with heat, maybe, but just heat, no. However, I've never heard of humidity causing plants to not flower before. I think that must have another cause (plants too close together is a common cause of reduced flowering/production; it's not so much that the roots are too close together that matters--although that does matter--as that the foliage is too close together; when tomato foliage is crowded, it often doesn't produce or flower/fruit as much). When roots are too close together, plants use up the nutrients very fast.
If you're going to amend the soil for better results, a soil test would probably be preferable, if you have the means to do so and don't mind dealing with that (it might be kind of expensive for an end-of-season thing, though). My guess, however, is that the plant needs the following nutrients to go along with all that nitrogen (if the nitrogen really is high, which I don't think is really the case):

Calcium
Phosphorus
Potassium
Possibly magnesium

Adding some monopotassium phosphate, garden gypsum, and Epsom salt would provide those nutrients. Dolomite lime has calcium and magnesium, but can raise the pH some. Wood ash has lots of calcium, as well as a vast array of micronutrients in smaller amounts, but it can raise the pH (with all that nitrogen, if it is high, you might have acidic soil, though). Gypsum is pH-neutral, though (which is why I mentioned it first).
It's a little late in the season to be worrying that much about fertilizer, though (unless the soil depth is limited, or you're using a container, that's mostly a first half of the season sort of thing), but phosphorus probably would help speed the ripening along, even if there's not time to get new fruits.
On the plus side, even if your fruits don't ripen in time, you can pick them and let them ripen the rest of the way indoors. It does work (and it even helps the seeds to mature, if you're a seed-saver). It's best to pick some stem with the fruit (instead of pulling the stem and calyx off).
Plants with lots of nitrogen tend to have glossier, shinier, more tender leaves. Nitrogen also helps a lot with making the leaves a nice green. I do see chlorosis in your plants, so it's possible you might have too little nitrogen (rather than too much); that could be caused by disease or another deficiency, however. Plants with low nitrogen can still have tender leaves, if they're also low in potassium.
I'm guessing fertilizer in general (not specifically what I mentioned in that list above) is probably what you need (but it's a little late, if your frost is coming up soon). Adding it probably won't hurt, though.
It does look like there is some disease, by the nectrotic parts of the yellowing leaves. I'm not sure what kind of disease (possibly more than one). Maybe a copper foliar spray would reduce the issue some (copper is antifungal and used for some tomato diseases). Copper probably wouldn't help with Verticillium, and viruses, though, as an antimicrobial (as a nutrient, it might help, if the plants need more). Fertilizer can improve results in the face of a number of diseases.
I think what you're doing is actually working pretty well.
Comment: Part1 -  Thanks for the information @Brōtsyorfuzthrāx
I did get a better harvest last year when I used more spacing. I changed my garden this year, and I will change it again next year. Right now, there is about 18 inches of space between each root. And yes, their foliage is all intertwined. I used about 2 feet of spacing last year. Butler's farm (a u-pick farm in my area) they use about 4 feet of space. Good catch, and I will change this.
Comment: Part2 -  I am still learning to garden after watching my father for many years. I am Italian and you'd think I would be a natural at growing tomatoes, but that is not the case! I am not so knowledgeable when it comes to soil chemistry and plant disease prevention. Thank God for u-pick farms in my area, they are a life saver. And the tomato sauce I make from farm tomatoes taste just like the ones growing in my garden.

Tomatoes not flowering or producing


Missing "Emoji for English words" in Google Keyboard add-on dictionaries

Question: I've been running Android 4.4 on my Galaxy S4 active for years and recently realized that I've never had access to emojis on my phone. I never really cared too much for them, but I don't like the idea of not having access to something that's so commonplace nowadays so I decided to look up how to get them on my phone.
I did some research and it seemed like it would be a simple installation of "Emoji for English words" under the add-on dictionaries in the Google Keyboard settings. Well, even after refreshing the add-on dictionaries page the emojis never appeared, and a google search for my issue results in nothing really fruitful.
Granted, when I'm using google keyboard I can hold the enter/return key and I'll get a very basic list of emojis but it's limited to stuff like :-) and :-$. About 15 of those face emojis and 24 other basic symbols. That's it. No hot fire emoji, cry laughing emoji, nor the underlined 100 emoji. I need these to be hip with the kids.
I like using google keyboard but the lack of emojis is really starting to annoying me into wanting to use anything else. If anyone's got any ideas or suggestions on a fix, or even a suggestion for another great keyboard app that does have emoji support, I'd be eternally grateful.
Answer: Updates to the Google Keyboard app have made the emojis you are looking for available through long press of the Enter key.


Is it safe to use the Attributes collection to store extra data?

Question: Is it safe to use the attributes collection of a web control to store extra data?
e.g.
DropDownList ddl = new DropDownList();
ddl.Attributes.Add("ExtraData", "SomeData");

Answer: I would recommend against it as these attributes may be prone to tampering.  Instead, you should have a list of objects on the server in which each object stores both the drop down text data as well as the extra data in it.
You can then use the index of the drop down to determine which object in your list on the server is selected.  Typically, frontend controls should never contain anything but display data and indexes if you can help it.  This is why datagrids have a data index column, so you can retrieve the index of the record that corresponds to the row.  The record itself is not stored in the grid, only its fields are displayed.
Answer: It will (most probably) safely arrive at the browser, but everything can be altered there. So anything you get back from the browser cannot be relied upon unless you sign it properly e.g. with a hash of your data + a secret.
With something like:
HASH_FUNCTION(DATA + SECRET), DATA

you can check on the server if somebody has tampered with your data.
Comment: I've found another way to accomplish what i was after but that is good to know, thanks.
Answer: Yes! But only if your data isn't sensitive and it doesn't matter if a client tampers with it. HTML 5 officially recognizes the use of data-* attributes for general purpose data. Mind you the data-* attributes are mostly used for client side stuff; they can also be used server side. But remember, only store non-sensitive data.
I've personally used data-* attributes in asp.net to simplify the client side process of displaying warning messages for links/buttons (such as a delete) button. The message can then be changed server side as needed by accessing the appropriate data-* attribute in the Attributes collection. If the client tampers with these attributes, it only hurts the client in that they may not get the warning message.


Is the LIHTC assistance program exempt from the lawful source of income discrimination?

Question: I am applying to lease an apartment in California that rents under the "Low-income Housing Tax Credit Program (LIHTC). My source of income is S/S and secondary income from investment interest. The manager is demanding an explanation of how I derive income from this financial product. I have submitted 5 years of 1099 INT forms prepared and reported to IRS from my broker. They declare that they do not accept 1099 INT as proof of income. When I brought up the question of the source of income discrimination, the on-site manager stated that they are exempt from that law because the apartment provided rental assistance under the LIHTC program. I had not heard this before and assumed the source of income discrimination applies to all assistance programs. I have not been able to verify.  Does anybody know where online this can be verified?
Answer: LIHTC is administered at the state level, in California by the California Tax Credit Allocation Committee. CTCAC has a compliance document here which sets out the rules. P. 31 of the document says

The owner or agents of the owner shall not discriminate in the
  provision of housing on  the basis of race, color, sex, national
  origin, religion, marital status, age, familial status,  sexual
  orientation, source of income, or handicap. Additionally, owners
  cannot refuse to  accept a prospective tenant based solely on the fact
  that the applicant holds a Section 8  rental voucher or certificate.
  All owners, managers, and staff members should be familiar  with both
  state and federal civil  rights and fair housing laws

P. 40 starts the discussion of income verification, with federal minimum requirements set out in appendix 2, and they note that CTCAC requirements may be more strict than the federal requirements. I should point out that the CTCAC language encourages landlords to be skeptical about income sources (their job is to filter out improper tax credit claims). There is nothing in the 4 documents comprising that appendix that refers to IRS form 1099 as an allowed or disallowed document. This document lists the inclusions and exclusions, under HUD regulations. It explicitly lists as included "Interest, dividends, and other net income of any kind from real or personal property". The second half of the document lists exclusions, which does not suggest that interest income is to be excluded. The CTCAC document also does not list any further restrictions on acceptable forms of income.


"Upload to" vs. "upload on"

Question: Which preposition should follow the verb to upload — to, on, or something else?
Comment: Upload the file to YouTube.  Upload the file on Tuesday.  Upload the file over Spring Break.  Upload the file under duress.  Maybe you can think of more prepositions to use.
Answer: Generally you "upload to" and "download from".
You might express that you "uploaded from your laptop to your server", which uses both from and to.
You might say that you "can do the upload on that machine in the corner", but that refers to the machine you performed the command to upload on (the one physically in front of you), not the one you uploaded to (often the one uploaded from, but not necessarily).
Comment: Your last example sounds to me like the machine you execute the command on. For example you could upload to and from another machine but perform such processes ON the machine in the corner
Comment: @mplungjan You are correct, it would be common for the machine uploaded *from* to be the one uploaded *on*, but it doesn't necessarily follow. I've edited accordingly.
Comment: But wouldn't you write "The ZIP folder is now uploaded onto/into your FTP", considering the fact that at that point said ZIP folder would have already reached its destination and therefore figure on/in said FTP, however "virtually" so?

"Upload to" vs. "upload on"


Is hiring a single software engineer common or reasonable for smaller companies?

Question: I work as a software engineer at a small/medium sized company. I work alone as a software engineer. There are two other people in the building that know programming, but one is the head of the engineering department and the other is an engineer (biomedical engineering). My question, is hiring a single software engineer common in the industry? I have no real complaints about the job but, working on my own, I have no one else in the company I can go to for help with major problems if I encounter any. The deadlines and expectations are reasonable  currently but my fear is that this might change in the future. Is it reasonable for a company to expect one software engineer to function independently like this? How can I best handle this situation?
Comment: [This problem](http://workplace.stackexchange.com/questions/9128/how-can-i-prepare-for-getting-hit-by-a-bus) is a natural side effect of this situation.
Comment: Working as a 1 man team can be a really great experience, you really have to learn a lot more of entire systems giving you a good big picture view.  However, you normally cannot move up a ladder if one does not exist.
Comment: Common and reasonable are not synonymous
Comment: @enderland That's an amazing post. I'll have to read it over in its entirety later on. Thanks so much.
Comment: @JoeStrazzere He means the software development industry.
Answer: As another lone programmer, I can tell you it is very common and a lot of software gets written this way.
To get help, you have to reach outside your office. Join local or online user groups. Stackoverflow has been a big help for specific programming questions. You could argue you may get better answers faster there than from your own team members who are too busy. For domain specific questions, you should have other resources there, but they may not be programming-savvy which may require more time to get on the same page.
With one programmer it's easier to see what you are capable of and you should get more fluent as you improve your skills and understand the business needs. Less productive developers could have an advantage of getting lost in the team. Time-off can be difficult because you're the only person to put out all the fires. A supportive supervisor may be better than having others pick up the slack in the long run.
Comment: This is all true. Having a supportive supervisor has been extremely helpful and crucial. The job would be impossible if the expectations were outside the scope of such singular manpower. I've learned a lot and it's been a great experience so far. It just demands extreme independence and organization which, again, is possible as my employer, thankfully, recognizes the scope and capabilities of a lone software developer.
Answer: I worked at a small company as single developer so I would say it is not unusual. Two are more developers are always better since there is always the danger of you getting serious ill and there will be no one the carry on with your work. Maybe you will even go on vacation from time to time. But additional people always mean additional expenses for the company.
Even if you work alone you still can (and should) communicate with other developers. The internet is a great place. I guess you already use Stackoverflow and the related sites. The most important and helpful people for your job may be working on the other side of the planet.
Answer: A small company can be compared to a small project. For some companies/projects having one employee with skill set X is fine, for others it is not.
It will depend on the product being produced by the company/project. Is function X critical to the survival of the company/project? If yes then you want to avoid a low bus number. If it is not critical then it might be able to survive while you find a replacement.
It will also depend on the workload needed to complete the tasks. They can't just have two of everything just in case of disaster, or to provide way for an employee to grow.
Answer: Yes this is reasonable.  Small companies on average have small budgets.  A software engineer is an expensive position to fill.  Having two would be doubling that cost from a budget perspective, and probably offer minimal gains in productivity.  My best advice for you would be to spend 3-5 hours a week maintaining documentation for getting another developer up to speed quickly.  Then, if you get hit with a major project and have to hire a contactor, or developer, you won't spend a month getting them up to snuff with your evnironment.  This will also help your replacement if you get hit by a bus.
Comment: That's the problem, there was no version control or documentation before I came. I'm trying to get my own systems set out and one major thing (to me) is version control. I'd like to use something like Github, which I have experience with, but they're rather hesitant towards it as the idea of storing private code online is, understandably, seen as a risk. Currently my only documentation is what I myself produce in source code comments.
Comment: I've never done singular, independent developing before in a professional environment so I'm still spending time getting my own systems in order (I've only been here for two or three months). Currently it's difficult to stay organized for myself, let alone other individuals.
Comment: It *might* be reasonable if the budget is tiny.  It is rarely wise in anything but the short term - single point of failure, no shared knowledge.  I think you are also quite wrong about the productivity.
Comment: It is easy to install a svn server or git server on any server or desktop computer.  Look into Turnkey Linux VMs.  Just document what you've done as you go, and that is better than not documenting anyting.  Just take a set amout of time per day to organize and plan.


What is the verb, synonym of stuck, that describes when an object is located between two other objects?

Question: For example:
"The door was ________ between two bookshelves"
Comment: More context might help with this. Something can be "Lodged" between two things, but that might not make sense depending on the way in which the door is stuck.
Answer: I think it is JAMMED.
According to  Merriam-Webster's Dictionary
 (https://www.merriam-webster.com/dictionary/jam) :
jam
intransitive verb
- to become blocked, wedged, or stuck fast
// The line  jammed and the boat hung useless.
Answer: "The door was wedged between two bookshelves."

wedge (1)
  VERB

[with object] Fix in position using a wedge.
[with object and complement] 'the door was wedged open'
[with object and adverbial] Force into a narrow space.
'I wedged the bags into the back seat'

[Oxford Dictionaries]

As the second meaning indicates, if something is wedged there is a sense of it being forced into position. Strictly speaking, you would not normally take a door and force it into its location between two bookshelves - door frames don't tend to be mobile. However, the word is often used metaphorically, for example to describe a tightness of fit (which suits your example sentence) or being forced to choose between competing social or political objectives (e.g. a good policy outcome vs good public opinion).


Cocktail party and tripartite graphs are DS?

Question: Cocktail party graphs and $k_{n,n,n}$ (a tripartite graph) are determined by the spectra of their adjacency matrices? I think thay are DS ( determined by the adjacency spectrum) but I can't find a reference for that. Does anyone know if there is a reference for this?
Thanks to everyone for the help.
Answer: Yes, the cocktail party graphs and $K_{n,n,n}$ are determined by the spectra of their adjacency matrix.  See for example, Proposition 6 of the paper Which graphs are determined by their spectrum? by van Dam and Haemers. Proposition 6 shows that the disjoint union of any collection of cliques is DS.  You also need to use the fact that if $G$ is regular, than a graph is DS with respect to the adjacency matrix if and only if the complement of $G$ is DS with respect to the adjacency matrix.  Since the cocktail party graphs and $K_{n,n,n}$ are both regular and the complement of a disjoint union of cliques, the result follows.
Since the paper appears to be behind a paywall, I will include a proof of Proposition 6 here.

Every graph which is the disjoint union of cliques is determined by the spectra of its adjacency matrix.

Proof. Let $G=K_{n_1} \sqcup \dots \sqcup K_{n_k}$ where $n_1 + \dots +n_k=n$.  The spectra of $G$ is $n_1-1, \dots, n_k-1, -1, \dots, -1$, where $-1$ occurs $n-k$ times.  Let $H$ be a graph with the same spectra and $A$ be the adjacency matrix of $H$.  Since all eigenvalues of $A+I$ are nonnegative, $A+I$ is positive semidefinite. Therefore, $A+I=BB^T$ for some matrix $B$.  Because the diagonal entries of $A+I$ are all $1$, each column of $B$ is a unit vector.  Moreover, since $A+I$ is $0/1$-valued, it follows that if $x$ and $y$ are columns of $B$, then either $x=y$ or $x$ and $y$ are orthogonal.  By grouping identical columns of $B$, we see that $A+I$ can be put in block diagonal form, where each block is an all-ones matrix.  It follows that $H$ is also a disjoint union of cliques.  Finally, it is easy to see that two graphs which are both the disjoint union of cliques have the same spectra if and only if they are isomorphic.
Comment: You're welcome.  I also added a proof of Proposition 6 here.  If you are satisfied with the answer, you can click on the green check mark to show that it has been answered.
Comment: Great. Thanks for your answer. You mean since these graphs are regular, we can take $\overline{A}$, instead of A, the adjacency matrix, it's right?
Comment: Yes, that's correct.
Comment: Thanks for your answer.
Comment: A tiny bit is missing in order to go to the complement.  Namely, a regular graph cannot be cospectral to an irregular graph. This is an old result of Sachs: a graph is regular iff the sum of the squares of the eigenvalues equal $n$ times the largest eigenvalue.
Comment: @BrendanMcKay Yes, I swept that part under the rug.  Thanks for your comment!
Comment: @Tony Huynh Thanks for your proof.


Apps uninstalling on battery death

Question: I have an HTC Incredible smartphone. Every time the battery dies during normal usage, my applications uninstall. Why does this happen, and how can I prevent it from happening in the future?
Comment: Most of these portable computers will automatic shut down, when the battery drops to a certian voltage, usually that leaves enough power in the system for days of maintaining the volitile memory. If someone change the way it worked (some firmware) , if the battery was really really bad, or much time had passed I could see it.  but It isnt normal. Or I hope it isnt.  How old is your battery, how much did you change the original firmware or software?
Comment: It gives warning, but you can decide to totally run the battery out on some of them. A sort of 911 emergency power last phone call and you don't care if it wipes type function I guess. Did it with a Samsung **ONCE** which was annoying enough to not do it again.
Answer: The battery backed memory that holds installed apps is clearing when the battery goes dead. Don't let the battery go totally dead like that. It kills off your battery life, unless you've already damaged it.

Apps uninstalling on battery death


Do I need a dweller in the storage room?

Question: Do I need a dweller in the storage room(s), or can I use the dweller elsewhere?
Answer: No, you do not need to have a dweller in a Storage Room. You might want to, in case of a fire or radroach invasion, but I wouldn't bother.
Comment: Yeah there doesn't seem to be any benefit other than place to put dwellers if you have no other place to put them.
Comment: The only benefit of having a dweller in a storage room is incase there is an incident. The thing with that though is that there are other dwellers near by so they can just go to the room and take care of it.
Comment: I like to put one in there for aesthetics. I hate the look of the rats in an empty room. :)
Answer: Putting a dweller in the storage room keeps them happy. Put high endurance dwellers in the storage room.
Answer: The storage room can be working as an empty one. The only reason you want to add dwellers inside is in case of an emergency starting in that spot, so you have people to take care of it.
Adding more dwellers adds NO benefits to your storage.


Shortest path: identify edges that cause negative cycles

Question: I have a directed graph with negative edge weights. The graph is modified by the program and sometimes will form negative cycles. When that happens, shortest path algorithms (Bellman-ford/Johnson/Floyd-Warshall) would detect the existence of such negative cycle and fail, but no other useful information is produced.
I would like to identify what edge causes the negative cycle and disallow such modifications in the graph. Can someone help me with a pointer?
Thanks,
Paul
Comment: Unless there is only one edge is of negative weight in a negative cycle, you can't tell which negative edge among several of them are causing the problem.
Answer: Paul, If you're about to add an edge (source, destination, weight), and you know the distance from destination to source, then you're creating a negative cycle if and only if new weight + old distance is negative.
On the other hand, if you've just got a graph, the bellman-ford algorithm detects negative cycles and can exhibit one when it finds one. You just need to either find an implementation that does that (rather than just failing), or write one yourself. It's not a difficult algorithm and there's lots of pseudocode on the web.
(It's probably a couple of days consultancy work if you want one custom-written for you. I do this sort of thing for a living and would be happy to.)
I'm not sure exactly what you need. I don't know, but I'd imagine that there's an on-line version of Bellman-Ford that keeps its distances up to date cheaply as new edges come in, and will scream if you add a bad one.


How can I get Chrome to launch and close "developer tools" on Mac (like Firebug with F12 & Ctrl+Shift+C)

Question: How can I get Chrome to launch and close "developer tools" on Mac (like Firebug with F12 & Ctrl+Shift+C)? It was so convenient in Firefox/Firebug to just hit F12 followed by "toggle inspect mode" (Ctrl+Shift+C) and then hover my mouse over the different elements. I would love it if anyone else used to have this workflow.
Answer: For those that are still looking for ways to access Chrome's Developer Tools:
To access the developer tools, open a web page or web app in Google Chrome. Then take one of the following actions:

Select the Wrench menu  at the top-right of your browser window, then select Tools -> Developer tools.
Right-click on any page element and select Inspect element.
On Windows and Linux, press

Ctrl+Shift+I to open Developer Tools
Ctrl+Shift+J to open Developer Tools and bring focus to the Console.
Ctrl+Shift+C to toggle Inspect Element mode.

On OS X, press

⌥+⌘+I (Option+Command+I) to open Developer Tools
⌥+⌘+J (Option+Command+J) to open Developer Tools and bring focus to the Console.
^+⌘+C (Control+Command+C) to toggle Inspect Element mode.

Source: http://code.google.com/intl/nl/chrome/devtools/docs/overview.html
Comment: You have the key symbols mixed up... **⌘ = Command, ⌥ = Option**. See [Dan Rodney's List of Mac OS X Keyboard Shortcuts & Keystrokes](http://www.danrodney.com/mac/).
Comment: In newer  versions of Google Chrome, you can now use F12 to open developer tools.
Answer: Ctrl + Shift + I
Opens developer tools. I don't think you can toggle "inspect mode" (I found this looking for that)
Comment: Thanks for confirming that, one thing I really loved about Firebug, hopefully it comes to Chrome (or I switch back to FF).
Answer: On my Mac, I use:
"Cmd" + "Option" + "I" - To open/close Developer Tools
"Cmd" + "Shift" + "C" - Opens Inspect