Where does Spotlight store its metadata index?

Question: Where does Mac OS X store Spotlight comments associated with a file? Is it stored as HFS+ file metadata, or is the information kept by the OS somewhere else?
Answer: The metadata is inside a hidden .Spotlight-V100 folder at the root of the indexed volume.
Answer: The values of the kMDItemFinderComment attributes that get stored in metadata store directories like /.Spotlight-V100/ depend on the com.apple.metadata:kMDItemFinderComment extended attributes.
Finder also stores the Spotlight comments of all items in a folder in a .DS_Store file.
You can print Spotlight comments with mdls or xattr:
mdls -n kMDItemFinderComment test.txt
xattr -p com.apple.metadata:kMDItemFinderComment file.txt | xxd -r -p | plutil -convert xml1 -o - - | ruby -rcgi -e 'puts CGI.unescapeHTML(STDIN.read.scan(/<string>(.*)<\/string>/m)[0][0])'
If you use Finder to add a Spotlight comment for a file you don't have write permission to (like some application bundles in /Applications/), the comment won't be saved as an extended attribute, and it won't get picked up by Spotlight. You can open Finder as the superuser or use sudo xattr -w though.
If you delete a .DS_Store file from a folder and quit and reopen Finder, the Spotlight comments of all files in the folder disappear from Finder's information windows. If there are still extended attributes for the Spotlight comments, the comments are seen by Spotlight though.
If you use xattr to add a com.apple.metadata:kMDItemFinderComment extended attribute, the comment gets picked up by Spotligt, but it won't be shown in Finder's information windows.
xattr -w com.apple.metadata:kMDItemFinderComment comment file.txt
If you use AppleScript to change the comment attribute of a file, the comment is also saved in a .DS_Store file and shown in Finder.
osascript -e 'on run {f, c}' -e 'tell app "Finder" to set comment of (POSIX file f as alias) to c' -e end file.txt comment
(There is a warning like CFURLGetFSRef was passed this URL which has no scheme in 10.8 when a relative path is converted to an alias, but you can ignore it.)
Comment: @beroe I edited the answer.
Comment: Please provide a way to verify this. I was unable to do so. Setup: Create folders `foo` and `foo/bar`, use Automator to set Spotlight comment *baz* on `foo/bar`. Open foo in Finder, search for *baz* in it. This finds `foo/bar`. Then open Terminal, delete `foo/.DS_Store` (there's no `foo/bar/.DS_Store`). Relaunch Finder. Open `foo` in Finder, search for *baz*: Still finds `foo/bar`.
Comment: This works for me! Is there a way to write them? I've tried writing to the plist as well as an ascii-encoded hex string and neither sticks. I can write keywords that Spotlight finds using `xattr -w com.apple.metadata:_kMDItemUserTags`  Maybe I should write this as a question of its own...
Answer: If you're trying to edit the spotlight comments on a file, you can see/modify them under the Get Info (command + I) window for the file.


Can I unshelve to a different branch in tfs 2008?

Question: Let's assume that some developer in my team shelved his changes that he did in branch A. And I am working on branch B. Can I unshelve his changes into branch B? (By GUI or command prompt)
Comment: Demo of above command: [Unshelve command basics](http://codereferences.blogspot.com/2012/02/migrating-shelveset-from-one-branch-to.html)
Answer: The Visual Studio Power Tools should let you do this.
C:\src\2\Merlin\Main>tfpt unshelve /?
tfpt unshelve - Unshelve into workspace with pending changes

Allows a shelveset to be unshelved into a workspace with pending changes.
Merges content between local and shelved changes. Allows migration of shelved
changes from one branch into another by rewriting server paths.

Usage: tfpt unshelve [shelvesetname[;username]] [/nobackup]
                     [/migrate /source:serverpath /target:serverpath]

 shelvesetname          The name of the shelveset to unshelve
 /nobackup              Skip the creation of a backup shelveset
 /migrate               Rewrite the server paths of the shelved items
                        (for example to unshelve into another branch)
 /source:serverpath     Source location for path rewrite (supply with /migrate)
 /target:serverpath     Target location for path rewrite (supply with /migrate)
 /nobackup              Skip the creation of a backup shelveset

For example to merge a shelve set called "Shelve Set Name" created on Branch1 to Branch2 use this:
>tfpt unshelve "Shelve Set Name";domain\userName /migrate /source:"$/Project/Branch1/" /target:"$/Project/Branch2/"

Comment: Yep, the power tools SHOULD let you do this, but unfortunately the merge goes horribly wrong each time so it's next to useless.
Comment: Ooohhh...
Curt, I think you just made my day.  I'm going to have to try that later.
Comment: Just tried it. I moved many files within the shelfset and unfortunately this doesn't seem to work well . You need to manually "migrate" all these files (there is also no multi-select). And then they are added as new files to the workspace. I can't use it, because I can't merge it anymore.
Comment: Where do you get the power tools from?
Comment: The merge isn't that bad.  I found that Auto Merge works in 90% of the cases.
Comment: The power tools can be freely downloaded from some MSDN site. Use Google or Bing to find the right site -- that's what I need to do, too.
Comment: @apathetic - Masterful. :) Um, 'auto merge'? Yeah, cause that's what *I* want to do, trust a tool to decide conflicts for me. :) If that's what you mean by 'the merge goes horribly wrong', it's time to spend a bit more than 30 seconds recovering your shelfsets. :) Much better than copying the files over and having No Idea wtf the changes were. :)
Comment: @user254180 - "Um, 'auto merge'? Yeah, cause that's what I want to do, trust a tool to decide conflicts for me" - Automerge merges the changes automatically that do *not* conflict. When they do conflict, you are being asked to resolve them manually. That's the beauty of it.
Answer: Alternative solution to tfpt that avoids   having to merge each file manually
The problem with the tfs power tool is that you're doing a 'baseless merge' so have to confirm every file. I had a shelveset of over 800 files and I never trust the 'auto merge' button and didn't want to go through each file in turn - so I had to find another way!

Download and install the TFS Shelveset Sidekick.
The tool appears under 'Tools' in VS2010
Run the 'Shelveset Sidekick' tool, click Search to show shelvesets
Right click on your shelveset and select 'Export Shelveset'
Save to an empty location such as C:\temp\shelveset-name
Now have a complete directory structure containing JUST the new files

(Note: There's no progress bar when exporting - so if you have a large shelveset that takes a long time to export you'll just have to check in Windows Explorer (File>Properties>Size) that the files are still coming down if you think it's frozen).
You now just have to copy them over to the new branch with Windows Explorer.
This worked for me :

Checking out the whole solution first (in the new branch)
Close that solution
Take TFS offline from within VS (Tool to do this) - see below for why this is important...
Copy files over in Windows Explorer. The directory structure in c:\temp\shelveset-name will have to be renamed to correspond to the new branch. Tip: Make sure you copy to the right place!!!
Bring VS online
It should find all the changes and add the new files
If it asks you to bind the sourcecontrol be sure to verify the path is correct for the new branch.
Test - and then checkin the new files

Important: I've found that if you don't first take TFS offline then you'll end up with any new files (from your unshelves changeset) showing without a little red check mark and you'll have to exclude and include them again to get them to add. If anyone has an alternative solution to this problem I'd love to know - refreshing doesn't seem to work.
Comment: This method is easier for larger shelvesets and is the one I followed. Thanks!
Comment: This method is really better for bigger shelvesets
Comment: Well you may get away without taking TFS offline. But I am not sure it is worth it. What I did was to run the Compare action - in Source Control Explorer from the context menu open on the relevant folder. One can filter the output to only show the items that are different. Then it allows to do a multiple selection on them and Check Out all of them at once. But I guess taking TFS offline is faster and simpler than that.
Comment: Unfortunately, this does not work for me when I have "add" changes in the shelveset. I get an error "Failed to retrieve shelved file.A shelved pending change on a file is required".
Comment: @JohnSaunders you mean a shelveset with *any* adds or exclusively adds? I haven't needed to do this in years :)
Comment: A shelveset with many adds. I made a number of changes in the wrong branch (and on a different computer) and wanted to move them to the correct branch on my new computer.
Comment: My situation was kind of a one time thing. I don't have any branches, just need to do this kind of stuff occasionally when I have a fried laptop and need to get files onto my spare. Good luck tho :)
Answer: The shelf information includes the specific path it goes to.  Unfortunately I don't know of any automatic way to unshelve to any location other than the one it was shelved to.  The times I've wanted to do this I had to check out the equivalent files in the new branch, unshelve from the old branch, then manually copy the files over.
EDIT:  Well, I guess I was doing it the hard way.  I'll have to try out Curt's solution. :)
Answer: I spent good amount of time to get this done and I had few issues to overcome. It is possible but here few issues and few rules to follow to avois these issues
Error:

unable to determine the workspace

This particular issue was solved by running the command from source branch root folder. This is contrary to some answers on SO where they say to use "target" branch - no, use "source":
cd [your !!source!! branch root]
tfpt unshelve /migrate /source:"$/MyCollection/Development/Maint1.1" /target:"$/MyCollection/Development/Maint1.2" "myShelveset;UserName"

Second issue appeared after this. Seem that it couldn't connect to TFS server. What I realized, I have multiple VS installed and connected to different TFS servers. I was using VS12 and I had workspace and server connection. But I didn't realize that same connection needs to be replicated in VS13 for TFPT2013 to work. It connects to same server and workspace.
I also tried doing it using TFPT2015 but I installed it and it didn't install TFPT.exe hence it was useless. So I tried from TFPT2013 to TFS2015 and it worked for this particular command. I wonder, why not, if VS12/13 works fine against TFS2015?
To summarize

Use CMD or DevCMD - doesn't matter
run command from source branch root folder
verify Team Explorer Server connection for specific VS
TF Power Tools 2013 work against TFS v15, at least migrate option works
Answer: The following steps can be used for small size shelvesets (~20 files or less).

On the shelveset and target branches, start by having all pending updates checked in or rolled back.
On the shelveset branch, unshelve the files from the applicable shelveset.
On the target branch, checkout any of the existing files that were in the unshelved shelveset.
Compare the unshelved files on the shelveset branch with those on the target branch to identify those files that require merge updates (if any).
If needed, manually make merge updates to the applicable files of the prior step and save these files in the target branch workspace.
Copy the other shelveset files from the shelveset branch workspace to the target branch workspace.
Compare the new updated files in the target branch workspace with the checked in files. Make any corrections as needed.
Check in the new updated files on the target branch.
Rollback the unhelved files on the shelveset branch.


Shutting down Dell Server via iDRAC and UPS

Question: does anybody know if it's possible to shut down a Dell Server via iDRAC card triggered by UPS? Background: The server hosts a ESXi which isn't (in the free version) able to shut down via UPS. But it's possible to tell ESXi that it shall shut down in preferred way if the "power swich" is pressed - so maybe something like a "virtual" power switch could be "pressed".
Answer: You can SSH to iDRAC - so if your UPS has some kind of management agent, then you could run this in a virtual machine with a trigger to run an iDRAC shutdown.
HOWEVER, this will not do a clean power down of your VM's, which is the critical component and the whole point of a clean shutdown. An ESXi server is easy to rebuild - your VM's are not.
Therefore you'll need to shutdown your virtual machines somehow. I have no idea if ESXi free can do this from the command line. If not, you'll need to remotely shutdown each of your VM's using whatever tools their operating systems provide.
This, does, of course leave you in a sticky situation because your scripts will be running on a VM, too. So, you'd be better off running your scripts in their own dedicated VM which takes the risk with an unscheduled shutdown as the host goes down.
Alternatively, you could purchase the proper tools for the job and use the VSphere suite with VCenter.
Comment: Thanks for the Answer. The information, that I could ssh to iDRAC fits the needs. If it's simmulating a power switch you can configure ESXi to do whatever you want with the VMs.
Answer: If you really need to stick to ESXi, I suggest that you plug this UPS into another machine (maybe a desktop running linux?) and from there you can remotely perform a clean shutdown on all VMs, then on the ESX host via ssh as soon as you pick up a signal that you're running out of backup power.
The linux package nut - Network UPS Tools will run whatever script you want when batteries run out, enabling you to shutdown everything and even email you or whatever action you need.
Check nut on opensuse or nut on ubuntu as examples.
Comment: Shure, why didn't I come to this result. There're multiple servers. So it won't be a Problem :-)


EU citizen (Romanian) with Asian (VN) wife want to live in UK

Question: I am an Eu citizen (Romanian) and I worked for 3 years as an engineer in the UK. I left a few months ago to go to Asia (Vietnam) to get married.
Now, we are going back to Romania and hope we can return to England together. Do we have a chance? Can she get a visa?
Answer: Yes.  She should apply for an EEA family permit, or, if you are already registered under the settlement scheme, an EU settlement scheme family permit.  The possible grounds for refusal are few.  The most likely problem you'll face is the suspicion of a marriage of convenience.
Comment: @BufanuLoren see [EEA family permit refusal](https://expatriates.stackexchange.com/q/14735/2440). The refusal reads in part "you have provided an extract of marriage certificate issued by the Italian authorities however ... you were married in Albania.  Therefore, this is not your original marriage certificate...."
Comment: @BufanuLoren the UK will want your *original marriage certificate* from the jurisdiction where the marriage took place, translated into English (or Welsh).  You do not need, and should not submit, any other marriage certificate.  I would not use a company.  I would submit the application myself.  If you doubt your ability to compile the materials effectively, though, or if you lack the time, it makes sense to hire someone to do it for you.  I would certainly shop around, and I agree that £550 seems a bit much.
Comment: Thank you for the reply. I will watch to see which one fit for our case and I will apply as soon as we get the European marriage certificate. It should not be a hard process from what i read. A company asked me for 550 £ to apply in my name. I find that a bit pricey.


Do programmers need a good memory?

Question: It seems that it's necessary to remember all sorts of syntax to be able to program. If a person doesn't have a good memory for remembering names, will it be more difficult to learn to program?
Comment: If syntax is a problem, then pick a language that has the minimal syntax. Lisp/Clojure?
Comment: These days I don't spend all day programming, but I do spend *some* time every day programming. And I program in a bunch of languages that aren't like each other. I program in C, Java, Javascript, Lisp, VBA, PL/SQL, Ruby, Python, Perl, Smalltalk, and even a little Prolog from time to time. I just look up syntax.
Comment: Universities certainly teach it like you need good memory, which is utterly stupid. Mine is particularly notorious for requiring CS final exams to be worth at least 50% (always closed-book) and midterms usually being at least 30-40%.
Comment: IMO Historian needs better memory than Programmer, I often don't remember many /human|programming/ languages I use but they just chime in when I need to use them. I found learning+practicing multiple /human|programming/ languages help me in this case. Note: I got memory problem since I got Vertigo, I even need to speak way slower than average people in my native human language, but I can still code happily.
Comment: @Chiron: Premature optimization.  Lisp's infamous "lack of syntax" causes more problems than it solves.
Comment: @Mason Wheeler now that sounds interesting, what problems does Lisp lack of Syntax cause?
Comment: @Andreas: Making the code harder to read, both inherently (there's a reason they came up with the backronym Lost In Superfluous Parenthesis) and because it means that everyone ends up having to invent their own syntax, and everyone's personal version will be a little bit different.
Comment: @Andreas: To give just one example, look at the classic answer when people ask "what are Lisp macros useful for?"  Apparently you can use them to implement an `IF/THEN/ELSE` construct. Lispers seem to think this is something awesome.  I wonder how anyone can look at that without being a little bit dumbfounded at a language where you *have to roll your own `IF` statement!*  Why does anyone take a language that primitive seriously?!?  How is Lisp not classified with other excessively simplistic languages like INTERCAL and Brainf**k, as a joke language?
Comment: I think it's  because you don't understand lisp you don't  like it. Try reading SICP and feel enlighted!
Answer: The syntax of a language is not as hard as you think to remember, if you use it daily. Eventually it becomes very easy. Remembering all the various library functions is much more difficult and I think that most people can only remember the most common ones they use. But that's OK if they have access to the Internet, or books, or something else that "remembers" all the other details for them.
Comment: O'Reilly's pocket guides help me keep track of things. Highly useful.
Answer:
It seems that it's necessary to remember all sorts of syntax to be able to
program speak a natural language.
If a person doesn't have a good memory for remembering names
words, will it be more difficult to learn to program
speak?

It can't be true that people have a "natural" ability for languages, can it?
It can't possibly be true that we have low-level neural hardware just to acquire languages, can it?
Programming uses artificial languages that follow many of the rules of natural languages.
Natural languages have a little more flexibility than programming languages.
If you can speak, then you can learn to program without memorizing anything more than what you memorized when you learned to speak.
Answer: Yes:
If you are talking about short term memory then yes. a programmer must be able to juggle multiple bits of information simultaneously  when programming/solving problems.
No:
If you are talking about long term memory then not really. There are many manuals and references + tools that can aid significantly in recalling information. Certainly memorising these long term information will make you a faster developer (overall), but its not a prerequisite.
Answer: A good memory is absolutely essential, but not for the obvious reasons.
Remembering details on specific algorithms, libraries, variable names, and such comes in very handy, but is not super important.  You have Google, DuckDuckGo, man pages, language-specific documentation, and smart editors to help with all of the above.  It helps if you don't need to rely on these crutches, but you'll get by just fine if you do need them from time to time.
Where memory is essential is in keeping the details of what you're working on in active, short-term memory.  Being able to visualize the design, data flow, algorithms, data structures, and how they all interact to do whatever it is your product does separates the OK programmer from the great programmer.  When you're actively doing it, it feels like you're successfully juggling a gargantuan number of balls while riding a unicycle.
This is often referred to as being in the zone.  Interruptions, stupid questions, bosses needing TPS reports all jolt you from this zone.
The better your memory is, the easier it is to get into the zone, the easier it is to stay there, and the easier it is to get back into it after an interruption.
If you have issues with this kind of memory, I'd suggest learning meditation techniques and memory tricks as the more facile your memory becomes, the greater success you will have as a programmer.
Comment: I would actually say that the memory requirements are cut down if you better modularize the program and name things right.  If you have a two page method with 20 variables, then you have to remember a lot more than if you have a 5 line method with calls to other well named methods to do sub tasks.  Also each time you want to modify something that complex, you have to get into "the zone" to do it.  Whereas if it is simpler then you can just make your change.  I would say "the zone" is a liability.
Comment: @Cervo - Yes, when you're coding individual modules and small units of code, what I describe above isn't really necessary.  But when you're debugging a whole system and trying to find which nice, neat and clean module the problem resides within, it helps to be able to keep as much state in mind as possible.
Comment: Why in the world did this have only one vote?  You can't design your code properly without remembering how it fits into the stuff around it.  A lot of modern programming is about cutting down the amount of detail this entails but that simply reduces the amount you must remember, not the fact that you must remember it to do your job.
Answer: I'm going to go against the flow, and say yes. A good memory is be an awesome asset as a programmer. My memory I've always seen as a programming liability, so I've picked up some tricks to compensate for my handicap:

You should be able to remember how that variable (which you used 3 lines before) was spelled. If you can't learn to use Intellisense (or whatever your form of auto-complete is in your editor or IDE).
You should be able to quickly remember what you were doing last time you worked on this project. This might have been days ago, it might have been just before lunch. If you can't, learn to write stuff down. Keep a notebook by your side and write what you were (or are) doing, TODO items, and stuff you need to remember about how the current code you're working on fits together.
Debugging and QA is hard. Ideally you should keep a very detailed notebook about the steps you took when trying to reproduce a bug or debug something. This is something I know I should do, but still struggle with.

Hope this helps!
Answer: The Guerrilla Guide to Interviewing (version 3.0) is a common reference that notes being smart and getting things done are the important points of programming.  Smart does include some memory skills but not necessarily as much as you may think.
Intellisense can help a lot when it comes to syntax if you want some help on that side of things.  Knowing how you learn so that you can quickly apply what you learn in a meaningful way is more important than being able to answer trivia questions.
Answer: I believe remembering names is a rather different cognitive function from remembering processes which is different from remembering vocabularies.  There have been cases of people who have received brain injuries that completely removed the ability to remember names while being able to function perfectly well otherwise.
So I'd say that the ability to remember names in unrelated to learning programming languages.
It'd be helpful to be able to remember logical patterns, rules, and vocabulary, however.
Comment: I'm pretty sure you're right. The Myers-Briggs Type Indicator says that INTPs (who are peculiarly suited to becoming programmers) have trouble remembering people's names. I know that true in my case. I can remember your pets' names, your car's license plate, and where I put the printout of a stacktrace you gave me last year that had the weird newlines as 0x0D0A0D. Your own name, though, I'll forget it 10 minutes. (When I was younger, it took me three years to get the names of all the people on my soccer team.)
Answer: No. The memory depth of tools (Intellisense, Google, compilers, code generators) is infinite comparing to human memory. So programmer with good memory is no much better than one with a hole in the head.
What programmers actually need is "peak speed of focus gaining" when they switch between levels of abstraction. The faster you can, the better you are as a programmer. Some have a heartbeat speed like 500 ms, with arrival of first blood wave to brain you are focused. Some have focusing clock rounded to smoking cycle, about 2 hours. Some need morning shower, so about 24 hours. etc. The difference between good and bad programmer was once declared 1:80 fold years ago, and the gap is only growing.
Answer: Nope, you just need to understand how Google works to get what you want
I have a horrible memory, but my Googling skills are awesome ^_^
In all seriousness, as long as you know where to find the syntax, you don't need to remember it. That's what intellisense, help files, reference guides, the internet, etc are for.
Answer: First of all, learning to program is difficult for everyone.  Having a good memory helps I'm sure.  But, dedication and a love of lifelong learning are more valuable.  Learning syntax is just like anything else, repetition.
There's nothing magical or superhuman about the skill of programming.  Just spend about 10,000 hours on it...and you will be a master like any other skill.  Of course, that's 10,000 hours of training, not blindly and mind-numbingly repeating past mistakes.
Answer: You wrote this post in English, with proper syntax. Clearly you are able to remember how to use a language. You just need to learn a new language and use it often enough that you get it right all the time. Unlike human-oriented languages, computer programming languages will always let you know when you've used incorrect syntax, so it's actually easier. :-)
Answer: I agree that there is a huge variety of things that an average programmer may know to accomplish its tasks, just think on all the words, syntaxes, techniques you should basically control to built a simple web site (on front end: html, css, javascript (you may count also some Js frameworks as jquery), ajax, on the back end: Php or ASP or ASP.Net, and do not forget about data bases, mySql or SqlServer or Oracle or MongoDB, etc). There is a huge list of languages, paradigms, sintaxies, patterns, etc., it is impossible to remember everything of them.
It think that what makes a good programmer is practice, practices with algorithms more than with languages, and with that you eventually will remember the things you most often uses, for the rest, there is always google =P
Answer: A great memory can cut both ways.
If you can juggle dozens of bits of information in your head at once, you'll have a much easier time making sense of (and hopefully rewriting) that horrible piece of legacy code that's critical to the project but so complicated that everybody else is afraid to touch it.
On the other hand, that horrible piece of code that's critical to the project but so complicated that everybody else is afraid to touch it was probably written by someone with an awesome ability to juggle dozens of bits of information. If you've got a great memory, work extra hard to cultivate an appreciation for the elegance of simplicity.
Learning the syntax of a programming language doesn't require a great memory. As others have said, syntax is reinforced in your memory so much that it quickly becomes second nature. Do you ever forget which side of the road you're supposed to be driving on? Which arithmetic symbols represent addition and subtraction? If not, you'll master the most common parts of the syntax of your chosen language without too much trouble, and you can look up the less common bits when they come up.
Some libraries have hundreds or thousands of functions, classes, and/or methods. It would seem to an outsider like an impossible task to learn to use all that functionality. But there's almost always some underlying structure to the library. Instead of trying to remember all those functions, a smart programmer tries to understand how the library is organized and what it can do. With that done, it's usually pretty easy to find the function you need when you need it.
In short, memory is far less important than understanding.
Answer: It depends.  Within Java and .NET the standard libraries are in a sort of hierarchy and are well documented.  Therefore, if you know you are dealing with networking, then you go to system.net in C# and from there you can drill down to the specific objects/calls you need.  So from that respect you don't need to memorize the details and there.
In your own program, it is all about how you organize/name things.  If you are using names like a$, b$, c$ ... or g$ from Basic of old, then good luck.  if you name things the way you will think about them like  FirstName, LastName it is much easier.  A lot of languages have naming standards which help as well.  In Java for example there is a convention of setX, getX for getting/setting specific attributes of a class as well as capitalization conventions.  So if you know a person has first name, then it is probably called firstName and the getter/setter are probably getFirstName and setFirstName.....  So those conventions help a lot...
Also shorter methods/functions help you to keep less in your head at one time.  And using proper names helps you to not need to go looking.  For example if you name things for what they do, then when reading one procedure that calls getMaximumValue you will probably not need to read getMaximumValue to figure out what it does...  But as functions/methods get longer and more nested then a better memory definitely helps.
Comment: I left out intellisense that JB King mentioned, but for C# it really helps as well.  I tend to use editors for Java that don't have it :(  Nevertheless the rest still applies, if you keep shorter methods, stick to naming conventions then intellisense works even better.  If you have 50 variables in a method then intellisense might still leave you a bit overwhelmed.
Comment: Cervo I am primarily a C# developer but have doing more and more in java lately.  Try out IntelliJ Idea.  Their latest version has pretty good intellisense.  Not Visual Studio good but close.
Answer: Memory is not all that important. If you are at all worried about it, I regularly forget my wallet or keys in my house in the morning. I call everyone by the wrong name at least once (including my family and girlfriend). I just plain forget to do things around the house all the time.
At the end of the day the tenets of programming will still be in your head just like "you never forget how to ride a bike". Specific details and implementation details are not all that important. You can always Google those.
Answer: From Joel On Software about productivity of a programmer-

Productivity depends on being able to juggle a lot of little details in short term memory all at once.

So, the short term memory is very important for a programmer given a critical task.
But I don't think the long term memory matters that much.
Answer: From a quick read through, I didn't see anyone talking about memory in the general sense of programming rather than a singular task of writing a program.
Memory is useful for two things:

Remembering the basic semantics / libraries:
This is easily supplanted by repetition and Google. IOW, the amount of memory you are born with has to be ridiculously low to be not able to surmount this problem.
Remembering context in big programs:
Here is where the trick is. As programs get bigger (and you get senior), the decisions you make totally relate to the amount of your knowledge of the system and ability to retrieve it in a matter of milliseconds if it is to be of any use in project discussions, debugging, reacting to operational emergencies etc. When the push comes to shove, no amount of documentation / wiki entries are going to help you - your team "wizard" is going to be your only option. This is one of the reasons why principal engineers are valued/paid so much. Most of them might not spend all their time actually coding at this point, they spend more time keeping current with the full picture and applying it for any problems / improvements. The good ones just keep in touch by doing a ton of CRs and a coding change here and there / prototyping newer revisions.

IOW, You can be a reasonable programmer with #1 alone, but if you are ever going to be the next Linus, You better have a lot of memory, at least enough to encompass the problem you are solving.
From my observations, I could even say that working memory is almost directly proportional to the worth of the person.
A little disclaimer to wrap up: If you have Eidetic memory but zero/low intellectual power in applying that logic, you will be no good to a project than a camera.
Answer: If you have difficulty remembering the names of people you meet, you could still become a great programmer.
I forget people's names all the time. I am a senior programmer with almost a decade of experience. In my case, my terrible auditory memory is compensated for by a great visual memory.
Even so, the essential requirement for a good programmer is the ability to abstract. No matter how much or how little you can remember, if you cannot understand the concept of a variable, and how to use it in a program, you won't become a good programmer.
My suggestion is that you try one short course in programming, or complete the Python tutorial to see how you like it.
That should give you a good idea about whether programming is a career you might be interested in pursuing.
Answer: I say an emphatic YES!
At present I am learning JAVA & C#.  All the tests are closed book, so for JAVA its all 100% from memory coding all applications in exams.
What's more, it is getting harder & harder.  I'm at the point now where I need to start using memory tricks like mnemonics, etc.
I would say High IQ, good general knowledge, good vocabulary, polymathism, higher mathematics knowledge, touch typing & good memory are all assets for a programmer.
I know very clever programmers that can't touch type or do higher math, etc.  It they did, they could be much better.
Comment: The real world isn't closed book.  In almost all cases closed book tests are an indication of a teacher who doesn't know how to make good tests.

Do programmers need a good memory?


Macro to sort Excel only on highlighted text

Question: So this is literally the first time I've ever attempted to create a macro in Excel, so wondering if anyone can help me out.  I've got a spreadsheet that is several pages long, with several different, yet similar sets of data.  The different data sets are for different customers, and I need to keep them separate, but I'd like to create a macro to organize the different sets of data by column B, then by column D.  I started with this macro:
Sub Sort_Twice()
'
' Sort_Twice Macro
'

'
    ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Clear
    ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Add Key:=Range("B2:B12") _
        , SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
    ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Add Key:=Range("D2:D12") _
        , SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
    With ActiveWorkbook.Worksheets("Sheet1").Sort
        .SetRange Range("A1:G12")
        .Header = xlYes
        .MatchCase = False
        .Orientation = xlTopToBottom
        .SortMethod = xlPinYin
        .Apply
    End With
End Sub

So this will sort everything between A1 and G12 because that's what I had highlighted when I started recording.  Any suggestion on how to get to allow me to highlight a new block and run the macro only on those fields?  The only things I can find say to change the the cells listed in the rangers here, but that seems very counterintuitive to what I'm trying to do.
Answer: If you can name the ranges of each data set you can do something like this:
Sub SortRanges()
    Dim TargetSheet As Worksheet
    Dim RangeName As Variant
    Dim CurrentRange As Range
    Set TargetSheet = ThisWorkbook.Worksheets(1)
    For Each RangeName In Array("Range1", "Range2", "Range3")
        Set CurrentRange = TargetSheet.Range(RangeName)
        CurrentRange.Sort key1:=CurrentRange.Columns(2), key2:=CurrentRange.Columns(4)
    Next
End Sub

It will take the list of range names and sort them one by one on column 2 and 4. If you can't name the ranges, make an array of ranges in your code instead.
Answer: You can sort the entire column.
I don't know if you have to clear the sort fields, I just left it in there.
Sub CDER()
    Dim sh As Worksheet
    Set sh = Sheets("Sheet1")

    With sh
        .Sort.SortFields.Clear
        .Range("B:B").Sort key1:=.Range("B:B"), order1:=xlAscending, Header:=xlYes
        .Range("G:G").Sort key1:=.Range("G:G"), order1:=xlAscending, Header:=xlYes
    End With

End Sub

Comment: Thanks.  Unfortunately, that seems to sort the entire sheet, combining all of my sections.  My goal is to sort only a section at a time, but the size of that section changes because we're constantly adding lines.
Comment: I changed it to sort individual columns


Sending money from US to China

Question: I receive money in the US for recruiting students here in China.  I have a BOA account and it was free for me to use the ATM machines at China Construction Bank.  However, CCB started charging a 3% conversion fee.  Is there a better/cheaper way to withdraw my money in China from the US?  Should I open a Chinese Bank account and do a wire transfer to CCB?  If so how?
Comment: I wonder if a Hong Kong bank account would be lower cost...? HSBC has branches in the USA.
Answer: You could use Bitcoin. Bitcoin is THE fee-killer. I haven't used US and China exchanges, but you can connect your US bank account to Coinbase, buy bitcoins, transfer to BTCChina, and sell for CNY. There are many other options to convert from and to Bitcoins, but Coinbase seems to be most practical and most widely used in the US and BTCChina is the largest and probably most trusted exchange in China. You can also use LocalBitocoins for both buying and selling, but people on LocalBitcoins typically charge larger fees than exchanges, though this may vary.
Please read a bit about Bitcoin before using it, and be aware of the risks. It's still very new (but revolutionary and very easy and fast to move internationally). Try with a small amount first to check it out. Your electronic wallet can be stolen, and you're exposed to certain risks of exchanges shutting down or government/banks stepping over their boundaries. One nice thing is that you probably won't be affected by volatility as you won't be holding bitcoins for long.
Also be aware that the Chinese don't like capital leaving China and there is a possibility that China government will introduce further regulations on exchanges (though they have stated that buying, selling and owning bitcoins is legal). You're doing the opposite, importing money into China, but you'll probably feel it in one way or the other.
P.S. Approximate fast fee calculation: Coinbase has 1% transaction fee + $0.15 bank fee. Bitcoin transfer is free or in some cases with minimal 0.0001 BTC fee (a bit less than $0.01 currently). BTCChina has 0.3% trading fee and 0.5% CNY withdrawal fee. As you can see, the main fees are exchange fees, but still less than 3% and if you find a good exchange combination with low fees you're golden, or might even make money on transaction if BTC price rises. Also check this Reddit thread - there are alternative China exchanges with lower fees.
P.P.S. Found this blog post, maybe a bit outdated, but probably with better calculation than mine as it takes into account exchange prices.

Sending money from US to China


Proving that the sequence $\{x^2 (\cos (1/x) - 1)\}$ does not converge to $0.$

Question: I'm trying to prove whether or not
$$
\sum_{x = 1}^\infty x^2 \left (\cos\left (\frac{1}{x}\right ) -1  \right )
$$
converges. Based on graphs, I think that the sequence $\{x^2 (\cos (1/x) - 1)\}$ does not converge to $0,$ so once I prove that, I know that the series above diverges. But, I'm not sure how to show that the sequence converges to $0.$
Answer: You are right, it does not converge to $0$. Let $t=\frac{1}{x}$. We show that
$$\frac{\cos t-1}{t^2}\tag{1}$$
does not converge to $0$ as $t$ approaches $0$ from the right. Multiply top and bottom by $-(1+\cos t)$. We get that for $t\ne 0$, (1) is equal to
$$-\frac{1}{1+\cos t}\cdot\frac{\sin^2 t}{t^2}.$$
The rest is undoubtedly familiar. As $t\to 0^+$, the function (1) converges to $-\frac{1}{2}$.
Answer: Hint: Maclaurin series of $\cos$.
Answer: Using the Maclaurin expansion $$\cos\left (\epsilon\right )=1-\frac{\epsilon^2}{2}+O(\epsilon^2)$$ you get, as $x$ tends to infinity,$$x^2 \left (\cos\left (\frac{1}{x}\right ) -1 \right )=x^2\cdot\left(-\frac{1}{2\:x^2}\right)+O\left(\frac{1}{x^2}\right ) =-\frac{1}{2}+O\left(\frac{1}{x^2}\right )$$ and the considered series does not converge.


Relativistic calculation of kinetic energy of an object

Question: I tried to derive a relativistic formula for kinetic energy in a different way but my results didn't match to the actual equation and I got negative kinetic energy.Here is the method:
  $$d(K.E)=F.ds$$
where $$F = \frac{(mv.dv)}{ds}$$ and $$m = \frac{m_{rest}}{\sqrt{1-\frac{v^2}{c^2}}}$$
Now,$$d(K.E)=\frac{m_{rest}v}{\sqrt{1-\frac{v^2}{c^2}}}.\frac{dv}{ds}.ds$$
$$d(K.E)=\frac{m_{rest}v}{\sqrt{1-\frac{v^2}{c^2}}}{dv}$$
On integrating both sides,
$$\int d(K.E) = \int_0^v\frac{m_{rest}v}{\sqrt{1-\frac{v^2}{c^2}}}{dv}$$
on itegatgrating and doing some algebra
$$K.E={m_{rest}}c^2{\sqrt{1-\frac{v^2}{c^2}}}-m_{rest}c^2$$
The above expression shows the K.E energy to be negative
But this can't be possible.
Please tell me where I am wrong
Answer: Your expression for force is incorrect. It is more properly written as
$$F = \frac{dp}{dt} = \frac{d(\gamma m v)}{dt} = m\left(v\frac{d\gamma}{dt} + \gamma\frac{dv}{dt}\right)$$
where $p$ is momentum, $m$ is the rest mass[1] of the object, and $\gamma$ is the expression $1/\sqrt{1-v^2/c^2}$.
$$dKE = Fds = \frac{dp}{dt}ds = dp\frac{ds}{dt} = m\left(vd\gamma + \gamma dv\right)v = m\left(v^2d\gamma + \gamma vdv\right)$$
Integrating yields
$$KE = m\left(\int v^2d\gamma + \int \gamma vdv\right)$$
which will result in the correct expression for kinetic energy.
$$KE = \frac{mc^2}{\sqrt{1-\frac{v^2}{c^2}}} - mc^2$$
Your derivation is missing the $d\gamma$ integral.

[1] Very few physicists use $m = \gamma m_{rest}$ anymore because of mistakes like this. They just say that $m$ is the invariant mass, which is the same as the rest mass.
Comment: @Nancy Relativistic mass is not illogical. It can be used consistently with difficulty. Physicists (including Einstein) just do not find the concept useful. Momentum takes on the Newtonian form when you use relativistic mass, but that doesn't work for any other formula. Relativistic kinetic energy is not $K = (1/2)\gamma mv^2$.
Comment: Thanks for the answer.But I am still unable to understand the logical reason behind why can't we use $ m=\Gamma m_{rest}$ for the above derivation.


How to rotate camera using mouse?

Question: I'm looking for a basic example of rotating camera using the mouse. the only problem is I'm not sure of how to rotating the camera around it target. should i do this by an algorithm or is there a method of doing this? I am also only using managed dirextx and no wrappers
Answer: A very short cutoff tk fhis problem, if you don't want to use trigonometry, is to first translate the view matrix with the distance between the camera and the player on the +z axis, then rozate the matrix, and after that, move it to the correct place, by translating it to the player's position.
However, this is the worst and laziest solution I could think of, so if you want to have a method, that makes sort of sense, then use trigonometry.
You will need the angle aeound the y and x axis, in my example, i refer them to as xa, and ya, they also need to be in radians.
x = cos(xa) * cos(ya)
y = sin(xa) * cos(ya)
z = sin(ya)
To create a view matrix, first, you simply need a 4 * 4 identity matrix, then translate in the negative direction with the distance you want between the camera and player, in this example, 5.
1 0 0  0
0 1 0  0
0 0 1 -5
0 0 0  0

After this is done, rotate it on the y and x axis. The y angle is the angle around the player, the x is the "distance" from the ground.
You then multiply these matrices together
translateMatrix * rotationMatrix //Note: By doing the multiplication the other way around messes up things, so be aware

Now, you have it around the player. Only problem is, that it is placed according to the player, not the world coordinates, So, you need to translate it. The translation matrix should be made like
1 0 0 x
0 1 0 y
0 0 1 z
0 0 0 1

where x, y and z are the player position.
After this, you simply multiply the two matrices together, and voilá, you're done.
I can't help in retrieving mouse coordinates in DirectX, because I never actually used it, only OpenGL, I'm just a math guy. My way of doing it would be to always get the distance between the middle of the screen, and the mouse, and do things according to that, and finally, place the mouse back at the middle of the screen.
Comment: any examples of using the matrix? and thanks
Comment: You probably know what a matrix is, if you're making a 3D game, and you also should know, how create a view matrix.
I edit it in the post
Answer: A classic solution is to use an arcball.
Here's an example implementation using the SimpleMath wrapper for DirectXMath in the DirectX Tool Kit:
class ArcBall
{
public:
    ArcBall() :
        m_width(800.f),
        m_height(400.f),
        m_radius(1.f),
        m_drag(false) { Reset();  }

    void Reset()
    {
        m_qdown = m_qnow = DirectX::SimpleMath::Quaternion::Identity;
    }

    void OnBegin( int x, int y )
    {
        m_drag = true;
        m_qdown = m_qnow;
        m_downPoint = ScreenToVector(float(x), float(y));
    }

    void OnMove(int x, int y)
    {
        using namespace DirectX;
        if (m_drag)
        {
            XMVECTOR curr = ScreenToVector(float(x), float(y));

            m_qnow = XMQuaternionMultiply(m_qdown, QuatFromBallPoints(m_downPoint, curr));
            m_qnow.Normalize();
        }
    }

    void OnEnd()
    {
        m_drag = false;
    }

    void SetWindow(int width, int height)
    {
        m_width = float(width);
        m_height = float(height);
    }

    void SetRadius(float radius)
    {
        m_radius = radius;
    }

    DirectX::SimpleMath::Quaternion GetQuat() const { return m_qnow; }

    bool IsDragging() const { return m_drag; }

private:
    float                           m_width;
    float                           m_height;
    float                           m_radius;
    DirectX::SimpleMath::Quaternion m_qdown;
    DirectX::SimpleMath::Quaternion m_qnow;
    DirectX::SimpleMath::Vector3    m_downPoint;
    bool                            m_drag;

    DirectX::XMVECTOR ScreenToVector(float screenx, float screeny)
    {
        float x = -( screenx - m_width / 2.f ) / ( m_radius * m_width / 2.f );
        float y = ( screeny - m_height / 2.f ) / ( m_radius * m_height / 2.f );

        float z = 0.0f;
        float mag = x * x + y * y;

        if( mag > 1.0f )
        {
            float scale = 1.0f / sqrtf( mag );
            x *= scale;
            y *= scale;
        }
        else
            z = sqrtf( 1.0f - mag );

        return DirectX::XMVectorSet( x, y, z, 0 );
    }

    static DirectX::XMVECTOR QuatFromBallPoints( DirectX::FXMVECTOR vFrom, DirectX::FXMVECTOR vTo )
    {
        using namespace DirectX;
        XMVECTOR dot = XMVector3Dot( vFrom, vTo );
        XMVECTOR vPart = XMVector3Cross( vFrom, vTo );
        return XMVectorSelect( dot, vPart, g_XMSelect1110 );
    }
};

To use this class:
ArcBall m_ballCamera;

m_ballCamera.SetWindow(m_outputWidth, m_outputHeight);

if (m_ballCamera.IsDragging())
{
    // Rotate camera
    m_ballCamera.OnMove(mouse.x, mouse.y);
    Quaternion q = m_ballCamera.GetQuat();
    q.Inverse(m_cameraRot);
}
else if (m_mouseButtonTracker.leftButton == Mouse::ButtonStateTracker::PRESSED)
{
    m_ballCamera.OnBegin(mouse.x, mouse.y);
}

if (m_mouseButtonTracker.leftButton == Mouse::ButtonStateTracker::RELEASED)
{
    m_ballCamera.OnEnd();
}

See Ken Shoemake, "Arcball Rotation Control", Graphics Gems IV, pg 176 - 192
Comment: someone edited out that i was only using managed directx
Comment: And what version of "Managed DirectX"? are you using exactly? Hopefully SlimDX, SharpDX, Mono, or XNA GS since the legacy Managed DirectX 1.1 assemblies have been deprecated for ages.
Comment: using the managed directx from the 2010 release which is the same of the 2007 version. i only doing to for fun and a learning experience
Comment: Which is the same as the 2006 version. Super ancient, not particularly relevant, and doesn't work with .NET 4.x without hacks. Read [DirectX and .NET](http://blogs.msdn.com/b/chuckw/archive/2010/12/09/directx-and-net.aspx). [SlimDX](https://slimdx.org/) is basically an updated version of the same design assemblies, so take a look at that.

How to rotate camera using mouse?


ios: Adding real time filter effects to photos

Question: I want to program an ios app that takes photos but I would like to filter the photo preview in real time. What I mean is implemented in the app called "CamWow" (here is a video of the app: http://www.youtube.com/watch?v=L_o-Bx08YZE ). I curious how this can be done. Has anybody an idea how to build such an app that provides a filtered real time preview of the photo and captures a filtered photo?
Answer: As Fraggle points out, on iOS 5.0, you can use the Core Image framework to do image filtering. However, Core Image is limited to the filters they ship with the framework, and I've found that it is not able to process video in realtime in many cases.
As a result, I created my BSD-licensed open source GPUImage framework, which encapsulates the OpenGL ES 2.0 code you need to do GPU-accelerated processing of images and video. I have some examples of the kind of filtering you can do with this in this answer, and you can easily write your own custom filters using the OpenGL Shading Language. The sample applications in the framework show how to do filtering of images with live previews, as well as how to filter and save them out to disk.
Comment: that library is beautiful!
Answer: I'm looking for the same kind of info (its a pretty hot sector so some devs may not be willing to give up the goods just yet). I came across this, which may not be exactly what you want, but could be close. Its a step by step tutorial to process live video feed.
Edit: I've tried the code that was provided in that link. It can be used to provide filters in real time. I modified the captureOutput method in ViewController.m , commented out the second filtering step ("CIMinimumCompositing") and inserted my own filter (I used "CIColorMonochrome").
It worked. My first few attempts failed because not all filters in Core Image Filter reference are available for iOS apparently. There is some more documentation here.
Not sure if this code is the best performance wise, but it does work.
Edit #2: I saw some other answers on SOverflow that recommended using OpenGL for processing which this sample code does not do. OpenGL should be faster.


Network hierarchy model - Situation to implement core layer

Question: I do not understand when will the core layer is needed. All the materials that I have read in general say that core layer should switch traffic quickly and no filtering. None say when or in what situations the core layer is implemented.
Answer: For smaller deployments a Collapsed Core is usually fine. Collapsed Core means that some devices perform both Distribution and Core layer duties.
With just a few Access switches there's no need to build a large Core.
If you have a large network then you will have many Access switches. Let's say that you have 20 Distribution switches. Connecting all the Distribution switches would be a huge waste of ports and fiber and you would also need a lot of routing peerings. For everytime you add a new  Distribution switch there would be a lot of work connecting it to the others and putting in new routing statements.
For those situations it makes sense to use a Core, you would then only add maybe two connections from each Distribution switch to the Core. The number of peerings on the Distribution layer switches would be a lot less as well.
The main factor is scalability but other things could affect as well like speeds and feeds, the distance your network is covering, external connections and factors like that.
Comment: @RonVince If you have a lot of access switches, it becomes even more imperative to stick with the access/dist/core model. Distribution switches serve as redundant, high-speed systems that should survive a single node failure.  Read the [Cisco High Availability Design Guide](http://www.cisco.com/c/en/us/td/docs/solutions/Enterprise/Campus/HA_campus_DG/hacampusdg.html#wp1107706) for in-depth reasoning on what your trying to achieve. The crux of it is to eliminate single points of failure, not solely for breaking up broadcast domains.
Comment: If there are many access switches, why should I even use distribution switch when a router and VLAN can be used to create broadcast domain?
Comment: @Fizzle What if I just use access switch at distribution and router at core? Of course 2 access switches and 2 routers for high availability. What would be the disadvantage of that?
Comment: @RonVince That's actually backwards, you normally shouldn't route at your core.  The disadvantages are all dependent on your requirements, if your organization is comfortable with having a substantial amount of users hanging off a one or two devices, then that's a vulnerability they're willing to accept.  When you say _"there are many access switches"_, I assume this is > 200.  Some organizations explicitly define access/distribution user requirements, _example: more than 128 users per access switch requires redundant uplinks._
Comment: @Fizzle > 200 access switches are overkill for me. I'm not at that level. My idea of using access switch at distribution and router at core is by having an idea that there are 4 access switches, 24 ethernet ports per switch. Somehow, this idea seems like to be collapsed core. Access switch is used to connect between user access switch with router to overcome low port density on router to make mesh topology if connecting the user access switch to router directly. Using another access switch for high availability shows the significant of the problem, 8 ethernet ports now required on the router..
Comment: ..Using access switch to connect user access switch with router will also ensure scalability in the future, consider to add another user access switch in the future. But I do not know the performance for this setup and when should L3 switch is to be considered.
Comment: @RonVince If your just trying to reutilize one of your access layer nodes at the distribution layer, then that's fine.  You obviously won't get the same robust, feature-rich traits of the higher-end switches, but it will certainly work.
Answer: Totally agree with Daniel Dib's response towards scalability and other good points.
One of the main issues we experienced towards implementing a layered access ->distribution/core solution is spanning-tree.
Lets say you implement an access-> distribution/core solution and you have many buildings/floors/departments with many access switches. What we have seen is when someone introduces (accidentally) a spanning-tree loop the cpu on your core goes through the roof (nearly). ALL of the users cannot use their computers, internet, file servers, etc... and the whole infrastructure suffers.
To alleviate this issue, I would recommend to implement an access/distribution -> core solution for your zones/buildings. Keep your vlans and the spanning-tree root roles for these vlans on the distribution switches.
Lets say you have 4 distribution switches connected to your core(s) and a routing protocol taking care of your internal routing between the distribution and the core switches, should one of the distribution switches suffer from a spanning tree loop, only that zone is affected and your other three zones/buildings continue to function unaffected.
That makes troubleshooting somewhat easier :-)
Comment: What about my idea that I explained to Fizzle - using access switch to connect between user access switch to router?
Comment: @Ron. That works too, depending on your design. If you look at the "Cisco High Availability Design Guide" document provided by Fizzle. Your router connects to your network at the access layer. Or you could do without.
Comment: I also think that the logic reason to implement access>distribution>core is frame loop besides port density on router and port speed on router. Using distribution>core seems to be necessary on very large network that implementing router-on-stick is not good anymore. Assume that the  computing resource of router and access switch (that connects user access switches to router) are monstrous, it seems that there is no need for L3 switch. Of course by assuming that the port speed on the router is high too. But again, managing and troubleshooting may be difficult if frame loop happens.


SharePoint Online2013 Team Site Deleted

Question: I created a DevGroup for myself and a new admin that is coming on board.  That site is now mysteriously gone.  I didn't delete the site, and no one else has access to do so.  Is there an audit where I can go back and find out what happened?
Answer: If you have auditing enabled then i think you can check. check this article for more details: Search the audit log in the Office 365 Security & Compliance Center
But if you want to restore that deleted site collection than follow these steps.

Sign in to Office 365 as a global admin or SharePoint admin.
Select the app launcher icon  The icon that looks like a waffle and
represents a button click that will reveal multiple application tiles
for selection. in the upper-left and choose Admin to open the Office
365 admin center. (If you don't see the Admin tile, you don't have
Office 365 administrator permissions in your organization.)
In the left pane, choose Admin centers > SharePoint.
On the ribbon, click Recycle Bin.
In the Recycle Bin, select the check box next to the site collection
that you want to restore.
On the ribbon, click Restore Deleted Items.

Restore a deleted site collection
Comment: There is nothing on that page.  It says no site collection was found.
Comment: is Tenant admin delete the site collection? if it is gone from that recycle bin then you have to contact the support for restore...they have 14 days retention,
Comment: I can get to the site via the URL, and it still shows up under the "Following" quick launch on our SharePoint home page.  But the tile is not listed anymore with all of our other tiles.
Comment: can you search the site on the admin center? is it site collection or subsite
Comment: Let me preface the next comment with I'm about 14 days new to SharePoint with absolutely no prior experience.

Under Admin -> SharePoint -> Site Collections, none of the pages I've create (3) exist there.

SharePoint Online2013 Team Site Deleted


Do events in Junkenstein's Revenge happen at specific times?

Question: After playing Junkenstein's Revenge a few times, I've started to notice a pattern in the order of events. Reaper spawns, then Roadhog, then Junkrat, then Reaper again, then Reaper again, then Mercy. Do these events happen at specific marks on the timer? Or do they happen a certain time after the previous boss was defeated? Additionally, are the tire spawns also scripted, or are they random?
Answer: Yes. All spawns are scripted across all difficulty levels, and will happen at the same time every time. Here's a list of the most important spawn times to know, from reddit:

These times are based on time remaining.

5:32 Left tire
4:41 Reaper
3:53 Center tire
3:32 Left tire
3:24 Right tire
2:45 Roadhog
2:21 Right tire
1:45 Junkrat
1:30 Reaper
0:48 Tire x 2: Right+Left
0:33 Center Tire
0:22 Reaper
-5 seconds Final battle

Note that spawns will happen regardless of whether or not a previous hero is still alive; it is possible to have both Junkrat and Roadhog on the battlefield at 1:45, for example.
Comment: Can you have 2 reapers out? like say you dont kill the reaper that spawns at 1:30 and the timer counts down to 0:22. would you get two reapers then?
Comment: @Dragonrage No. Reaper just refills his HP.
Comment: @Schism well, where is the fun in that? It would be a lot more amusing having multiple reapers out there.
Comment: You'd probably struggle to stay alive to be honest. Reaper does get death blossom eventually, and all 4 players being dead at the same time is a failure state
Answer: Yes, spawn times are scripted, even for the Zomnics. At the very start of the match, you'll notice that Zomnics always spawn in the same locations, in order: middle, left, right.
I don't have the exact times that Reaper, Roadhog, and Junkrat spawn (and I'm at work so I can't test right now) but if you check the score during a match, you'll see a timer counting down at the top of the screen. When this timer reaches zero, the "final battle" will begin and Mercy will spawn. After Mercy spawns, the game ends once you take out all the enemy heroes.
Comment: Do the previous 3 heroes (Reaper, roadhog, Junkrat), respawn in the same location they died in? An employable strategy if they do is to kite Reaper and Roadhog into the side room on the right, then grenade + dragonstrike them while they're in a confined space to burst them down.
Comment: They always revive at fixed locations. At least that's what I observed while playing
Comment: Anecdotally, after playing a few times, it seems that one of Reaper's revivals occurs after Junkenstein takes a certain amount of damage. It doesn't seem to be tied to a timer in that instance.
Answer: As Mage said, spawn times are scripted and happen when the timer reaches a certain number.

Reaper / "The Reaper": 5'
Roadhog / "Dr. Junkenstein's Monster": 2'50
Junkrat / "Dr. Junkenstein": 1'30
Mercy / "The Witch": 0'00

Source
Comment: I feel like this list is incomplete/imprecise. I know Reaper spawns at least 3 times.
Comment: @Unionhawk and as a semi-unrelated note, Reaper seems to be easier to target with Deadeye with each new appearance.
Comment: The linked guide says that Reaper shows up with Mercy, and something about another respawn. The other one might not be timed?
Comment: As suggested by @SirBraneDamuj in a comment on the other answer, one of Reaper's revivals seems to be tied to damage dealt to Junkenstein... so not "timed" per se, but still a fixed sequence.


How to fix dent in B+W circular polarizing filter?

Question: I own a 77mm B+W Nano Kaesemann Circular Polarizer with Multi-Resistant Coating.  It has a small dent in the rim that makes turning it difficult.  Can this be repaired, and if so, where?  Thanks.
Comment: This doesn't answer your question, but despite the cost, the best option may be to replace it.  Screwing a filter with a damaged thread onto your lens has the potential to damage the lens' thread too either by grinding it or warping it, plus even if you manage to fix it, it may never be as smooth as it originally was.  I'm guessing your lens is a fairly good one.
Answer: You have two options basically, you can try to repair it yourself or you can go to any camera shop that performs general repairs.
If you try to do it yourself I would recommend a tool such as this Camera Lens Vise Tool.
Keep in mind that CPLs are multiple pieces of glass and quite fragile. With proper it can likely be repaired, but there is a chance of making it worse of course.


How do I load a third-party PHP library in a module?

Question: Suppose I want to load facebook-php-sdk in my Drupal website, how can I load that class file in a custom module? I tried with the Libraries module, with different functions provided by that module, but everytime I fail.
Comment: You can also include custom libraries placing them in a directory, for example sites/all/libraries, and loading them through the template's .inc file.
Answer: You can do the same way in Drupal for Facebook module and put these code in your custom module:
<code> $fb_lib_path = function_exists('libraries_get_path') ? libraries_get_path('facebook-php-sdk') : 'sites/all/libraries/facebook-php-sdk';
 $fb_platform = $fb_lib_path . '/src/facebook.php';
 try {
     if (!class_exists('Facebook') && !@include($fb_platform)) {
      //show error
      return NULL;
     }
     $fb = new Facebook(array(
       'appId' => $appId,
       'secret' => $secret,
       'cookie' => $cookie));
 }
 catch (Exception $e) {}
</code>
You can check the fb_api_init function of Drupal for Facebook module for more detail.
Comment: I used same approach for a different library in drupal. In my case i need to use API class defined in /src/Api.php file. For me !(class_exists('Api')) is coming 1 i.e class is showing non-existed, though it exists. Please help.
Answer: Libraries API is a module designed to take the burden of this from your shoulders. You probably have it already installed, as it is required by many other modules.

The common denominator for all Drupal modules/profiles/themes that integrate with external libraries.
This module introduces a common repository for libraries in sites/all/libraries resp. sites//libraries for contributed modules.

When you put library where it needs to be, simply use:
<code>libraries_load($name);
</code>

You can also attach library to renderable array like that:

<code>$form['myelement']['#attached']['libraries_load'][] = array('libraryName');
</code>
More detailed documentation here: Using Libraries API 2.x (as a module-developer). That's the source of code snippets I pasted here .


When were the lictors abolished?

Question: I wonder when the position of lictor was abolished in the Ancient Rome? Who was the last Emperor to have lictors as companions?
Comment: Where is your source indicating they were abolished at all in Ancient Rome? http://www.livius.org/li-ln/lictor/lictor.html indicates they were still in use during the middle of the 5th century...
Comment: They are not used now so they were someday abolished.
Comment: This is one of the best questions here, I think. I am working on an answer...
Comment: @BenNeill: I think that livius meant the 5th century BCE, not CE.
Comment: What are lictors? Why did you ask the question? A good question would state: "lictors performed such and such functions, and provided such and such benefits to society, so why were they abolished."
Answer: I have not been able to find any evidence that Lictors were ever disbanded in Ancient Rome, in fact they seem to have been active well into the 5th century.
Once Augustus came to power their roles were gradually replaced by the praetorian guard, marking their decline as an organisation.
After the fall of Rome, most Roman administrative positions from the republican era, such as the consulship lapsed making the position of Lictor irrelevant.
Comment: @Anixx - The old saw about the Holy Roman Empire is that it was neither Roman, nor an Empire (and some would say not particularly holy). It really has nothing whatsoever to do with classical Rome. If you want to look for any kind of continuity from the Roman Empire into the late Middle Ages, you should be looking to Constantinople, not Italy or Germany.
Comment: This does not make sense. Emperors existed towards 14th century and traditionally emperors required lictors. Consuls degraded in prestige and were at 26th position in court hierarchy by 12th century. I doubt they used lictors up to then. This is complitely void answer.
Comment: I believe there were never lictors in Holy Roman Empire.
Comment: Please tell me where I said anything about Germany. It was Ben Neil who mentioned the HRE. I was asking when they were abolished in Ancient Rome and the answr that they were abolished with a lapse of consul office is incorrect by many reasnos.
Comment: Possibly you need to modify the question to indicate that you are asking for abolishment in history (i.e. including the Holy Roman Empire) rather than in Ancient Rome.
Comment: Downvote: 5th century is probably a mistake (reading the livius page, I'm prettu sure he meant BCE, not CE). On the other hand, you do have a point about the pretorians. Anyway, as it stands the answer does not settle the quedtion at all. Perhaps an edit is in order?
Answer: Here is what I came up with so far. The lictors are mentioned in the Theodosian Code (This is from footnote n.46 in this paper). More evidence for them at the end of the 4th century CE can be adduced from Gibbon who says that one Ammonius "expired under the rod of the lictor". I don't know what was Gibbon's reference for that but he can be trusted to get such things right.
So we know that lictors were still in vogue in the 5th century. When did they disappear? My present guess is that Heraclius might have abolished them as part of his reforms that swept a lot of the Roman heritage away. But that's just a guess, I'll keep looking for a real answer.
I also found this tantalizing pointer:

For the fullest account of the lictors, see Mommsen, Romisches
  Staatsrecht, i. 355, 374 (3 r d ed., 1887).

Perhaps someone can look it up...
Comment: Greek terms for lictors: ραβδοῦχος, ἀρχι-ραβδοῦχος, ραβδοφόρος. This can be helpful.
Comment: Mommsen includes history only up to Diocletian.
Comment: @Anixx: But who can tell what treasures are buried in his footnotes?
Answer: The last mentions of Lictors accompanying Roman emperors known to me are from the reign of Andronikos I Komnenos, so they were most likely around at least until the crusader sack of Constantinople of 1204. They are well-attested in the 6th century and we even have several original late antiquity depictions of fasces. So they actually existed long after the existing answers claim.
I disagree with the claim presented in Felix Goldberg's answer:

My present guess is that Heraclius might have abolished them as part of his reforms that swept a lot of the Roman heritage away

This is a dramatic misunderstanding of Heraclius. Heraclius never did anything with the intention of "sweeping a lot of the Roman heritage away". Mr. Goldberg is presumably basing this on a misunderstanding of Heraclius finally making Greek the main administrative language of the Empire, without knowing the context and details behind this. Heraclius firmly considered himself a Roman and would surely be shocked that he is being credited by someone with "sweeping the Roman heritage away".
Comment: Welcome to History.SE! Would you be able to provide any sources to back up your claims?
Comment: I can do that.I know exactly in which original sources it is present.But I will rather do post about it on my FB Roman history page(biggest existing there) for which I will also paint original artwork.After done I will provide link or wrote the same what in that post also here.After all this is old question so it dont hurry and I was mainly attracted to sign and answer by Heraclius being mistreated.

When were the lictors abolished?


Transferring from Windows to Ubuntu

Question: I am currently using Microsoft windows and I want to shift from windows to Linux, but I have huge data on my hard disk which is placed on other drives other than C drive.
Is my data on other drives is safe or not by installing Linux
Comment: Whatever you're going to do, first *make a backup* and *verify* that it's OK!
Answer: As long as you don't reformat the other disks, your data won't get affected. Most distros support all of the Windows filesystems by default (NTFS is an odd pickle).
If NTFS is not writable, you need to install ntfs-3g in order to make the partition writable.
Answer: It is safe to install the ubuntu on specified empty drive with out the data lose[where I also suggest that this portal is to coding related question answer so this question seem to better answered in askubuntu.com.
Answer: I have installed Ubuntu many times over Windows without problem, which will set your computer up to dual boot windows/Ubuntu. As long as you do not install your new OS over top of the data on the other drives you should have no problem with your data and it will still be available to Windows and will most likely be available to Ubuntu (out of the box).If it is not available to Ubuntu right away installing NTFS-3g will make it available to both OS's.

Transferring from Windows to Ubuntu


Getting Music from my Ubuntu One account into Ubuntu One Music?

Question: I get the message: credentials not satisfied in Ubuntu Music. How can I get the downloaded music from Ubuntu One into my Ubuntu music player. I am using a Samsung Galaxy S2/ Ypur help would be much appreciated.
Answer: This looks like a bug : https://bugs.launchpad.net/ubuntuone-android-music/+bug/684461
A fix was released according to the bug report.
does updating the system fix your problem ?
If not, I would advise you file a bug report on this.
Comment: I don't think apt works well on Android. :) Updating from the Market should work though.


Why is it said 「サークルで使う」 and not 「サークルに使う」

Question: As far as I know, 「サークルで使う」 means "To spend (money) on a circle club". However I don't figure out why the particle で is used instead of に, since I have seen so many examples of "to spend on sth" and I would say that all or at least most of them the particle 「に」 is used instead.
Answer: The meaning of 「サークルで使う」 and 「サークルに使う」 is different from each other.
As you know, 「Xに使う」 is a common way to say "to spend on X". The 「に」 indicates the target of 「使う」.
So, to have the meaning you expected, 「サークルに使う」 is preferable.
On the other hand, the meaning of 「で」 in 「サークルで使う」, in this case, is likely to be for the place, the time or the situation in which the action (「使う」 here) occurs.
In this case, 「サークルで使う」 is "to spend during(/as part of) a club activity."

By the way, is there any context around this 「サークルで使う」?
This single sentence does not necessarily indicate what is spent is money.
Since 「で」 has many meanings, the meaning described above would be wrong in a certain context.
Comment: Take another look at the last word used in the two sentences.
Comment: Thank you for your detailed answer, I really understand what you mean. The context is about a survey which states differents アルバイトの目的 like 「生活のゆとりがほしい」、「洋服が買いたい」、「生活費」、etc. Among them サークルで使う. So what would you say it is the real meaning?
Comment: @Dante404 Yeah, in this case the meaning of 「サークルで使う」 should be what I described in my answer: "to spend (/ use) as part of a club activity."


Issues with Rails 3.2 application.css.scss caching in development

Question: I seem to be having major issues with the asset pipeline in Rails 3.2. It alls started because I wanted to add a single, simple style to my application.css.scss whilst working in the development environment. I have done this in the past with no problem and it just works because there is no caching occurring (as you would expect).
However, when I attempted to add the new style today, Rails refused to load the updated styles. I checked my environment settings and they all seem correct in development.rb,
config.assets.compress = false
config.assets.debug = true

I did some research and came across rails 3.1 asset pipeline css caching in development. Following the advice given in that question, I made sure that I deleted the tmp/cache folder as well performed a clean using rake assets:clean just in case I had run the app in production mode at some point and it needed cleaning up.
After all this, still no luck. Just to confirm that I hadn't made a bonehead mistake, I temporarily moved the style to another stylesheet. No problems! It worked perfectly! So I moved the style back and it won't load again.
I also checked the console. It reloaded the other stylesheet correctly but no mention of the original stylesheet.
Now, here comes the major issue. As a last ditch effort, I tried clearing my browser cache. I normally have no problems with it on but I thought something might be cached and causing problems. I cleared it and reloaded the app and.... no styles loaded whatsoever!
It seems that all of my application.css.scss styles were cached at some previous point and now I simply can't reload them!
UPDATE:
Although I still haven't fixed the problem, I've worked around it by creating a new stylesheet called main.css.scss (name not important) and moving all of the styles to the new stylesheet. This works because of the //= require_tree . directive in the manifest.
But if anyone can shed some light on why the original stylesheet stopped working, I would love to know!
Answer: try rm -r public/assets/*
maybe your assets:clean task is not working properly.


Where to store local variables? NSKeyedArchiver or NSUserDefaults?

Question: bit of a noob here but what is the best way to save simple variables/arrays for an app? For example I have an app that has a friendList array and I want that to load each time the app starts? Would it be NSKeyedArchiver? NSUserDefualts? Or some other way? Another example is say I have a simple int variable postCount to track the number of posts made, this needs to be saved on exit and loaded. What would be the best approach? Thanks!
Answer: NSUserDefaults is best for small amount of data.
If data is small the better option is NSUserDefaults else use NSKeyedArchiver.
In your case friendList array can contain huge amount of data, so I prefer NSKeyedArchiver for that. For Storing the postCount you can use NSUserDefaults.
Answer: The NSUserDefaults class provides convenience methods for accessing common types such as floats, doubles, integers, Booleans, and URLs. A default object must be a property list, that is, an instance of (or for collections a combination of instances of): NSData, NSString, NSNumber, NSDate, NSArray, or NSDictionary. If you want to store any other type of object, you should typically archive it to create an instance of NSData.
Archives and serializations are two ways in which you can create architecture-independent byte streams of hierarchical data. Byte streams can then be written to a file or transmitted to another process, perhaps over a network. When the byte stream is decoded, the hierarchy is regenerated. Archives provide a detailed record of a collection of interrelated objects and values. Serializations record only the simple hierarchy of property-list values.
You can store NSArray using NSUserDefault but better approach is
You should use something like NSKeyedArchiver to serialize the array to an NSData, save it to the NSUserDefaults and then use NSKeyedUnarchiver to deserialize it later:
NSData *serialized = [NSKeyedArchiver archivedDataWithRootObject:myArray];
[[NSUserDefaults standardUserDefaults] setObject:serialized forKey:@"myKey"];

//...

NSData *serialized = [[NSUserDefaults standardUserDefaults] objectForKey:@"myKey"];
NSArray *myArray = [NSKeyedUnarchiver unarchiveObjectWithData:serialized];

Comment: okay thanks a lot, just wanted to check what the common programming practices where for storing simple program data like that. Thank you for your answer. Merry Christmas!
Answer: Small amounts of data related to the applications settings are easily kept in the UserDefaults. But don't go putting usernames and passwords in there - that's what the keychain is for.
If you just want to store arrays and dictionaries then serialising with NSKeyedArchiver is a reasonable solution.
However, and this is one of those things that is an engineering tradeoff, if you have large amounts of data, or data structures that are likely to change, then using a proper persistence mechanism is a better idea.
Proper persistence mechanisms such as CoreData, Realm.io, Mantle, give you far better control over the memory usage of your model objects, are better able to be scaled, and when your model objects change, then there is support for proper migrations.
It really depends on what you are saving, how it will be used, and how that use is likely to evolve.


how can my In-App-Purchase cater for volume purchase program?

Question: My customer wants to purchase my 2 In-App-Purchase products within one of my App on 16 ipads that her School District owns. However, due to their volume purchase program they cannot purchase them as in-app purchases. They want us to create a paid app for these contests so that they can purchase them. Is there any other way for both of us to adopt instead of creating a paid app for them separately?
Answer: I am a volume purchaser and have just run into this problem myself.  As far as I can tell from my research the only way around this issue is for the developer to create a paid for 'FULL Version' that contains all the features of the in-app purchases.
If anyone comes up with a better way please do share!


Animal for small aquarium

Question: I have a very very small aquarium (2L of water). What kind of animal could live in this size of aquarium with enough happinness? Maybe a starfish? Or some kind of crustacean?
Answer: Frankly, nothing will be happy in such a small tank.
I don't have experience with starfish and crusacean, but a quick google search indicates that they require bigger tanks.
If you're interested in setting up an aquarium with animals, then you'll probably need to have around 20L. Then you can start with shrimps or a single betta
Answer: I absolutely agree with Diether. You'll want something much bigger than that.
One additional thing to consider is also how difficult it is to keep a small aquarium within optimal operating parameters. The smallest change to the environment can have a big impact on your tank. For example, a fluctuation in temperature can change the water temperature in your tank hugely when there is only a small volume of water1.
A similar affect applies to pH, GH, KH, NH3 and NO3- during water changes. If the water you add back in has a different pH to your tank you could end up with a pH swing which has the potential to harm your fish.
Ultimately, it comes down to the life you want to provide your fish. If you're serious then do your research, take your time and seek advice on how best to proceed. Keeping fish can be enormously rewarding but it can be very cruel if you don't know the basics.

Animal for small aquarium


Can you reheat cooked calamari without thawing?

Question: Can you reheat cooked calamari without thawing first? If I take it from the freezer and boil it, how long will it take to reheat the calamari?
Comment: I think you're asking whether you can cook/reheat it without thawing? Defrosting is a synonym of thawing. I've edited accordingly; please fix it if I got it wrong.
Comment: I'm not sure you want to heat it to boiling. Maybe longer in a cooler water temperature.
Answer: It is entirely possible to reheat calamari without thawing first, I would suggest boiling for one to two minutes, depending on piece size, longer if you are using larger pieces. Conversely you can cover the calamari with boiling water and let it sit for a little bit longer than one to two minutes, I would also suggest that you heat thoroughly, better safe than sorry. I am also not entirely sure the texture will be optimal. Good Luck.


In the Aggregator module, limit number of items per feed

Question: I am using the Aggregator module in Drupal 8 to combine several RSS feeds, but I would like to set a limit on the number of items that are shown from any one feed. How can I accomplish this?
Answer: This might not be the right way to do it but I solved this by using template_preprocess_aggregator_feed(&$variables) and then slice the items using array_slice().
My items were stored at $variables['content']['items'] but there were two other hashtag variables stored in the beginning of the array so I had to add that to the total count.
function template_preprocess_aggregator_feed(&$variables) {
  $number_of_items = 5;
  $variables['content']['items'] = array_slice($variables['content']['items'],0,2 + $number_of_items);
}


How to transform a private key into an ECKey?

Question: I´d like to construct an ECKey from a hardcoded private key but it´s not working...
First try
If I run the code in this example the key import is working just fine. But since I actually want so send money I need to import my own key...
I tried this private key L48r9sYN2dtsWHWwJ1Xez27W7a3X7RvG6obrmVgU2JLTFQeUCnkh and used this site to generate it. When I try to make the private key an ECKey like this:
ECKey key = ECKey.fromPrivate(Base58.decodeToBigInteger("L48r9sYN2dtsWHWwJ1Xez27W7a3X7RvG6obrmVgU2JLTFQeUCnkh"));

I´m getting the exception
Exception in thread "main" java.lang.IllegalArgumentException: private key exceeds 32 bytes: 304 bits

Second try
I tried the solution form this question with this code
String priv = "L48r9sYN2dtsWHWwJ1Xez27W7a3X7RvG6obrmVgU2JLTFQeUCnkh";
ECKey key1 = DumpedPrivateKey.fromBase58(TestNet3Params.get(), priv).getKey();

Which leads me to this exception
Exception in thread "main" org.bitcoinj.core.AddressFormatException$WrongNetwork: Version code of address did not match acceptable versions for network: 128
at org.bitcoinj.core.DumpedPrivateKey.fromBase58(DumpedPrivateKey.java:59)
at com.javamaster.TicTacToeApplication.main(TicTacToeApplication.java:42)

Third try
I tried another solution form this question
    byte[] b = priv.getBytes();
    System.out.println(priv);
    ECKey key3 = ECKey.fromPrivate(b, true);

It results in the same exception as from the second try.
What is wrong with the key? Should I use another way to generate the private key?
Answer: The valid private key is L48r9sYN2dtsWHWwJ1Xez27W7a3X7RvG6obrmVgU2JLTFQeUCn not L48r9sYN2dtsWHWwJ1Xez27W7a3X7RvG6obrmVgU2JLTFQeUCnkh. You mistyped and added "kh"


How to identify if popup download of Adobe flash Player was infact a virus or malicious on?

Question: How to identify if popup download of Adobe flash Player was in fact a virus or malicious on El Capitan, OS x10.11.6?
I am not a savvy person but I can do things if someone explains it to me in plain English.
Comment: Welcome to Ask Different! Without a screen shot of what the pop-up in question looks like it will be impossible to tell. You may need to edit your question to instead ask for steps to take in finding any possible malware this suspected thing installed on your Mac.
Answer: Unless you specifically went to Adobe & downloaded it right from their page at https://get.adobe.com/flashplayer/ then assume it was malicious & discard it.
If it arrived in the form of a Disk Image (.dmg) then so long as you don't mount the image, the file itself is inert & can safely be trashed.
If it was a Windows executable (.exe) then that is also technically safe on a Mac - ie, it will not run - so can also be safely discarded.
If it was a compressed file (.zip, .7z, gz etc) then so long as it remains unextracted, again it is safe to simply discard.
If it was anything other than one of those types, or if you extracted any archive, then scan your computer with something like Malwarebytes or send the file to VirusTotal for further analysis.
Comment: I want to acknowledge and thank you, Tetsujin, so very much for such a concise and easily understood answer!


Best method to add style sheets into child theme?

Question: I created a Twenty Fifteen child theme and wondering what is the best
method to add style sheets into the child theme? Should I use enqueue script in functions.php, or add directly in header.php?
Answer: Firstly, never add the stylesheet on header.php unless you have to. It is not the WordPress convention.
Secondly, adding stylesheet to header.php will cause certain problem like dependency hierarchy. Cause when you install any plugin and if it has its stylesheet then the dependency hierarchy is automatically managed by WordPress system by wp_enqueue_scripts hook.
Thirdly, by using wp_enqueue_scripts hook you can use WordPress default scripts and stylesheets which is kinda messy if you proceed to use it in the header.
Fourthly, (I'm not 100% sure) caching can be a problem if you use stylesheet on header.php.
And all those rule are applicable for themes as well as child themes and plugins.
Comment: If you think this answer clarified your concept, then it would be great if you accept the answer. @sam
Comment: sure, i am just reading the answer at the moment and just a small confusion left now , my HTML template have stylesheets linked in header sections which i have pasted into my header.php and added wp_head() below . So am i supposed to remove my stylesheets links from the header section and add it using enqueue script ? or am i not supposed to copy paste my HTML template header into my header.php which i want in all WordPress pages ?
Comment: Obviously you should add those scripts and stylesheets using enqueue script. Never put your scripts and stylesheet on any template or part of any template files unless you must have to.


Database table name for events

Question: I want to access the details of registered members for an event through database.So I want the table name in which the details of the registered participants will store.
Comment: You need to provide more information in your quesitons. Every question should include the version of CiviCRM you are using and the CMS and version it is paired with.  Then for this question you should state what you are trying to achieve and why you think you need to access the database directly.
Answer: The table is called civicrm_participant which holds all the event participant record
If an single user is registering for multiple user then you can find the registered user using column name registered_by_id
I guess this help
Answer: I am confused by 'registered members for an event' and assume you mean contacts that have registered for an event, not necessarily members (=contacts that have an active membership). The details of participants are stored in civicrm_participant
Answer: Are you sure you need the database table?
The preferred way to access CiviCRM data is via the CiviCRM API.
It is very likely you can get the data you need, with a much lesser chance to harm the data integrity of your CiviCRM
https://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API

Database table name for events


Is an LED's voltage response to current non-linear with temperature?

Question: I have been measuring the voltage response to current of an LED. It's a point source LED with an oval emission area of 40x150um (link to datasheet https://www.daido.co.jp/en/products/point_source_led/pdf/med7p4_e.pdf). I have done the same measurements for a range of temperatures from 10°C-70°C. I expected the decrease in voltage with temperature to be linear, but these graphs don't show that. Is there a physical explanation for this or is it more likely to be some kind of experimental error?
Answer: Those currents are so high that the ohmic resistance of the semiconductor material becomes important. It is not just the voltage over the $pn$ junction. (And another effect is that at high currents, the current will affect the temperature.)
Theoretical values can only be expected in the region where the $IV$ curve is exponential. Maybe up to 1 mA or something like that in such devices.
Comment: I realise that the current can affect the temperature but that doesn't seem to be the issue in this case as I've also measured the junction temperature, which seems normal. The datasheet for the LED says that it can be operated between 0 and 25mA, so it shouldn't be outside of its normal operating range.
Comment: The $IV$-curve can be exponential over several orders of magnitude (for example from 1 mA down to less than 1 μA) but not in the normal operating range of such devices. Diode thermometers work with much lower currents than LEDs.


What is this flowering fern-like plant called?

Question: Here's a photo of the plant. I've tried plant id apps but no luck.
Answer: One possibility for this is Erodium cicutarium or red storksbill; the foliage and rosette habit match the botanical description, however the flower in your illustration, while not perfectly clear, seem to indicate a slightly different arrangement of petals, so it is hard to be certain.
Comment: Thanks. I'll probably buy one and edit the question with a better "more zoomed in" pic.


Libre office Calc freezes wile working on a sheet in xlsx format

Question: I'm currently facing an issue where an excel file ocassionally freezes while working on it and applying some vlookup formula to it. I'm not sure if it is an issue with the file itself or in Libre office calc but nevertheless its becoming quite an annoyance now.
When I open the file and start working on it, the file starts to freeze and it freezes the whole system along with it including the mouse pointer movement. At that point, I either have to wait for Libre office to respond or try to force quit it which sometimes doesn't work ultimately forcing me to restart the system.
I have tried to uninstall and reinstall Libre office calc, tried to do open the file in older version of libreoffice calc, reinstalled the whole os and even tried to use it in libre office calc in windows 10 but there was no relief. The only difference I saw in Windows 10 was that only the file freezed but the OS itself was functional.
I love using Libre office and didn't face any issue whatsoever in the previous files I used. They opened up and worked smoothly so it would be great if we have a workaround for this too. Also, I cannot really share the xlsx file here but I can give some additional details about the file if it helps.
System Specs and version details:
Processor: Intel® Core™ i5-8250U CPU @ 1.60GHz × 8
Graphics: Mesa Intel® UHD Graphics 620 (KBL GT2)
Disk Capacity: 1.0 TB
RAM: 7.6 GiB
OS Name: Ubuntu 20.04 LTS
OS Type:64-bit
Libre Office Calc Version: 220.127.116.11
Excel file Details:
File Size: 79.8MB
Count A Rows: 614090
Cont A Coloumns: 48
Thanks !
Answer: It seems like the issue was the auto save feature in office that periodically saved the file which made the whole system freeze for the duration of the save. Disabling the auto save feature completely solved the issue.