Charging MacBook Air with a fast charger from usb-c

Question: I have a MacBook Air 2020 and forgot my charger at work. Evidently I need to charge it in a few hours. I have One Plus phone with a fast charger which is USB-C compatible (5V, 4A). Could I use it to charge the MacBook Air?  Does this damage the mba ?
Answer: It shouldn't damage anything, but it might not be powerful enough to keep up.
The Macbook Air charger is 30w, which is about 6A.
Amps are "pulled" by the computer rather than "pushed" by the power supply [which is the opposite to voltage; this is why voltage has to match but amperage doesn't] however, your charger will be incapable of supplying all the Mac is asking.
This will just make charging slower. If you're lucky, it might just keep up, otherwise the battery might still lose charge slowly while the Mac is in use, even with the charger connected.
Answer: I didn't think it would... but the ubiquitous Apple 12W USB-A iPad/iPhone charger

works fine for me when my M1 MacBook Air is shut down.  The battery life is good enough to handle moderate use (take measures to minimize drain!) and then I just plug it in when I'm not using the laptop, shut it down and it charges slowly. (USB A to C cable needed)  Definitely needs extra time but is usually charged in a couple/few hours.
I guess the only question I have about this would be - is there anything wrong with leaving that setup (12W USB-A charger, USB A to C cable, M1 MacBook Air) plugged in while I'm working on the computer?  I have heard that it's best to not drain and charge at the same time.  So I guess more generally I need to research the entire question of charging while using.
Answer: Apple laptops with USB-C, and the power supplies that come with them, will use USB-PD for charging.  I've discovered that in a situation like yours my MacBook Pro will charge slowly from a 12 watt iPhone power supply that uses USB-BC and Apple's BrickID for charging.
Based on what I know from USB-PD I believe your One Plus charger does not support USB-PD.  This is because 5 volts at 4 amps is not a valid USB-PD power profile.  A bit of research tells me that this charger is likely using a charger protocol called VOOC or Dash Charge.  These chargers will fall back to USB-BC charging for backward compatibility with older One Plus phones.  The supported USB-BC charging rate from this charger is likely 5 volts at 1.5 amps.  The 7.5 watts you will get from your phone charger is 1/4 what you would get from the Apple charger that came with the laptop.
I'm quite certain that your MacBook Air will take power from this charger to at least extend the battery life while in use, perhaps even have some power to spare for charging.  I'm quite certain it will charge the laptop while it is powered down or sleeping.  I'm most certain that this will not damage either the charger or the laptop, both have enough "smarts" in them to not do anything that will damage them.  The transfer of power would stop before damage is done.
I'm quite certain my answer is too late to help with your dilemma of avoiding a dead battery, but will hopefully help you or someone else in the future.  One last thing I'll say I'm at least minimally certain about is that it would be wise of you to invest in a spare USB power brick better suited for powering your laptop.  That's assuming you didn't do what I did that forced me to charge my 60 watt laptop from a 12 watt phone charger, temporarily misplace two laptop chargers.
Years ago I found myself in a spot with a much needed laptop running low on battery and no charger for it in the vicinity.  I keep a spare laptop charger on hand since then.  Today this isn't near the problem as then since USB charging is the norm, chargers are less expensive now and very interchangeable.  The problem we will find today is that not all USB chargers are equal.  The chances of me not having any means of charging my newest laptop is near zero now as I have multitude of USB chargers on hand.  The number of them rated for more than 12 watts though is just two.
I don't know if a 20 or 30 watt charger exists that supports both VOOC and USB-PD.  If so, and it doesn't cost too much, then getting one might be a wise investment.  A quality 20 watt USB-PD charger can be had for $20, and should provide enough power to avoid running the battery dead on a MacBook Air unless it's run really hard, and will also be a spare 7.5 watt charger for your phone.  A $30, $40, or $50 charger removes the slow charging concern for the laptop, but not for the phone.
I do wish USB chargers would put on the charger what charging protocol they use, and do so using the same names as everyone else.  VOOC is the same as Dash charge.  Quick Charge is the same as PowerIQ.  What Apple calls "fast charge" is just USB-PD by another name.  It also doesn't help when they use such similar names for incompatible charging systems.  Well, they are incompatible for providing more than 5, 7.5, 12, or maybe 15 watts of power.  They will all at least fall back to providing something for power.  There will be no harm done for people that mix up these USB chargers, but mixing the up will get disappointing charging rates.


How to add a new field and overwrite existing feature class by using FME 2021

Question: What I am trying is to add a new field to an existing feature class in file GDB, overwrite this feature class and continue with processing. So far I tried to read that feature class connect to AttributeManager to add new field and FeatureWriter to overwrite it, but for some reason it doesnt update my current feature class. How this can be done in FME 2021?
Answer: Without seeing the details of your FeatureWriter, I would suggest the following:
In the FeatureWriter, ensure your Table Handling is set to "Drop and Create". This should delete the feature class and recreate it.

However, it's important to understand the locking that can be in place with a file geodatabase. It's possible that if someone else (including you) has this feature class open, then there may be a lock preventing you from deleting it.
The other thing that is important is how your User Attributes are configured for the writer. If set to Manual, and you haven't specified the new field, then it won't create the field.

If you have it set to Dynamic or Automatic, then you will get the new field, but you may also end up with other fields that you don't want, depending on what is exposed in your reader.
Comment: the thing is that I dont want to delete and recreate the existing feature class! I just want to add some more columns on it and continue with the processing without making a copy of my current feature class....  Sorry if my question was not very clear
Comment: The thing to remember is that - if you are adding a new field to an existing FC, which has existing data, then ALL records in the FC are going to need to be updated to reflect a value for that new FC. Given that all records will be updated is the reason why some people prefer to just drop and recreate the FC from scratch.
Comment: @Fezter this is exactly what I wanted. Thanks a lot. I think I just misunderstood the meaning of "drop and create" but this solved my problem. Thank you again. Furthermore I had wrong output port as Mark Ireland realized.
Answer: From a debugging perspective, try the following:

As above with Fezters answer - Ensure that you set your writer to 'Drop and Create' it will drop the current FeatureClass (ie: remove it) and then recreate it from scratch, with the specified attributes and data.

Use AttributeCreator transformer when creating new attributes. This may solve your problem.

Also, I would debug your bench by replacing the FeatureWriter, with just a normal writer. In theory it should be the same but it will at least confirm that the transformer type is the issue.

Finally, I would just try a different writer format. This will inform you whether its having issues writing to the format (being the same as the reader).

Go from there and post back whats happening if the above doesn't solve it.
Answer: If you're reading and writing to the same table, why is the source feature type named "coord" when the output is called "Output"?
Perhaps it's as simple as you're just not looking at the correct output table?
Otherwise, you're going to need to add more details, such as whether there is a warning or error message in the log, and what are the parameters of the FeatureWriter.
Comment: the assumption is that he has just created the screen capture for our purposes - Given that he also talks about doing further processing beyond the FeatureWriter transformer.
Comment: @Mark Ireland you are right I was just using the wrong output port :-( Thanks a lot.


Javascript timer not working when php gives it a date

Question: Okay since I am not to familiar with javascript I had php spit out a date if it matches certain criteria. I stored the date in a session variable so that it wouldnt be lost on a refresh, as I know php variables lose their value when the page is refreshed. I declared a variable with a stactic date to see if the date is being fed to the javascript timer. It is not reaching the timer. I tested with an alert to see if it was being fed to javascript and sure enough it is. No errors in the console. I thought maybe it was the fact that javascript counts dates 0-11 instead of 1-12 like php does, and I accounted for that and no change. All I see is the text that gets rendered when timer is done counting down.
Basically the date is not reaching this block:
<code>window.onload=function(){
  var cdown = new CDown();

  cdown.add(new Date(CountDownDate), "countbox1");
};
</code>
I have no idea how to fix the javascript so that date does reach that block. I tried putting that static date in the block and still no change, but if I change CountDownDate to a static string then it works like a charm.
Comment: No one will look through all of these code for you. Please distill your program to ideally 5-10 lines of code.
Comment: Yeah in the works of doing that now.
Comment: So on my own on this one I guess
Answer: Wow the fix was sooo simple....
I looked up date object on w3schools and tested my format and it didnt work. I was using this format for dates:
yyyy,mm,dd,hh,mm,ss
I know the above format is in fact valid, because I have seen it used in tutorials before, but when I used the following format it worked like a charm:
yyyy mm dd hh:mm:ss
The one thing I dont get is that I wasnt getting no errors in the console when I used the first format. I guess the first format doesnt work when it is in a variable.


Can I use a longer thru axle than the stock thru axle skewer but have similar pitch?

Question: I'm looking for a front thru axle skewer for my bike. The stock axle has these measurements, L124mm TL16mm TP M12 x 1.5. The closest I've seen so far online is L125mm TL17mm TP M12 x 1.5.
Would it be okay to fit the one I've seen online as is, or should I opt out getting a washer/spacer?
Answer: Yes, in most cases you can do what you propose and it's fine.
To look cool, some frames have covers on the drive side of the axle, such that nothing can stick out unless you remove the cover. Canyon is one company that has this.
It's also pretty common for the stock axle to have more threaded length (TL) than it necessarily needs. As long as the axle you choose isn't running out of threaded length before it engages all the dropout threads, you don't need any more than that.


What does this icon mean?

Question: The white arrow in attached image, what does it mean? I use Windows and there is no tool tip with info.
Comment: Ok, i noticed this scene layer has an animation attached to it. However, i have several layers which use animation but do not contain such a icon. Why have a few scene layers (see above image) such an icon and contain special layer in the the animation view? I remoevd the animation view extra info, but the icon and info in the scene layer is persistent. How can i clean this up?
Answer: That small squiggle arrow is indicating that the object has an action. Meaning that the object is animated.
If you click on the plus button and open up the hierarchy you will see that it is an animation.
Comment: How can i remove this action, i tried to remove it from the animation view, but the info in the scene layer is still there... i do not want extra actions. Im not aware that i added extra actions.
Comment: David, thanks for additional info, i noticed that too. But teh strange thing is im not aware to have animated these objects.
Answer: Ok to get rid of these icons (which indicate an action), right click it and pick "UNLINK ACTION". Either before this or after open the ANIMATION VIEW -> CLICK the Object and then delete the action from the animation layer too.

What does this icon mean?


Printer randomly stops, Is the power supply bad?

Question: I have a prusa i3 with Mendel firmware and a RAMPS board.  Recently it has been randomly stopping during prints.  The LCD screen will lock up, the print will stop, and the heating elements will turn off.  Pressing the reset button on the RAMPS restarts the system and it works fine.
In addition to stopping during prints, it has also frozen up while just sitting while on.
My first thought is the power supply (12V 30A) is going bad, but is there anything else I should check before I buy a new one and replace it?
Update:
I replaced the power supply with a new one, and the printer did not stop and completed a print.  I am voting to close the question.
Comment: I'm a little suspicious about the PSU being the issue here, because locking up implies the processor froze, and the processor is on a 5v regulator circuit that should be pretty resistant to input voltage variation.
Comment: Do you have a multimeter to check what the supply voltage is doing?
Comment: I have measured the voltage on the supply and it is 12V.  I am guessing it drops for <1 second which would cause the problem.  I am planning on getting a scope and and putting a trigger on the voltage and also measuring current out of the supply.
Comment: Are you confident that your mains power is stable? If you have a spare UPS unit or one you can temporarily assign to the printer, using it will eliminate or confirm problems with commercial power, as opposed to on-board power supply trouble.
Comment: As an add-up to Ryans comment: If the voltage drops below operation level (as in the case of complete loss of power for a short time), the board should not freeze but simply restart as soon as power is back (not 100% sure, correct me if any of you have experience with too low voltage)
Answer: It could be several things.
Your ramps board is overheating or has to much load on it. If you're not cooling the ramps board adding a fan may help the issue.
I know Robo3D had this issue and started shipping with a fan to cool the ramps board.
The ramps/arduino board could be faulty, the firmware may have gotten corrupted or the current version has a bug in the code.
If you are not printing from the sdcard on the lcd controller and using software through a usb connection, that computer may be causing the issue as well.
Comment: for anyone who could be interested in [cooling ramps](http://www.thingiverse.com/thing:166045)
Answer: I had the same thing, the printer was not heating the nozzle anymore after starting the print.  I fixed this by reinstalling the firmware.
It could also be that your stepper drivers are overheating. you can add a fan to cool them.
The SD card could be bad, maybe try an other card or another .gcode file.
It is probably not your power supply, a 30A power supply is more than enough, but you can measure the volts on the power supply while the printer is running, if it is around 12V it is probably alright.


How do I bait the parrot?

Question: The parrot zombie is rather annoying on some levels as it seems to randomly select plants to pick, often times my twin sunflowers in the back row.  How does it choose which plant to go after?  Is there a way I can bait it into picking an iceburg lettuce?  What is the best way to deal with a parrot?
Answer: After a short wiki check on the Zombie Parrot it seems that it chooses the plants absolutely at random. It also says that:

It steals plants like Bungee Zombies if it is not defeated in time.

From my personal experience I can say that it's (almost) impossible to tell which plant will it (try to) steal before it lands on it. I assume that you want to bait it into an Iceberg Lettuce only because it costs nothing, but I'm quite sure that it's impossible to force it to take the plant of your choice. But normally by the time you encounter them you have enough defense to kill them. Personally I had a Repeater and some other plants in each row which was enough to kill it before it got too far.
Possible strategies vs. Zombie Parrot:

If you see that you won't be able to kill him before he passes your attacking plants, you may want to use a Plant Food on a plant that attack the row in which the Parrot is flying at that moment. A good option would be to feed a Cabbage Pult, because it heavily attacks all zombies on the screen.
If you want to slow the game down a bit to let you gather more sun and not to lose a plant you may plant the Iceberg Lettuce somewhere and immediately feed it with Plant Food. It will freeze all zombies on the screen(pretty much the same as Ice Shroom from the first game).

I don't know if there is anything like Umbrella Leaf in the second game, but if I will find a defensive plant against Parrots I'll update my answer.
Comment: Nope, no umbrella leaf plants unfortunately :(
Comment: will freezing it kill the parrot?
Comment: @z' After the Far Future update, the Blover will blow away Parrots, tossed Imps (mid-air), Seagull Zombies, etc.
Answer: I've noticed the pat of butter from the corn catapult instantly kills the parrot...it also makes the seagull drop his zombie
Answer: You can unlock the Far Future world, and get Blover there. It blows all flying enemies, including the Jetpack Zombie, Seagull Zombie, Zombies swinging on ropes, flying Dodo Zombies, and Parrots.

How do I bait the parrot?


How to become a cricket umpire for icc?

Question: I like cricket very much, is there a way to take umpire as carrier?
If so what should i do?
Answer: If you are living in Europe you can find this ICC Europe Umpire Education Courses
Answer: It is possible to take umpiring as a career BUT it is very difficult to get to the level at which it is a proffessional option and it takes a lot of time.
The first step in getting involved in umpiring is to contact your local cricket association and ask about umpire training.  They will offer some, in the UK it's the ECB ACO, in europe its ICC Europe, I am fairly sure the BCCI and PCB also offer the same.
Then it is a matter of getting out on the field and umpiring and over time if you have the abilities needed you will rise towards the top and may eventually be able to do it as a career.
However given the competition it will take time and luck.
There are for example only 12 elite umpires employed by ICC.
The ECB employees a further 33 on its 1st class and reserve lists.
Ben

How to become a cricket umpire for icc?


Does ESXi take care of disk partitioning?

Question: I am installing ESXi for the first time and really need to know if I have to partition and format the hard drive for the virtual machines prior to installation of ESXi or ESXi will be handling all hard drive problems for me?
Comment: Just as a helpful comment, you may want to consider installing ESXi onto a USB flash drive or SD card.  This allows all of your hard disk space to be used for virtual machines (or to have a diskless server if you use shared storage).  I used a few 8G usb drives, they work great.
Answer: short answer: don't worry. No need to partition.
longer answer: make sure that there is nothing you are still interested in on the hard disks attached to the hosts you install ESXi on when you install. ESXi will apply a default format for it's own (management) stuff, and create a "data store" from the space left.
remark on namings:
ESX and ESXi store hypervisor "stuff" they need to run on partitions usually not visible in the VI Client. You get to see results that come from there, like log entries, but usually you are not moving around there by yourself (unless you explicitly login the the CLI on the ESX host). Such partitions are often locally attached disks on a ESX/i host, as they are only used by one single host.
Virtual machines and such are stored on separate partitions, called "data stores", and usually you put those on a shared storage so everyone attached to the SAN/NAS can see and use the data store. However, data store can reside pretty much everywhere - also on local hard disks. In that case, other host would not be able to mount that data store, but it's still a perfectly avlid data store.
To share locally attached disks with other ESXi hosts, have a look at the vSphere Storage Appliance.
Answer: Yes, ESXi partitions and formats vmfs volumes on your local disk.
During the reboot operation, VFAT scratch and VMFS partitions are created on the disk.
http://www.vmware.com/pdf/vsphere4/r41/vsp_41_esxi_i_vc_setup_guide.pdf, page 45, step 9
Answer: Once you have installed ESXi you can use its interface to set up your data stores. There are no third party steps involved.
Answer: The "hard drives" you set up for Virtual Machines are actually files. Usually VMDK files with VMWare. Your physical hard disks become Data Stores and as you configure virtual machines and drives for them, you'll see folders with various files, the largest of which will probably be VMDK files which are the only Hard Drives the virtual machines know about.
So don't bother partitioning anything on the physical drives. Do all your hard disk config for the virtual machines inside the vCenter app as you set up each virtual machine.
Answer: Unless you have a specific need, partitioning will reduce your future flexibility. I just have one giant volume, then in the datastore vmWare puts each VM's files in a seperate folder to keep them tidy.
Comment: Even a single file system has a partition.


Does got any optimise method can swap/splice/loop channel without on-chain cost in lighting node?

Question: if I got custom Node and Alice has 3btc and bob got 0btc and bob got 0btc with Tom 1 btc. Is it possible we can change channel for Alice 3btc with Tom 1 btc. And close Tom. And it doesn't go to on-chain btc. Does it possible Only swap this in off-Chain my node?
Answer: If initially the channels from Alice, Bob and Tom came from the same channel factory (we do not have channelfactories as part of lightning as they would be much easier to build on eltoo channels) then I guess Bob could easily be removed off-chain to have a new channel just between Alice and Tom.
As with current lightning network I think we have to hit the chain to achieve what you want
Comment: So the action will be 1. Remove Bob from this node (This will commit to on-chain btc). And move Tom to bob channel. For this one should I create new channel or got any function can do off-chain?
Comment: right now you would close the two channels (the alice-(3)----(0)-bob channel and the bob-(0)-----(1)-tom channel and then open a newly dual funded alice-(3)-----(1)-tom channel


Sitecore SXA 1.9 Upgrade

Question: We tried to upgrade our SXA to SXA 1.9. We follow Sitecore documentation but we found some of the templates are merged incorrectly, and items created with those templates were incomplete.
Answer: We wrote to Sitecore support and we found this is an known issue.
Solution
Install the SXA 1.9 package three (3) times. This will solve problems with missing fields under some templates.
Note: Before the upgrade make sure that you have a backup of your custom scaffolding actions (actions of type ExecuteScript are affected).
More information can be found here: https://support.sitecore.com/kb?id=kb_article_view&sysparm_article=KB0588338

Sitecore SXA 1.9 Upgrade


How do I get someone else's apple ID off of the iphone 5

Question: I purchased a used iphone and now I cannot transfer my information to it because it still has the former owner's Apple ID.
Answer: This depends on the situation.
IF Find My iPhone is on, he'll have to remove it from his account. Otherwise, sign out in iTunes & App Store, iCloud, FaceTime, Messages > Send & Receive, and GameCenter (can all be found in Settings, some may not be signed in). In most of these, you can tap on the AppleID: or Account: field, which shows the email address, while in iCloud, you scroll down to the bottom and look for Sign Out (iOS 8) or Delete Account (7 and earlier)
Ideally, as long as Find My iPhone is not turned on, Settings > General > Reset > Erase All Content And Settings, or even more ideally, use iTunes to Restore iPhone.
In summary, when Find My iPhone is NOT turned on, the best way is to use iTunes to restore.
Edit: I just noticed you tagged your question ios-5. If it's not running iOS 7 or newer, you may not need to worry about Find My iPhone. Activation Lock begins with 7. (You can check the version in Settings > General > About if you're unsure.)
Answer: Go to Settings > iTunes & App Store > click on the 'Apple ID: email@example.com' > Sign Out
Sign out of iCloud : Settings > iCloud > Sign Out (at the very bottom)
Or you can just restore to factory settings.
Comment: Signing out of iCloud autonomously turns that off as soon as you sign out. Additionally, I think restore to factory setting encompasses that as well, and probably the safest thing to do as opposed to turning off select features since it is a previously owned device @Rob
Comment: You're missing essential information about Find My Iphone in your answer.
Comment: Totally agree that a full wipe to factory settings is warranted. The idea here is to start afresh.


Default Venue for this website

Question: In general, when discussing a question and it is not stated that the context is the US and unless explicitly stated otherwise:  is it assumed the governing law is US patent law and that the question is domestic?
Answer: Speaking only for myself, I do not feel the there is a default venue on this site. Some of the most prolific contributors are from countries other than the US.
Answer: I normally ask the op to clarify if I suspect they want to have a US answer.
If not, I try to answer generally. There's really not so many questions where the law differs substantially between US and Europe and it's not clear from the question which is meant.
Other jurisdictions would have to be specifically mentioned, but are rather rare.

Default Venue for this website


Can a revolving body self-gravitate?

Question: If a body is revolving around a point at radius R with tangential velocity V, does General Relativity predict that at some tangential speed, the body will revolve around the point without any external forces acting on it?  Since General Relativity models gravity as a curvature of spacetime, I was thinking that an observer at the center of rotation of the revolving body would measure some curvature of space as a result of the revolution.  This is because the body would be contracted in the tangential direction relative to the observer, such that C<2*PI*R where 'C' is the circumference of the revolving body measured by the observer (the revolving body is thought of as a ring of particles).  This implies a curvature of space, which would be equivalent to a gravitational force.
Comment: http://en.wikipedia.org/wiki/Lense%E2%80%93Thirring_precession

http://en.wikipedia.org/wiki/Frame-dragging

http://einstein.stanford.edu/
Answer: I'm not sure about axially symmetric solutions, but for spherically symmetric configurations, curvature inside a certain radius is unaffected by the matter distribution outside (as in Newtonian gravity). I suspect the same thing happens in your case. I suspect that if the ring were thick enough, there would be an effect, but that is not exactly the case you are considering.
Answer: Oliver Heaviside showed at the end of the nineteenth century, that if a field is moving at a finite speed, then there is a co-field, which is caused by, and acts on, moving charges.  Since in this scope, gravity is a field, its charge is weight (ie what is incorrectly called mass:  Mass is a measure you find with rulers.).
In any case, the nature of the co-field is similar to magnetism (which is the co-electric field), something demonstrated by OH.  It's called variously co-gravitation [Jeffimenko] or gravitomagnetism [wikipedia].
More recent analysis changes some of the numerical constants by a factor of 2.
So if your planet is spinning at something like very fast, one has to take to account the nature of the co-field into account.

Can a revolving body self-gravitate?


how can I filled with a Xuggle IPacket from RTP Stream

Question: When we decode a file, we can read a file with IContainer and after call container.readNextPacket(packet) >= 0, the packet can be filled. But how can I fill with the packet when I only get the H.264 Stream
Answer: I'm assuming you mean the H.264 stream is incoming, and you're wondering how to fill a packet with the data, correct?
In that case, you're doing it correctly. As long as you set up your IContainer to use the URL/Path of your H.264 stream, then container.readNextPacket(packet) will fill the IPacket with a packet of data from the H.264 stream.


How to get write access in guest os (linux) for raw disk (ext4) with virtualbox on Win7 host?

Question: I created the vmdk-file as describe in Chapter 9. Advanced topics and added it to my guest vm. After it, I could mount the entire raw disk up in my linux guest vm. Now I can read the ext4 file system, but I can't write to it. How can I get write access without changing the file system to NTFS? In Win7, I cannot set permissions to that hard disk because it's a raw hard disk with an unknown file system.
Comment: I found I needed to run VirtualBox with administrator access in order to fully access raw disks under Win 7. Have you tried that?
Comment: Sorry, doesn't work too.
Comment: How are you mounting the drive? Can you write to it as root from the linux guest?
Comment: Did it by clicking the hdd in the file browser to mount it. I also  tried `sudo mount /dev/sdb1/ /media/Data` and it was mounted then, but without write permissions.
Comment: If you mount is and then run mount command then you should see something like:
/dev/sdb1 on /media/Data type ext4 (rw,errors=remount-ro). rw means that the drive is in read-write mode.
To remount it in rw mode you could try mount -o remount,rw /dev/sdb1
Comment: Doesn't do anything. I think it's not the guest os (linux), which causes the issue. I think it is the host (Win7), because I remember that I tried this before, but via VMware. At that time I had to change the file system from ext4 to ntfs. If the vm (guest) talks to Win7 (host) to let Win7 talk to the raw disk, then it is logical that it doesn't work. Win7 can't read/write to ext4. But is there no way to let the guest talk directly to the raw disk?
Answer: Okay, I found a solution by myself. Now, I want to give you detailed instructions about the steps I did to get it working.
My setup
VirtualBox 4.2.0 r80737
Host: Windows 7 (64-bit)
Guest: Ubuntu 12.04 LTS (64-bit)
Disk configuration in Win7 (host)

Close all open programs or documents on any partition on the disk to pass-through.
Run DISKPART (command line utility) as admin.
Type LIST DISK to get a list of all available disks and their related ids. (LIST PARTITIONS if you want to use just a part of the whole disk)
Select hard drive carefully using SELECT DISK.
Offline the disk using OFFLINE DISK. All disk volumes will disappear from windows explorer.
Type ATTRIBUTES DISK CLEAR READONLY (important!) to make sure the disk will be writable.
Verify with ATTRIBUTES DISK.

VMDK file creation in Win7 (host)

Run cmd (command line utility) as admin.
Type cd "C:\Program Files\Oracle\VirtualBox"
(your path can differ dependent on your VirtualBox location).
Type VBoxManage internalcommands createrawvmdk -filename /path/RawDisk.vmdk -rawdisk \\.\PhysicalDrive1
(PhysicalDrive1 means second drive)

(Source: VirtualBox Manual: Advanced storage configuration)
Add VMDK file to your Linux VM (guest)

Open VirtualBox Manager
Select Linux VM > Settings > Storage > IDE Controller > Add Attachment > Add Hard Disk > Choose existing disk > Select VMDK file
Start Linux VM

Set permissions and mount raw disk
If you use Ubuntu then you should already see the drive in the navigation pane of the file explorer. If you would click on it now, you would just mount the drive read-only to /media/drivename. To prevent this, open up a terminal and put the following into it:
cd /media
sudo mkdir DRIVENAME
sudo chown USERNAME DRIVENAME
sudo chgrp USERNAME DRIVENAME

(replace DRIVENAME and USERNAME with proper values)
Reopen the file explorer and mount the drive by clicking on its name in the navigation pane. Now you should be able to create files and folders on your raw hard disk.
Further information
Of course it is possible to permanently mount the disk via /etc/fstab, but then you have to sudo mount the device and the graphical mounting via navigation pane won't work anymore.
After the VMDK file creation I noticed the following line in there:
ddb.adapterType="ide"

This option is set by default. If you still run into issues and your raw disk is not an IDE disk but SATA, just change this line to:
ddb.adapterType="sata"

Of course then you have to add the VMDK file as SATA Controller to your VM instead of IDE Controller.
Comment: thanks; the one thing i hadn't tried was *leaving* the disk in the 'offline' state when booting the VM, which turned out to be the solution
Answer: The disk will appear in your guest as /dev/sda1 (consult virtual box' docs). You need to mount that drive read-write. The easiest way to configure this permanently is by adding a line to /etc/fstab such as this:
/dev/sda1      /mnt/raw/disk-file/        ext4      defaults    0 2

If you wish to remount the drive read-write on the fly, you may issue the comamnd:
mount -o remount,rw /dev/sda1

Again, this is assuming that the device for the drive is sda1. If you have nothing like that, then I would look trough the output of dmesg scanning for lines with "ATA" or "SCSI" as that will lead you to the device node of the drive. Usually It's really easy to spot in the /dev/ folder. Just look for hd[abcd..][1234] or sd[abcd..][1234...].
Comment: After adding the line into /etc/fstab the drive disappeared from file-explorer and the mount command just throw a "bad operation" error. I removed the line from /etc/fstab and the drive appeared in the file-explorer again, but when I click on it to mount the drive (read-only) the VM crashes now with a BLKCACHE_IOERR error ID.
Comment: You don't have to run mount if you have it /etc/fstab. That's the whole point. The second argument i.e. \`/mnt/raw/disk-file/' is an arbitrary path where you want the disk to "appear in file-explorer".
Comment: I know, but it didn't work via /etc/fstab or via mount. I still think it is not wrong mounting going on here, but rather no compatibility to access ext4 through a windows host.
Comment: Windows writes to a "raw file" or a partition. It doesn't need to know ext4. The guest knows it's ext4, there is no need for windows ext4 "compatibility". look here: http://superuser.com/questions/407977/mounting-external-usb-harddisk-ext4-in-virtual-box-in-windows He fixed his problem, and the issue was not the filesystem type. Anyway... gl


skype conference call problem

Question: I am using Ubuntu 14.04 32 bit version. I have installed Skype 184.108.40.206. I can call anyone. But when I try for conference call, my video device does not work and my friends on the call can see that my skype is not upgraded to allow conference call. Can anyone help?
Comment: Possible duplicate of [Unable to do group video call and group screen share using Skype 4.3](http://askubuntu.com/questions/534186/unable-to-do-group-video-call-and-group-screen-share-using-skype-4-3)
Comment: Have you tried this:https://support.skype.com/en/faq/FA194/can-i-make-conference-calls-with-skype-for-linux ?
Comment: yes, I have tried this and I can make conference calls too, but my webcam do not work then.@Jos
Answer: Possibly you hit bug #1372846. Try this:
<code>sudo apt-get install skype-bin
</code>
Comment: It did not work.It shows:
Package skype-bin is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  skype

E: Package 'skype-bin' has no installation candidate

@GunnarHj
Comment: @AmartyaRej: Ok.. I assumed that you had installed Skype from the Canonical Partner repository in the Ubuntu archive, but considering what you now say, I suppose that you installed it from the skype.com web site. If so, you can disregard my answer above.
Comment: Yes, I downloaded it from the skype.com @gunnarhj
Answer: Video conferencing (group call with video) is unsupported on Skype for Linux.
Video conferencing works on Skype for Windows. You can install this on Ubuntu using PlayOnLinux/Wine, but it requires some fiddling...

skype conference call problem


Different document length in computing cosine similarity?

Question: Is there any rule, when I like to find cosine similarity between two documents that have different number of words?
Answer: The standard formula does not require the number of words to match. You can just sum over the union of the words of both documents. All words that are in B but not in A give rise to a 0 in the word vector for A. All words that are in A but not in B give rise to a 0 in the word vector for B.


Beginner: Can Java source code be executed by Java Virtual Machine? Or not directly?

Question: Im in my first week of college majoring in computer science. Can java source code be directly executed by JVM?
Comment: read up on [bytecode](https://en.wikipedia.org/wiki/Java_bytecode).  It explains what the JVM does.  javac takes the java source code to bytecode.
Comment: By takes it to he means compiles it to.  If you're going to think a programmers every time you're stuck on a question can I suggest you search a little harder for an answer first.  We do design questions here.
Answer: No, it can't.
The name "Java VM" is a bit of a misnomer. The JVM came about as a part of the Java platform, but it is actually independent from Java. Neither does the JVM execute Java (it executes its own language, which AFAIK doesn't have a name, but is usually called JVM bytecode, Java bytecode (another misnomer), or sometimes JVML) nor does Java require a JVM (you could just as well interpret Java directly, compile it to native machine code, compile it to ECMAScript, compile it to CLI CIL bytecode, etc.)
The Java platform consists of three components:

The Java Programming Language
The JVM
The Libraries

They are all independent from one another. For example, you can use Java without the JVM and the Libraries, e.g. on Android. Android has a different bytecode format for a different VM, and it has different libraries. You can also use the JVM and Libraries without Java, e.g. from Scala, Clojure, ECMAScript, Ruby, Python, PHP, Fantom, Groovy, Frege, and so on.
Answer: No. Java VM cannot run (interpret) source code. Code must be compiled first, generating a byte-code file (.class) that can be interpreted and run by the JVMs. Java compilation doesn't generate native executables either.
Bytecode is an intermediate instruction set that is platform independant and so can be run in different OS's JVMs. Each JVM is compiled for its host OS which allows it to interpret the bytecode and compile it into native CPU instructions during runtime.
Answer: Short answer - no.
By way of an analogy:
Can you run your car on dinosaurs?
Of course not.  Even if there were some around to try it with, they wouldn't fit (or want to get) in the tank.
Can you run your car on the bacteria, heat and pressured-treated remains of dinosaurs?
Yes.  We call that petroleum.
You and I write source code.
A compiler converts that into byte code that we store in [jar] files.
The Java RunTime can link-load those files into something that a computer can actually execute.  There's no short cut.


How long to pump well out for

Question: What is the procedure for restarting a drilled well?

1st pump was clear, but after that cloudy.  How long and how many times to pump to clear it up?  Will silt damage the pump?
I pumped 4 times into two 5 gallon buckets
Comment: Duplicate : https://diy.stackexchange.com/q/164796/97780
Comment: Sort of a duplicate...I find SE rules for new questions confusing...so I figured this was a specific time request for the pump out
Comment: You were given enough detail - several days was suggested to allow the water from the well to become clear...
Answer: In general, moderate silt won't damage a typical electric well pump, as there are no close clearances (virtually all are not a piston with seals, it's a set of impellers which have space between them and the silt just flows through with the water.)
Heavy sand over long periods of time can cause significant wear, but that does not look like what you show, and in any case you either have to live with it, (and replace your pump more often) or possibly reposition the pump to try and minimize it. You can use various filters to keep it out of the plumbing if it persists, but it may not persist once you have flushed things out a bit.
Are you pumping into a 5 gallon bucket inside the building? Put a hose on, run it outside, and run it for an hour or so, keeping an eye/ear on it so you can shut it off just as soon as water stops coming out, if it does.
Pay attention to when that happens, and make the occasional check of how long it takes to fill a bucket for an estimate of flow rate (which will vary over time as the water level in the well drops) and you can get an estimate of your well's recharge rate. You'll also get an idea of how the silt is progressing. If your well recharge rate is high enough, it may just keep pumping the whole hour, that's fine.
Leave it several hours or a day to fully recharge, and repeat for perhaps a week, perhaps less depending what you see for collected silt.
Your previous post has some data regarding the "volume of water in the well" which implies a 6 inch casing and counting the water below the pump (10 feet off the bottom of the well) which you cannot pump. In reality (if those figures are still accurate - water-tables not being fixed) you have about 110 gallons "stored in the well" you can access, and anything more than that you get out over a period of time informs the recharge rate of the well (typically stated in gallons per minute.) So if you pumped out ~200 gallons over the course of 30 minutes and then the water stopped, you could infer that about 90 gallons flowed in over the 30 minutes, implying 3 gallons per minute inflow. But if your pump pumps out slower than water comes in, the water would never stop - but you'd still have a number for the minimum rate of inflow you could infer. That's merely information, but it's often good information to have.
In "flushing out the well" you certainly want to pump out MORE than the "stored volume" each time, since water WILL come into the well (and if the well has not been used for a long time, the initial inflow may indeed carry some silt with it.)
Comment: I'll call the driller tomorrow and edit this comment.  Flow rate was low when drilled.  Good for 2 people he said.
Comment: Flow rate when drilled and flow rate now may also be quite different, as with water levels. It's an ever-changing system down in the aquifer...

How long to pump well out for


Looking for way to "punish" the d5 push after 1. d4 Nf6

Question: All is said in the title. I find the move 2. d5 after 1. d4 Nf6 pretty annoying even if it's probably not a great move. What are suitable moves to "punish" this opening play? I will add that I am more of a Benoni/Benko player.
Answer: If you're a Benoni player, there's nothing wrong with 2... c5, which will get you in familiar territory (3. dxc6 e.p. is harmless and not something White wants to play - exchanging a center pawn for a flank pawn).
While it's not a great move, Black isn't immediately better, just about equal. So it's dangerous to try to 'punish' this move, especially if White has probably more experience with this line than you (and less with the main Benoni/Benko lines).
Comment: Thanks for your reply, I used to play 2...d6 which often leads into KID type of positions, which is not my cup of tea :)
Comment: @Glorfindel - tangential question - White routinely exchanges d-pawn for Black's c-pawn in the Sicilian, so how can we reconcile that with "not something White wants to play - exchanging a center pawn for a flank pawn"?
Comment: @rolando2 good question; the difference is that here White spends three tempi with this pawn, in the Sicilian only one.
Comment: Ahh yes - Very good.
Answer: The most direct way to punish this move seems to be to attack the d-pawn immediately. Black gets a very slight advantage. For example
<code> [FEN ""]
 1. d4 Nf6 2. d5 c6! 3. c4 cxd5 4. cxd5 Qa5 + 5. Nc3 b5! 6. Qd3 b4 7. Qb5 Qb6 8. Qxb6 axb6 9. Nb5 Ra5 10. e4 Nxe4
</code>
I'd recommend that you run this line by the engines. They do tend to agree that this line gives Black a very slight advantage.
Answer: If you like the Benoni, 2...c5 is definitely an option.  However, the kicker here is that White doesn't have to play 3. c4 and transpose to the main line.  Instead, White could play 3. Nc3!? and if you play 3...e6 then 4. e4! could be unpleasant.
A solid option would be 2...e5.  While this gets you out of your familiar territory, it does give you good play on the dark squares. Example:

c4 Bc5 (or Bb4+) 4. Nc3 a6 (giving the Bishop a strong home on a7) 5. e4 d6 sees Black's typically passive dark-squared bishop enjoying activity.

One last suggestion could be 2...b5.  It prevents 3. c4, and if 3. Nc3 then 3...b4.  Since White also can't play e4 for the moment, the d5 pawn is vulnerable.  You can play Bb7 and e6 to put pressure on it and take it out.
Comment: Against 2 ... c5 3 Nc3 d6 could be an option, trying to transpose into the Pirc - the early d5 should mean easy play for Black if he/she manages that
Comment: Yes, transposing to a Pirc is definitely an option.  One problem though is that most people don't play it as Black against e4, so they'll be in unknown waters.  I'm not entirely familiar about how good the Pirc is with c5 thrown in, but I know it definitely leads to double edged positions (more so or equal to the Benoni).
Comment: If white follows up  3 Nc3 4 e4 5 f4 it's one of the most innocuous ways to play the Austrian attack, though he might throw in Bb5+ at an appropriate point as well which is probably a bit better. But all in all I think there's little to fear for black, the e5 break is a bit more slowly, and given many of the lines have the point of stopping an early c5 from black it does look like not a bad idea. But I play the Pirc (and Benoni!)
Comment: Fair enough.  I play the Benoni as Black as well.  I think there are upsides and downsides to White not playing c4.  The upside for Black is that White has less control in the center, but the obvious downside is that White has an extra tempo.  Although that's only if Black plays e6.  If someone is fine with playing the Pirc, then 2...c5 is definitely a viable move.
Answer: Why is 1.d4 a good move? Partly ecause it controls the central squares c5,e5. What squares does 2.d5 weaken? c5 and e5. Good plans would take advantage of this. . 2...e5 looks very nice with ..Bc5 to follow
Answer: Wes's answer seems quite good but I think ...e6 is also a strong alternative. The point is that you just get pieces out, and d5 comes under pressure. It also seems that, since you play the Benoni, the exd5 capture will lead to positions favorable compared to the main lines, since White never has time for e4. You can castle and play Re8 (f3 is not really an option, as White's king knight will be terrible for a while). Your position will not be cramped. Here is what happens if Black tries to push pawns.
<code> [FEN ""]
 1. d4 Nf6 2. d5 e6 3. c4 (3. Nc3 Bb4) Na6 4. a3 Nc5 5. b4 Nce4 6. f3 Nd6 7. e4 Nfxe4!
</code>

...Bb4 is also good here, and maybe less risky, as Black can just threaten to exchange the bishop for the knight, again either winning a pawn or collapsing the White center. The two bishops aren't enough compensation for the loss of time from d4-d5-dxe6 or a3.

So 2. d5 looks annoying until you find a way you like to go against it. The main thing is to attack the pawn immediately and force White to trade it for a less aggressive pawn or waste time defending it. Fortunately, there are pretty straightforward moves to dissipate White's advantage, but there are more adventurous ones like Na6 too. So I bet after you see it a few times, you will have fun neutralizing it.

Looking for way to “punish” the d5 push after 1. d4 Nf6


Why should we not feed LDA with TF-IDF input?

Question: Can someone explain why we can not feed LDA topic model with TFIDF?  What is wrong with this approach conceptually?
Comment: Because LDA is based on term counts and document counts.
Comment: @Blue482 many thanks for the answer :), may I ask you to explain more? I know the concept behind TFIDF and LDA, but I can't understand what will be wrong if we feed LDA with a vector which is times of terms counts and the weight in each document?
Comment: @Blue482 Also may I ask you to provide your answer in the second post,https://datascience.stackexchange.com/questions/21947/how-to-feed-the-document-topic-distribution-vector-of-lda-to-svm-classifier because I can not comment in the first post as I explained. i made that as guest, and guest can not put comment, because of that I create my account and create another post, I really appreciate your help, needs your insight in the result. thanks :)
Comment: I've created another post in stackoverflow. as I can not follow your answer, may I ask you to follow there(I updated my answer there and it seems working but still some questions about the output)? as it would be hard managing in this way, I really appreciate your help in advance,  https://stackoverflow.com/questions/45535277/how-to-feed-the-document-topic-distribution-vector-of-lda-to-svm-classifier
Comment: @Blue482 I got why that is incorrect :|,  it would be really good if you could add your explanations as answer, so I will accept that
Comment: If it doesn't make sense to feed LDA with tfidf as Lei Hao says, what does scikit-learn do when you do it anyway? From my personal experience, you get better quality topics using the tfidf matrix (I mean more diverse topics).
Answer: Since the StackOverflow link in the question comments seems broken, here is another reply that addresses the same question: https://stackoverflow.com/a/44789327/6470915
Direct quote:

In fact, Blei (who developed LDA), points out in the introduction of the paper of 2003 (entitled "Latent Dirichlet Allocation") that LDA addresses the shortcomings of the TF-IDF model and leaves this approach behind. LSA is compeltely algebraic and generally (but not necessarily) uses a TF-IDF matrix, while LDA is a probabilistic model that tries to estimate probability distributions for topics in documents and words in topics. The weighting of TF-IDF is not necessary for this.

That sums it up on the high level. It would be interesting to understand more technically, why the model would perform more poorly if TF-IDF is used. Actually, there is another reply in the SO link which claims that LDA can be improved with TF-IDF.
Answer: Latent Dirichlet Allocation (LDA) is a popular topic modeling algorithm that is often used to discover underlying topics in a collection of documents.
LDA operates by assuming that each document in the collection is a mixture of a small number of topics and that each word in the document is attributable to one of those topics. In simple terms, LDA is a generative probabilistic model that assumes documents are mixtures of topics and topics are mixtures of words.

TF-IDF is a frequency-based representation that captures the importance of words in a document relative to a corpus. It measures how often a word appears in a document and compensates for how common it is across all documents

The use of Term Frequency-Inverse Document Frequency (TF-IDF) vectors as input to LDA is not conceptually wrong, it might not yield the best results in all cases, can lead to suboptimal results or might not fully capture the underlying topic structure, and there are some conceptual differences that should be considered.

Semantic vs. Frequency-based Representation:

TF-IDF doesn't directly capture semantic relationships between words.
LDA aims to uncover the latent topics within a corpus and assigns each word a probability of belonging to each topic. It's more focused on discovering the underlying themes or topics in a collection of documents.

Potential Loss of Information:

Feeding TF-IDF values directly into LDA might lose some semantic information. LDA relies on word co-occurrence patterns to infer topics. By providing TF-IDF values, you're effectively downscaling the importance of common words, which might lead to topics being dominated by rare words.

Optimal Use of LDA:

LDA works better when it's fed with the raw frequency counts of words in a corpus. It's designed to discover topics based on these frequencies. While TF-IDF could be used, it's not its primary intended use.

Dimensionality:

LDA works with a fixed number of topics as a user-defined parameter. TF-IDF vectors can be very high-dimensional, and directly using them as input might result in topics being spread thinly across dimensions, making them less coherent and interpretable.

Normalization:

LDA relies on probabilities and distributions for topic assignments. TF-IDF vectors might not be normalized in a way that's optimal for this probabilistic framework.

Loss of Word Order:

LDA is a generative model that assumes word order is not important within documents. It only considers the distribution of words. TF-IDF, on the other hand, captures word importance and frequency in the document but discards word order. This can lead to a mismatch between the assumptions of LDA and the input representation.
Answer: LDA is a word generating model, which assumes a word is generated from a multinomial distribution. It doesn't make sense to say 0.5 word(tf-idf weight) is generated from some distribution. In the Gensim implementation, it's possible to replace TF with TF-IDF, while in some other implementation, only integer input is allowed.


convert utf8mb4 characters to utf8 in php

Question: is there a way to convert utf8mb4 characters to utf8 to store in a utf8 mysql database? and then when we get it from database, restore it to utf8mb4.
goal is storing phone smiley in a utf8 database without having to change database encoding.
for example replace first byte of those characters to a special byte and then in restoration change it back?
Answer: ok what I did was using BLOB type for that column..


How are weekly question contests advertised on individual sites?

Question: I just finished reading the latest blog post on weekly question contests.
I am interested in finding out for sites where this has been successful, how has this has been advertised to the site's community? Is it only on the meta or a banner etc?
Answer: As far as I'm aware, on the sites I frequent, they're advertised only on meta. I personally find this extremely ineffective. I don't seem to be the only one; have a look at the comments on the cooking contest announcement question. I found out about it when someone mentioned it in a comment on the main site.
This does make the contests probably visible on the main sites, but in a very subtle way. Looking at the cooking front page on my large monitor without any ad blocking, I see  all the way at the bottom right, below my tags, the house ads, the "Love this site" ad, and the chat... "Visit Meta", with room for only one question title before the fold, and it happens to be the contest announcement. If I had a smaller monitor, or if it weren't the first question, or if my browser had a toolbar, or if I had one more row of interesting tags, I wouldn't be able to see it. Things are a little bit better on bicycles, where for some reason I see the meta section right below tags, but it's still some of the least obvious text on the entire page. It's also not present on anything but the front page. And of course, until new users get around to clicking on that tiny "meta" link at the top, they won't have any idea how to go to meta and (hopefully) see the announcement as one of the top listed questions.
It seems to me that for contests to really be effective, we need something a bit more obvious. Maybe a tasteful one-line banner like is used to announce moderator elections. Maybe an encouraging icon or snippet of text ("contest!") near the "Ask Question" link, leading to more information. As it is, it seems that it's pretty easy for even frequent visitors to be unaware of contests.

full screenshot with "annotation"
Answer: On Writers.SE we use system messages. Certainly prominent, if not long-lasting...


"Refresh Tab" Works For Subtab, But Not Main Tab

Question: I've created an LWC wrapped in an Aura Component so that I can navigate directly to it as a tab (see 2nd part of answer here). Everything works just fine, except that: when I'm 1) opening it as a subtab, the "Refresh Tab" works just fine; but when I'm 2) opening it as a main tab, "Refresh Tab" does nothing:

Here's the difference between the 2 places I'm using it (remember this is the same exact component, just used in 2 slightly different contexts):

As a subtab (#1) - I'm Navigating from one component ("Order Det...") in the screenshot and opening a new subtab ("ZCR") - this is all within the main Account tab (shown here as "Richard Doyle").
As a main tab (#2) - the main "ZCR" tab that #2 in the screenshot is pointing to is opened from a record list - I've edited the content of the page that opens when clicking on one of the items in the record list (a Record Page using my custom object). I replaced the default content with my Aura-wrapped LWC component.

Why is "Refresh Tab" working in #1 but not #2? Is there any workaround for this?
I've even tried capturing the refresh event in the Aura component and then manually refreshing via $A.get('e.force:refreshView').fire();, but the event never seems to fire. I tried something like:

<aura:component implements="flexipage:availableForAllPageTypes, force:appHostable, lightning:isUrlAddressable, force:hasRecordId">

    <aura:handler event="force:refreshView" action="{! c.handleRefreshView }" />
    ...
    ...
</aura:component>

handleRefreshView: function (component) {
    alert('refreshView event triggered!');
    $A.get('e.force:refreshView').fire();
},

And the handleRefreshView handler never gets hit.
Which event gets triggered when "Refresh Tab" is clicked? Can I capture this?
Comment: Any update on this - @sfdcfox, any input?
Comment: So #1 is occurring through `NavigationMixin` from another custom component while #2 is actually just an object's record page (which your component happens to be on?)
Comment: @KrisGoncalves - sry for the delay - yes, correct.
Answer: You can use the lightning:tabRefreshed event.
See the documentation for more detail.


Can I use someone's group name when I write Java library?

Question: I want to write spring framework extension. named xxxx.
Can I use org.springframework group name? Is it good choice?
Is it conventionally occupied?
Answer: I would recommend NOT using it.  The system is designed to prevent clashes in namespaces.  What if Spring created something with the same name?
Answer: You should use the reverse of a domain name that you own, eg if you own example.org, then you put it under org.example, etc.
Don't squat in other people's namespaces without their permission.


setting type TIMESTAMPWITH TIME ZONE to JDBC callable statement

Question: I search records in my oracle db 11g using search procedure. I'd like to search by
column whose type is TIMESTAMP WITH TIME ZONE.
How could I set my Calendar object to JDBC Callable statement? When I used standard oracle.sql.TIMESTAMPTZ class, mapped Calendar to it and tried to set it to JDBC, JDBC threw SQL exception - Illegal Conversion
thx:)
Answer: use TO_TIMESTAMP_TZ
Read this also.


Hypothetical question about heat and a perfect blanket

Question: Suppose that your body is covered with a "perfect" blanket where the heat you release is 100 percent reflected back to you, it does not leak any temperature outside the environment and the blanket is indestructible and can not be deformed in any way. If your body continues to generate heat at 37 degree, and just like the blanket you are indestructible and no matter what will continue to radiate 37 degrees of heat,  with enough time, can the temperature inside the blanket match that of the sun why or why not?
Comment: Temperature would rise to 41 or 42 degrees at most. Then death :(
Comment: You put out about 100W on average. But, you only have a finite amount of 'food' that can be turned in to heat. So, perhaps it depends how overweight the subject of such a horrible experiment is...
Comment: Related, near duplicate :  http://physics.stackexchange.com/questions/295653/if-i-sat-in-a-perfectly-insulated-box-what-would-happen/295654#295654
Answer: No, you could not reach the temperature of the sun.
First issue is what Pieter mentioned: we rapidly reach hyperthermia, pass out, and die.  Once we're dead, our cells will stop metabolizing and generating heat.
Beyond that, the next issue is that you aren't adding any energy into the system.  Thus, the maximum temperature achievable would be converting all of the energy stored in chemical bonds into heat.  You can't get any hotter.  If you take that energy and divide it evenly across all of the mass, you'll find your final resting temperature (see "Specific Heat" if you want to learn how to calculate this)
We don't have perfect blankets, so the closest you could get to this would be to heat the person up really quickly, using all of the chemical energy as fast as you can before the imperfectness of the blanket lets heat out.
In other words, if you set someone on fire and then covered them with a blanket, that'd be as close to the temperature of the sun as you're going to get.
Or maybe don't?  I'm just saying, it's a rude thing to do.  True, I intentionally omitted the fact that you'd run out of oxygen under the blanket, so the blanket would actually put the fire out, but just don't set people on fire.  It's a good policy. =)
Comment: I should have articulated my question better, so what if you are indestructible and can continuously generate 37  C of heat no matter what? Will that low heat of 37  C add up over time? @Cort Ammon
Comment: I think you may be confused about units.  37C is a temperature, not a unit of heat (which would be joules -- energy).  If the body is assumed to remain at the temperature of 37C, then it will reach the temperature of 37C, not the temperature of the sun.
Answer: I think you're suggesting that human beings shouldn't be able to increase their temperature much higher than their original temperature, by some thermodynamic constraint.
It's true that if you put a hot, shining piece of metal at 1000 degrees under a perfectly insulated blanket, it wouldn't be able to raise the temperature of the air inside higher than 1000 degrees. This is true even if the insulation is perfect and the metal shines forever -- because once the air also reaches 1000 degrees, it'll shine too, and send energy back to the metal just as fast. This is guaranteed by the Second Law of Thermodynamics.
However, a human's temperature is different, because humans aren't in thermal equilibrium. Our bodies are constantly producing energy and expelling it to the environment; the Second Law argument doesn't apply because we're constantly producing entropy by these chemical processes. So thermodynamics doesn't really place constraints on the maximum temperature reached here.
Comment: Sorry to have to ask to clarify, I don't see why humans and metals are different from one another, they are both forever radiating heat to their surroundings  shouldn't they follow the same law?@knzhou
Comment: @aimepie read carefully the answer. "humans are not in thermal equillibrium"  metal is inert chemically, no metabolism!
Answer: So heat energy and temperature are two very different things. You are constantly burning chemical compounds to produce heat energy to maintain a constant temperature as you lose heat to your surroundings; your temperature is basically a measure of how much you are willing to "give out" heat to other people.
It's kind of like going to a sports game: the total heat energy has to do with the capacity of the stadium and how many people are in it, whereas the temperature has to do with how people flow into or out of the gates. It's very indirect. Now in our experience they are somewhat connected because when we're talking about a liquid or gas we're effectively talking about people milling around randomly and bumping into each other and there are people bumping around randomly outside the stadium too and people only go one way or another through the gates because they're bumping into each other more on one side or the other, so when you increase the heat energy contained in an object, you put more people in the stadium, people bump more into each other, and people are more likely to bump someone out of the doors, increasing the temperature. And that's also why temperature kills diseases; imagine a disease as being made out of little balloons spread through the stadium, if people bump into each other enough, naturally, they will pop the balloons. But they are fundamentally different phenomena, and technically one (temperature) is a "marginal" or "differential" version of the other (heat energy). (If you're more inclined to economic metaphors than sports metaphors, I can tell you about the difference between "total costs" and "marginal costs" in business.)
Now you want to put a body like mine into some sort of thermos that keeps in all of the matter and energy, but explore the idea of what would happen if that energy all became heat-energy. Well, of my 100kg body, there's about 50kg of water, 15kg of dry bone mass, and maybe 35kg of actual burnable stuff. Given that proteins and carbs yield 17 kJ/gram and fats yield 37 kJ/gram, we could split the difference by guessing that this averages to maybe 27 kJ/gram, meaning that in those 35kg there's about 1 GJ of chemical energy available. Vaporizing my water is a much lower cost of maybe 120 MJ or so: but in general people don't spontaneously combust because you still need to pay that 120 MJ to evaporate the water before the rest can burn. So it's a bit of a tradeoff.
It's very likely that if you just left me in a big thermos, my total heat as I rotted would not go much above boiling: my chemical decomposition is likely going to be done by other organisms feeding on my body, but most organisms can be killed by high enough temperatures and it would be very hard for them to survive in such a pressure-cooker.
But supposing you were willing to give my body a measured chunk of energy $E$ and then you would carefully remove an amount of $E$ energy later, so that the full 1GJ was liberated without increasing or decreasing my mass/energy in the balance: this would probably also require filling the thermos with a lot of raw oxygen gas. Then typical specific heats range from 1 to 5 kJ/(kg °C) so the remaining 850 MJ or so can raise my 100 kg somewhere between 1700 - 8500°C to somewhere in the 2000 K - 9000 K range. I would probably guess towards the lower end of that spectrum, maybe 3000 K or so, but the interval does include the Sun's surface which is at 5777 K.
So: you would probably be shy of glowing white-hot, but there's a decent chance you'd be glowing red-hot at least.


How to exchange RSA public keys safely between two parties?

Question: How to exchange RSA public keys safely between two parties via internet?
Comment: If you don't trust the communication medium, then it's impossible to setup secure communication between two parties via only that medium. Like Mat said. And even that only works if you trust that  someone else won't impersonate you at the meeting. You need at the least some prior shared secret information to verify identity.
Comment: use certificates from a trusted third party.
Comment: @Mat: If we don't rely on 'trust' of third party, then how?
Comment: face to face exchange - the only option if you don't have a trusted intermediary. (I'm assuming you want to guarantee the identity/authenticity of the public key)
Comment: @Mat: Yup, I want to guarantee the identity/authenticity of the public key. But I want to explore any internet options just to accomplish that. Any ideas?
Comment: In a perfect world, a public key is just that, public.....
Answer: Get yourself a trusted key. Two easiest options are an SSL certificate ($50..$100) and a GPG key (free).
Encrypt or sign the data you send with that key. With SSL, you can just serve your data via https, but can also just sign it. With GPG, you have to build enough trust for your key, so that the receiving end is sure it's you and not an impostor.
Another option is to create a  public key to your SSH server, publish it and let people just SCP your data from there. Send them fingerprints of your SSH key via snail mail or tell verbally by Skype / phone. An impostor would have to fake your key, your server on a known domain name, and your phone / Skype / SIP contact; this should be sufficiently hard to thwart such attempts.
Comment: +1.  There are really only two options:  Have a trusted third party act as "introducer" (this is the SSL/CA model, and also the PGP "web of trust" model), or find some out-of-band way to communicate the key or its fingerprint.
Comment: @gens: @nemo's simple description is right.   If you're going to talk to them out-of-band, a fingerprint will work to validate any kind of key or other data and you don't need to use SSH. The idea of publishing your data by giving people keys to scp the data from your machine is silly and scary.  Note - if you choose SSL, how do you plan to securely communicate which site they should go to or what they should look for there?
Comment: @nealmcb: I still exploring the options available. But SSL definitely a no no because I can't trust the 'trust' of third party.
Answer: There are a few easy options.

Put the key or other data anywhere on the Internet, calculate a fingerprint for it via SHA-256 or some other decent hash, and communicate the fingerprint out-of-band with the other party: via a phone call, SMS, or perhaps email if you aren't too worried about someone else intercepting an email.
Get a third party that both of you trust to vouch for the key or other data.  They could  do this via a PGP signature on the key (the classic web-of-trust), or a CA signature on the key in an X.509 cert, or perhaps by providing a fingerprint for the key on an SSL site.  If you go the CA route, note that deployed browsers implicitly trust hundreds of CAs and it is difficult to know or specify just which one both of you are putting your real trust in.  If you need high security, see this for more discussion: How feasible is it for a CA to be hacked? Which default trusted root certificates should I remove?".

Of course your preference will depend on just what kind of key it is, who you're sending it to, how you intend to use it, what your threats look like, what you're using it to protect,  etc.
Answer: Email, pm on a forum, really any way you want.
The idea is that anyone can know the public key and it doesn't matter.
edit: Note that this assumes you just want them to be able to send encrypted messages to you, which other people can't read. If you want to guarantee the sender, than rather than trying to keep the public key private (which defeats the purpose, and you may as well not use RSA), get them to sign the message using e.g. their own RSA key.
Or failing that, encrypt the key using something like their RSA public key, so they can decrypt it.
Comment: Answer is no good due man-in-the-middle attacks.
Comment: @Sysyphus: We can't guarantee the identity/authenticity of the public key via email or pm. Any other ideas?
Comment: @Gens Ah, I see. You want to guarantee that the key the second party receives is your key, rather than a third party's key which they can use for something like a man in the middle attack?
Comment: @Sysyphus: Exactly. Any ideas?


14 day rental rule and 1099 Misc. How to report?

Question: I rented my house for 12 days to a movie production company. I understand that I don't have to report the income (or any expenses). However, the production company sent me a 1099 Misc for rents, which was also sent to the IRS. So how do I report this?
Comment: 1099-MISC and IRS refer pretty clearly to the United States.  I added the tag.  If it is not correct, please feel free to clarify and retag.  If you want to know about implications for state income taxes, if any, then please specify your state.
Comment: Note that you will probably get better practical answers at http://money.stackexchange.com instead of this site.  We don't give personal legal advice here, so at most you will get a general summary of tax law regarding to rental income.
Answer: In the US, an IRS web page says:

In most cases, a taxpayer must report all rental income on their tax return. In general, they use Schedule E (Form 1040) to report income and expenses from rental real estate.

Special rules apply if the taxpayer rents out a dwelling that's considered a residence fewer than 15 days during the year. In this situation, the taxpayer doesn't report the rental income and doesn't deduct rental expenses. Publication 527 has more information about these rules.

If you didn't rent out the house beyond the 12 days, it would appear that no report need be made. The movie company has no way to know if you rented to others during the same year, so they are obliged to send you a 1099. You would do well to consult Publication 527, and perhaps a tax professional or to use good tax software, which will apply the proper rules.
I have gotten 1099s in the past for income as an independent contractor which was lower than the required reporting limit. I simply left them off my return, and the IRS did not object.


inserting list in specific column using python

Question: i have a database where there are two column sess_id and data. Now i want to insert a list from py to db how should i do this.
suppose this is the list to be inserted in data column of list.
database_list= ['elem1','elem2','elem3'...]
this is what in have done but no progress:
    cursor_three=conn.cursor()
    cursor_three.execute('INSERT INTO table (data) VALUES (database_list)')
    cursor_three.commit()

Answer: Depends on what you want to do. If you want to insert a list of values into one column you can loop through the list and insert row by row. You can also use executemany instead of execute.
If you're directly inputting the list then use excutemany, otherwise if you're looping through the list use execute.
cursor.executemany("""
              INSERT INTO table
              (data)
              VALUES (?)
              """, data_list)

OR
for i in data_list:
    cursor.execute("INSERT INTO table (data) VALUES (?)", i)

Answer: You should iterate list like this:
cursor_three=conn.cursor()
for elem in database_list:
    cursor_three.execute('INSERT INTO table (data) VALUES (%s)' % elem)
cursor_three.commit()

After that you will have sess_id column empty unless you declared it autoincrement row. If you have two sorted arrays for example
database_id_list = [212, 444, 532...]
database_data_list= ['elem212','elem444','elem532'...]

You should use zip() function to iterate them simulteniously, like this:
for elem in zip(database_id_list, database_data_list):
    cursor_three.execute('INSERT INTO table (sess_id, data) VALUES (%s, %s)' % elem)  # elem is tuple here

Notice that this code is using string fromat function for simplness (you didn't noticed which database you're using) and it is not protected from SQL injections. You better use your sql deriver's formatter, for example for psycopg2:
cursor_three.execute('INSERT INTO table (data) VALUES (%s)', [elem])

Comment: mysql.connector.errors.ProgrammingError: 1054 (42S22): Unknown column 'easy' in 'field list'


Jupyter, Python: the kernel appears to have died while training a model on a big amount of data

Question: I am training my model on almost 200 000 images, i'm using Jupyter and now after 3 days of training ( i used 800 epochs and batch-size = 600) I have this " the kernel appears to have died. It will restart automaticaly" And this appears after 143 epochs only. Can anyone help me to solve this, and also can anyone advise me something in case of using big amount of data, because i am struggling with this dataset and I can't retrain the model each time the Jupyter blocks. Infact, I'm working on my internship project so I have to use all the data. I will be so grateful for your help.
Answer: Depending on the library you use you should be able to create a checkpoint of your model every few iterations so that you dont lose your models in the event of a crash. If you are unlucky enough to encounter a crash, you can always begin retraining from the latest available checkpoint. That way you don't start from scratch. Good Luck on your internship.
Comment: Btw, if you are using keras, this features of saving model checkpoints is baked into the library as a callback.
Comment: Ok, I will try that. BTW, I have 2000 classes and I'm using transfer learning with VGG16 for image classification. When I save my model I notice that the size of the file (.h5) is 203 Mo, don't you think that it is big or it can cause a very slow training ? I'm using a powerful machine but even when I use batche-size = 600 with 800 epochs it's very slow, it takes days for a small number of epochs. Thank you
Comment: I tried training with checkpoints but sometimes it doesn't begin from the latest results that I got and the loss increases! should I use checkpoints with only one file or is it better to use multiple files for each improvement of accuracy? and should I compile the model after interrupting the training? I wish I get an answer. Thank you for helping
Answer: I have had the same problem while training in huge data sets in Jupyter Notebooks. The only solution I found was to create a scrip .py with my training process (including model persistence) and running it from my terminal (python3 myscript.py)
Comment: So I juste have to download my file from Jupyter and run it in my terminal ?
Comment: Not as simple as that. What I meant Is to create a script .py or a set of scripts .py in which you will code all your process so that at the end you can call your file from terminal and this file will run, execute and train all what you need. So in this way you won't have to run it inside a notebook


What is the dimension of $\mathbb R[x] / \langle x^3-x\rangle$ as a vector space over $\mathbb R$ ?

Question: What is the dimension of  $\mathbb R[x] / \langle x^3-x\rangle$ as a vector space over $\mathbb R$ ? Can someone please give some links , articles where I can study about polynomila rings and its quotient rings ?
Comment: Hint:Division Algorithm !
Answer: Let $I = \langle x^3 - x\rangle$.  For $p \in \Bbb R[x]$, denote the element $p(x) + I$ by $p(t)$.
By the division algorithm, note that every element of $\Bbb R[x]/I$ can be written as $p(t)$ where $p$ is a polynomial of degree at most $2$.  It follows that the set
$$
B = \{1,t,t^2\}
$$
is a spanning set of $\Bbb R[x]/I$.  Verify that $B$ is additionally linearly independent, so that it forms a basis.

Illustrative example:
$$
t^5 + t^4 = \\
(t^2+t)(t^3 - t) + t^2 + t = \\
(t^2 + t)\cdot(0) + t^2 + t =\\
t^2 + t = \\
1 \cdot t^2 + 1 \cdot t + 0 \cdot 1
$$
Intuitively, you can think of $\Bbb R[x]/I$ as $\Bbb R$ extended by a symbol $t$ that we've defined to satisfy $t^3 = t$.  Note that, since $x^3 - x$ has zeros in $\Bbb R$, this quotient ring is not a field (since it is not a domain, since it has zero divisors).


spectral sequence example diagonal map confusion

Question: I'm attempting to wrap my head around spectral sequences, so constructed a really basic example to apply the definitions and go through the motions. My filtered chain complexes are:
$F_2C_*: 0 \rightarrow \mathbb{Z} \xrightarrow{i_1} \mathbb{Z_1}\oplus \mathbb{Z_2} \xrightarrow{p_2} \mathbb{Z} \rightarrow 0 $
$F_1C_*: 0 \rightarrow 0 \rightarrow \mathbb{Z}_2 \xrightarrow{p_2} \mathbb{Z} \rightarrow 0 $
$F_0C_*:$ The zero complex.
Here $i_1$ and $p_2$ are the inclusion and projection maps, and the sub-indices on the $\mathbb{Z}s$ are just for labeling purposes.
With $Z^r_{p,q}$ defined as $\{x \in F_pC_q : \partial x \in F_{p-r}C_{q-1}\}/F_{p-1}C_q$, the differential is meant to restrict to well-defined maps $d^r:Z^r_{p,q} \rightarrow Z^r_{p-r,q-1}$.
But in my example the map $Z^1_{2,2} \rightarrow Z^1_{1,1}$ does not appear to be well-defined:
$Z^1_{2,2} := \{x \in \mathbb{Z}\oplus \mathbb{Z} : p_2 x \in \mathbb{Z} \}/\mathbb{Z}_2 \cong \mathbb{Z}_1$,
$Z^1_{1,1} := \mathbb{Z}$.
However $[(a,b)]$ and $[(a,b')]$ in $Z^1_{2,2}$ get sent to $b$ and $b'$ in $\mathbb{Z}$ respectively, even though $[(a,b)] = [(a,b')]$.
I cannot see where I've made a mistake, but I'm pretty sure something's not right. Where have I gone wrong?
Given a map $A \xrightarrow{f} C$ with $B \subset A$ and $D \subset C$, in order for the quotient map $A/B \xrightarrow{\bar f} C/D$ to be defined we must have $f(B) \subset D$.
But it this case we have a map $(Z_1 \oplus Z_2) / Z_2 \xrightarrow{\bar p_2} Z/\{0\}$, but $p_2(Z_2) = Z_2$ which is not contained in $\{0\}!$
Answer: $Z_{p,q}^r$ isn't a subquotient just a subobject. $$Z_{p,q}^r := \{x \in F^pC_q: dx \in F^{p-r}C_{q-1}\}$$ check eg wikipedia.


Image size high-fidelity prototype

Question: What is the resolution and image size to use for high-fidelity UX prototypes? I am supply images to someone doing a UX design for smartphones-iphone and android, tablets and desktop--I am wondering if 72 resolution is good enough and an image that is what pixels (or inches) by what pixels (or inches).
Comment: as big as possible, as higher resolution as possible. You can always go down, but you can't go up, so no need to gamble.
Answer: Resolution should match the target device whenever possible, both for prototypes and production. For instance, images for an apple retina mobile screen should match its @2x/@3x guidelines, but also keeping in mind these images would not be appropriate for a television or a watch.
In more plain terms if the device is 700px wide your image should also reflect that width. Usually when it comes to resolution 72ppi is pretty much the standard when it comes to the web, unless in cases of apple retina devices.
Answer: Since its only a prototype the resolution does not matter.
For web just use 1920*1080, for mobile Apps just use the dimensions of the iPhone 6/7 (375x667).
If you hand the finished design to the developers you should just make sure to export every asset as 2x for retina displays so your icons and images look sharp on every device.
Ps.: the 72ppi myth should die already

Image size high-fidelity prototype


What excel formula can I use to select the last non-error value in a range (that is vertical)?

Question: Ok, for example if my range is B1:B5000. This is a time series. At certain point in time, the values all become errors that are #NUM! So is there any formula I can use to return the last value that is not an error going down the range? Or would it be easier if I got rid of all the errors by using :=IFERROR(B1,NA()) and basically making another error free range? In this case, what excel formula would I use?
Comment: I posted an answer but note that NA() generates an error value! To eliminate errors and replace with spaces it could be =IFERROR(B1,"")
Answer: Whether you eliminate errors or not you can find the last number in B1:B5000 (times are numbers in excel) with this formula
=LOOKUP(9.9E+307,B1:B5000)
Answer: The short answer is you can use the following formula to find the last non-error value in a range:
=MATCH(ERROR.TYPE(#NUM!),B1:B5000,-1)

This will find the first #NUM! error and give you the last row prior, based upon a range of B1:B5000.  Assuming your last good value was in Row10, it will return a value of 10.

If you're looking to use this in a charting application, or need to use a dynamic range as items are added, it will be more complex.


Why does searching on Stack Overflow and other communities not have spelling correction?

Question: Why does searching on Stack Overflow and other communities not have spelling correction? Something similar to Google's spelling correction...
Answer: It does have some kind of spelling correction. Searching for 'spellings' and sorting on newest gives your question as one of the top results, even though it does not contain the word 'spellings':

This is the result of using so-called stemmers in Elasticsearch, the repository powering the Stack Exchange search.
If you frequently misspell words, it's better to install a browser extension which underlines wrongly spelled words in editable fields, and offers a context menu to correct them.
Comment: @mindstormsboi I wrote that the question doesn't contain spelling***s***.
Comment: I think you're wrong about this post "not containing 'spelling'", this question contains the word spelling. But the SE search engine knows the difference between plurals and singulars, that's why this questions appears.
Comment: I think the search engine probably doesn't know the difference between singular and plural, but stores and queries the roots of words, essentially erasing the difference.


What to say when you hear that your colleague is quitting the job?

Question: What will be the best way to express the feeling when you hear that your colleague is leaving the job.
Comment: Do you like your colleague? Do you dislike said colleague? Do others in your group feel the same about your colleagues as you do? Is the company willing to foot the bill for a farewell lunch? Is your colleague going on to a position that's sufficiently senior that you want to ask said colleague to be available to act as a reference? Are there loose ends that you want your colleague to tie up before said colleague leave?
Comment: So just say it. If you feel that your statement is not strong enough, say it and deposit a million dollars in my bank account :)
Answer: What you should do is dictated by your local culture/norms. In some places there is a small get together with cake + refreshments; in others there is a formal ceremony; yet some places just have a card + signatures.
No matter where you are, try to at least cover these areas in your approach/farewell - within the norms of your culture/establishment:

Congratulate/thank them for their time with you.
Wish them good fortune/best of luck etc. in their future endeavors.
Ask them if you can add them to your linkedin to keep in touch. Very important, as you don't want to burn bridges. Replace linkedin with whatever suits your environment - I prefer linkedin as its not a wild wild west situation like facebook.

That's about it.
If you are unhappy about their departure (for example, if this means you have to do extra work/hours/shift or train their replacement, etc.) this is not the time to bring that up; you should discuss this in private with your management/HR after the person has departed amicably.
Comment: Yup. Everything in its own time. No need to cry up a storm at someone else's party. Bring up the tears and grievances after the party.
Answer: Your question is rather vague. You don't indicate who you're concerned about expressing yourself to, or a time frame. Nor do you indicate in any way in the question how you truly feel about the colleague leaving. It's normal to feel confused, angry, betrayed, relieved, excited, nervous, happy, and many other things too. Let me give you some suggestions.

at the instant someone tells you for the first time "I was just fired" or "I have decided to take another job" the only culturally appropriate response is surprise. If you happen to like the person, then an aligning statement ("oh man, how could they fire you?" or "it sounds like you've found a great job, congratulations my friend") can be added. Essentially something that puts yourself "on their side" without actually doing anything about it.
at the instant someone else tells you for the first time "Steve will be leaving us on Monday" or "Steve doesn't work here any more" again surprise is appropriate. Curiosity is only appropriate if you are alone with the person who told you. In a group setting a muted response is always safest. Say very little. If you care a lot (whether positive or negative) you can seek out the leaving employee or the person who made the announcement for a one-on-one conversation to ask for details that are relevant to you
during a person's leave notice, where everyone knows they're going but they haven't gone yet, you stay polite and professional even if you're very jealous of the opportunity they're getting, angry that they're leaving you to finish something, can't wait to take over from them as lead, can't wait till you don't have to see them any more, or whatever. You say out loud that you wish them the best of luck and hope everything works out great for them in the new position. You may discuss with management or leads how some practicalities will work out - who will do specific tasks next week that the leaving person is doing this week, that sort of thing.
once the person is gone, it is rarely useful to say to others that you miss the person nor that you are glad they are gone. Occasionally a mild or gentle comment like "morning meetings sure are faster these days" or other reference to how things were when the colleague was here may be appropriate.

If the person is a friend, the time between when you learn they are going and when they go can be quite awkward. Often, you may have mixed emotions yourself: angry that your friend was laid off, but relieved that you were not; or jealous of the great opportunity but proud of your friend for landing it; sad at the thought of having one less friend in the office, but excited about the new responsibilities you'll be taking on. Just go with the situation and don't try to resolve the mixed feelings. Do your best to express only positive feelings in group situations. One on one with your friend, only express sad feelings that are positive (I'll miss you) not those that are negative (I'm going to have so much more work to do because they're not replacing you.)
If the person is not a friend, don't overthink this. Do and say what the others around you do and say, no matter how you feel, and carry on about your job. Colleagues come and go, it's part of normal workplace life.
Comment: Decent advice sir, but I cant mark your answer as accepted as I used the words written in the above answer answered by burhan Khaled.
Comment: Quitting the job may not be same as leaving the job. I view 'quitting' as one of personal decision and I respect the person for doing the same
Answer: Offer them your heartiest congratulations and wish them all the best for the future! If they have been with the company for a long time, it can be appropriate and appreciated to have everyone write in a card wishing them all the best for their future endeavours.
Comment: Also in some companies, particularly smaller ones, but also small teams within a larger company, it's fairly common for the rest of the team to contribute a couple of pounds (/dollars/Euro's/whatever your local currency is) to a small gift.


Saving and sharing changes made to Vagrant box

Question: I setup an Ubuntu 13.04 box from www.vagrantbox.es. Post that I made changes to the box - installed ruby, rails, git, mysql, ngnix, etc. How do I share the modified box with someone else?
Answer: After making your changes, use vagrant package in the directory with the Vagrantfile. It will shut the machine down and start saving it to a file.
You'll end up with a boxfile in that directory that you can share.
Answer: As already answered, vagrant package creates a new base box out of an existing VM.
Anyway "the Vagrant way" is to use and share a Vagrantfile with provisioners. This way the installation of the software is repeatable. The downside is that initial vagrant up takes longer while it installs all the software, but on the other hand the shared base box is smaller. Depends on your use case what is the best.
If you choose to share a pre-installed image you can still benefit from automated provisioning using e.g. Packer to build the box.
Answer: To package existing rolled out machine, do following:
1) Get list of machines by command VBoxManage list vms
2) Copy name of machine and execute command vagrant package --base {name_of_machine}
Then .box file will be created in vagrant folder


Desktop icons are gone in Windows XP

Question: My desktop icons are not showing up, and right click won't work, but the taskbar and all are there.
This happened after I set up a active desktop. Now I have removed it and changed the theme as well, but still no icons and right click on desktop still does not work.  How can I reset this?
Comment: You sound infected...what anti-malware programs have you run? Can you boot into safe mode and get your icons?
Comment: @KCotreau may be on the right track, lately malware has been hiding everyhing on the hard drive, which includes icons on the desktop.
Answer: Try #195 on here:
http://www.kellys-korner-xp.com/xp_tweaks.htm
if that doesnt work try #256 #246 then in Task Manager kill the process called explorer.exe
then go File>New Task(Run...) and type in explorer.exe and see if it works.
also try this:
http://www.winxptutor.com/showdesktopicons.htm
Comment: second link worked , explorer was running but dekstop icons only gone

Desktop icons are gone in Windows XP


Vibration when lugging

Question: Why do engines vibrate/shake when lugging? Is shaking a foolproof indicator to know whether an engine is lugging?
Answer: The engine shakes when lugging because it is approaching a stall.  The pistons firing downward don't have enough torque to drive other pistons upward.  A sudden slowdown of a piston as it meets too much resistance traveling upward in turn decelerates another piston connected by the crankshaft.  If the process keeps going, all pistons would come to a halt.
The shake, therefore, is definitely a telltale sign of lugging.  Engines designed properly with enough low-end torque -- take as examples modern European luxury or classic American muscle -- can run at low rpm and relatively high gear with no shake.  I can tell you from experience that they sound like they are lugging at very low rpm (1,200), but the absence of shake means that they are not, even if you ease down the gas pedal.
Answer: Here is an answer I did a while ago pertaining to lugging and why it is bad.
Shaking in and of itself IS NOT a telltale sign of lugging, meaning, just because the engine is shaking does not mean you are lugging the engine. Shaking can occur for many different reasons, to include (but not limited to) bad motor mounts and misfire. Lugging will occur at lower RPMs and only on standard shift transmissions. The design of a torque converter in an automatic will not allow an engine to lug because when the RPM gets low enough, the torque converter basically allows the engine to run due to it having not met the torque converter stall speed.

Vibration when lugging


Can I say $x>0 \implies x\ge0$?

Question: By the logic, I can understand that if $P$ is true, $P \lor Q$ is also true whatever $Q$ is. Since $x\ge 0 \iff (x>0 \lor x=0)$, if I know $x>0$, can I conclude $x\ge 0$?
Sorry for some sort of stupid question.
Comment: $$P\Longrightarrow P\vee Q$$
Comment: Yes you can. Try encasing math symbols in dollar signs:  \$x>0\$ to make it look better ($x>0$)
Comment: You could also say $x\gt-1$ however, and so your statement is weaker than the original.
Answer: Yes of course
$$x>0 \implies x\ge 0$$
since
$$x\ge 0 \equiv \left(x=0\quad  \lor \quad x>0\right)$$
Answer: Yes, everything you have written is correct, except for the suggestion that there's something stupid about it.  The point that you raise was considered important enough for a footnote beginning with "There is one slightly perplexing feature of the symbols $ \geq$ and $ \leq$."
That's in a book by Michael Spivak that is for first-year University calculus students who would be prepared to continue in math up to and including the Ph.D. level, without having to go back and upgrade their calculus.
Answer: Yes. As a proof:
\begin{array}{lll}
1. & x \geq 0 \Leftrightarrow (x > 0 \lor x = 0) & \geq definition\\
2. & x > 0 & Given\\
3. & x > 0 \lor x = 0 & \lor \ Intro \ 2\\
4. & x \geq 0 & \Leftrightarrow \ Elim\\
\end{array}
Answer: Yes.  $P \implies P$ or $Q$.
so if $P$ is $x > 0$ and $Q$ is $x=0$ then if $x> 0$ is true, then $x > 0$ or $x =0$ is true.  Which is the same thing as $x \ge 0$ is true.
I can see why this seems weird: We know something specific ($x > 0$) and we are suggesting something less specific and even implying something we know to be false ($x \ne 0$) to possibly be true ("$x \ge 0$??? so that means... $x$ could be $0$???").
But consider this.  Suppose you knew $x = 3$.  Can we conclude that $x \ge 0$?  Well, of course we can!  $3 \ge 0$ and as $x = 3$ we know $x \ge 0$.  But $x \ge 0$ implies that $x$ could be $15$. Are we saying that $x$ could be $15$?  Are we saying that $3$ could be $15$?!?!?!
Well, no.  The statement that $x \ge 0$ isn't necessarily a statement of all potential possible things[1] and the only thing we know for certain is that $x < 0$ is false.  The statement that $x \ge 0$ is literally just a statement of fact; it is the case that $x$ is greater than or equal to $0$.  We may or may not know any more than that but that much is true.[2]
Another analogy is "Penguins are animals".  Well, "animals" can be many things including camels or elephants or eagles.  But "Penguins are animals" doesn't mean that all those possibilities ("Penguins might be camels"?  No Way!) are open.
[1] although it could be.
[2] actually $x$ must be something.  Its not possible that is both $x = 0$ and $x > 0$.  So it is never a case that all possibilities are open.  $x$ must be something and if its that, it can't be anything else. We might not know what it is, but it can't be more than one unknown option.  But that's okay.  Saying $x$ is one of several things isn't implying that all are equally valid.

Can I say $x>0 \implies x\ge0$?