What does this PHP code mean?

Question: require dirname(__FILE__).'/yahooPHP/lib/Yahoo.inc';

This line is in one file in one directory and I am having trouble determining how to reference a file in another directory.
What does this expression mean and does it imply references must only be within the same directory?
Answer: __FILE__ is a Magic Constant that correspond to the full path to the file into which it is written.
This means that dirname(__FILE__) points to the directory into which your current file (the one in which this is written) is.

So, dirname(__FILE__).'/yahooPHP/lib/Yahoo.inc' points to :

The directory into which this line is written,
And, then, the yahooPHP subdirectory of that directory
and the lib subdirectory of yahooPHP
and the Yahoo.inc file into that lib directory.

Basically, you have :
your-file.php
yahooPHP/
    lib/
        Yahoo.inc

Answer: http://php.net/manual/en/function.dirname.php

A key problem to hierarchical include
  trees is that PHP processes include
  paths relative to the original file,
  not the current including file.
A solution to that, is to prefix all
  include paths with:
  <?php
  str_replace('//','/',dirname(FILE));
  ?>
this will generate a base path
  relative to the current file, which
  will then allow an include behavior
  similar to C/C++.
thus, to include a file that is 1 in
  the parent directory:
  <?php
  require_once(
  str_replace('//','/',dirname(FILE).'/')
  .'../parent.php'); ?>
to include a file that is in the same
  directory:
  <?php require_once(
  str_replace('//','/',dirname(FILE).'/')
  .'neighbor.php'); ?>
to include a file that is in a
  subdirectory:
  <?php require_once(
  str_replace('//','/',dirname(FILE).'/')
  .'folder/sub.php'); ?>
Notice that all paths we reference
  must NOT begin with a /, and must be
  relative to the current file, in order
  to concatenate correctly.
Answer: After checking out the specification.
This is actually an example of including specified resource into your PHP script, along with retrieving parent folder path and string concatenation. This works as follow:
require = add file to your PHP script (similar to `include`)
dirname() = get the parent directory of specified path
__FILE__ = this will be resolved to absolute path of the current file
.'/yahooPHP/lib/Yahoo.inc' = string concatenation, so this part simply adds file's path to the rest of the string

So in the end you end up adding a file pointed by a path to the Yahoo.inc file (which should be found in directory relative to the parent directory).

What does this PHP code mean?


Do we ever find out what Ike did to have his law license revoked?

Question: In Theodore Boone, Ike Boone gets his license to practice law revoked. Do we ever find out why? Is this mentioned in The Activist?
Answer: It seems there's no textual evidence as to why his license was revoked.
The closest thing we have is this, from The Accused:

"Listen to me, Theo. A long time ago, I was a successful lawyer in Strattenburg, had an office just down the hall from your mother, had lots of clients, and life was good. Then the cops showed up and started asking questions. I didn't have all the answers. They came back with more questions, then more. I couldn't believe what was happening and I slowly realized I was headed for trouble, but I couldn't stop it. Once the criminal justice system starts moving against you, it's hard to stop.

(emphasis mine)
This seems to hint at some form of legal malpractice, but we don't know for sure.
Comment: @fi12 It could be a plot point in a future book.
Comment: Yes, but it seems like he *didn't* actually do anything according to that...
Comment: @Mithrandir He obviously must have done something that attracted the attention of the police. Grisham is just annoyingly vague at that portion, so I'm guessing the reason Ike no longer has his license is fully intended to be a mystery.
Comment: @Benjamin Very true. I guess we'll have to wait to find out.


Trying to collect information on grad schools

Question: I'm in the process of listing and comparing all the graduate schools I am interested in. What should I be comparing, gathering, etc. And what is the best way to keep all the information together?
Answer: Here are some ways in which different schools differ from each other:

Size. Both small schools (personal attention) and big schools (lots of seminars, people to talk to) have their advantages. Which is more important to you?
Research focuses. Even large schools will be dominated by a couple of research groups. Do you find their work interesting?
Program structure. Some programs are very structured, with lots of requirements; some are more free-form. Which is best is a matter of individual preference.
Competitiveness. Some departments are friendly and competitive, some departments are friendly and less competitive. (And a couple of departments are unfriendly and you should avoid them.) Do you thrive under pressure? If so, choose a competitive place.
Quality. (This one is obvious.)
Geography. Some places (Harvard, Wisconsin, Michigan, Washington, among many others) are located in towns where it's a lot of fun to be a grad student. Some are not.
Support. Some places offer more money, and/or less teaching requirements in exchange for funding. (Typically private schools fare better than public in this regard, but not necessarily.)

All things to keep in mind when you compare schools.
Comment: To add to this list - Outcomes: What percentage of students graduate in a reasonable time (maybe 7 years for PhD depending on field). This information can be hard to come by, but for US programs: http://www.phds.org/graduate-school/graduate-school-listings-and-rankings/
Comment: +1 for answer the first part of OP's question. But, this doesn't answer the second part of the question (how to keep all the information together). My simple suggestion: a spreadsheet.
Comment: You forgot another big one: **People.** Look through the faculty web pages in details. Can you identify a few potential advisors? Are they highly visible in their field? Are their former students successful? Do they look like someone you would get along with? (Yes, this is hard to judge over the web, but if something raises a red flag, even subconsciously, you should probably listen.)
Answer:
What is the best way to keep all the information together?

You've got a number of options here, but I would suggest two:

A spreadsheet (as Thomas mentions in his comment) for the logistical issues.  I had a spreadsheet with the following columns:

Name | Website | Location | Due date for application | App. complete? (Y/N) | Letters sent? (Y/N) | Accepted? (Y/N/Waitlist) | Visit date | Primary contact name | Primary contact email | Thoughts (this was a one-liner column where I would put "great location!", "no funding...", or "perfect research fit", etc.
2. A folder on your computer for each school, underneath an overarching "Grad School Applications" folder. This is where you can drop all information pertaining to the school, including: a document with jotted down thoughts, your personal statement personalized for the school, a cover letter, the application form (if offline), correspondence you've received from the school (printed emails work pretty well), etc.
I would put everything in a Dropbox so you can access it on the road (and for backup).


Is the Wordpress HTTPS Plugin Still Safe To Use?

Question: I have a client who wants to accept Authorize.net donations on their website. We only have a need for one page to be secured for our purposes.
I've put a lot of research into this and it seems that the Wordpress HTTPS plugin would be the best option, with the least amount of brain damage.
However, I see that the plugin has not been updated in three years. Multiple forums and blogs say that it is still safe to use, but I want to know if anyone has/is currently using this plugin for similar purposes and if they have any advice for me before I go down this road? Thank you!
Comment: Thanks so much guys! I should have made it more clear that I already have an SSL Certificate. Just need to make sure it applies to only one page. Thank you!
Answer: If you are looking to use HTTPS, I reccomend following this wordpress guide: https://make.wordpress.org/support/user-manual/web-publishing/https-for-wordpress/#implementing-https-for-wordpress
You can get a free SSL Certificate from: https://letsencrypt.org/
If you find difficulty setting it up, you can often pay your host a small fee to help set this up. Once set up, you just need to make sure all the links on the page are HTTPS and not HTTP. Really easy to fix with plugins like Velvet Blues URL.
The Wordpress HTTPS plugin just makes implementing the SSL a bit easier. I would discourage installing old plugins as they often have security flaws and can conflict with your theme / other plugins.
Comment: If you already have an SSL Certificate, I highly recommend this tutorial: https://css-tricks.com/moving-to-https-on-wordpress/
You basically need to ensure all elements are HTTPS and force your site to HTTPS. As I mentioned  before, Velvet Blues URL is really good for fixing majority of your http:// . I normally replace all http:// with // which basically tells the browser to fetch whatever the site protocol is. Ie. if your wordpress sire URL is https:// it will fetch https:// Hope this helps! If your site is going to https:// but the padlock isn't appearing, its because you still have http:
Comment: To find where the http:// elements are located (sometimes things are hardcoded in the dashboard and hard to spot, for example in your theme's custom css or gravity forms custom buttons, you can use https://www.whynopadlock.com
Comment: for the free SSL cert, it seem that you need root access right? https://letsencrypt.org/getting-started Not possible on shared hosting?
Comment: It depends on the host. I use Dreamhost for a bunch of stuff, and they've started offering free letsencrypt certificates as part of their services. Check with your host.
Comment: Thank you! I should have specified that I already have an SSL certificate. Is there a step-by-step that can catch me up on this process? I understand the theory, just not quite the practice...
Answer: Wordpress HTTPS doesn't solely secure the site. It just allows a page/pages/sections to be forced to HTTPs. You still need a certificate.
Our company uses Wordpress HTTPS in combination with an SSL certificate installed to the server. We also process through Authorize.net, and have not experienced issues (WP 4.4.2); though, we're still updating our theme to be compatible with 4.5.x.
Comment: Thank you! I'm already on 4.5.2 and haven't noticed any issues so far. I appreciate the input!
Answer: There is a Woocommerce setting to force SSL on the checkout page only. It's in Woocommerce > settings > checkout > Force secure checkout
As a side note, and someone correct me if I'm wrong on this, but I've recently heard that it actually doesn't matter if the page is loaded over https as the only connection that has to be a secure ssl connection is the one from the client's computer to authorize.net. Having the server send content to the user over https is just for show because everyone thinks this means their checkout is secure.
Comment: Huh. That's really interesting. I suppose it makes sense but I would love to hear more about this. Maybe I'll create a different thread for this topic. Thank you!


Plant ID: deep red flower spikes

Question: I'm new, and joined just because I keep seeing flowers I'd like (maybe) in my yard and I need to identify them to see if they're toxic to pets! This one has light red stems, with deep red flower spikes, and low, ground-lying deeply lobed leaves. The spikes look like Amaranthus spikes, but the leaves most certainly don't! Any ideas or suggestions to research would be greatly appreciated. I've done an image search, but can find nothing like this, and I don't know enough about plants to even guess at a family or species.
[Edit: On closer inspection, the leaves are not deeply lobed, they've just been chewed on by some insect.]
Comment: Can you post some closeup/clearer photos of the flowers, leaves etc..
Comment: Yes, I have them, but I'm not sure how to add them. I don't see an "add a picture" link in the comment box, and there also isn't one in the "edit" box for the original post. Do I have to make a new post or is there some feature I'm not finding on this page?
Comment: @KarenJG You can't add pictures to comments. You probably need to accumulate some reputation points before you can edit your original posts to add more pictures to it. But I think I know what it is from the picture you already posted.
Answer: It looks like a dock (or docken in some parts of the UK) which has gone to seed. There are two common species of these weeds in the UK, the broad-leaved dock Rumex crispus and the curly-leaved dock Rumex obtusifolius, but there are hundreds of other species world wide.
Far from being poisonous, the seeds can be ground into gluten-free flour, and the leaves are also edible and were used in many herbal medicines.
You had better learn to love these weeds, because you will never get rid of them. They are one of the five weeds covered by legislation in the UK (the 1959 Weeds Act) in an attempt to restrict their spread.
They grow very deep tap roots (up to 1 meter / 3 feet) and any broken-off piece of root can produce a new plant. Also, the seeds can survive for 50 years until the conditions are right for germination.
Old UK gardening lore said that if you dig up dock plants, burn them on a bonfire, keep the ashes in a jar for seven years, and then scatter them on the ground, they will immediately start to grow again. That's probably an exaggeration, but it's a fair description of how hard it is to eradicate them.
Attempting to dig them up will fail. They will grow again from any broken pieces of root left behind.
Brushwood killer or glyphosate will kill the plants, but not the seeds so you can still expect more of them for the next 50 years, from seed that is already in the ground!
Comment: "I want to add some to a flower bed that needs some tall color for balance" - just be careful what you wish for :)
Comment: OKay, looked up "dock or docken" plants, and it looks like we may have an ID! The leaves look right, and the flower/seed spikes are the same, but a different color on the ones I found. Still looking! Oh, and I don't want to get rid if them, I want to add some to a flower bed that needs some tall color for balance.
Comment: @KarenJG They seed spikes are green before the seeds ripen, and change through shades of brown and red to almost black.  Some species may have different colored seeds.
Comment: I found a picture that looks *EXACTLY* like the plants I see on my walk. They're growing wild in a stalled subdivision development site that we walk by nearly every day. I think I'll just dig/pull one up and put it in a pot to see if it survives/grows, and go from there. NOte: just saw your new comment. Yeah, I'll have to be careful not to let it take over. Or I could just give it it's own area - they'd be pretty massed in a isolated corner, too...
Comment: Found a great site detailing the health benefits, if anybody's interested: https://www.healthbenefitstimes.com/dock/

Plant ID: deep red flower spikes


Is there anyway to use manual payments?

Question: I'm trying to create manual payments within Craft Commerce so the customer doesn't have to enter their credit card but every time I use the checkout button it says that the payment information is invalid. Is there anyway to have customers checkout without credit card info?
Answer: You need to create a 'Manual' payment gateway in Commerce > Setting > Payment Methods This will allow the customer to choose the manual payment method on checkout.
The 'Manual' payment method is the only way a customer can submit an order without payment information. This gateway does not place any validation on the payment form action, so you should not see any errors. If you are seeing errors, make sure you are sending the ID of the manual payment method with the paymentMethodId param to the payment form action.
The 'Mark as Complete' is a separate action that allows those that have the 'Manage Orders' permission, to turn a Cart that is in progress into an Order:
Comment: If you don't have the paid version of craft commerce, you don't have access to the manual payment method.
Comment: Thats what i currently have it set to but when i click the submit order button i get a "payment information submitted is invalid" message
Comment: I also read that theres a complete order button with a paid version of craft?
Comment: @LukeHolder I'm using this method as well and it's going though fine.  However, the 'Total Paid' is not being set to $0, but to the order 'Total'.  How can I fix this?
Comment: @LukeHolder Never mind.. I set the payment type to Authorize only to resolve this.

Is there anyway to use manual payments?


Height of building

Question: How would I find the height of a building? I have been given the initial velocity, the angle at which the object was thrown, and the landing distance. And I was able to successfully compute the horizontal displacement and the time. I'm just stuck at the height. Any suggestions?
Comment: Suggestion: look at the equations your book gives, then look at what variables you have, then see how you might be able to rearrange some of them for a different variables and lastly, solve.
Answer: You already have $t_{on\ the\ ground}$ expressed through initial velocity, angle and landing distance. Plug this time into equation for vertical displacement, and you will find the height.
Answer: You just solve for the $t$ (time) corresponding to your $x$ (the landing distance) and evaluate your $y$ (height) by that $t$:
If $x_{(t)}=t\cdot v_0\cdot \cos (\beta )$, then $t_{(x)} = x/v_0\cdot \sec (\beta )$
So you plug that in for $t$ and evaluate the height $y$ by distance $x$:
$y_{(x)}=t_{(x)}\cdot v_0\cdot \sin (\beta )-g\cdot t_{(x)}^2/2$
Also see Wikipedia: derivation of motion
Example:
If $v_0$ = 100 m/s, $\beta$ = 45° and the height you are looking for is $h$ = 200 m you pass this height after 3.86 s and 273.08 m or 10.57 s and 747.33 m.

Height of building


How to create a bootable usb for Ubuntu Server?

Question: I want to create a bootable USB with Ubuntu Server on my flash drive. I have created such media using Rufus, but instead of being bootable Ubuntu instance, I got installation media. How can I create bootable USB?
Answer: A method I like is to use Virtualbox to setup Ubuntu Server (and other OS's I need).
This is what you need:

one usb thumb with around 32GB
Linux with installed Virtualbox

Choose VDI as storage and size the disk around 2GB less then the total size of your thumb or just straight use a less size - like 30GB for the storage (virtual disk).
Just install everything and customize Ubuntu server as you like it. After that just do the following (shutdown the virtual Ubuntu server fist)

open a terminal and go where the VDI file of you server resists
Enter:
VBoxManage clonehd nameofyour.vdi sdx.raw --format RAW

In case you get an Error like:
VBoxManage: error: Cannot register the hard disk 'nameofyour.vdi' {UUID} because a hard disk 'nameofyour.vdi' with UUID {UUID} already exists

just copy and paste the "{UUID}" and replace "nameofyour.vdi" with this uuid like in this example:
VBoxManage clonehd 3cde9fac-41f3-4260-835e-100991fdb581 sdx.raw --format RAW

Now you should have a RAW Image. Proof it with "file sdx.raw" for example.
You should see something like this:

/data/sdb.raw: DOS/MBR boot sector; GRand Unified Bootloader, stage1 version 0x3, stage2 address 0x2000, stage2 segment 0x200, GRUB version 0.94

Now you can write this Image to your USB Thumb with "dd" like in this example:

insert you USB thumg and proof with "dmesg" for the correct device name.
This could also be done with the command "lsscsi"
if you determinate the right destination device use "dd" to write the
image like in this example (as root user):
dd if=/data/sdx.raw of=/dev/sdc bs=4096

after that you are done. In additional you can proof is the USB Thumb is booting also inside Virtualbox if you like.
Just create a VMDK File from you inserted USB Thumb (you need to know the /dev/sd-name). For example:

VBoxManage internalcommands createrawvmdk -filename ubuserver.vmdk -rawdisk /dev/sdc

Make sure your user (where you run Virtualbox) is a member of the group "disk" (sudo adduser $USER disk)
Now add the virtual disk created as the VMDK file to your virtual-machine and remove the current vdi file. (VirtualBox Gui -> Click on the VM -> Settings -> Storage --> Storage Tree
After tat you should be able to boot this USB Thumb in Virtualbox.
Answer: What you've done is setup an install medium rather than a bootable distro.
While this may not be the best way of doing it, it works and is what I tend to do if I need to set up a bootable USB.
You will need

A second USB stick

Method

If you are dead set that you want it installed on the USB you're currently using, setup your install medium on the new one and format the desired one for installation. If not, and you can just install on the other USB, skip this step.
Boot from your install USB with your desired bootable one plugged in.
Go through the usual install steps until you get to partitioning the device. I'm assuming this is a graphical installation btw. Please correct if not.
At this point you're going to want to ensure that you're only including the desired bootable USB in the partition table. It'll likely be under /dev/sdb or /dev/sdc. It should be obvious which one to choose based on size and space available. Setup your partitions.
Before moving on, ensure that the desired boot location matches the device that you've set up the partition table on: dev/sdb or /dev/sdc. Otherwise you run the risk of messing up your PC's boot record with the added effect that your USB will only boot on that PC. In the graphical installer, this is usually a dropdown menu at the bottom of the partitioning screen.
Then just continue the install as usual.

If you need any further info, give me a shout.
Hope I've been of some assistance.
Edit - Courtesy of Fiximan
In case of only one USB flash drive: the iso can also (temporarily) be added into GRUB menu and then be booted into. See here
Comment: All sorted now? If so, would you mind accepting the answer so that others will know at a glance that the question has been solved?
Comment: In case of only one USB flash drive: the iso can also (temporarily) be added into GRUB menu and then be booted into. See [here](http://www.howtogeek.com/196933/how-to-boot-linux-iso-images-directly-from-your-hard-drive/)
Comment: Thanks bud, I didn't know. Added in as an edit.


Replacement for E402/J402/LS3954 JFET?

Question: I've come across old synthesizer schematics for an oscillator which makes use of a couple E402s. I am looking for a suitable replacement, and I don't think the specs have to be spot on at all, but I still want "professional" advice.
The source gets between 5 and 10 volts, the drain delivers that voltage minus whatever drop across the JFET, and the gate gets 5 volts so the circuit isn't very demanding. If you need more info I'll gladly add it since I have no clue what info you need to find a replacement.
Answer: The 'E402' is an N-channel JFET pair in a single package. 2N3954 was its replacment, but not easy to find.
More here: http://analogue-heaven.1065350.n5.nabble.com/Moog-2N3958-replacing-E402-td29183.html
A few candidates:
NTE NTE461
From Linear Systems, LS3954
On Mouser, 2N3954:  It's $23. Ouch.
Comment: Yeah, I just want super cheap but still functional JFETS since I'm selling these and trying to keep manufacturing costs low (and I don't want to deplete the worlds supply of these things lol) so I will research if these JFETS need to be electrically matched. I think they do.

Replacement for E402/J402/LS3954 JFET?


What does it mean by degree of aromaticity of a molecule?

Question: This is a fundamental question, though I didn't really get the meaning/idea what does it mean by aromaticity or degree of aromaticity. Does it mean the ability of a molecule to be aromatic?
Comment: Welcome to Chemistry.SE! Could you provide a little more context? I suspect that this term refers to the amount of aromatic resonance stability compared to benzene. For example, furan (despite meeting the Huckel requirements) is less aromatic, evidenced by its ability to act as a diene in a Diels-Alder reaction
Answer: Aromaticity might be viewed as resonance stabilzation energy, NMR shift, or altered reactivity.  Here is a way of measuring its change among related systems,
Chem. Commun.  48, 8144 (2012)
J. Am. Chem. Soc. 131, 189 (2009)
J. Am. Chem. Soc. 127, 16251 (2005)
J. Org. Chem. 67, 8798 (2002)
J. Am. Chem. Soc., 124, 13495 (2002)
Chem. Rev. 101, 1301 (2001)
Tetrahedron 57, 3689 (2001)
http://nptel.ac.in/courses/IIT-MADRAS/Engineering_Chemistry_III/pdf/1_Aromaticity.pdf
A more practical approach derives from MO theory and Hund's rule of maximum multiplicity.
http://www.youtube.com/watch?v=U6FX5RfLjd0
http://www.youtube.com/watch?v=H0so_NJ2aVw
Frost circle
Answer: I'm currently studying this and...
Degree of aromaticity can be assessed by many methods, both thermodynamic and spectroscopic but one of the favoured these days is actually computational. One of the characteristics of an aromatic system is that it gives rise to ring currents which then cause significant deshielding of the aromatic protons. This can be exploited by a technique called "Nuclear Independent Chemical Shift calculations", or NICS. In this computational method, the shielding parameter (the CS bit) for an arbitrary dummy nucleus (the NI bit) in the centre of the ring is calculated. If the shielding parameter is negative, then the ring is aromatic, if the shielding parameter is positive, it is anti-aromatic and if zero, it's just not a delocalised system.


Privacy Violation

Question: A coworker revealed to business customers that I am dealing with an illness in my family. He was not given permission to share this information. As a result, customers lost confidence in my ability to provide services to them. I do not think it qualifies as a HIPAA (Health Insurance Portability and Accountability Act of 1996) violation. How do I handle this?
Comment: What is your goal? We can't tell you what your goal should be.
Comment: Did the colleague give specifics of the illness or just that you are dealing with something?
Comment: Did you lose customers? How are you measuring their confidence and how has it impacted you?
Answer: Your colleague behaved in an absolutely unacceptable way. He also damaged the business (customer lost confidence). There are two reasons why I might tell a customer about your illness: One is utter stupidity, the other is the intent to harm you.
I would tell your manager about what happened, he will most likely have a word with your colleague about what information to not give to customers, but may also have a word with him about privacy violations. Ask your manager if he will talk about privacy violations. If not, you can put in a complaint to HR. You may talk to your colleague first about how unacceptable his actions are, and delay the complaint to HR if you think the colleague will stop his behaviour.
Illness is your very very private business. No colleague has the right to talk about your private business to a customer.
Comment: The way I read your answer it seemed like you mean that OP has the illness, but OP says the illness was in their family
Answer: There's a couple options available, and it really depends on what result(s) you want.  Do you want to get your coworker reprimanded?  Do you want your customers' confidence back? Both?
If you feel like your coworker deserves to be reprimanded for this violation (this of course is your opinion, others may not agree), you should elevate this either to your manager, assuming you share managers or your human resource department.  They will handle it from there.  This of course should be considered thoroughly, HR especially is not your friend.
Concerning your lost confidence, do you have direct communication with each customer?  Since your illness is already known, then being direct to each customer that knows seems like the best way.  Word something to the tune of,

"As I'm sure you are aware I was struggling with a family [INSERT ILLNESS]
  previously, I am happy to update you that I everything is much better  and
  glad to be back in full capacity working with/for you."

Being straight forward and expressing that you are back and healthy is the first step to regaining confidence, of course the second part is actually following through.
Comment: Minor quibble - the OP said the illness was in their family, and not the OP's illness.
Comment: @WesleyLong can't believe I misread that, thank you for pointing it out.
Answer: I think this could either have been poor judgement on your colleagues part, or something more insidious. Your colleague may have intentionally done this to try to undermine you.
The way you respond may depend on what the intention was. If it was not malicious, and was simply a case of poor judgement, an apology may suffice. If they did it maliciously, then you have bigger problems to deal with, and you probably will need to escalate, as it likely won't be an isolated incident.
Only you can make this call.
Perhaps you could try to recall if there have been other signs that your colleague may be trying to undermine you. Sometimes incidents in isolation may not seem suspicious, but are when considered as a whole.

Privacy Violation


I accidentally deleted administrator account and the other accounts are asking root password

Question: I unexpectedly deleted my user account (the only administrator for the machine). I have another account which is a standard account and now I can't access my hard disk or anything with that standard account - it is asking for the root password. Is there any way I can recover access to the administrator account?
Comment: Related: [How do I add myself back as a sudo user?](http://askubuntu.com/questions/70442/how-do-i-add-myself-back-as-a-sudo-user) I'm not sure if we should consider this a duplicate. Probably not, since this has answers about how to *create a new account* (and that's about how to make an existing account an administrator account).
Answer: You can use recovery mode to add the standard user to the admin group (which is now called sudo in 12.04). Below is a set of simple instructions copied from my personal website.
Using Recovery Mode To Add Users To The Admin / Sudo Group
First shutdown your computer.
Then restart whilst holding shift on the keyboard to load grub menu.
Select recovery mode from the grub menu.
Select drop to root shell from the recovery menu.
Use the following command to remount the drive mount -o rw,remount /
Now type adduser username sudo replacing username with your user name  ie. 'adduser  phil sudo'
You should now see a message saying 'adding user' followed by 'done'.
Type shutdown -r now to restart the computer.
EDIT: If it is telling you that user xxx does not exist, first you can use the following command to list users and make sure that you have the correct username
ls /home

The other option is add a new user, from recovery mode using the following commands :
useradd username -m -s /bin/bash
passwd username
adduser username sudo

Again replacing username with your desired username.
Comment: whilie in adduser comand it is showing user XXX does'nt exist please help me.
Comment: @Niranjan  - I have edited the answer to include the information you need. :o)
Answer: You can use the recovery console and boot as root this is a extra option on your grub menu and create a new user then add them to the admin group.  I'm not sure if this will fix your issue, but give it a try and let me know.
useradd newuser
adduser newuser admin

Answer: I had the same problem
Select recovery mode (if you are using laptop it differents but it's in the same place you get in bios)
Then select root
Write the command(# adduser )
Then the command(# password root)
And write the new password
And restart by the command( #reboot)
Comment: this is a bad idea. The root account is disabled in Ubuntu for security/safety reasons
Comment: I have a problem now I loved in but I can't use mu computer normally can you help me
Comment: What's the problem exactly? Can you say more clearly?


What are the risks with PPTP (MS-CHAPV1/V2)?

Question: What are the risks with PPTP (MS-CHAPV1/V2)? Are the only ways that it can be exploited are if someone already has access to the network and can ARP poison etc or capture packets some way? Or can it be exploited with it only being open to the internet, RCE wise, or letting people capture packets for further decoding etc?
Answer: MS-CHAP is completely insecure and has practical attacks.  The protocol in many ways resembles NTLMv1.
Both protocols use unsalted, uniterated MD4 hashes of the password (secure password hashing requires a secure salt and effectively requires some sort of iteration) and the encryption of a challenge with DES using the hash as the key.  The attack on this stage of the protocol requires about USD 20 to perform and there are sites offering it at this price.  In addition, MD4 and single DES are completely obsolete and MD4 has been known to be insecure since 1995.  There is no justifiable reason to continue using it.
You should assume that if anyone can see a single exchange, they can break the protocol, so you should not use it.  It is actually a better idea to send an encrypted password over a secure connection (e.g., using PAP and EAP-TTLS) because then the password can be stored securely on the server side.


How to override django edit_inline/tabular.html for only 1 app?

Question: I can override edit_inline/tabular.html if I save it in my overall template directory (for example mysite/templates/admin/edit_inline/tabular.html), but when I try to save it with other admin template, like change_form.html (in mysite/myapp/templates/admin/myapp/mymodel/change_form.html, it doesn't works.
Answer: I come across this thread which is a bit old, in fact for the inline model you need to explicitly set your new template in your admin.py like below :
class ModelInlineAdmin(admin.StackedInline):
    model = Product
    template = "admin/products/product/edit_inline/stacked.html"

check this http://blog.ruedaminute.com/2011/05/django-journal-override-a-django-admin-template-inline-or-otherwise/
Comment: Thank you for the answer, please mind that the link provided is no longer active.
Answer: The documentation hints that inlines can have a template attribute. Try setting that to admin/myapp/mymodel/edit_inline/tabular.html and create the corresponding template file in the templates directory of myapp.
Answer: The form is like this:
templates/admin/app_name/override.html
For you change_form.html example, it should be like this:
mysite/templates/admin/myapp/change_form.html
See http://docs.djangoproject.com/en/dev/ref/contrib/admin/#overriding-admin-templates for more.
Comment: This doesn't answer about inlines, only regular admin pages.


Cut duration of animated gif

Question: I have an animated gif and I'd like to cut off the last 5 seconds. Does anyone know how to do that in Linux/Ubuntu?
Comment: I think an online editor would be much easier than finding some special GIF editor for Ubuntu, but if you open the file as layers in GIMP, you can manually delete the frames you don't want before exporting it as a GIF again.
Answer: There are multiple ways to do this.
Option 1: Use a command line tool called gifsicle. It's available in default Ubuntu/Debian repositories.
It's fast and won't affect the quality, buy it only accepts frame numbers, not time, so if you need to cut exact time, you should figure out the frame number yourself. You can view the total number of frames and delay times between each frame with this command:
gifsicle --info YOURFILE.gif

Then you can divide the time you want to cut with the frame delay and it will give you the number of frames in this time, so you can figure out start frame and end frame.
Replace XXXX with the frame where you want your GIF to start, and YYYY with frame where you want your GIF to end.
gifsicle YOURFILE.gif '#XXXX-YYYYY' -O3 > cut.gif

Option 2: Using FFMPEG. It's also available in apt.
FFMPEG accepts time directly, so it's very straightforward, but it may worsen the quality of output gif and increase file size in some cases.
ffmpeg -i YOURFILE.gif -ss 00:00:04 -t 00:00:08 -async 1 cut.gif

Option 3: if you're ok with online tools and your GIF does not exceed 20MB, this online tool can cut GIFs by frame number or by time and won't affect the quality.
Comment: FYI for others, `-O3` is an [optimization option](https://www.lcdf.org/gifsicle/man.html) and not necessary (though  maybe helpful) and `#XXXX` is just a placeholder for frame number. Use the frame numbers as they appear in the previous `--info` step output. In my case `'#0-74'` for a gif I just made. (Got hung up on four digit numbers for a moment when I first saw this.)
Answer: Here's one more. Using ImageMagick, the command:
 magick Long.gif[0-100] Short.gif

takes the first 100 frames of Long.gif and saves them as Short.gif
You can see how many frames you're starting with using:
magick identify Long.gif

The last line of the output will show the number of frames in square brackets, for example:
Long.gif[829] GIF 64x64 64x64+0+0 8-bit sRGB 256c 1.86076MiB 0.031u 0:00.034

which indicates that Long.gif has 830 frames.
Note that much legacy documentation of ImageMagick refers to the identify (now magick identify) and convert (now magick) commands, which could be what you need depending how recent your version is.

Cut duration of animated gif


How to switch desks with coworker/s?

Question: So I want to switch workstations at my job. I currently work in an open-plan desk and was hoping to switch to a closed office there are plenty at my work but all taken. Have you ever switched workstations with someone at work? Is it a common occurence? How does one go about doing or trying it?
Comment: I can sit and "switch out" of the surrounding noise - comes with having to concentrate / focus in noisy environments. Or you can wear headphones - some find that works.
Answer: An office is more coveted than a cubicle or a desk in an open office. Nobody will trade with you even if you ask nicely. Best case scenario is that they'll politely tell you no, but more likely they will be offended by your audacity and/or you'll be laughed out of their office.
Your best course of action would be to ask your boss if you can get the next available office. If you want to be on the shortlist, you'll need to have a better reason than "I work better in an office" (because  that applies to everyone).
Comment: Then you likely get in trouble with your boss and/or HR.
Comment: @Outsider: the office isn't "owned" by the current occupant and it's not theirs to give away. If an office opens up it gets re-allocated by HR,, facilities or management based on business needs, not on what the previous occupant wants.
Comment: What if I offer to pay the person? What if I "rent it" for some amount of time?
Answer: The only aspect not covered by zmike's answer is if there is some specific part of your role that would benefit from having an office; for instance you work in HR and are constantly having conversations/calls that require confidentiality or your day is almost constant external meetings. In that case you could raise it with your manager and the company night decide it benefits the company (not you personally) to re-allocate an existing office to you or put you at the top of the list for the next available one.
Just saying "because the office is noisy and I have to concentrate" probably isn't sufficient reason because I expect most employees feel like that.

How to switch desks with coworker/s?


Mac Mini 2012 - dual band bluetooth?

Question: does anyone know what the radio is in the mac mini late 2012? The only detail I can find is that it is 4.0, but I can't find out if it is dual-band capable.
Answer: I don't know if this answers your question but here:
Single-Chip Bluetooth® 4.0 HCI Solution with Bluetooth Low Energy (BLE) Support
The Broadcom BCM20702 is a single-chip Bluetooth processor with a high performance integrated 2.4-GHz RF transceiver. It is fully compliant with Bluetooth 4.0 and all prior standard features. The BCM20702 offers unmatched integration, including on-board memory for a very small footprint and low cost of implementing a Bluetooth system.
Which i got from http://www.broadcom.com/products/Bluetooth/Bluetooth-RF-Silicon-and-Software-Solutions/BCM20702.
I got this from ifixit's Mac Mini Late 2012 teardown.

Mac Mini 2012 - dual band bluetooth?


Include Form Title in Freeform Notification

Question: I'm trying to make a single Notification template for a general auto-response to several forms and would like to include the form's title in the subject line and body. To be sure, this is not {form_name}. I hoped {nonfield_title} would do the trick, but it does not output the title as it does on the live page. Any tips?
Comment: This question isn't 100% clear upon reading it. I'd suggest fine-tuning and adding more information to ensure you get good answers. Screenshots would be great so we know exactly what you're doing and where.
Comment: I was simply looking for the general tag to include a form's title within Notifications. Timo Häkkinen got it below with {form_label}. Cheers!
Answer: It's not clear from your question whether you are putting this information into the form or the notification template.
Create a hidden input field in your form containing the information you want. You can then include this custom field in your notification template.
You could pass that information to the form via an embed parameter, hardcode it or use the {form_info} tag pair to output information that can be included in your notification.
Answer: You were close, it's {form_label}.
When you create a form, it says "Form Label: This is the full name of the Form." When you add "Title" in composer, this gets outputted as nonfield_title.
You can use {form_label} in notification's Subject as well as Email message. You could even make "{form_label} - {name}" the subject, assuming you have a name field.
Comment: This is exactly what I was looking for. Thank you!


what would happen if I installed a Ubuntu with md5 hashes that are different fom the intended ones

Question: What would happen if I installed Ubuntu with md5 hashes that do not match the intended ones.
Comment: It would be a bad install and some/all features wouldn't work. If you are lucky it might be a small bug. If you're unlucky, it might not work at all, and completely freeze your computer.
Answer: Anything could happen. You could find that you are installing Windows! :D Or that your setup is compromised in some way, with keyloggers and botnets and whatnot. Or it simply wouldn't install, because the affected file is crucial to installation.


Why Do Pipeline ADCs have an "Overlap Bit"?

Question: In pipeline ADCs, there is an amplifier after each stage that amplifiers the remainder of the previous stage by 2^(number of previous stage bits - 1). For example, if the flash ADC in the first stage is 3-bit, the remainder is amplified by a factor of 4. This leads to an overlap bit between the stages. My question is, why do we need this overlap bit, and why don't we remove it to get the maximum number of output bits from the ADC?
Comment: I haven't ever designed one or examined them as closely as you appear to have. But what you write makes me imagine that the reasoning my follow along similar lines as for a ["partial products multiplier" tree](https://i.stack.imgur.com/JRgcj.png). It will be educational for me to see good answers on this. I may be way, way off-base.
Answer: this happens because this bit that is overlaped, we don't trust its value. Can exist some offset error. There may be some error in this last bit and you don't want to pass this error to the next phases. I recommend you read the following link, maybe it helps and explains it better than me: Digital Error Correction and this: ADC Offset Error
Answer: I never designed a pipeline ADC and never studied it carefully, but I designed a SAR ADC with redundancy before.
In a perfect world, where the comparators have no offset, no noise, where the reference voltage has zero source impedance, etc, you don't need an extra bit per stage. However, in the real world due to the noise of the comparators, offset or other non idealities (that I am not completely aware in the pipeline ADCs), you can have an error in the result of one of the stages. If you have only N bits for N effective bits, you can't recover from an error like this and get the right conversion result. Why? Because you only have one output code for a certain range of Vin values.
Therefore, in ADCs people use frequently redundancy. This means that the ADC determines more bits than the effective number of bits that you are looking for. At the end of the conversion, you convert these bits into the right number of bits. Since the raw result has more bits, it has more possible combinations. If done right, you now have several possible codes for the same Vin range. Therefore, if you make a mistake in one bit, you can still recover from that mistake, since there are more output codes available that correspond to the right Vin.
As I said, I never learned about redundancy in pipeline ADCs. I could give you some references for papers about it in SAR ADCs. Tell me if you are interested.


What is space made of?

Question: General Relativity posits that matter curves spacetime, such that geodesics point towards the object in question, hence, gravity. Now, how does matter do this? What is spacetime "made of", anyway, such that it should interact with matter, being bent by it and forcing it to accelerate (via gravity)?
Answer: The image of space being bent is just an analogy, it is not meant that anything is actually being deformed. Gravity distorts the notion of distance on spacetime, i.e. the presence of matter somehow causes the metric to change. A way to visualize this is to think of spacetime being bent, as you say, but really, spacetime is not made of anything, the idea of an ether has been laid to rest for a hundred years now, with good experimental reasons.
Spacetime interacts with matter since matter exists within (or on, in some terminology) it, and when the notion of distance changes, the behaviour of objects relying on that notion changes.
As for why the presence of matter itself influences the metric...well, this is the defining property of having mass/energy, just as generating (or reacting to) an electric field is the defining property of having an electric charge - in a manner of speaking, mass could be seen as the charge of gravity, though, since we do not fully understand gravity (yet), this is necessarily vague.
Comment: Relevant xkcd: https://xkcd.com/895/
Comment: So... then, how do we separate space from the metric defined upon it?
Comment: Short answer: We don't. Slightly longer answer: On the same "spacetime", which is really just what one would call a (smooth) [manifold](https://en.wikipedia.org/wiki/Manifold), there are many different possible metric structures one could define. The one that is realized in nature is given by the solution of the [Einstein field equations](https://en.wikipedia.org/wiki/Einstein_field_equations), where the solution is mainly dependent on the energy-momentum tensor, which arises from the distribution of energy/matter. Spacetime without metric is (likely) just $\mathbb{R}^4$.
Answer: Conventional theory calls it spacetime, which I would assume refers to an unidentified amount of space over an unidentified amount of time but both distance and time are measurements of properties of matter and are dependent upon relative matter, example. Time is the measurement of relative movement, thedistance the sun can travel in a second is different than the distance an atom could due to a difference in the motion of each. Should there be no motion, there can be no "time" as there would be no cycles taking place. 1 earth cycle=1day. Motion=time. In the interest of answering your question with the understanding I have I would have to say space is made of a medium of extreme density, so much so that the substance that comprises it doesn't give any energy (exert a force) as it doesn't require loss of energy to travel through. (when you throw something in space it goes on until acted upon by another force=no drag) there must be some medium by which matter can interact/propagate because it is difficult to believe that spacetime doesn't exist and isn't real or that it's empty yet it's able to react to gravity to influence light...
Answer: Due to gravitational time dilation, time moves slower in areas of space near heavy objects. You can think of it as time having different speeds at different locations in space. The combination of a three dimensional space coordinate with the speed of time at that location is space-time.
If you define space as the distance between two points, you can create more space by moving these two points farther apart. But this requires energy. How much energy depends on the mass of the two points and their distance. If the two points move closer together,energy is released in the form of acceleration and motion. On the surface of the Earth, increasing the space/distance between a one pound object and the Earth by 3 feet requires roughly 1 calorie (3 foot pounds) of energy.
How does matter curve space like this? If you define space as the distance between two points, then the universe is using polar coordinates, not rectangular coordinates and gravity doesn't exist, but the result of our incorrect idea of what a straight line is. You can think of objects in motion following a straight line and being affected by gravity or objects in motion follow a path curved because space-time is curved. Is the moon following a path around the Earth curved by gravity or is the moon moving in a "straight line" around the Earth?
How to visualize this? If you drew a bunch of points on a piece of paper and drew a line between every point and every other point, places where lots of points were close together would represent a heavy object. Space (the distance between two points) would not be distributed evenly on the page and space would be "thicker" near a heavy object with lots of points.
You can also combine the two equations:
E = MV2  (Energy = Mass times Velocity squared)
and
E = MC2 (Energy = Mass times the speed of light squared)
to get the total energy of an object including it's motion:
E = MV2 + MC2
This is a simplistic, probably slightly incorrect version of Einsteins 10 equations of space-time.
If an object moved from a region of space where time was fast to a region where time went slower such as closer to a planet, C (speed of light) would decrease (due to time dilation) and V (velocity) would increase (object starts moving faster). This answers the question of when an object moves away from the Earth and it slows down, where the energy went.
Answer: Space is the canvas on which the Universe is painted. Space is created when a Higgs wave (dark energy) intersects dark matter. When this happens, three things are created. Matter, energy and a whole lot of SPACE. Space has two known properties. First, Dr. E. tells us it can be warped. Second, I tell you it cannot be compressed. That being said, this reaction is still occurring and therefore the Universe continues to expand at an accelerated rate. This also explains the Big Bang. Prior to it the Universe had no dimension as the two darks were both waves and did not require space to exist. A quantum foundation caused the dark energy to produce the cascading Higgs wave which produced the matter energy and SPACE.
Hope that clears things up.
L. Stewart Hearl
Comment: No, that really doesn't clear much of anything up.

What is space made of?


Should I use abbreviations for university names while writing my Statement of Purpose?

Question: I am specifically asking for University of Illinois, Urbana-Champaign. I am writing a Statement of Purpose for the university and have to mention it a few times. Should I write the complete name or can I use UIUC or Illinois instead?
Answer: The first time write out the entire name and put the abbreviation in brackets, then use the abbreviated form forward
e.g. I am writing in application for graduate studies at the University of Toronto (UofT)..... UofT would be the best choice because....
Comment: +1, this is probably the best solution, though in a statement of purpose, I think writing the abbreviation every time is also probably fine, particularly for long names like UIUC. If you're applying to UVA and describe why you want to go to "UVA", I can't imagine a UVA professor would be confused as to whether you really meant to apply to Amsterdam.
Comment: +1 Writing out the full name first is important, as there are so many universities, some differences between abbreviations are so subtle they can easily lead to confusion, e.g. UVA (Virginia, USA) and UvA (Amsterdam, Netherlands).
Comment: If you applied to any dutch university and wrote you got your degree from UVA then the chance of a misunderstanding would be extremely large.


According to Catholicism, how can a relic help a sick person?

Question: I took several holy cards to view and touch relics of the saints.  Now do I keep the relic and pray for someone or give it to the person so that he/she can pray for healing?
Comment: Are you asking for the Catholic, Orthodox, or another perspective?
Comment: & are you asking about physical healing or spiritual healing?
Comment: The tone of this question suggests a Catholic perspective.
Answer: How can a relic help a sick person?
From the tone of body of your question, I am presuming that you would like a Catholic response. That is the perspective I am  going to give for you.
Holy Cards touched to the relics of the saint are third class relics.

The Catholic church divides relics into three classes:
First-Class Relics: items directly associated with the events of Christ's life (manger, cross, etc.) or the physical remains of a saint (a bone, a hair, skull, a limb, etc.). Traditionally, a martyr's relics are often more prized than the relics of other saints. Parts of the saint that were significant to that saint's life are more prized relics. For instance, King St. Stephen of Hungary's right forearm is especially important because of his status as a ruler. A famous theologian's head may be his most important relic. (The head of St. Thomas Aquinas was removed by the monks at the Cistercian abbey at Fossanova where he died.) If a saint did a lot of traveling, then the bones of his feet may be prized. Catholic teaching prohibits relics to be divided up into small, unrecognizable parts if they are to be used in liturgy (i.e., as in an altar; see the rubrics listed in Rite of Dedication of a Church and an Altar).
Second-Class Relics: items that the saint owned or frequently used, for example, a crucifix, rosary, book, etc. Again, an item more important in the saint's life is thus a more important relic. Sometimes a second-class relic is a part of an item that the saint wore (a shirt, a glove, etc.) and is known as ex indumentis ("from the clothing").
Third-Class Relics: any object that is touched to a first- or second-class relic.[38] Most third-class relics are small pieces of cloth, though in the first millennium oil was popular; the Monza ampullae contained oil collected from lamps burning before the major sites of Christ's life, and some reliquaries had holes for oil to be poured in and out again. Many people call the cloth touched to the bones of saints "ex brandea". But ex brandea strictly refers to pieces of clothing that were touched to the body or tombs of the apostles. It is a term that is used only for such; it is not a synonym for a third-class relic.

Many holy cards have a prayer on the back of them invoking the particular saint who's image appears on the front of the holy card. You are quite free to pray this prayer for the intentions for yourself or for the healing (or some other grace) of another person. You are also free to give to someone. If the person you are giving the holy card to is not really into praying, yet freely accepts the holy card from you, it is quite fine that you can do the praying for them. Prayer is never in vain. You could also place the holy card, while praying for a healing on the place of one's suffering. I would suggest that you perhaps try praying a novena to the saint in question at the same time.
I cannot find the story on the internet, but several years ago I was reading life in French of the Little Flower, St. Therese of Lisieux and how she had offered her last Holy Communion, on August 19, 1897, for Fr. Hyacinthe Loyson who had left the priesthood and eventually got married. Some years later an exorcist placed the holy card with the image of St. Therese of the Little Flower on the head of the possessed and and demon admitted to the particular priest, Fr. Hyacinthe had converted and repented of his sins on his death bed and was saved though the intercession of St. Therese of Lisieux. (If anyone knows of a link about this story please place it in here). As you see holy cards and holy images are to be treasured.
Answer:
Matthew 9:20-22 (DRB) And behold a woman who was troubled with an issue of blood twelve years, came behind him, and touched the hem of his garment. 21 For she said within herself: If I shall touch only his garment, I shall be healed. 22 But Jesus turning and seeing her, said: Be of good heart, daughter, thy faith hath made thee whole. And the woman was made whole from that hour.

It is our disposition to have faith in God's healing power that heals us, not the relic itself as such (by which I mean that they are to no effect for one without faith; or at least opposed to faith). Although God may confer upon an object healing power extrinsically (e.g. Acts 19:11-12), these are only aids to faith, or tokens to help us place saving—or healing—faith in Him. That is to say, miracles leading on to the faith which saves: to believe God is with Paul is to accept the gospel he tireless preaches as truth, and so be saved by believing it salvifically.
This does not mean relics are no more special than any other object, they are 'most dear to God for the sake of' their original beareres (i.e. saints qua those who bore witness to the truth and show forth the glory of God), we might say; and that is perhaps the only reason 'they' have healing power. Do we think that Jesus' clothing had healing in its physical makeup anywhere? On the other hand, do we think that God the Father would not punish someone who would seek to defile or otherwise disrespect this possession of Jesus, which clothed Him—the very Temple of God—and reward those who, contrariwise, honor and venerate it as such (and not beyond)?
It then stands to reason that the one with more faith is more likely to benefit from this sacramental.


the mathematical function that relates a given output to three inputs through artifical nural network analysis

Question: I have a data set with three input variables and one output. I want to fit the target column to the input data using an artificial neural network with one layer, for example. My concern is, can I obtain a closed form or analytical formula that links the modeled target to the three input variable? Please let me know whether the software can process that.
Answer: Technically, you can always translate a one-layer neural net into a closed form solution. Let's call your input variables x, y, and z, your bias node b, and the connections between them and your output cx, cy, cz, and cb respectively. Once you've trained the neural network so that the connection weights are adjusted, the output value should equal xcx + ycy + zcz + cb. (technically the bias term is bcb, but b = 1).
If you were using a more complicated neural network, this equation would get a lot more complicated, particularly as you add hidden layers, but theoretically you can always write it out analytically. It just won't always be tractable to evaluate the analytic form.
For a more detailed answer, see: Deriving equation by weights and biases from a neural network


derivative matrix and the Dirac delta distribution

Question: For a project I'm working on, I was working with the following equation
$$
w(x) = \int k(x,y)v(y)dy
$$
I noticed that if I choose
$$
k(x,y) = -\delta'(x-y)
$$
Then we probably get (I haven't touched Dirac delta functions for years, please correct me if I am wrong.).
$$
v'(x) = -\int \delta'(x-y) v(y)dy \tag{1}
$$
Where $\delta'$ is the derivative of the Dirac delta distribution as detailed here and $v'(x)$ is the derivative of $v(x)$.
My question is: Would it be possible to discretize (1) using some technique to get different finite difference schemes for derivatives? Presumably different definitions of $\delta$ using different limit of sequences of functions would lead to different finite difference schemes.
Something like
$$
v' = Pv
$$
Where $P$ is a matrix, $v$ is a vector whose entries are values of $v(x)$ at equispaced locations and and $v'$ is a vector containing the finite difference approximation to the derivative.
Answer: You could, but why would you? We have systematic ways of obtaining finite difference stencils approximating derivatives that do not rely on the derivatives of functions that are zero everywhere and infinite in one place.


Unity Multiplayer player synchronization

Question: I am working on a unity mobile game. Which is like a multiplayer version of temple run. Because this game is meant for mobile there is a fluctuating latency generally in the range of 200ms - 500ms.
Since the path is predetermined and actions the user can perform are limited (jump,slide, use powerup etc) , the remote player keep running on the path until it receives the updated state from its local player.
This strategy generally works pretty well since I only need to send limited amount of data over the network but there is a specific case in which I am having issues.
In the game, players die on the specific positions (obstacles).
 I want remote players to die on the same obstacle/position as local player but due to latency in sending message, the remote player crosses the obstacle by the time it receives the death message.
Is there a way to sync the players on the deaths.
One of the things I tried was moving the remote player back to the local players death position but not only does it look awkward visually but can also raise other syncing issues.
Is there some other better way to do this ?
Comment: Interesting problem - Can you just clarify this statement a bit "I want remote players to die on the same obstacle/position as local player" ?
Answer: One way I may recommend is to make one player acts like server (not real server). The server-player will do all the computation like moving, jumping, creating scenes, etc. Then the server-player will send all the data to sync with the client-player. The client-player get the data and process game state. The client-player can also send his action (left-right-jump-slide) to the server-player. This way both player will have the same state of the game like position, die. You also need to deal with latency by adding some prediction.
Answer: So the solution I implemented was I spawned all the remote player behind enough so they can have some time to receive the information that local player was died on specific obstacle. And in the end there is a straight path where I just sync players again. So that result is displayed correctly.


Algorithms/theory behind predictive autocomplete?

Question: Simple word autocomplete just displays a list of words that match the characters that were already typed. But I would like to order the words in the autocomplete list according to the probability of the words occuring, depending on the words that were typed before, relying on a statistical model of a text corpus. What algorithms and data structures do I need for this? Can you give me links for good tutorials?
Answer: You don't need probability for autocompletion. Instead, build a prefix tree (aka a trie) with the words in the corpus as keys and their frequencies as values. When you encounter a partial string, walk the trie as far as you can, then generate all the suffixes from the point you've reached and sort them by frequency.
When a user enters a previously unseen string, just add it to the trie with frequency one; when a user enters a string that you had seen (perhaps by selecting it from the candidate list), increment its frequency.
[Note that you can't do the simple increment with a probability model; in the worst case, you'd have to recompute all the probabilities in the model.]
If you want to delve deeper into this kind of algorithms, I highly suggest you read (the first chapters of) Speech and Language Processing by Jurafsky and Martin. It treats discrete probability for language processing in quite some detail.
Comment: > "then generate all the suffixes from the point you've reached and sort them by frequency". I think there must be some important optimisations. It is impossible to traverse an entire trie given just one (or 2, or even 3) first characters. I suppose there should be a pre-computation phase...
Comment: Although a straightforward approach, this solution doesn't take into account information from n-gram language models of the corpus. i.e. word history
Comment: @swami: that's right, but is that a problem? Frequencies can be weighted if required, perhaps using an exponential scheme, so that the user's typing will outweigh the corpus or vice versa.
Answer: Peter norvig had an article How to Write a Spelling Corrector that explains how Google's Did you mean...? feature works that uses Bayesian inference to make it effective. It is a very good read, and should be adaptable to an autocomplete feature.
Comment: #4 of the improvements points me in the right direction: Using n-grams for predictions.
Comment: @larsmans True, it maybe overkill. But finding words matching the autocomplete text and sorting them according to probability just seems _so_ simple ;)
Comment: Using Bayes' law will be overkill for autocompletion, though, since the ; just giving the most common autocompletion of a partial string is often good enough.
Comment: sorting them by frequency is much simpler.


macOS: Disable popup showing accented characters when holding down a key

Question: How do I disable the display of popup which appears when holding down a key? It slows my typing speed and makes me do so many mistakes in my writing and programming. I need it at time when I wish to enter an alphabet twice.
Answer: In macOS, when a key is held down while entering text, a popup is shown which lets one choose between various accented forms of the character. To disable this execute the following command line in the Terminal.app:
defaults write -g ApplePressAndHoldEnabled -bool false

Now, you'll need to log out and log back in. This should disable the display of the popup and character typed should start repeating when the key is held down.
If you ever wish to return to this behaviour, execute the following command line in the Terminal.app:
defaults write -g ApplePressAndHoldEnabled -bool true

You'll need to log out and log back in again for the setting to take effect.
Comment: Note: you don't seem to have to log out and back in, just restart any apps where it doesn't take effect immediately (some seem to not need to be restarted at all).
Comment: thank you! i have a problem in Intellij products because of this feature: after I press and hold some letter button on a keyboard, any code editor pane is disabled for text input. now, the problem fixed. thank you again.
Comment: Is there a way to map holding the letter onto a specif one of the popup items?
Comment: Thanks, I feel like this should be an option in the Keyboard settings, but Apple is Apple I guess.
Comment: @JoelH I am not aware of any built-in way. It may be possible with the help of a 3rd-party tool.
Answer: I solved this problem by turning my keyboard off and then on, and the special chars window went away; now it only shows if I press and hold a key for a few seconds (like it should); before, it was showing every time and there was no way for me to remove it.
My guess is that a keyboard key got stuck sending the pressed signal or something like that.
Comment: This is not a bug, it's a feature.


neo4j vs mongodb for spatial search

Question: I'm getting ready to start a project where I will be building a recommendation engine for restaurants.  I have been waffling between neo4j (graph db) and mongodb (document db).  my nodes/documents will be things like restaurant and person.  i know i will want some edges, something like person->likes->restaurant, or person->ate_at->restaurant.  my main query, however, will be to find restaurants within X miles of location Y.
if i have 20 restaurant's within X miles of Y, but not connected by any edges, how will neo4j be able to handle the spatial query?  i know with mongodb i can index on lat/long and query all restaurant types.  does neo4j offer the same functionality in a disconnected graph?
when it comes to answering questions like, 'which restaurants do my friends eat at most often?', is neo4j (graph db) the way to go?  or will mongodb (document db) provide me similar functionality?
Answer: Neo4j Spatial introduces a Spatial RTree (or other means) index that is part of the graph itself. That means, even disconnected domain entities will be found via the spatial search, if you index them (that is relationships will connect the Spatial index to the Restaurants). Also, this is flexible enough that you can combine the Raw BBox search in the RTree with other things like check on the restaurants categories in the same go, since you can hop out and in the different parts of the graph.
This way, neo4j Spatial is supporting the full range of search capabilities that you would expect form a full Topology, like combined searches and searches on polygons with holes etc.
Be aware that Neo4j Spatial is in 0.7, so be gentle and ask on http://groups.google.com/group/neo4j/about :)
Answer: I'm not that familiar with Neo4J Spatial but it would seem that MongoDB is at the very least a good fit since it's the database Foursquare uses with exactly the purpose you describe. MongoDB geo indexing is extremely fast and scales up nicely.
Comment: Agreed, don't look any further. MongoDB is a perfect match for your requirements. Now just mix it with Node.JS and you have an ultra-fast and scalable solution
Comment: thanks guys - i now plan on implementing mongodb for this solution, which is what i initially wanted to do because of the spatial indexing and numerous APIs.
Answer: Another possible solution is to use CouchBase. It uses a document model as well - though you need to be much more comfortable with MapReduce for queries. It has better spatial capabilities right now thank MongoDB but that may change over time.
Suggestion aside, I agree that of the two choices you have given Mongo will suit your needs fine and probably more appropriate for your spatial queries.
Answer: Neo4j geospatial doesn't scale up that good. I created a geospatial layer in neo4j and added nodes to this layer. Beyond 10,000 nodes the addition of nodes to the layer becomes very slow even when using neo4j2.0
On the other hand, mongodb geo-location works comparatively much faster and is more scalable.

neo4j vs mongodb for spatial search


Position, Rotation and Scale blocked when I imported model with animation, any help?

Question: I recently made a polar bear model with an animation that I wanted to import into another Blender file, but when I imported it over using FBX (the animation stayed which was good) it's scale etc. cannot be changed and always returns back to the original imported state.
What am i doing wrong?
Comment: You can use *File -> Append* to add objects (or collections) from one blend file to another blend file.
Answer: I faced similar issue once, but It turns out that my position rotation and scale parameters in the Item Transform property panel was locked. U can try unlocking it.
But since this is an animation, I would advice checking your scale in each keyframe to make sure that its not changing.


Arm may not be usable for TBB windows users. What are the alternatives?

Question: The anonymizing relay monitor (arm) may not be usable for TBB windows users (or is it?). What alternatives exist for TBB window users?
Comment: I do not understand your question. What do you mean by ARM? The CPU architecture? How is it connected to TBB on Windows?
Comment: Dear Pabouk, ARM as Terminal (command line) application for monitoring and configuring Tor.
Answer: Your best bet is Vidalia. This must be installed manually. However one of the Tor developers has some pre-built binaries. Select the one which fits you best and download it. You can extract (or execute in Windows) the package to any directory. Within the extracted files is a script called start-vidalia. When you execute it Vidalia comes up.
When Vidalia doesn't connect automatically to a running Tor instance, you'll have to configure it. Click on Settings and find a line with the word tor. On the right side is a button Browse. Click on it and enter the correct path to your Tor executable. This is usually the subdirectory Tor of your TBB installation. Now save your settings.
Try to play around or use Vidalia as you're used to.
You might also want to have a look a trac entry #8641. The transition from Vidalia to another solution is discussed there. Probably other solutions can be found in the future there.


insert values from one table to another table in mysql

Question: i have two tables one is table 'a' and second is table 'b'. in table 'a' there are five fields and a_id is assigned as primary key and in second table 'b' there are two fields and b_id is assigned as primary key.there is one common field name in both table as cust_name.my problem is when i insert value in table 'a' then table 'b' should also be filled with values in the respected column. how is it possible. plz help me.
Answer: You can set a trigger on insert actions into table_a and in the body of the trigger insert the required values into table_b. Check the mysql trigger syntax


How to protect decking when it's already winter

Question: I have decking that looks in desperate need of some protector or oil. In the UK it's already quite wintery - temperatures are consistently around 5C (~40F), most days are wet. The instructions for all the protectors and oils that I see say to apply in temperatures over 10C-15C and only in dry conditions. How important is this? Should I assume that doing something is better than doing nothing? Is there any advantage to protector over oil in this situation (I think protectors tend to be water-based, so maybe less sensitive to wet weather?).
Comment: I would say the real problem is that the British climate is just not suitable for uncovered wooden decks. They work well in dry sunny places, like southern California. The long-term solution is to either put a roof over your deck, or replace it with something more weather-resistant, like a brick patio. The new plastic composite decking boards might also be the answer, but I don't have any experience with those.
Comment: How big is the decking area?
Answer: The temperature range is important because it dictates the drying time and should be followed pretty close. The dryness factor is critical. Wood absorbs water. When you set out to protect your deck you want the deck to absorb the sealer. If the deck is already wet, then the sealer won't sink into the wood and you've wasted your money. The deck must be dry so it absorbs the maximum amount of sealer. This applies to water based sealers too.
If you feel the need to do something now, You can get a water proof tarp and cover your deck and then apply the sealers when the deck is dried out. Make sure to allow for air flow while the tarp is on the deck. Then keep the tarp on the deck until the sealer dries, still allowing for air flow. Otherwise, wait until spring. Good luck.
Comment: When covering, make sure to allow airflow...
Comment: @SolarMike Great addition.
Comment: Add it to your answer, and you're welcome.
Comment: Even if you put a tarp over it, it's still 40F and the air is humid most of the time. I doubt that the deck would dry out before springtime. And even if it does, it'll  still be too cold to apply the sealer.
Answer: It doubtless took years to get into this state.  In winter, with cool temperatures, biological activity (mould, fungus) aren't going to proceed with any great speed. So, waiting until spring should be fine with very little additional deterioration.
Inquire with locals for confirmation:  There may be merit in applying a fungicide at this time.  In the horticulture trade Captan is used, as it's hard on most fungi, but benign to plants. This would stop any fungi in places you can reach.


Safe to let indoor cat mingle with outdoor cats?

Question: There are some (feral) outdoor kittens in my yard that have taken a liking to my indoor cat (and vice versa) through "interactions" through a sliding glass door. They have also smelled each other via the glass door being slightly cracked (such that they can smell but not touch each other). Ignoring run-away and fighting considerations considerations (as these won't happen), is it safe to allow my indoor cat to come into physical contact with the outdoor cats? I ask specifically from the perspective of disease transmission. My cat is up to date with his vaccinations and I give him anti-flea medication... is this sufficient to allow them to interact? Or is transmission of something too high a risk? I can be certain that the outdoor cats aren't going to like attack/bite him as they are kittens and he is significantly larger than they are, so transmission would come from just touching or licking each other.
Comment: Could you clarify what "up to date with his vaccinations" means in this context? It is not uncommon for vets to opt for a different vaccination regime for indoor-only cats, e.g. vaccinate only against diseases that are more easily tracked indoors by humans and as such carry the highest risk for the cat. Does he have core vaccinations, or does he also have vaccinations typically only recommended for outdoor cats? Are you living in an area that has elevated risk, e.g. close to large forest with varied wildlife, are you in an area with a risk for rabies, etc.?
Answer: excellent and important question. I am trap-neuter-return certified and frequently handle feral cats, bringing them into my own home (where I have indoor cats) where they await+recover from their spay/neuter surgeries before being released back outside.
TL;DR: It is not "safe" to let your indoor cats interact with outdoor cats of unknown health status, meaning that even through a cracked door there is absolutely a level of risk you are exposing your cat to. Some of the viruses your cat could be potentially exposed to are very detrimental to your cats health and are untreatable. I'd suggest just letting them enjoy each other's company through the glass door but with no further contact. When I bring feral/outdoor cats into my own home I have to take a number of precautions to ensure not only that my indoor cats have 0 interaction with them but also deeply sanitizing everything the outdoor cats came into contact with.
Longer version: No vaccine or flea medication is 100% effective. And there are viruses cats may carry that actually have no vaccine and no cure for treatment. Sadly, feral/outdoor cats can have a host of contagious disease, fleas, lice and parasites that are transmittable to other cats and have large health consequences.
Responsible rescuers in the US (where I'm based so can speak on) do not let indoor cats come into contact with outdoor cats or any objects an outdoor cat might have touched until that outdoor cat has tested negative for two specific viruses, has been dewormed, treated for fleas/lice, and quarantined for at least 2 weeks.
The viruses of concern: Specifically, there are two contagious disease of note that feral cats might have - FIV and FELV - that rescuers in the United States take protective measures against to insure the safety of all cats.
FIV stands for Feline Immunodeficiency Virus. There is no vaccine for FIV and there is no cure for it, so your cat is not protected from this virus. It is only passed through bite wounds, which you say you are not concerned about, but the risks that FIV poses to your cats life and health are severe and I would say it is likely not worth it. FIV creates immune deficiency in cats meaning "which allows normally harmless bacteria, viruses, protozoa, and fungi found in the everyday environment to potentially cause severe illnesses" (Cornell Feline Health Center). While cats who have FIV can live normal lives (and are worthy of adoption and love!), this virus is severe and it can make them much more likely to suffer fatal or near fatal consequences from minor illnesses.
FELV stands for Feline Leukemia Virus. While there is a vaccine for FELV, it isn't considered a core vaccine in cats so your cat might not actually be vaccinated against this virus. And again, no vaccine is 100% effective. FELV also create immune deficiency in cats and can cause cancer. It is progressive and eventually fatal. FELV can be passed through saliva, mucus, mutual grooming, feces, urine, and bite wounds so there is actually risk that FELV could be transmitted even through a cracked screen door. There is no treatment for FELV. Rescues and vets actually suggest that pet owners who have an FELV+ cat should not introduce new cats to their household unless they are also FELV+.
Finally, outdoor cats commonly have feline calicivirus. This is a virus that causes respiratory infections (like a cat cold!) but it can also cause painful sores in the cats mouths. Your cat likely has been vaccinated against this, but again, no vaccine is 100% effective! While less severe than the viruses above, calicivirus is extremely contagious and airborn just like the human cold. Once infected, some cats can become carriers of the virus for life. In these instances it is often dormant and doesn't interfere with infected cats living a normal life, but it can flare up and these cats then become sources of infection for other cats.
A final suggestion: As I think my answer has illustrated, outdoor cats can have a number of health problems that are detrimental to their lives. Cats also reproduce incredibly quickly. If you have feral kittens in your neighborhood, they can quickly grow to be an incredibly large feral colony. I recommend searching for "trap-neuter-return" services in your area. Local rescues may be able to help TNR these kittens. At least in the US, TNR programs also vaccinate the feral cats they spay/neuter so this would help stop some of those viruses I illustrated above from getting a foothold in your area.
Comment: Great answer, regarding FeLV I'd add that studies suggest the virus can even survive for some time on clothes and tracked inside by humans if they come into contact with infected cats, so I would absolutely suggest vaccinating indoor cats too, especially given they might slip outside at some point and the disease is highly contagious. We have a FeLV+ cat living in our home with two negative companions (vaccinated), and I'm dying a thousand deaths each year when they are re-tested before updating the vaccination.


Drawing too much power vs not supplying enough power

Question: Why in some cases a device draws more power than the source is capable of supplying thus damaging it, and in other cases the device will work under-powered?
Comment: it appears that you are talking about two different things ... or you are indirectly talking about a power supply .... if you are talking about a power supply, then ask a direct question about a power supply
Answer: If the voltage source has low output impedance, its output voltage will not drop a as much as it continues to supply higher levels of current, so the load will continue to try to draw a higher current. This can cause the voltage source to overheat and damage itself.
But if the voltage source has a high output impedance, it's voltage will droop as it tries to supply more current which in itself will limit the amount of current the load will try and draw (since the load sees less voltage, it will try to draw less current).
An analog is like a person who gets tired when they try to push something too hard. The harder they push the more tired they get so they can't push as hard anymore. But a person who doesn't get tired might just keep on pushing until they break their bones or damage their muscles.
And of course, some sources are just protected with current limiting to begin with.
Whether the load will work with a lower voltage due to voltage droop from the source supplying too much current is independent of the question you actually asked. It's entirely up to the characteristics of the load.
Answer: You have to match two things in a power supply:

the voltage.  The voltage rating of the source and the load should be matched, for example, 5 V or 12 V;
the current.  The current rating of the supply should be more than the load uses, For example a 5 V, 5 A power source will be able to supply a 5 V, 1.2 A load.

In this example the power supply is a \$5\ V\cdot 5\ A = 25\ W\$ power supply and the load has a   \$5\ V\cdot 1.2\ A = 6\ W\$ rating.


Saving Array to PList from downloaded content in table view on iPhone

Question: I copied these posts from a forum where I posted recently, but got no reply.
I have the base for my code all setup, it is a drill down table with navigation controller which loads data into a nsmutabledictionary from a plist with some empty values, on purpose. On command the app then downloads information which is then set, setValue, in NSMutableArray. The issue is that this NSMutableArray is 3 levels down from the root of the plist. I am looking for a way to replace the array in the plist which is loaded and saved in the appdelegate. How do I this? Help is much appreciated.
So that probably didn't make much sense. In the AppDelegate it loads a plist file into an NSMutableDictionary. The plist is like this:
Root
>Title(String)
>Rows(Array)
>>Item 1(Dictionary)
>>>Title(String)
>>>ID(String)
>>>ItemList(Array)
>>>>Item 1(Dictionary)
>>>>>Title(String)
>>>>>ID(String)
>>>>>Value(String)-----------Empty Value which is Downloaded
>>>>Item 2(Dictionary)
>>>>Item 3(Dictionary)
>>>>Item 4(Dictionary)
>>Item 2(Array)
>>Item 3(Array)
>>Item 4(Array)
The Rows array is sent to the RootViewController. When one of these items is selected from the TableView and new instance is created with the table data source set to the ItemList of that selected item. When the user presses a button it downloads the values and using [setValue: forKey:@"Value"] the values are set in the array. Here is where it gets lost. I need to now set this ItemList array back into the main Root dictionary and then that Root dictionary sent back to the AppDelegate, so that on applicationWillTerminate [self.data writeToFile:] can be called and the downloaded information does not need to be downloaded the next time.
Answer: I'm not totally sure I understanad what your problem is. Once you've got the new value populated into the array, you just need to use setObject:forKey: on the dictionary to replace the old array.
If you're having trouble getting a reference to the app delegate, you can use [[UIApplication sharedApplication] delegate]
if the problem is that your dictionaries and arrays are nested such that you need to change more than one object to set the value, consider using mutableCopy to produce mutable arrays and dictionaries from the plist on load. Alternatively, maybe think about using a mire-sophisticated data representation, rather than reading and writing plist format.
Answer: I believe I might have to use forKeyPath


Converting AVAudioRecorder input to buffer of floats

Question: Apologies in advance for the noobiness of this question, this is my first exploration of the audio side of iOS programming.
I'm using the AVAudioRecorder class to record input through the microphone, using the following settings dictionary.
NSMutableDictionary *settings = [[NSMutableDictionary alloc] init];
[settings setValue:[NSNumber numberWithInt:kAudioFormatLinearPCM] forKey:AVFormatIDKey];
[settings setValue:[NSNumber numberWithFloat:11025.0] forKey:AVSampleRateKey];
[settings setValue:[NSNumber numberWithInt: 1] forKey:AVNumberOfChannelsKey];
[settings setValue:[NSNumber numberWithInt:16] forKey:AVLinearPCMBitDepthKey];
[settings setValue:[NSNumber numberWithBool:NO] forKey:AVLinearPCMIsBigEndianKey];
[settings setValue:[NSNumber numberWithBool:NO] forKey:AVLinearPCMIsFloatKey];

It works absolutely fine, the problem comes however when I attempt to use the echonest-codegen library to generate a fingerprint to identify the music played in.
Don't worry, if you've never used it before, basically I have to run this function:
Codegen * pCodegen = new Codegen(const float* pcm[], int number_of_samples, int samples_offset);

Where const float* pcm[] is a buffer of samples. I need to convert my input to a "buffer of floats". I've been pointed towards the ExtAudioFile docs, but they're not making an awful lot of sense. Could anybody point me in the right direction? I'm utterly lost!
Many Thanks!
Answer: You can easily get audio sample with Audio Queue Services
The biggest issue I see here is that audio buffers are (I believe) of type char* (byte), I don't know why you need float*


Could Senate Democrats do anything to block Donald Trump's nominations?

Question: Would it be possible for the Senate Democrats to block any of Donald Trump's nominations within the 52-48 Republican majority Senate? or would this be deemed implausible as a minority?
Comment: Comments are not for extended discussion; this conversation has been [moved to chat](http://chat.stackexchange.com/rooms/52250/discussion-on-question-by-bradley-wilson-could-senate-democrats-do-anything-to-b).
Answer: No, they cannot block the nominations.
Senate confirmations only require a simple majority vote as shown in this document from the State Department:

Under Senate Rule XXXI, the final question on a nomination is, "Will the Senate advise and consent to this nomination?" The Senate has three options: confirm, reject, or take no action on the nomination. Confirmation requires a simple majority vote.
(emphasis mine)

However, they can stall the confirmations of his cabinet officials. The process is described in this article by CNN:

Once the committees have voted to send the nominations to the floor, Democrats, who have 48 seats compared to 52 for Republicans, can force delays for up to about one week per nominee, meaning it could take months to get through all the major posts.
But without GOP support, Democrats will be unable to use the ultimate stopping power of the filibuster to block nominees they oppose because in the last Congress they changed Senate rules -- over the objection of Republicans -- to lower the threshold of votes to overcome a filibuster of executive branch nominees from 60 to 51.
That means they best they can do is use procedural delays to stall a final confirmation vote.
They can insist on cloture votes for each nominee, and then use the entire amount of debate time allowed under the rules to delay speedy votes, and clog up floor time with lengthy floor speeches. This would mean each nominee could take up to a week to ultimately be confirmed and force McConnell to set aside other top legislative priorities -- like starting the process of repealing Obamacare.

That being said, it's very rare for nominees to be blocked. As seen in this article by FiveThirtyEight, only nine Cabinet appointees in history have been rejected.
The agencies will continue to function as per normal, but would have a lack of leadership if the appointments are blocked.
Answer: Can they block the nominations by themselves?  No.  In fact PBS reports:

Of those 25 [Democratic] senators [up for election in 2018], 13 are from states Trump captured or narrowly lost. Among those are Maine, Michigan, Pennsylvania and Wisconsin, which hadn't backed a GOP presidential candidate since the 1980s

So building coalitions will be difficult if not impossible.  Coalitions are likely to go the other way.  So what can the Democratic Senators do?
They can play the race card, and have.
They can rely on a dishonest media to carry their argument for them.
But there is very little the Democratic Senators can do to stop his nominees.
Answer:
Could Senate Democrats do anything to block Donald Trump's nominations?

Trump has the sole power in nominating those people.
but the democrats can certainly block the confirmation of those nominees, to the extent they can rally enough republicans to go with them.
it has been done by both parties.
Comment: Hmm... I read the question as asking whether Democrats alone could block a nomination, but, yes, you're right that they could block a nomination if they got at least 3 Republicans to go along with them and all Democrats voted together. (It would require 3 Republicans because, in a 50-50 tie, Mike Pence would cast the deciding vote and, presumably, wouldn't block his administration's own nominee.)
Comment: senate democrats eliminated the nuclear option when they had the majority a few years ago, over republican objections. the republicans warned that without the nuclear option, the democrats could lose a powerful means to stop the republican administration nominees if / when the table is turned. well, the democrats today would have loved to undo what they enthusiastically did a few year back.
Comment: Well, they employed the 'nuclear option,' which was to eliminate the filibuster for nominations. But, yes, you're right. Had they not done that, they'd have been able to stop the Trump nominees to which they strongly objected. Even quite a few Democrats at the time warned Reid about the implications of that action, but he was ultimately able to convince the Democrats in the Senate to go along with him... for which they're now kicking themselves.


How to draw image on Grid in silverlight?

Question: I am making an application using Silverlight 3.0. In that application i am drawing a waveform on grid.Now i want to show a image at the bottom of waveform  repeatedly. I am not getting what i have to do now? Please help me.Thanks in advance
Answer: Silverlight doesn't support this out of the box. However you can create your own image control that supports tiling or use something like ExImage. Other option is to make your Silverlight host transparent and use CSS for the background.