What exactly is a Critical Hit in Resident Evil 6?

Question: There is a skill upgrade that increases chances of Critical Hits, but what are critical hits in the game? Do they provide one shot kills? How useful are they against the NPCs?
Comment: From my experience playing the game it is when you score a head shot that instantly kills a Zombie (or takes his head off, sometimes they mutate.) How this transfers to the other enemies I do not know, I would think it means increased damage.
Comment: Yeah I am wondering if I should upgrade that skill.
Answer: Critical Hits have same meaning as in previous games in RE series, and are powerful attacks that do more damage to enemy and, for some enemies, causes different animation of their death.
Note that for most weapons/enemies causing a critical hit requires hitting enemy in special spots of their body, so that will not apply to your every shot (as general gun power upgrade). They help you to conserve ammo with small enemy encounters then you have time for precise shots, but less valuable then confronting large groups of enemies. That's up to you to decide that suits you better.
Comment: How do I know the critical areas of an enemy to be shot at ?
Comment: I guess there is no any specific indication in-game of such weak spots. It's all about intuition and chance you discover it.
Comment: Well you sound knowledgable from your answer (didn't play anything after RE3).. So what's the weak spot for the J'avo ?
Comment: Unfortunatelly I had no chance to play RE6, so I can't say specifically. My personal knowledge is from playing RE5 and the wiki referenced in answer.


Eject CD on shutdown

Question: OK, so I have a simple problem: I have a live CD, and I want the CD to eject when the computer is rebooted or halted.
Executing /usr/bin/eject -m makes the CD eject just fine... trouble is, as you might expect, this then crashes the OS because it now can't read any files. So the reboot never happens, because /sbin/reboot is inaccessible. (I tried executing reboot --help > /dev/null right before the reboot, but there are still other files which still can't be read...)
In summary, it appears that I need to make the eject be the very last thing that happens. So it seems that systemd is the puppy I need to play with... But I have wasted literally hours of my life poking and prodding it, and no matter what I do, it never, ever, under any circumstances, actually ejects the CD. And I have no idea why. I've tried a dozen different ways of invoking eject, but nothing ever happens.
Can anybody tell me the simplest way to run eject? (I imagine just after umount.target would be sensible...)
Comment: I take it you have another OS on the computer or why else would you like to eject the CD on reboot? If this is the reason, you could probably do better if you set up a boot menu where you could select whether to boot from the CD or from the disk.
Comment: After you umount the CD, aren't you still left with the contents of your initramfs? If there's an `eject` there, you would be fine?
Comment: Hold on. That's odd. Linux Mint, and I think Ubuntu do this by default.
Answer: Eventually my colleague found the following article:
http://lists.freedesktop.org/archives/systemd-devel/2012-September/006573.html
In summary, I created a file named /lib/systemd/system/eject.service which contains
[Unit]
Description=Eject the DVD
Before=final.target
After=shutdown.target
DefaultDependencies=no

[Service]
Type=oneshot
ExecStart=/usr/bin/eject -m
StandardInput=tty-force
StandardOutput=inherit
StandardError=inherit

[Install]
WantedBy=shutdown.target

I also had to run systemctl enable eject.service to make this actually do anything. But now systemd ejects the CD right before shutdown, exactly as I wanted.
...unfortunately the OS still segfaults when it can't find the rest of the files with the CD ejected. I tried adjusting the above file so we have After=unmount.target, which you would think runs the script after the filesystems have been unmounted. But no, still it segfaults.
It looks like I'm going to have to figure out how to copy the live CD image into RAM on boot - but that is an entire other question...
Answer: The followings may help you :

Add your eject command at  /etc/init.d/halt.local
You could also look at the /etc/init.d/skeleton template and
customize this to perhaps add some output eg system shutting down,
press any key to eject cdrom etc.
Check out the scripts in /etc/init.d that are linked to in the
runlevel directories /etc/rc0.d (halt).
Answer: ubuntu can use eject -m; reboot -f
Answer: Check out the scripts in /etc/init.d that are linked to in the runlevel directories /etc/rc0.d (halt) and /etc/rc6.d (reboot). For example, I put the eject command in /etc/init.d/reboot and it worked fine.
But, I'm not on a Live CD so I can't test what would work.
If you think about it, something like this, it is hard to imagine, putting in a script or even a compiled binary. Even a binary requires some allocation/deallocation overhead, and as soon as you eject the CD, you are done. Rather, it should be like a flag and a pointer to a machine instruction, stored in some super-persistent memory...
Maybe it's easier to just run the command and deliberately crash the OS, but to do so when almost all stuff is offline, so it won't matter that you crash your remaining system.
(Edit) Another thought: Could you somehow partition your filesystem, creating a partition for just the eject command and reboot, unmount all the others, then run the command? (But, probably then fsck would have to be told not to complain every time, that the eject-partition was not unmounted correctly.) Or, could you put it on a USB stick? (This is a very interesting problem; if you solve it, do tell us!)
(Edit 2) What about merging eject and reboot, so you get one binary, it is loaded into memory, eject ejects the CD, but doesn't have to load reboot from any filesystem, it is already in main memory?
Answer: Create a file named eject.shutdown with executable permissions in /usr/lib/systemd/system-shutdown/.
#!/bin/sh
/usr/bin/eject -T

Source: System shutdown logic
See also: Eject CD before shutdown

Eject CD on shutdown


How to get current product in magento 2 observer without registry

Question: I need to get the current product details in magento2 observer without using the registry.because magento latest version is deprecated this registry.
I need the current product for reviews. when submit the form send the email
please help me.
Answer: This all depends on the event you are observering. Events can be fired from anywhere and usually have data assigned to the event itself - it may not always be the case that a product is defined in the registry when an event is fired.
If you are working with an event like catalog_product_save_after for example, you can access the product being saved like:
public function execute(\Magento\Framework\Event\Observer $observer): void
{
    $product = $observer->getEvent()->getData('product');
    if (!$product instanceof \Magento\Catalog\Api\Data\ProductInterface) {
        return;
    }

    // We now have a valid $product, do whatever with it.
    $product->setData('foo', 'bar');
}

EDIT:
As you've mentioned in comments, it appears the event in question is review_save_after. The below code should work in your observer class:
/* @var $review \Magento\Review\Model\Review */
$review = $observer->getEvent()->getObject();
foreach ($review->getProductCollection() as $product) {
    // We now have access to each $product associated to the review.
    $product->setData('foo', 'bar');
};

Comment: Do you know the name of the event you are observing? It should be defined in your modules `events.xml` file.
Comment: event name="review_save_after"
Comment: I've updated my answer in relation to review_save_after event.
Comment: Hi, it is set the data to product attribute. I need to get the current product details
Answer: Yes, but the deprecated here is just a notice, and It stands in code for a long time, I'm using it day-by-day tasks and have no consequences, the registry still contains the data, so why not,
Answer: If you don't want to use Registry, you can try using $this->request->getParams().
You can get id in params,
$this->getRequest()->getParams();

For Product Id,
$this->request->getParam('product_id'); // Use this class in construct() \Magento\Framework\App\RequestInterface

In your Controller file
protected $request;

public function __construct(
        \Magento\Framework\App\RequestInterface $request
    ) {
        $this->request = $request;
    }

public function execute()
{
    $this->request->getParam('product_id');
}

To get id in getParam() you need to pass it as hidden field in phtml file
In your phtml file,
<input type="hidden" name="product_id" value="<?php echo $product_id ?>">

In Observer & Plugin File:- It depends on which event you want to observe and same goes for the plugin. If you're passing as hidden field and calling a observer on that particular event, you can get id as i mentioned above.


What is meant by sequential model in Keras

Question: I have recently started working Tensorflow for deep learning. I found this statement model = tf.keras.models.Sequential()  bit different. I couldn't understand what is actually meant and is there any other models as well for deep learning?
I worked  a lot on MatconvNet (Matlab library for convolutional neural network). never saw any sequential definition in that.
Answer: There are two ways to build Keras models: sequential and functional.
The sequential API allows you to create models layer-by-layer for most problems. It is limited in that it does not allow you to create models that share layers or have multiple inputs or outputs.
Alternatively, the functional API allows you to create models that have a lot more flexibility as you can easily define models where layers connect to more than just the previous and next layers. In fact, you can connect layers to (literally) any other layer. As a result, creating complex networks such as siamese networks and residual networks become possible.
for more details visit : https://machinelearningmastery.com/keras-functional-api-deep-learning/
Comment: Thanks. Also Is there any best way to read the images from the folder of datatype .mat?
Answer: From the definition of Keras documentation the Sequential model is a linear stack of layers.You can create a Sequential model by passing a list of layer instances to the constructor:
from keras.models import Sequential
from keras.layers import Dense, Activation

model = Sequential([
    Dense(32, input_shape=(784,)),
    Activation('relu'),
    Dense(10),
    Activation('softmax'),
])

You can also simply add layers via the .add() method:
model = Sequential()
model.add(Dense(32, input_dim=784))
model.add(Activation('relu'))

For More details click here
Answer:
The Sequential model is a linear stack of layers.

The common architecture of ConvNets is a sequential architecture. However, some architectures are not linear stacks. For example, siamese networks are two parallel neural networks with some shared layers. More examples here.
Answer: As others have already mentioned that "The Sequential model is a linear stack of layers."
The Sequential model API is a way of creating deep learning models where an instance of the Sequential class is created and model layers are created and added to it.
The most common method to add layers is Piecewise
import keras
from keras.models import Sequential
from keras.layers import Dense

#initialising the classifier
#defining sequential i.e sequense of layers

classifier = Sequential()

# Adding the input layer and the first hidden layer
classifier.add(Dense(units = 6,activation = 'relu'))
#units = 6 as no. of column in X_train = 11 and y_train =1 --> 11+1/2

#Adding the second hidden lyer
classifier.add(Dense(units = 6, activation='relu'))

#adding the output layer
classifier.add(Dense(units = 1, activation = 'sigmoid))


How to push UIViewController with replaced UINavigationController

Question: I have a custom UINavigationController that draws a custom background. That navigation controller is already set when accessing self.navigationController on the root view controller. Now what I'd like to do is to push a new view controller but replace the navigation controller in the new view controller to a default one (without the custom background).
Basically the new view controller is presenting an image with the navigation bar being translucent. Because it reuses the navigation controller (with the custom background) from the root view controller, the end effect is translucent navigation bar with custom background.
I know I could replace the navigation bar when presenting the new view controller as a modal view. But can I replace it when pushing the new view controller?
I tried something like this but this code has no effect:
LTImageViewController* controller = [[LTImageViewController alloc] init];
UINavigationController* navController = [[UINavigationController alloc] initWithRootViewController:self];
[navController pushViewController:controller animated:YES];

Answer: You can't just push a view controller onto any old navigation controller's stack. (Well, you can, but you won't get very far.) The nav controller should be the root view controller for the app's window. If you want to use your custom navigation controller, you should replace the existing navigation controller with your custom version. You'd do something like:
AppDelegate *appDelegate = [[UIApplication sharedApplication] delegate];
delegate.window.rootViewController = [[MyCustomNavController alloc] init];

Comment: It sorts of work but the transition to the new view controller isn't being animated.
Answer: While pushing a view controller in UINavigationController it creates an stack, and i think we can not push an navigation controller in another.
You can do one thing show your viewController modally and change the TransitionStyle to UIModalTransitionStyleCoverVertical
Might Help
Answer: If your problem is just the style/color/image of your navigationBar, in the viewWillAppear: of your viewControllers you can just set:
 [self.navigationController.navigationBar setBackgroundImage:yourImage
                                               forBarMetrics:UIBarMetricsDefault];


Can I displace a king in Mount and Blade warband?

Question: I just thought is there a way to displace a king, and get rid of him, so that I can take his place? I have conquered almost whole map, and I own only a few castles and cites, so I wouldn't like to leave the faction. However, I would want to do this without losing the lands I have conquered. Is there any way to do this?
Answer: There is no way to replace the king with yourself, per se. However, there are two things you can do:
1) Continue to take castles and towns and always demand them to be awarded to you. Once of these times the king will refuse. At that point, you will be given a choice to revolt. Do that and all your towns/castles/villages become your own faction and you - the king. Your former king will declare a war on you, but hopefully you are a big boy by now and can handle him :)
2) Find the claimant for your king's faction (he will say he is the true king). Offer to support his claim. You may have to do a couple of quests, I don't quite remember. But the end result is the same - you revolt against the king and your possessions become your own kingdom. The difference from #1 is that it will be much easier to recruit new lords. You will automatically have high "right to rule" rating and an option in the dialog with the lords (of that faction) to ask them to join your faction.
Answer: Sadly, there is no way in the vanilla game to do this.
I highly recommend you trying out some mods for the game, my personal favorite is "Floris Mod pack", which allows for exactly this (and a lot of other stuff, too).


"Dear students" and "dear colleagues"

Question: When addressing students, can I use "dear students" instead of "ladies and gentlemen"? Likewise, can I address my colleagues as "dear colleagues"? If not, what is a valid alternative?
Comment: Speaking or writing?
Answer: I think the decision to use "students" or "colleagues" after "dear" depends on the relative position of the addresser and the addressee(s). For example, as a professor, speaking from a position of authority over the students, it wouldn't be considered too gauche to use "dear students" while a student addressing his follow students might use "dear colleagues." It is worth noting that the use of "colleagues" among students has a somewhat formal feel to it--something to take into consideration when setting the tone of the message.
Answer: The question seems to be broad and it typically depends on an individual's relation with the group that s/he is addressing. Also, are you talking about addressing them in an email or in speech from a soapbox?
To many, the word dear is a bit intimate and connotes a personal relationship (BBC). In emails, dear is less frequently seen (I have seen mails quite straightforward, starting with 'Hello' or a bit informal 'Hi').
Having said this, putting 'dear' makes it a bit more personal. If you are addressing them in your speech, there are many options considering your kinship with students or whosoever they are.
The transformation, I think, is by dint of immense use of emails those are more like texts than letters. I'd personally prefer addressing the crowd using 'Hello' if I'm speaking for the first time. If the communication and relationship has been established, using Dear is okay. But again, as I said, this is what I understand and practice. Let others come up with their views.
A side note but worth mentioning: This question reminds me the lesson of 'Swami Vivekananda' being taught in my school days. In his speech in America, he addressed the audience with 'Sisters and brothers of America' and at these words, Vivekananda received a two-minute standing ovation from the crowd of seven thousand!
Good read about the usage of the word dear is here on CNN.

"Dear students" and "dear colleagues"


Using an SVG feDisplacementMap filter, how do I anti-alias?

Question: When using an feDisplacementMap svg filter, my smooth svg lines are getting all jagged. I could probably render it large and then shrink it down, but isn't SVG supposed to be able to anti-alias?
Answer: SVG filters process inputs at the pixel level, not the vector level. As far as an SVG filter is concerned, it's been handed a big rectangle of RGBA pixels to work with. Results from a displacement map can look pixelated because a filter has no idea where the edges that have been displaced are - it's all just pixels as far as it is concerned. (The old semi-transparent pixels that used to be the anti-aliasing have been displaced as well.) However, sometimes you can add another filter or two to solve any problem that this creates. Creative ways to solve this problem:

Take the post-displacement graphic, blur it with a radius of a few pixels then blend the blur back into the original graphic.

Take the post-displacement graphic, do a luminance to alpha conversion, then use that alpha map with a diffuse lighting effect to add a fake anti-alias lighting effect.

Use a convolvematrix with edge detection values to extract edges from the graphic, blur that result and blend it back into the source graphic.

Depending on your graphic, you might be able to use an erode or dilate filter, but that tends to produce boxy highlights and might not work. And of course, you can always tweak your input in SVG (using stroke effects) to "pre-antialias" your source graphic so the result doesn't look so odd.
Answer: Okay, so I figured out the answer to my own question: the filterRes attribute: http://www.w3.org/TR/SVG/filters.html#FilterElementFilterResAttribute
In my testing, on Chrome, increasing the filterRes slows things down pretty dramatically.


Are "The Carnival of the Animals" and "Danse Macabre" the same piece?

Question: I wonder if "The Carnival of the Animals" and "Danse Macabre" are the same piece? Why are they named differently?
Answer: The 12th movement of the suite "The Carnival of the Animals", Fossils, is copied partly from the "Danse Macabre", a piece previously written by Saint-Saëns.
It quotes the theme of Dance Macabre in a humorous way, and also several other tunes including "Au Clair de la Lune" and "Ah! Vous d'irai-je, Maman" (the tune  English-speakers know as "Twinkle, Twinkle, Little Star" or  "The ABC Song").
Comment: Is "Fossils" then a pun on reusing all those old tunes?
Comment: @MichaelCurtis It's a joke, but not a pun.


What's that U shaped metal thing needed for tuning called?

Question: There is this metal thing shaped as a 'U'; you hit it against something and put it against your ear to hear this sound. I'm not sure what it's called but I need it to tune the A string on my violin.
Answer: It's a tuning fork:

(image taken from the Thomann website)
Comment: @enkryptor, looks like _camertone_ looks like an English-ized spelling of a foreign word for tuning fork.  There is _камертон_ in Russian and maybe _Kammerton_ in German.  I'd never heard the word, so thanks for bringing it up.
Comment: also a "camertone"?
Answer: If it's U shaped it won't work. It needs to be Y shaped, so the handle can be held without damping the tines. Hold the handle onto something like the violin body, and the sound will be amplified. It's usually called a tuning fork, although a couple of my students call it a pitchfork, which, actually, it could be...
Comment: The point is that the vibration travels into your skull and hit your ear drums. You bite using your front teeth right in front of the ball. The major advantage is I can flick it with a finger and immediately tune using a bow on a violin. It's actually much more useful than it sounds.
Answer: I guess it is also called a diapason.
Comment: Albeit the word exists in English, does it really mean tuning fork in English? Or is this just the case in Romance languages like French, Spanish and Italian?

What’s that U shaped metal thing needed for tuning called?


Installing Nvidia Drivers Breaks Computer

Question: After I installed the Nvidia drivers my screen resolution dropped and I can't log in. When I try logging in my screen thinks for a bit, turns black with the message /drv/sda2: clean, X/Q files, Y/Z blocks (x, y, q, z are big numbers) and then just returns to the login screen. How do I fix this? I made sure to install the correct drivers, I've tried this three separate times but I keep getting this issue. I have a GTX 690, and I couldn't find any questions with a similar issue.
Answer: Try ctrl+alt+f1 before logging in graphically. It will bring up a terminal. In that terminal after you type your login name and password type startx and it should display any errors causing you not to be able to log in. If you are able to log in I would definitely consider opening up synaptic and reinstalling your Nvidia driver. sudo dpkg --configure -a (configure pending packages) at the terminal before login might help in this case as well.
Answer:
restart your computer
enter into recovery mode
terminal will open, enter your credentials
just run:
      sudo apt-get remove --purge nvidia*
      sudo apt-get install ubuntu-desktop
      sudo apt-get autoremove
      sudo rm /etc/X11/xorg.conf
      echo "nouveau" | sudo tee -a /etc/modules
      sudo reboot

Comment: add this command to step 4: "mount -o rw,remount / " before the apt-get remove command


Can you insert into sorted list with time O(1)?

Question: Wondering if this was possible. If I have a sorted list, can I find the right spot for an integer and insert it, all in O(1) time? The only way I can think to do this is via having a MASSIVE hashmap with one slot for each possible integer. 2 billion different integers * 4 bytes per integer = 8 gigabytes....but it'd technically work. There has to be a better way to do this though, right?
Comment: Your title only says "sorted list" but to do it O(1) requires "sorted list of (bounded) integers" e.g. 32b/64b/etc. You can't do this for unbounded integers (or floats, strings, arbitrary objects).
Answer: Sounds like you want a solution for bounded integers, 32-bit for example. If so, any sorted dictionary whose complexity depends on the key length only will do what you want. Two examples are binary trie and van Emde Boas tree.
Answer: One way to convince yourself it is not possible is to consider what it would enable. Assume there exists an O(1) algorithm for insertion into an unbounded sorted array, CONST_INSERT. Then we can define a O(n) sorting algorithm as follows:

Let $L$ be an empty list $()$ and $U = (u_1, u_2, \ldots u_n)$ be an unsorted list.
Iterate over $i: 1 \rightarrow n$, inserting $u_i$ into $L$ using CONST_INSERT

This produces a sorted array, since at the end of every iteration $i$, $L$ will be exactly a sorted list of $(u_1 \ldots u_i)$. And it will have a runtime of O(n).
From a practical perspective, if an O(n) sorting algorithm existed it would be very useful, so you'd likely know about it. From a theory perspective, resources like this
might help you convince yourself that no such sorting algorithm could exist.
Comment: OP specifically mentioned that sorting is done for 4-byte integers. Comparison-based sorting lower bound doesn't apply here.
Comment: That's a good point, and it looks like your answer is a good overview of the things applicable to the bounded case.
Answer: One thing before I explain: HashMap doesn't use an array that big, it uses chaining, which is another concept you'll have to look up. And if you're talking about creating an array size 2 billion, that still won't work because you still have to scan the 2 billion entries in the array. Ok, technically that's O(1), but only because O(2 billion) is counted as O(1).
I actually wondered about this for a long time. If you think about it, there is no possible way even with the HashMap. Before I get into why HashMap doesn't work, if you don't use a HashMap, you'll have to scan the whole size that you have to insert. Now to the HashMap part, after inserting you're number, you'll have to update every entry after that. And if you don't, you'll get an O(1) insertion once, but after that you'll get wrong insertions.


Preseed Ubuntu18 partition doesn't work UEFI

Question:
I am setting up dual boot, Windows and Ubuntu 18.04, for our computer labs (more than 40 computers).
We successfully set this up with an auto installer before. We re-image the machines with MDT and there is a task sequence to provide an empty partition for linux to use.
In the past the preseed file we made succesfully found that partition and used the max amount of space available.
We have all new computers now that HAVE to be run as UEFI. (No way around this long story).
I ran the auto installer I built and it didn't work. So I realized that I now have to reference the kickstarter and preseed file from grub.cfg and no longer txt.cfg. That worked!
There is only one thing that is NOT working and is perplexing me:
TLDR The partition options in the preseed for finding the max free space aren't working. Instead it gobbles up the entire disk drive for linux. :(
Link to my preseed: http://ada.evergreen.edu/~tc_michelle/anbrew.seed
d-i partman-auto/method string regular
d-i partman-lvm/device_remove_lvm boolean true
d-i partman-md/device_remove_md boolean true
d-i partman-lvm/confirm boolean true
d-i partman-auto/init_automatically_partition select biggest_free
d-i partman-lvm/confirm_nooverwrite boolean true
d-i partman-auto/choose_recipe select atomic
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
d-i partman-md/confirm boolean true
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
Answer: So I found out the culprit/s. I walked through the installation without a preseed and found out I needed to answer one more question:
d-i partman/unmount_active boolean false
I also commented out
d-i partman-auto/method string regular
It works :D


What are the pro and cons of working directly with a client versus through a consulting agency?

Question: Never have done any consulting or freelancing work I'm curious what the advantages and disadvantages are.  Obviously a consulting company takes a cut on your pay check and may provide some business connections that give your more consulting opportunities.  What other differences are there that need to be considered when deciding between these options?
Answer: Having worked both for myself only, and through an agency, I have decided that I enjoy both equally, but for different reasons
PROS of an AGENCY

Constant work
Less overhead on your end
No worry about taxes
Usually the contract with the client is dealt with professionally via the agency (including loopholes, extensions, pay, etc)
Sometimes, you get Worker's Compensation or other benefits paid for
Someone else can complete your work at the agency if you fall ill or cannot do the project yourself. This can sometimes also include support from other contractors without costing yourself extra money, just time.

CONS of an AGENCY

You are not your own boss
You may not be able to negotiate requirements for projects
Less money then dealing directly with the client
You may have an agreement where you are not allowed to pursue clients after leaving the agency

Now, for working for myself:
PROS of my own work

Negotiate directly with the customer
(this is especially good when I know the techinical limitations of myself, or the project they are asking for. Many agencies I worked for in the IT industry simply say YES to every request without concern of how long or difficult it may be, or will forget a major component)
More money
(this comes with more responsibility, as you need to know every last detail, including promise of delivery times, potential blocks in a project, and any extra costs that may come up with little notice)
Referrals
(many of my good clients refer me to their friends' businesses or spouses' businesses, and there is nothing to stop me from getting more clients. Word of mouth is the best form)
Comment: This is a good start, but I cannot emphasize enough that a (good) agency will handle a lot of the dirty work for you, as well as take on the risk.  Client not paying?  Not your problem.  You delivered exactly what they asked for and they're still unhappy?  Let your managers deal with that.
Answer: A big plus for working through consultancies/agencies is that they tend to have more regular payment terms in force, and because you have a contract with the agency rather than the end client, you can leave it to the agency to worry about whether the client is going to pay or not.
Answer: Agencies have much to offer, especially for someone seeking interim/casual work. However, as a Freelancer I value my independence...
One of the biggest CONS of working through an agency is the ambiguity about your status... especially your tax status - which will see you struggling to maintain "self-employed" status with the tax authorities.
Here in the UK there have been several attempts to bring agency workers into the remit of Pay-As-You-Earn (tax deducted at source). I could go on at length about these...
Likewise, at EU level, the Agency Workers Directive seeks to enshrine the same employment rights on agency workers as permanent staff. Which will lower the rate you are paid (someone has to pay for these "benefits"!)
Answer: One thing to keep in mind is what would happen should the consulting company go under or no longer send work to you. How would that affect you?
It may, psychologically, keep you in a better, constant state to work directly with clients as opposed to working through a consulting agency and having to scramble to do the administrative tasks that the consulting company normally took care of.


make player inable to deal damage to someone minecraft

Question: I made a mechanism where if you get hit, you get hit by lightning. However all the redstone freezes and stays on if you spam it. Because it test if you have stat.damageTaken and if it is 1 or higher it executes lightning at all players with score of one or higher. However I can't do <code>/scoreboard players reset @a isHit</code> fast enough because I need a delay for the lightning going away. However during the delay, a player can hit the other player again and spam it freezing the redstone. Is there away to make it reset instantly or make the player unable to hit for a few ticks? I prefer the 2nd one becuase it makes it less OP for a custom PVP map I am making
Answer: I think editing your redstone is ultimately a better solution, however if you do want to stop a player from being able to do damage, I believe using a high level Weakness status effect actually yields 0 damage:
<code>/effect @p 18 3 255 true
</code>
This should render the targeted player unable to do damage for 3 seconds (Change the 3 to any number of seconds as required) The true at the end also hides the particle effects, so it shouldn't be too noticeable to the player.
Structure of command:
<code>/effect <player> <effect> [seconds] [amplifier] [hideParticles]
</code>


How to add additional I2C sensor module on Arduino

Question: I have tried the GY-521 sensor on Arduino by using the guide from (http://playground.arduino.cc/Main/MPU-6050). It worked well. Can anyone guide me on how can I add another GY-521 module please? I am planning to use a total of four of them connected to my Arduino Uno. How do I define the additional sensor modules in the program?
Answer: The GY-521 sensor breakout is an I2C slave device. As long as you can obtain (or configure) the additional sensors as I2C slaves with different slave addresses, they would be controlled the same way as the first one, other than having separate communication initiation for each of the sensors, and then reading the data back from each sensor by its I2C address.
Unfortunately, the MPU-6050, the Motion Processing Unit IC in the GY-521, supports only two I2C slave addresses, so at best you would be able to find (or modify) break-out boards to support these two addresses (by the logic level applied to pin AD0 / pin 9 of the IC). If you actually need more than 2 devices at the same time, look at other similar devices and their corresponding breakout boards.
The physical wiring involves all the modules being connected in parallel on the same pins you have used already to control the first module, also known as an I2C bus. This would only work if only one of the modules has its pull-up resistors enabled. On the schematic for the module, these pull-up resistors are marked R4 and R5, 4.7 kiloOhms each.
On the GY-521 board shown in the link provided in the question, the pull-up resistors appear to be 2.2 k each, as seen below:

The actual board you have would need to be examined, to verify which specific little SMD parts are the pull-up resistors on it: Not too difficult to do, since they are tied to the SDA and SCL header pin pads.
On all but one of the sensor boards, you would need to de-solder those two resistors carefully, without messing with any other parts or other solder junctions on the board. If you are not accustomed to working with SMD components, it might be better to start by practicing on some scrap boards salvaged from condemned printers or other hardware, first.

It is a bit much to ask someone to write the code for you, but there are several Arduino tutorials on communicating with multiple I2C devices sharing a bus. Search on the same site you found the guide for this module.
Comment: @Robert Correct: You would have to set the AD0 line value for each of the modules from code, and then they'll respond to the two possible addresses. You will need two GPIO pins from the microcontroller for these two pins - or you could use resistors to pull-up the AD0 on one, and pull it down on the other. For wiring the I2C pins, just connect each module in parallel.
Comment: Hi Anindo, thank you for the reply. I have examined my boards and they are 2.2k resistors. Should I remove the resistors on my second board and link the second board to the first board? Or is there any other way without making physical alteration on the board, code modification maybe? I am sorry, I have never done the I2C communication before and I am confused. Moreover, I had difficulty in understanding your comments. Please kindly use simple  and English. Short sentences would help.

P.S. I never requested anyone to write the program for me. I just hope that someone would guide me on this.
Comment: @Robert For using just 2 of the modules, you can try without removing the pull-ups: That will cause a 1.1 k pull-up value on the SDA and SCL lines, which may work. You will also have to figure out changing the pin 9 connection on one of the boards, to change the device address: See the datasheet for the MPU-6050. Regarding simplifying my words: I'll try and edit the answer later, if you point out specific parts that are difficult. Thanks for the feedback.
Comment: Hi Anindo, from the datasheet I found out that the slave address of the sensor is 7 bits long. The logic level on pin AD0 of the 1st and 2nd sensor can be set as logic low and logic high respectively. While coding I can define as follows,

#define MPU6050_I2C_ADDRESS 0x68 //1st Sensor
#define MPU6050_I2C_ADDRESS_2 0x69 //2nd Sensor

Am I on the right track here?

I am still unsure about the physical wiring of the I2C bus. Can I connect them in parallel to the Arduino? I couldnt find info on this from the datasheet.

P.S. Long sentences can be shortened. Thank you.
Comment: Thank you Anindo. Can I just connect one of the ADO to the Vcc and short another one to the ground? Or do I need to use the resistors? What is the significance do the resistors make?
Comment: Dear Mr. Anindo Ghosh,

Millions of thanks to you. I have managed to make the two sensor modules work.
Comment: Dear Mr. Anindo, I have accepted your answer however I could not upvote your answer as I lack 'Reputation'.
Comment: re: SMD desoldering, for this particular case, wouldn't it be easier to just snip the resistors? or do you think you'd run an even greater risk of damaging things than with an iron?
Comment: @RobStarling That would depend on one's finesse with a snipping tool, as well as the quality of the PCB - lifted traces can be a nuisance sometimes.
Answer: Since you require four of these i2c modules, which only support two addresses (Based on the AD0 pin), you have four options.
The first is using multiple i2c buses on your Arduino. There are various software i2c implementations for Arduinos. These are software (or bitbanged) i2c code. They add overhead, but for most projects, should be just fine. These take up another two pins.
The second is using an i2c switch/multiplexer/bus/buffer chip. These chips either physically switch between two (or more) buses, or use buffers or other methods to allow multiple buses on one side to communicate on a single bus on the other side. Some use an extra input to switch, others are i2c devices themselves (you send an i2c message to do the switching).
The third and fourth are a bit different, and require a couple of free pins, and depends on the i2c chip you are using. Not all i2c chips will act the same to this. The third depends on the speed it takes to restart from a power loss, or if it takes a while to calibrate. This would be switching the power off to one of the modules. Any small signal transistor or mosfet would work for this. Since the mpu-6050 has a recommended power up procedure (VDD then VLogic) this might not be the best.
The final option, the ad0 pins on the four modules can be tied to four free gpio on the arduino, and then you can switch the ad0 so that only one of the i2c devices has the unique address at a time. Three would have the same 0x68 address (AD0 Low), the fourth would have 0x69 (AD0 High), read the sensor, then switch it so the third has the 0x69 address, read it, rinse lather repeat. This adds just a little code to your project while requiring no extra parts. This might not work if you do it too fast, or if the ic does not like the AD0 pin being switched after power up, but it's the cheapest and simplest way.
Comment: Option 3b) use 2 transistors in place of each one, to switch the i2c lines rather than power. Would that work? What about just SDA, if you remove almost all pullups on SCLs?
Answer: I don't think you can add 4 identical I2C devices as their bus device IDs will be the same. Why would you need 4 accelerometers - one gives you all axis' of movement?
Comment: Thank you for the reply. I am building a lower limb exoskeleton. I am placing 2 of the sensor module on one leg, thigh and shin. The other twos are placed on the other leg to get feedback as I control the motors.
Comment: Actually, for most devices you *can* place more than one of them on the same I2C bus. Only part of the address is hard-coded in the device. A few bits are settable via external pins.


what version of OpenNTF Domino API can I use?

Question: I would like to use the OpenNTF Domino API but to me it is not clear which version I can use?
The version of the extension library on the Domino server is 9.0.1.v00_00_20151122-0905 (upgrade pack 1).
Answer: If you're using Domino 9.0.1 Feature Pack 8, then 4.0.0 is the way to go. Otherwise, 3.2.1 is the right one.
The plan is for 3.2.x to get critical fixes (which is what 3.2.1 itself was over 3.2.0) but otherwise remain as-is, while future development will happen on the 4.x+ Java 8 path.
Comment: Hej! I read for version 3.x : This release requires Domino 9.0.1 and the REST API specifically requires the Extension Library 9.0.1_17 or higher. I suppose match that, thank you. (not using the rest api)
Answer: The version of ODA will depend primarily on the Domino server version. It sounds like you're running Domino 8.5.3 and we've not specifically developed against that version. There was a lot of new functionality added in 9.0, specifically around NoteCollections, which is spread throughout the API. I did compile a version some years ago for 8.5.3, but it was never heavily tested or officially released. The server in question was upgraded to 9.0 before the project went live, so I'm not sure if I even have that version any more.
Version 4.0.0 is the first specifically compiled for 9.0.1 FP8 and will not work on previous versions. That's because it includes the new core Domino APIs (encryption, ID Vault etc) added with FP8. It's not currently compiled for Java 8, but work on that has already begun in the develop branch.
Version 3.2.1 is the recommended version for 9.0.1 up to FP7. It will still work on FP8, but only if there is no intention of using the new Domino APIs added with FP8. It will work with the base Extension Library as long as the Graph API REST functionality isn't required (not a regular requirement at this time), for which ExtLib 9.0.1_v00_17 is required. That's because additional hooks were added to the core Domino REST service functionality in ExtLib.
For any general discussion about ODA, there is an OpenNTF Domino API channel in the OpenNTF Slack. The OpenNTF Slack team can be joined from the main OpenNTF website home page.


What is the TextBox's touch event in Silverlight?

Question: I'm working on a Silverlight 5 application, which is supposed to be deployed on a touch-screen interface. The Button click events are raised correctly on the touch screen as far as I know (I do not have access to a touch screen).
But, what event is raised on touching a SL5 Textbox? The Textbox does not have a click event.
Also, what event in raised on touching a textblock?
Answer: You can use MouseLeftButtonDown event.


How do I tell if my Godox trigger or flash needs a firmware update?

Question: I'm having an issue with my Godox gear, and I often see people referring to updating the Godox firmware. But I'm not sure how to tell if my Godox gear needs to be updated to fix my issue.  How do I find out?
Comment: I need insurance because there is no way to ensure that I'll get the most up-to-date firmware.
Comment: If it is anything like Yongnuo, and if it is working at all at any basic level, the answer is, "If it ain't broke, don't fix it!" On a more serious note, good info in both of these questions/answers.
Comment: Will there be a third installment regarding "How do I insure that the Godex/Flashpoint gear I purchase already has the latest firmware installed?
Comment: @MichaelClark, Why would you need to buy insurance for that? :)  I _am_ trying to figure out an on-topic way to do the "how do I update yongnuo/godox firmware on a mac?" question but haven't yet contrived it so it won't be closed or migrated to Ask Different, where they'll just tell you to use WineBottler, which won't work (non-standard USB driver). My brain feels fuzzy. I may have to take it to meta or just drop the idea.
Comment: @MichaelClark, you wanna handle the "can't trigger my Godox flash" x/y question where y is not distinguishing optical slave mode from radio slave mode?
Answer: There are three steps to determine this.

Find out what firmware version you're currently using:

Devices with a MENU button (other than the AD200/AD200 Pro), press the MENU button.
A1: Hold down the SET button while turning on the trigger.
AD200: Hold down the MODE button while turning on the strobe.
AD360 II: Hold the Zm/C.Fn button to enter the custom function menu.
TT350 / V350: Hold down the MODE button while turning on the flash.
TT685 / TT685 II / V860 II / V860 III: Hold the Zm/C.Fn button to enter the custom function menu.
X1T transmitter: Hold down the MODE button while turning on the trigger.
X1R receiver: Hold down the GR button while turning on the unit.

Find out what the latest version of the firmware for your device is and what it does, by going to the Godox firmware webpage. The Godox page lists the current version of each firmware image, its release date, and (kinda) describe what it does. If you're interested in what earlier versions do, you must download the .rar archive of the firmware download, and extract the PDF file inside, which has the entire version history in both Chinese and English.

Decide for yourself if you need the update or not. This may hinge on how you interpret the sometimes cryptic (translated) descriptions of the functionality that was fixed or added in the Godox documentation.  So, doing a bit of research on messageboards for reports of whether the firmware update does what you think it does may also be in order.

See also:

How do I troubleshoot my Godox firmware updating process?
How can I update the firmware on my Godox gear on a Mac (OSX) or Linux computer?
Comment: @xiota, why do you think I wrote this puppy!? :D  _I_ needed some way to look it up!
Comment: I *knew* I had to hold down a button while turning it on, but couldn't figure out *which* one.


Sensor Fusion under translational movement

Question: There are many sensor fusion algorithms available like the complementary filter or the EKF. They all do a decent job for rotational movement attitude estimation, but what happen when I have a translational movement? For example the complementary filter does rely on the accelerometer alone when there is slow angular movement, which is the case for translational movement (no angular movement at all). So, the estimated angle is wrong and I get a deviation from the real position. Is there anything I can do to avoid this drift? Would a Kalmanfilter compensate for that? If we take as an example a quadcopter, where often a complementary filter is used. How does they avoid this drift? There is a lot of translational movement in this kind of application.
Comment: Sensor fusion implies multiple relevant sensors. Clearly, gyro and magnetometer are irelevant, so what other sensors are you fusing with the accelerometer?
Comment: Only the Gyrometer.
Comment: Then you don't have sensor fusion as far as translation is concerned. Now you could add gps...
Comment: Ok, you are right, so is there nothing one can do about it? So also the Kalman Filter will fail? The only minimization of this drift can  be done my minimizing the influence of the accelerometer, right?
Comment: You can do something about it - add another sensor or another source of translational position. The Kalman filter will do the best job it can with what it's got. If that's only the accelerometer, it'll drift like the accelerometer. If you give it a gps position once a second or once a week, or some other fix, it can fuse these with the accelerometer and do better.
Answer: It is as @Brian Drummond said. 'Fusion' implies that you have multiple sources of data to combine. This isn't just limited to sensors. Anything that gives data about your system will do.
For sensor fusion you always need a model, aka some assumption about your system. However, this only works if the desired state is observable. Consider these two examples:
If you attach an accelerometer to a 1d pendulum
$$m\ddot{x} = -kx+u~~\text{and}~~h(x,\dot{x},\ddot{x}) = \ddot{x}$$
 you can reconstruct $x(t)$ based on $h(\cdot),u(t)$ readings, because all states are observable. In this case a Kalmanfilter can compensate and the position error $e_x(t)\to 0$ for $t\to\infty$.
On the other hand, if you put the accelerometer on a freely movable 1D point-mass
$$m\ddot{x} = u~~\text{and}~~h(x,\dot{x},\ddot{x}) = \ddot{x}$$
you can only get information about $\ddot{x}$, but $\dot{x}$ and $x$ are not observable. Now it is impossible for a Kalmanfilter (or any other observer) to reconstruct $x$. You can still integrate acceleration, but the error will only increase for $t\to\infty$. This is also known as dead reckoning. If you wanted to track this system you need to directly measure $x$. If you do, you are able to stop measuring $\ddot{x}$ and still reconstruct the entire state.
The same principle holds for a quadcopter. Depending on the observability of the position it may or may not be possible to get a precise position estimate. Thus, quadcopters often measure position directly and mainly use accelerometers to increase precision.
Comment: The answer can be improved by giving or defining a sample filter (e.g. Acceleration & gps pos; or airspeed and lateral acceleration, etc).
Comment: @GürkanÇetin What filter do you have in mind? They are rather problem specific. The OP don't give enough specifics to nail it down and I don't want to bload the answer unnecessary.
Comment: I don't have particular filters in mind. At second thought, you're right that the question does not mandate a solid example.


Is it possible to query raster from ArcGIS Server 10.1 REST?

Question: I have a map service that contains a SDE raster layer and served out by ArcGIS Server 10.1. Is it possible and how to query through REST service on the raster layer? Basically what I want to do is to query the pixel value for the given x, y coordinates. Didn't find any example to do it.
Comment: Have you tried using the Identify service? That usually works for me.
Answer: You can use the Identify Operation on the Mapservice to get the pixel values from the raster.
Using the Identify Operation on a map service with Rasters, I can get both the Pixel value, as well as the stretched values:
Answer: If you want more control over the request that the Identify tool does. You can monitor your network traffic (for example with Google Chrome if you do the identify from the browser) and see the request that is sent to your service when an Identify is done.


Good example of a multi-column form

Question: What is a good example(s) of such a form? I know that the general rule is to stick to the single-column pattern, but in my opinion, many of such "rules" come from people working on relatively simple websites. And too often, the reference is a registration/purchase form.
I am thinking about business apps where users are using the form repeatedly.
Comment: Can you provide any more information, for instance, what problem you are trying to solve? Rather than dismiss single column forms (for which there is a lot of evidence) why are you so keen to create a multi-column form?
Answer: I will insist on the good practice that you seem to already know which is to stick to a single column pattern. If there is a high volume of information that you need from your users in the context of a business app, then consider extending the form on multiple pages with a clear indication of completion progress.
Answer: The guideline for single-column forms is indeed being abused much too often. As you mention it relates primarily to single-use, data entry-only forms, like registration forms (although most consumer data collection use cases will also fit). They prioritize things like intuitiveness for the novice/occasional user and a clear path to completion with minimum friction. In the context of complex, productivity-oriented web apps, where forms are needed to display information more often than to update it, multi-column forms are not only acceptable, but are a much better solution vs a very long single-column form. The classic example are CRM and ERP applications, but pretty much any sufficiently complex web app will reach this point pretty soon.
This is from Salesforce:

This is from SAP Fiori:

ServiceNow:

Good example of a multi-column form


Spy story with a sci-fi element

Question: The story was about an American spy on the track of (probably) some Russian spies. For some reason he had a device that enabled him to go backward (forward?) in time by a few minutes. I'm pretty sure that the film was made in America and I think I saw it in either the mid 1960's or (at the latest) the early 1970's. I checked out the following wiki page and at first thought it might have been  "Agent for H.A.R.M." (using the logic sci-fi film involving spies) but this proved fruitless.
Comment: I saw a film called Agent for H.A.R.M once- well ,actually it was shown and mocked on MST3K- there was nothing in the film itself about time travel, though.
Comment: @Obie2.0 Look like it, and Jeffrey Hunter certainly rings true as one of the spies.
Answer: Could this be Dimension 5?
The spy protagonist has a time travel device:

What happened? What was that device? Did he teleport? No, in fact he
  time-traveled. Which is later explained as travel to another
  dimension, "the fifth dimension." Not explained: why they skipped the
  fourth dimension, or how dimensional travel equals time travel.

It was made in 1966, so it fits your timeframe.
The enemy spies were from Southeast Asia, I think, not Russia.

Spy story with a sci-fi element


Excel services cannot open workbook

Question: I am trying to open a workbook (excel 2010) in sharepoint 2010 with Excel services on the server. No matter what workbook I try to open (even if I create one from scratch) the "OpenWorkbookForEditing" method of excel services fails with "The workbook that you selected cannot be opened. The workbook may be in an unsupported file format, or it may be corrupt."
I have googled the daylights out of this and all the answers on the web dont seem to fit. I have reset IIS, I have removed all secuirty settings in the trust centre of excel, I have tried .xls, .xlsx, .xlsm files, I have made sure the excel file is in a trusted location in SharePoint.
I am completely baffled by this.
<code>        SPListItem newListItem = SPContext.Current.Web.GetListItem(SPContext.Current.Web.Lists[Constants.SharePointListName.TemporaryFileLibrary].RootFolder.ServerRelativeUrl + "/" + SPContext.Current.Web.Properties[SPContext.Current.Web.CurrentUser.LoginName].ToString());

        Microsoft.Office.Excel.Server.WebServices.ExcelService cli = new Microsoft.Office.Excel.Server.WebServices.ExcelService();
        Microsoft.Office.Excel.Server.WebServices.Status[] status;

        // Open the workbook. - THIS IS THE POINT OF FAILURE.
        string sessionId = cli.OpenWorkbookForEditing(SPContext.Current.Web.Url + "/" + newListItem.File.Url, "", "", out status);
</code>
Answer: Try logging the value of:
<code> SPContext.Current.Web.Url + "/" + newListItem.File.Url
</code>
It may be that this is not an excel file.
Answer: Make sure that Excel services "Service Application Associations" for the web appplication is configured.
You can enable the feature at
Application Management->Web Applications ->Manage web applications->Select your web application->Service Connections

Excel services cannot open workbook


Unused E Visa for Indonesia

Question: My husband and I are traveling to Indonesia in July 2024. I applied for the eVisa yesterday and received it. But I did not realize that I had applied too early: the visa expires in May, two months before we will even go to Indonesia. I have reached out to the visa office via email, but I thought I would ask here to see if anyone has any input. Will this ruin our chances of another e-visa closer to our arrival?
Answer: No, you'll be fine.
As a rule, unused visas are not a problem, they don't count "against" you on future applications.
Comment: Thank you for your response. I had a feeling but just don't want to be caught off guard.
Comment: @SarahYoho Glad to help.  Please click the ✔ mark if this answered your question!

Unused E Visa for Indonesia


How can I get netrw to not move the cursor when I return to it

Question: When I open a directory in netrw by opening vim like vim ., it will show me a list of files in the current directory. If I find a file then press t it will open that file in a new tab, when I'm done, I'll close the file with :q, then the netrw tab will be shown again but my cursor will be at the top, not over the file I just opened. How do I get it to not move the cursor?
Comment: Following your description, my cursor stays on the same file
Comment: Have a look at [How to debug my vimrc](https://vi.stackexchange.com/q/2003/10604) and
[How to debug a mapping](https://vi.stackexchange.com/q/7722/10604) to make sure nothing is interfering
Comment: What version of vim/netrw are you on? I'm on 8.2/168. and I removed my .vim/.vimrc away and it still happens.
Comment: Personally with `8.2.4699` (netrw dates to 9th Feb 2021 according to header) I don't have the issue you describe; instead, the cursor stays on the file.
Answer: I had to add the following line in my .vimrc:
let g:netrw_fastbrowse = 2

When that variable is set to 2, it will not refresh the listing every time you enter the buffer, and so it will not position your cursor at the top of the screen.
Extra info:
I found within netrw there's an autocommand like this:
au BufEnter *  sil call s:LocalBrowse(expand("<amatch>"))

not sure what it's trying to do, but if I disable it, makes my cursor stay where I want it to be. So I wrote a file in ~/.vim/after/plugin/netrw.vim with this line:
au! FileExplorer BufEnter

while this works with starting vim like vim . it doesn't work when running something like :e . once inside vim. So the better solution is to set the variable above.


Can premature ejaculation be cleaned with a cloth?

Question: In the morning I cleaned premature ejaculation with a cloth because it was very small amount then I put my clothes on and did breakfast after breakfast I washed my private parts with water. Is it permissible to do it and if it is not are my clothes impure?
Answer: I am assuming that you are talking about madhiy that is at its place of excretion on the private part of the body, as the rules differ for other parts of the body or for clothes or land etc.
There is difference among the madhabs on whether it is valid to do istijmaar (wiping with a stone or cloth etc.) to remove madhiy. One view is that it is permissible which is based on analogy with wiping after using the toilet:

إذا ذهب أحدكم إلى الغائط، فليذهب معه بثلاثة أحجار يستطيب بهن، فإنها تجزئ عنه
When any of you goes to relieve himself, he should take with him three stones to cleans himself, for they will be enough for him.
— Sunan Abi Dawud

While the other view is that it is not valid because the Prophet ﷺ specifically commanded for it to be washed:

يغسل ذكره ويتوضأ
Wash your organ and perform ablution
— Muslim

Washing is also the preferable method, so resorting to it would be better and would also avoid the difference of opinion.
Comment: so my cloths are not najais because of precum
Comment: Any cloth which comes into contact with wet impurity becomes impure.


How do you put paint onto a paintbrush?

Question: By this, I don't mean that I can't paint blocks, but I can't figure out how to put paint onto a brush! What do I do?
Answer: You don't need to put paint onto a brush.
Simply equip and use it on the block or wall of your choice.
To paint blocks you need the brush , to paint walls you need the roller.
Maybe you just cant see the paint because its hard to notice.
Try mixing 2 paints of a kind together in the dye vat to get a "Deep paint".
Maybe you will notice it now.
Also certain blocks can't be painted.
Answer: With the paint brush or the paint roller equipped, you should automatically place paint, using the first paint can in your inventory, working from the top left. Two things to consider:
Ensure you are using the right tool
The paint roller is for background paint, the paint brush is for foreground paint. So if you try to use a roller on a chair, it will not work.
Ensure you are using the right paint for the job
Some tiles are to rich to contain paint. Others will take the paint, but display it very lightly. Buy yourself a Dye Vat from the Dye Trader, and use it to combine two of the same paint into its "deep paint" version. Deep paint not only looks a lot better, but is necessary to paint on things like stone and brick. The white, grey and black colours work without being turned into deep paint, and as such, do not currently have a deep counterpart.

How do you put paint onto a paintbrush?


What is the use of two power supplies in an opamp?

Question: I am learning about opamps. Now I want to experiment with them but the problem is with -Vee (that negative power supply). I felt like I couldn't design it so opted for ground instead of negative supply, as I heard about single supply. Now anyone please elaborate what is the use of two power supplies also the consequences of making the -ve supply as ground. My college course prefers IC 741 OPAMP.
Comment: [Reasons not to use a 741](https://electronics.stackexchange.com/questions/304521/reasons-not-to-use-a-741-op-amp/304522#304522). It's the circuit function that dictates whether to use a negative power supply and you haven't stated what that is.
Comment: Opamp doesn't know there is negative power or ground. It's ok to work either way if you know what the implications are
Comment: So that you can sense input and output below zero, or in the case of bad antiquated 741, sense and output down to zero.
Answer: The uA741 does NOT require dual supplies. It requires the ability to bias the operating point of the internal amplifiers between the power supply voltage and the easiest way to achieve that is with a dual supply. Look at the datasheet in section 7.2. Although the supply is shown as VCC+ and VCC- there is no Ground shown. The decision about where the ground point might be is complex and depends on both input bias and output load configuration. For example you could have a load that goes from output to VCC+ which would change the output current characteristics you would expect.
The biggest problem that new users have is that the 741 is actually a very high voltage op amp, so needs a 10 V (+/-5V) supply to meet the recommended operating conditions.
Notice in section 6.4 that the output swing is guaranteed to be 20 V peak to peak within a 30 V supply (+/-15V). The output amplitude relative to the supply is very restricted, especially as you put a greater load on the output.
The 741 is used in course material because it is easily analyzed: here is a typical DC analysis, but there are many, both AC and DC.
Answer: See this:

The ground line isn't normally connected to supply a 741. There's no pin for it. Thus the 741 cannot have a slightest idea what happens to be your ground potential compared to VEE line, it's happy if there's high enough voltage between VCC and VEE lines.
Let's assume your 741 does something useful and does it as we expect an opamp to work in its linear region. Then internal transistors Q3 and Q5 need proper operating voltage. It comes from Q1.
Let's assume UE=2V is enough, more is allowed but less than 2V isn't enough. As you surely know from the theory of the emitter follower, then U1 must be about 2,7V or more.
Let's assume your application needs that 741 must be fully operational even in case the +input is connected to ground or it gets a signal voltage which happens now and then be zero voltage above your ground potential. To keep 741 operational there's no other possiblity than to connect VEE line to negative voltage and it should be at least 2,7V below zero. If you must put negative signal voltages in the +input, then even more room is needed. -3V to +input forces to use VEE=-5,7V
If you want to get negative voltages or even zero from the output, you also need negative VEE.
Be informed that you can connect VEE to the ground, but then all input voltages must be far enough from zero. If the 2V minimum UE is true, then U1 must be at least 2,7V
The 2V limit is my coarse simplification to keep the numbers short, you can read from the datasheet how much lower VEE must be than the input.
ADD: You can easily find simple opamps (say 3704) that are advertised to work from a single positive supply. If you look at their interior schematics, you see that they have just mirror PNP input stages. There the voltage reserve is a must between the input and VCC line. Dual supply is still needed, if you want to have both + and - input or output voltages.
Rail to rail opamps use input circuits that do not need that voltage room between rail and input. They have fet outputs which can pull the output to both rails if needed.
Answer: The picture below shows what you need to think about when choosing the power rails for your op-amp: -

Most common op-amps (741 included) can't: -

Work with input voltages too close to the positive rail
Work with input voltages too close to the negative rail
Produce output voltages that are too close the the power rails

So, if your circuit application does not need to directly measure and produce voltages close to the power rails then the -Vs supply can be ground or 0 volts.
If your application is a DC amplifier whose input signal can be 0 volts to a reasonable positive value then you should either look for an op-amp whose common-mode-input-voltage-range includes the negative rail or provide a negative rail of 3 volts or more.
If the output has to also fall to close to the negative rail then you might consider a "rail-to-rail" output op-amp although there are still serious limitations of getting to within 10 mV of the negative rail. Again, this is solved by providing a small negative rail to the op-amp to give more headroom.
If your application is a DC amplifier whose input signal is bipolar around 0 volts then you would naturally choose a design that has a negative rail power supply. I'm sure there are some exceptions to this rule with some more specialist op-amps but the 741 is definitely not one of them.
Comment: +1 Your last paragraph explains the "why". In the olden days we worked mostly with signals that were bipolar, like audio.
Answer: The design of a 741 opamp is 50 years old (!) and its performance is very bad compared to newer opamps. Kiss it goodbye and bury it.
Maybe your college professor is 80 years old and has never seen a newer opamp's spec's?


UWP Bluetooth ConnectAsync error to Raspberry Pi. Element not found

Question: I'm making a Windows UWP app that uses RFCOMM to communicate to a Raspberry Pi. Both my Windows laptop and Raspberry Pi are already connected and paired (manually). I know the bluetooth address of the Raspberry Pi and the channel it's using and these values are hardcoded into the parameters for ConnectAsync(...).
When ConnectAsync(...) is called, the Raspberry Pi does receive a connection and it prints the line "accepted connection from ('Windows bluetooth address', 1). However, the exception "An exception of type 'System.Exception' occurred in mscorlib.ni.dll but was not handled in user code. Additional information: Element not found. (Exception from HRESULT: 0x80070490)" happens at where ConnectAsync(...) is called, and the message is never delivered to the Raspberry Pi.
Windows Code (as the client, trying to send message to the Raspberry Pi):
StreamSocket socket = new StreamSocket();
await socket.ConnectAsync(new HostName(bluetoothAddress), "1"); // the format of bluetoothAddress is 'AB:CD:AB:CD:AB:CD'

Stream streamOut = socket.OutputStream.AsStreamForWrite();
StreamWriter writer = new StreamWriter(streamOut);
await writer.WriteLineAsync(message);
await writer.FlushAsync();

Raspberry Pi (as Python Server):
import bluetooth

server_sock=bluetooth.BluetoothSocket( bluetooth.RFCOMM )

port = 1
server_sock.bind(("",port))
server_sock.listen(1)

client_sock,address = server_sock.accept()
print("Accepted connection from ",address)

data = client_sock.recv(1024)
print("received [%s]" % data)

When I replace the "1" in ConnectAsync(...) with bluetoothAddress, a 'Value does not fall within the expected range' exception appears.
Answer: The second parameter "remoteServiceName" of the method socket.ConnectAsync() should be RfcommDeviceService.ConnectionServiceName.
For more information you can reference Bluetooth RFCOMM chat sample.


Why am i not receiving bonus points for associating stackoverflow sites?

Question: I have joined in several stackoverflow sites but I am not receiving any association points automatically. I am not sure how to declare this points. Help me out please.
Comment: According to [Stack Overflow Blog - Cross-Site Account Associations](https://stackoverflow.blog/2009/07/08/cross-site-account-associations/), you need at least 200 reputation on one site to get the association bonus.
Comment: 1. Questions regarding the site itself belong on Meta, not here. 2. You need to have a lot of rep on another site first. I believe for Stack Overflow, once you have 1000 rep, you're considered trusted. I don't know if it's the same for all sites, but you'll definitely need more than the 6 rep that you have on Tex.
Comment: this is off topic for SO but you must be trusted on one site to receive an association bonus. For example, I earned 200 reputation points here then I got the bonus. When I joined other sites i got the bonus there too.
Comment: That's not a question related to that part of resource :)
Answer: You require a minimum of 200 reputation somewhere on the network.  If you have less, you will not receive the association bonus for creating new accounts on the network.
Remember, this is a measure of trust on the network.  Having 200 reputation is the barrier to cross when measuring that trust.  If you have less than that, you're not trusted on the network enough to justify letting you pass the basic limitations.
Comment: Thank you. That was helpful. But some other people said the same thing but on the comment. So how does this work? If I have a question about something, clearly I don't understand it properly. Why am I getting negative points?
Comment: @ImtiazAhmed Because it doesn't appear as if you had searched the site prior to posting this question; you can see it was marked as a duplicate of another question that was asked earlier.


4-wire to 5-wire thermostat conversion

Question: I'm installing a 5-wire smart thermostat replacing a 4-wire battery powered model.  I don't have 24v from the furnace, so I've installed a 24v transformer.  My furnace wires go to Green, Yellow, White, and Red on the old thermostat, I removed the red wire (left unconnected) and connected the transformer to Red and Common on the new transformer.  Everything seems to work but no fan, whether in Auto or Manual.  The R/RC jumper is connected.  So far, the tech help from manufacturer is useless.  Sound familiar to anyone?
Comment: Why not post a photo
Comment: Where did you install the new transformer?   Is it near the thermostat, hence easier to run new wires?
Comment: Perhaps you meant to write that you connected the new transformer to Red and Common on the new *thermostat*?
Comment: Pics of the wiring as well as actual brand/model of all the equipment or we're just making guesses in the dark like you are.
Answer: My first choice would be to use an "add-a-wire," "common maker," "wire saver," type accessory. These devices play electrical tricks to gain the functionality of having more wires. Compared to a second transformer they are much simpler to install correctly.
If you do prefer to use the second transformer there are a few things you'll need to know.

The usual 24 volt HVAC controls call one side of the transformer "C" (common) and the other side "R" (red). The thermostat operates the system by shorting white (heat), yellow (cool), or green (fan) to red. The thermostat works exactly like a familiar light switch: the furnace control is connected to common (aka neutral) and the thermostat switches on the power to cause the functions of the furnace/air conditioner to turn on. The thermostat certainly must be connected to the R wire in order to properly switch power from that wire onto W, Y, and G.
Transformers have a "phase." With a single transformer the phase doesn't matter, but when there are two transformers that will be operating together in a system, the phasing matters.

First things first: get the transformer phasing worked out. Disconnect the thermostat, then go to the furnace and connect the red wire to R and one of the other wires to C (this is only temporary). At the thermostat location connect the red wire to one of the terminals of the new transformer.
Switch on the power to the furnace and the new transformer. Measure the voltage between the second terminal of the new transformer and the temporary C wire from the furnace. If you measure just a few volts or less then the phasing is correct; if you measure something like 48-60 volts then the phasing is reversed. If the phasing is reversed, swap the positions of the red wire and the meter lead on the new transformer and measure again to confirm that the transformers are within a few volts of each other.
With the transformer phasing worked out you can connect the new thermostat. Return to the furnace, remove the temporary C connection, and connect the white, yellow, and green wires in the usual way. Connect the new thermostat to the white, yellow, and green wires also.
The last step is to bring the shared/common R and the local C from the new transformer to the thermostat. Note that the R from the furnace remains connected to one terminal of the new transformer, and also connects to the R/Rh terminals of the thermostat. The second terminal of the new transformer connects to the thermostat C terminal.

4-wire to 5-wire thermostat conversion


How to disable automatic inclusion of nodes into a node frame?

Question: When putting a node near a frame node Blender will sometimes automatically include the node into the frame. I find that behavior to be quite annoying, is there a way to disable it?
Comment: There is no "near a frame node" here. When you drag and drop a node over frame, the position of the mouse pointer determines whether the node is embedded in the frame or not.
Comment: @quellenform might be possible, though probably too much work: you need to program in resizing the frame, auto-resize if you want it, saving to/loading from a file... And still you can't easily share it in this form. \@tempdev - I don't think so, checked the attributes of a frame just now, and I didn't see any option not accessible from the interface. There's also no event that you could capture and block for a particular frame.
Comment: https://github.com/blender/blender/blob/master/source/blender/editors/space_node/node_relationships.cc#L2208
Comment: Well you kind of can, with Python, a script where you would add "locked" frames, and it would very frequently check if the children of those frames changed, if so, it would unparent the children. The tricky part would be optimizing the script so it's not too slow for a lot of nodes/node trees...
Comment: @MarkusvonBroady I think I'm starting to understand what he's getting at.... Therefore, the question to the Python guru: Would it be theoretically possible to draw free forms that can be drawn independently of all nodes and behave similarly to frames (or exactly like frames, only that no nodes can be dropped in them)?
Comment: @MarkusvonBroady isn't it possible to simple disable the ability of a node frame to accept new nodes into it?
Answer:
When you drag and drop a node over a frame, the position of the mouse pointer determines whether the node is embedded in the frame or not.

Can I change this behavior in a solid way?
No. -> Source
Can I manipulate it with a hack that comes out with what do I know?
Somehow, see Markus's answer (He seems to have somehow managed once again to bend Blender completely with his Python skills)
Comment: @tempdevnova It looked like you knew this, but the answer can only be completed with a clear "no". How else would it be possible to put a node into a frame?
Comment: Yes I know that. I want to disable this feature, so that it never embeds it in the frame.
Comment: The only way you can disable this feature is to edit the source code responsible for this behavior. you can checkout the blender repository by doing a `git clone git://git.blender.org/blender.git` and edit the source file
[Source](https://github.com/blender/blender/blob/master/source/blender/editors/space_node/node_relationships.cc#L2208) then compile the blender program again. Here's more information https://wiki.blender.org/wiki/Tools/Git
Comment: @quellenform you can manually put a node inside a frame using CTRL P
Comment: @tempdevnova I like the idea too ;-)  ...I would suggest to implement this as an option in the settings and bring it into the source code of Blender. Then you (and others) have that switchable in the future.
Answer: Python
You can use the strategy from this answer:
Driver based on shading types/ change boolean when switching shading types
to constantly poll and check if bpy.ops.node.translate_attach was executed. If so, check if node selection stayed the same (very unlikely, since typically you change selection with an operator). If so, it's possible that you've just inserted a node into a frame, so check against the mapping you update whenever the above-mentioned checks fail.
import bpy
from bpy import context as C
from bpy.types import SpaceNodeEditor as SNE

last_selection = []
last_parenting = {}

def test():
    if not C.active_operator or C.active_operator.name != 'Move and Attach':
        update_last()
        return
    sel = C.selected_nodes
    if sel != last_selection:
        update_last()
        return
    if not sel:  # empty
        return
    # node_tree = C.annotation_data_owner
    node_tree = sel[0].id_data
    nodes = node_tree.nodes
    for node_name, old_parent in last_parenting.items():
        n = nodes[node_name]
        if old_parent is None:
            if n.parent:
                print("remove unwanted parent")
                n.parent = None
        elif n.parent.name != old_parent:
            # the node would move from a frame to a nested frame
            print("restore old parent")
            n.parent = nodes[old_parent]

def update_last():
    sel = C.selected_nodes[:]
    global last_parenting
    # `a and b` gives b if a is truthy
    last_parenting = {n.name: (n.parent and n.parent.name) for n in sel}
    global last_selection
    last_selection = sel

try:
    SNE.draw_handler_remove(SNE.my_handler, 'WINDOW')
except (AttributeError, ValueError):
    pass

SNE.my_handler = SNE.draw_handler_add(test, (), 'WINDOW', 'PRE_VIEW')

Note: You can still parent with ✲ CtrlP, since this shortcut runs a different operator bpy.ops.node.parent_set.


Duty cycle mapping

Question: I need to build a conversion/mapping algorithm from a controller (PID etc.) output to the duty cycle in order to command my bldc motor via esc. I couldn't do it yet because l think l dont know the meaning of controller output. Anybody highlights my way?
Answer: Usually you would use a PID controller's output as a "substitute" for your (the operator's) output. If you bypassed the PID controller, what signal would you be providing to the ESC? It is easiest to put the input to the PID controller and the feedback to the PID controller in the same units as you would like the output to be.
In your case, I would use a input and feedback as speeds in percent, then the output of the PID controller should be speed in percent, which is easy to provide in PWM form. If you try to compare speeds in km/hr or m/s or something else like that, then you wind up having to convert that speed into a percentage anyways because you don't send "2 m/s" to a speed controller, you send a speed setpoint - either in rpm or percentage. Again, whatever units the ESC is using are the units you should be using for your PID control.
Comment: How are you getting speed feedback? What units is the feedback in?
Comment: The ESC already has its own internal PID controller and it usually uses [back EMF](https://en.wikipedia.org/wiki/Counter-electromotive_force) as speed feedback. So, do you need motor feedback? Yes and no; I'm not sure what your application is. If you are trying to do process control, assuming some variable load after the motor, then you *will* need motor feedback, but if you're trying to do something like a quadcopter, then you should have a stability/flight controller that gives you a reference speed that you can pass directly to the ESC.
Comment: You are correct in that, if you do need feedback, it will be in RPM or rad/s or some other rotational speed units, in which case you will need to calibrate your feedback. In general, though, I believe that if you multiply the [kV rating by the nominal battery voltage](http://www.rcgroups.com/forums/showthread.php?t=588177) you get the motor's top speed in RPM. Using this value as a max, whatever you get from feedback can give you a percentage, which is equivalent to the duty cycle.

Duty cycle mapping


70's tic-tac-toe 'like' game with a pendulum

Question: I remember receiving a game in the early 70's for Christmas that came in a pretty big box (about 18"-24" square). There was a pole that had a tether-ball with about a foot of cord and a ball that was smaller than a pool ball. The center of the base there was a plastic 'holder' that contained a 3x3 matrix of blocks. Each block had an 'X' or an 'O' (like in tic-tac-toe). You would swing the tether ball and attempt to knock a block from the center- thus getting the spot for your 'X' or 'O'. Maybe Vincent Price was pictured on the cover of the box- not sure. Anyone else remember this game?
Comment: Could you be misremembering it as Vincent Price, the horror actor, when it said Fisher-Price, the toy and game company?
Answer: There is a a game from 1972 called Skittle tac toe with two attached pictures (taken from the same BBG link):
The guy on the cover is Don Adams (Get Smart - credit to geneo) and there is a video commercial about the game as well.
https://youtu.be/LiLogFT0pI8?si=LQG1FU25pWTcxs7g
Comment: Nice find. FWIW: That company made a series of Skittle games with various thematic scoring alternatives: https://flashbak.com/believedon-adams-pitch-man-skittle-games-50303/
Comment: WOW- that is the game. It is Don Adams (Get Smart) not Vincent Price. Thanks.
Answer: Sounds like a Table Skittles with a tac-tac-toe theme added on for scoring instead of more traditional scoring options.
The Skittles games come in a variety of configurations, some with 9 pins arranged in a 3x3 grid, so it wouldn't be a stretch to try to replace the knocked pins (or whatever) with a marker for tic-tac-toe.
Sample of one version with a 3x3 arrangement:

From
https://tomsk3000.com/product/1960s-table-skittles-game-by-chad-valley-england/


Benefits of random search over other optimization methods in Neural Network hyperparameter tuning

Question: When reading about methods of hyperparameter tuning of neural networks, I have mainly come across grid search and random search in textbooks and articles online. I was wondering why other optimization methods such as Simulated Annealing or Genetic Algorithms not used? Are there any benefits to random search over the others?
Answer: Other benefits of random search in addition to what Tim mentioned are

Trivially parallelizable -- if it takes two days to train your model, and the deadline is in 3 days, random search works perfectly fine. Other sequential search algorithms may not.
No "hyperhyperparameters" to tune, besides specifying search range. Many other hyperparameter search algorithms have hyperparameters themselves.
Answer: Random search it trivial to implement, that's why it is so popular. Moreover, there are mixed results on comparing efficiency of different hyperparameter tuning algorithms: in many cases more advanced approaches like Bayesian optimization (based on Gaussian process, or Tree Parzen Estimator) work better, but there are also results showing that random search gives comparable results, or is not much worse, especially if you double the number of iterations (for discussion see this blog entry by Kevin Jamieson and Ben Recht and this PyData Berlin 2018 talk by Thorben Jensen). Long story short, if you want something that is "not bad" for hyperparameter tuning, but you don't want to bother that much about technicalities, then random search is one of the possible choices.


PostgreSQL Limit Who Can Execute Explain Plans

Question: If you want the bloody details keep reading otherwise all I'm asking is if you can limit what users are able to run the EXPLAIN command on their SQL statements, something like GRANT EXPLAIN TO billy would be nice, but doesn't seem to exist.
My goal is to encrypt data in a column, index the encrypted column because it can be used on searches, and keep the encryption key hidden from all end users(can live with sys admins or DBA seeing it).  What are some ways to do this in PostgreSQL that would allow this?  And if there isn't a way to do all of this what things do you have in place to try to get there?  My current approach listed below almost gets me there, but when and explain plan is ran on the query the encryption key is exposed. Which is why I wonder if you can restrict access from users being able to use explain.
So here is a walk through of a little setup to demonstrate what I'm talking about.
Say I have some data encrypted in a column in a database table, this column will be searched on via the gui front-end screens or via pg_admin ad-hoc queries.
CREATE TABLE test(id serial,my_data TEXT);

--Fill table with enough data to need an index.
DO $$

DECLARE counter INTEGER := 0;
BEGIN
    WHILE(counter < 1000)
    LOOP
        EXECUTE 'INSERT INTO test(my_data)
                SELECT pgp_sym_encrypt(''avalue' || CAST(counter AS TEXT) || '''' || ', ''apasswordwithsomeentropy'',''compress-algo=1, cipher-algo=aes256'');';
        counter := counter + 1;
    END LOOP;
END$$;

ANALYZE test;

CREATE INDEX index1
  ON test
  USING btree
  (my_data);

This select will still have to do a full table scan, which I want to avoid.
SELECT id,
       my_data,
       pgp_sym_decrypt(cast(my_data as bytea),'apasswordwithsomeentropy')
FROM test
WHERE pgp_sym_decrypt(cast(my_data as bytea),'apasswordwithsomeentropy') = 'avalue114';

"Seq Scan on test  (cost=0.00..665.00 rows=61 width=246)"
"  Filter: (pgp_sym_decrypt((my_data)::bytea, 'apasswordwithsomeentropy'::text) = 'avalue114'::text)"

So what if I make use of a function index to speed this query up.  I use the get_password function to not have the index created with the password hard code in it. Remember I don't want users looking at index defs and seeing the password.  Assume the user can't select from password or execute get_password(), only a single account with extra privileges can. And the get_password() function is only used from in the function index.  So my understanding is the user doesn't need execute rights to the function?
CREATE TABLE password
(
  password_id serial NOT NULL,
  password_value text
);

INSERT INTO password(password_value)
SELECT 'apasswordwithsomeentropy';
from get_password();

CREATE FUNCTION get_password() RETURNS TEXT
    AS 'select password_value
   from password
  where password_id = 1'
    LANGUAGE SQL
    IMMUTABLE;

CREATE INDEX index2 ON test (pgp_sym_decrypt(cast(my_data as bytea),get_password()));

Now when I run the select the database uses index2 and I get the results back nice and fast as I wanted.  The problem is index2 shows the password in plane text when I execute an explain plan on the select query.
SELECT id,
       my_data,
       pgp_sym_decrypt(cast(my_data as bytea),'apasswordwithsomeentropy')
FROM test
WHERE pgp_sym_decrypt(cast(my_data as bytea),'apasswordwithsomeentropy') = 'avalue114';

"Bitmap Heap Scan on test  (cost=4.73..171.49 rows=61 width=246)"
"  Recheck Cond: (pgp_sym_decrypt((my_data)::bytea, 'apasswordwithsomeentropy'::text) = 'avalue114'::text)"
"  ->  Bitmap Index Scan on index2  (cost=0.00..4.72 rows=61 width=0)"
"        Index Cond: (pgp_sym_decrypt((my_data)::bytea, 'apasswordwithsomeentropy'::text) = 'avalue114'::text)"

The only thing I can think of is to create web services to the database that would keep a user from directly interacting with the database.  But being the app is in house it would be nice if some users could still make use of pg_admin on occasion, but not see everything such as explain plans.  These users would not know what an explain plan and won't ever use them.
I keep coming back to creating a web service that wraps all the queries they need to run in functions that are invoked via the web service, but that takes extra time to get released in a formal development environment and takes away the ad-hoc query approach and adds another layer to maintain.  Any ideas? Thanks
Comment: @Michael: no, not necessarily.  Instead of decrypting the field, you encrypt the search string - the encrypted field should match your encrypted search string, if you used the same algorithm.
Comment: I'm not sure what you're asking for. What benefit do you get indexing a column of encrypted data? You would have to decrypt the column to do any meaningful searches.
Comment: @StarShip3000: I didn't read your whole post.  Depending on the size of your field, have you considered existing hash algorithms (MD5/SHA), read up on salting.
Comment: @vol7ron Don't blame you I was wordy. Kinda of dumping my brain as I thought. Ah sure of course!  Create a function called search_test(ssn) and have that encrypt the input using the same key used to encrypt the data column. That allows the encrypted column to be index with a normal (non functional index).
Answer: On a side note you might want to change
SELECT id,
       my_data,
       pgp_sym_decrypt(cast(my_data as bytea),'apasswordwithsomeentropy')
FROM test
WHERE pgp_sym_decrypt(cast(my_data as bytea),'apasswordwithsomeentropy') = 'avalue114';

into
SELECT id,
       my_data,
       pgp_sym_decrypt(cast(my_data as bytea),'apasswordwithsomeentropy')
FROM test
WHERE pgp_sym_encrypt(cast('avalue114' as bytea),'apasswordwithsomeentropy') = my_data;

This way postgres does not need to decrypt every my_data for your comparison. If pgp_sym_encrypt is deterministic and can be cached(not sure if postgres can handle this), your target data is encrypted once and only matching columns will be decrypted.
We have changed the where condition so plan may change, can you please try and send the new plan?


Modeling/sculpting hand

Question: beginner doubt here!
I've been staring for this hand for a long time and have no idea how I could sculpt that.
Does anyone have any tips for me? I've been modeling for a really short time, so anything is helpful!
Thanks a lot in advance!!!
Comment: You'll easily find pictures of low-poly hands, but do you plan to animate? in that case don't model closed hands.
Comment: no, it's going to be static for a spark ar filter
Answer: You can use your pictures as references, create a plane and subdivide it:

Extrude it up, extrude the fingers:

Rotate the front face or use the Shear tool, then continue to extrude and rotate:

Begin to work on the thumb:

Give it a Subdivision Surface modifier, change the topology appropriately:

Modeling/sculpting hand


Can't find purchased apps in Kubuntu

Question: I installed Kubuntu 12.04 and am trying to install Humble Bundle through the software center which I installed with the software-center package. I see the games on the recently purchased list, they seem to download and install, but after they are installed, I don't see anything in my menu and there is no related executable anywhere in my /usr/bin.
Answer: With Kubuntu you first need to have the Ubuntu Software Center installed. Kubuntu uses the Muon Software Center which the Humble Indie Bundle packages are not tied to, however I found a way to get them into Kubuntu.
There is a couple of methods you can try.
The first methos is installing the Ubuntu Software Center in Kubuntu by means of opening a terminal and typing:
sudo apt-get install software-center --no-install-recommends

This will install the software center properly for you and you have to go to File -> Reinstall Previously Purchase Software and use the single sign on to get your list of software.
I posted another method on my personal blog which is way too long to post here but you can look at it by going here.

Can't find purchased apps in Kubuntu


Short story where women came from another planet in a stranded spaceship and killed the original Earth women. Men who discover this are quietly killed

Question: This is a short story where women came from another planet in a stranded spaceship, killed the original Earth women, mated with the men and remained in control up to modern times. Men who discover this are quietly killed.
Comment: For now, I'm going to guess you meant "short story" rather than "short history," but please do correct me if I'm wrong. And even if I'm right, it would still be good to clarify when you read this and when you think it might've been published.
Comment: @AndresGoens, Please use the green "tick" mark to accept the answer and indicate that it is "right".  If you haven't done so already you can also upvote their answer.
Comment: Hi, welcome to the site. Is this a short story? Novel? Film? Also, in roughly which year did you read/see this, and when do you think it might've been published/broadcast?
Comment: Guy Clara Diaz´ answer is the right one : the Misogynist by James Gunn
Answer: This sounds a lot like The Misogynist, a short story by James Gunn, first published in Galaxy in 1952.
It deals with a chat between two men in a bar, the unnamed narrator and his friend Harry. Harry expounds his theory that women are actually aliens:

"Did you ever stop to think" Harry said, "about what strange creatures
women really are?... It's not just a matter of superficial
differences, you see. It's something fundamental. Women think
differently, their methods are different, their goals are different.
So different, in fact, that they are entirely incomprehensible."
"How did it all start?" Harry asked. "And when? If I knew these
answers I would know everything. Did a race of mateless females
descend upon the Earth when man was still almost a cave-dwelling
animal? Or was it in historic times? My guess is they were dropped
here by their men. Jettisoned. Dumped.

Harry goes on to explain what happens to men who discover the truth:

If my surmises are true, why has no one else discovered it? And the
answer is – they have!"
"They have?" I repeated.
Harry nodded. "They would have to be done away with, of course.

some are sent to asylums, and other are quietly killed. A lady happens to overhear part of the conversation... and the next day Harry suffers a heart attack and dies. The narrator concludes by ruminating "Why, I asked myself one day, are there more widows than widowers?".
The full story is available at the Luminist archive.
Comment: Glad to help @AndresGoens !  Please remember to click on the check mark to "accept" my answer, so that people can see that the question has been answered.
Comment: Thanks so much Clara That is exactly the one I was trying to remember


Is there a site where I can see how much EOS is being unstaked over time?

Question: I'm looking for a chart that shows how much EOS is being unstaked over time. Say last week 5 million was being unstaked and then today, there is 10 million being unstaked. Is there a chart for this?
Answer: I don't think that anyone has made a chart like this so far. However it shouldn't be too difficult to create such a chart as all you have to do is monitor for the eosio::undelegate action using any history solution like dfuse.
Comment: i just want to confirm if there was more unstake actions right after Dan Lamier announced he was leaving block one.