In the fuel of atomic bombs when does neutron fission activity begin?

Question: Do scientists first initiate neutron activity within the subcritical masses of fuel in the lab, or are the masses already undergoing some kind of minor neutron detachment naturally, or finally, is there no neutron detachment at all until supercritical mass is achieved?
Comment: Atomic bombs are made up of radioactive elements like Uranium and Plutonium. These undergo spontaneous fission (fission is the mechanism that gives you energy+free neutrons for the chain reaction), so neutrons are actively produced even if you haven't reached criticality. That is why they are dangerous for your health (if they were sterile they wouldn't affect you in any way).
Comment: @SV: Please make that into an answer.
Comment: @SV - neutron doses can affect your health whether you are sterile or not. While moderated neutrons (thermal) are more dangerous than the unmoderated spectrum one would get from U or Pu, you still don't want to be around it.
Comment: @JonCuster hahaha I was talking about the elements being sterile in terms of radioactive, not people.
Comment: @BenCrowell I can't make it into a proper answer right now but I will later when I get a chance.
Answer: In nuclear bombs, initiators are typically used to produce initial neutrons, the initiators can be activated by a shock wave caused by conventional explosives.
Answer: Neutrons are introduced when the bomb is detonated.
The way it works is that (at least for a plutonium bomb), once the detonator is pressed, a very precisely machined and synchronized set of high explosives is set off around a plutonium core, which then compresses it to a density high enough to sustain the fission chain reaction (if the nuclei are too far apart, then the neutrons will not fission nuclei faster than they escape by [in a quantum sense] missing all the ones in the material). At the same time, a special neutron source, made just for this purpose, fires (this, again, needs ultra-precise timing as the shock wave from the chemical explosives is on its way and will soon destroy it) at the time the core is expected to achieve maximum density. These introduced neutrons then break up a few plutonium nuclei, releasing more and hence commencing the chain reaction.
It would make no sense to introduce neutrons earlier, because the fuel is either not dense enough to chain-react or, if it somehow were, then you'd kill yourself (and the town!) as that would blow it up right in the factory!
Answer: The fission fuel in an atomic bomb is always undergoing spontaneous fission and hence emitting neutrons, but at a very slow rate. The rate stays slow in an untriggered bomb because the neutrons being produced are allowed to escape before they can trigger more fissions within the bomb material.
That bomb material is not pre-processed in any way to force it to emit more neutrons, but there are several neutron emitters which are incorporated into the design of the bomb to spray the bomb material with neutrons when the bomb is set off, to help reliably kickstart the fission process.


What are the fastest available implementations of BLAS/LAPACK or other linear algebra routines on GPU systems?

Question: nVidia, for example, has CUBLAS, which promises 7-14x speedup. Naively, this is nowhere near the theoretical throughput of any of nVidia's GPU cards. What are the challenges in speeding up linear algebra on GPUs, and are there faster linear algebra routings already available?
Answer: I can't answer the second half of your question as far as other implementations out there but I can provide some insight as to the challenges.  For reference, I personally used ViennaCL on a nVidia GTX 560 Ti with 2GB of memory for my benchmarks.
Over serial code on a mid-range i5, I saw speed-ups for dense matrix multiplications of approximately 40x.  For operations such as a vector-scalar multiply I saw as high as 1000x speed-ups.  The 800 pound gorilla in the room, however, is memory bandwidth.  For most commercial GPUs, you will be using something like PCIe which limits you to about 6GB/s of throughput.  In my case, while the computation was 40x faster, the three matrix copies (two to the GPU, and one back) each took about as much time as just doing the computation on the CPU.
The problem then with any general library for GPU linear algebra is going to be that they can't really re-use objects on the GPU, because they don't know what you are going to do with them.  So every call to a compute kernel will likely require copying to the GPU, then copying the result back.  This will eat up a large portion of the gains.
If you can reuse objects such as matrices, then you could write the higher level algorithms to avoid as much memory management as possible, but a library would be hard pressed to do this efficiently.
I hope that this helps, and I am sure there are other people here who are much more experienced in this, but these are the experiences and impressions I got during my short foray into GPU computing.
Comment: This is why you want objects that live on the GPU for an extended period of time rather than eagerly being copied back to the CPU. For example, PETSc matrices and vectors contain a flag indicating whether the CPU and/or GPU is current. An operation on the GPU marks the CPU version as dirty and vice-versa. A copy is transparently done if you request the memory in a place that is dirty, but that is rare if all algorithmic components that touch the large data structures can execute in the same place.
Comment: In many cases you will want to work on matrices that fit in the main system RAM but don't fit in the GPU memory.  In that situation you need optimized libraries that can use block algorithms and overlap computation and copying data back and forth.
Answer: Let me focus only on CUDA and BLAS.
Speedup over an host BLAS implementation is not a good metric to assess throughput, since it depends on too many factors, although I agree that speedup is usually what one cares about.
If you look at the benchmarks published by NVIDIA and take into account that the Tesla M2090 has 1331 Gigaflops (single precision) and 665 Gigaflops (double prec.) peak performance, you will see that for SGEMM and DGEMM we have a measured throughput nearly at 60% of the theoretical one, which is pretty good.
But how do you define the flops performance? Flop count / elapsed time, where flop count is $2\,mnk$ ($m\times k$ and $k\times n$ are the matrix dimensions), and elapsed time can include or not the transfer time from host to GPU memory and back. (As Godric correctly points out, this make a big difference!)
As what regards sustained floating point throughput, I think that flops should be computed without taking into account data and result transfer times, and this makes speedup comparisons difficult. Furthermore you have to take into account the matrix size, since best performance is for big matrices.
Bottom line: speedup of a real life application can be very different from peak measured performance on linear algebra routines, since you have to take into account GPU initialization, data transfer times, etc. etc.
So I won't answer your question about the fastest library, since the question makes no sense unless a precise metric and problem is defined. All this said, i think that cuBLAS and MAGMA are a very good starting point.
Answer: I recommend MAGMA. It provides functionality for calling GPU linear algebra routines from both CPU and GPU. In addition, it provides BLAS/LAPACK CPU routines. Install it with MKL(Math Kernel Library) and you have a library that is efficient at many things.
Comment: What do you  mean with "calling GPU linear algebra routines from both CPU and GPU"? How can the GPU call anything?
Comment: Do you have a link to Magma? It does not seem to be a very easy-to-google name.
Comment: Do you have any benchmarks to show how fast it is compared to other alternatives?
Comment: By the way, welcome to this site, and thanks for contributing! I do not want to seem overly critical of your answer, I was merely suggesting improvements but I appreciate you giving another alternative.


Wake up ESP8266 from deepSleep with a button

Question: I have a button with two isolated tracks. I want to be able to wake up esp from deepSleep with this button, and also detect that it was clicked. So i can't connect it to reset, because esp won't work if i don't release a button. And if it's not at deepSleep, it will reset, and i don't want it. How to do this?
Comment: Can you post code that you have so far?  Also, what do you mean by "two isolated tracks"?
Comment: Connect the button, with a pull-up to a GPIO. Also connect the button via a small capacitor to the reset pin. The arduino boards use the same trick to reset the ATMega328 via the USB to serial chips DTR-pin.
Comment: I don't have any code that would relate to this functionality yet. By "two isolated tracks" i mean that this button has 4 pins, and 2 paths are isolated, so you can connect two separate things to same button. One path will wake up ESP, and second will be connected to one of GPIOs.  Will thing with capacitor also reset it when it's running? I want it only to reset once at sleep, and don't do it while working.
Comment: Could you please draw me it in paint or something?
Comment: Possible duplicate of [Deep Sleep Reset with Shock Sensor](https://arduino.stackexchange.com/questions/69525/deep-sleep-reset-with-shock-sensor)
Answer: Use some other pin to hold RESET HIGH or to disconnect the button from RESET while the esp8266 is not running.

simulate this circuit – Schematic created using CircuitLab
I asked on EE SE for the missing part of the circuit.
Answer: You can't stop deepSleep, all you can do is reset the board so connect the button to the reset pin and make the appropiate set-up:

Connect a pullup resistor (10k) in RST
Connect the button from RST
to GND

When you push, RST has GND so the ESP gets reseted.
Remember that deepsleep only works for about an hour so you have to contemplate this situation, too, maybe with a static variable...
EDIT Thanks Juraj for the comment: "from SDK API "system_deep_sleep(0): there is no wakeup timer; in order to wake up, connect a GPIO to pin RST; the chip will wake up by a falling-edge on pin RST."
Comment: from SDK API "system_deep_sleep(0): there is no wakeup timer; in order to wake up, connect a GPIO to pin RST; the chip will wake up by a falling-edge on pin RST."
Comment: the reference assumes the esp8266 is used as 'coprocessor' for a main MCU, because it wasn't designed to be used standalone. so the mentioned GPIO pin is a pin of the main MCU


Is there any way to get the combat rifle very early in Fallout 4?

Question: Apparently, the combat rifle with mods and marksman perk is a beast, and I've wanted to try a sniping setup. How do I get a combat rifle early on?
Comment: Your best bet it to probably find a gunner of some sort that's carrying one. Or even raiders. Lots of enemies have them. But you'll need to level the right perks to modify it, and I also recommend getting the perk that upgrades all non-automatic rifle damage 20% for each level (up to 100%).
Comment: Relevant notes: Sniping is terrible in VATS, as scopes significantly increase VATS cost per shot. The red dot sight is MUCH better for VATS. Unless you want a silencer, laser and plasma weapons are better than the combat rifle. Righteous Authority is a beast. I've rarely had a playthrough where it made sense to use a combat rifle for an extended period of time. They're heavy, and by the time the ammo is common I have better guns available.
Answer: From the Combat Rifle wikia page, you are able to find a Combat Rifle in the following places:

Can be purchased at the Diamond City market.
One can be found next to a dead soldier next to a beached tank directly west of Libertalia.
One will spawn at any level on top of the roof of the Greater Mass blood clinic, next to the body of a dead survivor.
One can be found during the miscellaneous quest Find the Treasures of Jamaica Plain.
On the east side of Greater Mass blood clinic in the back of a burned out vehicle there is a chance one will spawn next to a skeletal soldier.

In general, you will be able to find them as drops from enemies, starting around level 15, though.

Around level 15, Gunners will start equipping these with large magazines and long barrels.
Fairly common among raiders after a certain level
At higher levels, the combat rifle and modded variants can be found on almost all the mercenaries at Parsons State Insane Asylum along with plenty of combat armor. These respawn almost daily, making them ideal for obtaining many for settlers.
One potential spawn is on top of the wrecked building on one of the small elevated parts of the floor where you find the BoS patrol in the quest The Lost Patrol, you will need to jump on a file cabinet to reach. Note - this spawn may be levelled, at lower levels a pipe rifle has been seen.

Based on the available information, I would say your best bet is to go to Libertalia or do the Find the Treasures of Jamaica Plain as those are both guaranteed Combat Rifle locations. After rereading your question, I realized you asked for northern areas specifically. Libertalia is slightly further north than Jamaica Plains, but it is further East. I do not think either of these should be too difficult for you to clear out and get a Combat Rifle from.
Note: I would not recommend buying one from Diamond City market at a low level as Combat Rifles tend to be quite pricy, especially for a low level character.
Answer: Overseer's Guardian is a weapon available from the merchant in Vault 81.  It comes with the Two shot effect, which can carry you well into the end-game (I was using it at level 90 on survival, but had to switch to a Gauss rifle for the Glowing Sea).
Answer: There's one on the road from Covenant to the Medford Memorial Hospital, where the caravan was hit in the Covenant quest. (Don't need to start the quest) You can get this rifle AND the .308 sniper rifle from the Red Rocket between College Square and Mass Sand and Gravel at level 2. You don't even need to be very sneaky.


Read .msf/mbox files offline in Thunderbird

Question: I have GMail account set up in Thunderbird 12.0.1 via IMAP. All the emails in it were synchronised to the client long ago. I no longer have access to the GMail account, but the mbox and .msf files are still there in my TB profile. How do I read the emails in those files? The folder pane shows nothing but an empty "Inbox" folder for that account - no emails, no sub-folders.
Comment: First of all, back up those files right away before going any further so that they don't inadvertently get erased, Second, What operating system? (This is important because thunderbird has more options for working with locally stored mail on non-Windows operating systems.)
Comment: Thanks, Stephanie. Windows 7 is my main OS, but I have Ubuntu 10.04 as well. So ideally I'd like to open them in Windows, but Linux is certainly better than nothing.
Answer: The mozillaZine article Importing folders may contain a possible answer.
It dates from July 2011, but may still pertain.
The steps it describes are the following :

Create a new Thunderbird profile without any installed extensions
Download and install the ImportExportTools extension, restart Thunderbird
Use the menu Tools -> ImportExportTools -> import mbox file
Browse to the mbox file and press the Open button. The imported inbox may have a suffix
appended to its name for uniqueness.

A second possible procedure is described in the mozillaZine article Manually importing and exporting, which is basically replacing an existing inbox file with the old one.
For that to work you should probably use the same version of Thunderbird that created the mbox.
Comment: Thanks, this worked very nicely. I didn't have to create a new profile, just added a new POP account (with dummy server names) to my existing profile and used ImportExportTools to import the mbox files into the new account and I can now read them again.
Comment: Thanks for the bounty, but you should also accept the answer (click the "V").
Comment: Oops, I thought I had. Accepted.
Comment: The `Import-ExportTools` addon is on the Mozilla Addons Repo: https://addons.mozilla.org/en-US/thunderbird/addon/importexporttools/
Comment: If your Thunderbird version is too old, the addon will not complain but will not work, updating and restarting Thunderbird should work
Answer: Like Stephanie said - start off by closing Thunderbird and backing up your profile folder. Since you said that you're using Windows 7, it should be located in "C:\Users\\AppData\Roaming\Thunderbird\Profiles"
Once your profile has been backed up to a safe location you can start to make the changes.
Within your profile folder, you should see two folder: "ImapMail" and "Mail" These are where your IMAP mbox files and your POP/Local folders are kept (respectively).
Go into the "ImapMail" folder and find the folder for the Gmail account that you want the data from. Select the mbox files (ignore the .msf files - these index files will be regenerated the first time you go into the folders again) and copy them into the "Mail\Local Folders" directory in your profile. You can change the filenames if they conflict and they'll show up as the new filenames when you restart Thunderbird.
Restart Thunderbird and you should see your old folders.
Comment: Note: until you configure an email account in Thunderbird, there is no "Local Folders" folder to put the files in. This was tricky for me since I have a bunch of old email archives from a defunct account that I wanted to read offline, and Thunderbird blocks creating an account unless it can connect to the server successfully. Workaround: put Thunderbird in offline mode, _then_ create a new account with a dummy username & server address (this bypasses the server connection test). Then quit Thunderbird, copy the files into the folder, and re-launch Thunderbird. Worked perfectly for me!
Answer: Its not a 'proper' e mail client (but rather a forensics tool - which is better in this case - its read only for one), but i've had good luck loading the mbox files off a arbitrary thunderbird install on mitec mail viewer - I didn't and still don't know the version of thunderbird the mailbox i had used then was on, and assuming you point it at the right file, it just works. This should give you the ability to read, export and print messages, but not connect to a mail server - which should be good enough for your needs. Its also standalone, and dosen't depend on a specific version of T-Bird being installed - these screenshots were made when i opened the mailbox from a copy of thunderbird 12.01.
Starting up mailviewer shows you a menu where you can select files to open

Select the type and hit the folder icon

Select the file - this should be something without an extention

This opens up a screen similar to any mail client where you can see, search and open your mails. You should also be able to print and export individual mails as eml files as needed, view attachments, and so on.

Mailviewer is freeware, and portable, and probably a heck of a lot easier than installing thunderbird, especially if a specific version is needed. It also won't affect your mailbox files since the software is a viewer, meant for mailbox analysis and recovery, rather than being a mail client.
Comment: Thanks, but Mailviewer didn't work well for me. It only showed 1-2 messages in a folder with thousands of messages and didn't separate the headers from the body, either. So I suspect it failed to parse the mbox files correctly.


What do I do if the disk image data is corrupted?

Question: I am trying to install Sims 3, but it opens a window saying that "The following disk images couldn't be opened because the image data was corrupted." What can I do to resolve this issue?
Answer: The error message means that the downloaded file is corrupt and can't be opened.
Re-download it and try opening it again. If it fails again, make sure that the download isn't being interrupted.

If you can obtain a checksum for the file, you can check it against your download by running openssl sha1 ~/path/to/download which will show the checksum for your download. Comparing the results should show if the file you downloaded matches what you should expect to download.
Answer: I just opened by Disk Utility and Select the mounted Xcode Disk. Finally, right-click and choose Open in Finder. Then, move the Xcode to application.
Comment: How is this relevant to Sims 3?


What is the difference between vbscript and vb.net?

Question: What is the difference between vbscript and vb.net?
Comment: Related post - [What is the difference between VB and VBScript](https://stackoverflow.com/q/1384051/465053)
Answer: Except for sharing some syntax and keywords, they're quite different languages. VBscript is a very light weight language usually used for short scripts while VB.Net is usually used to create full desktop or web applications.
You could try searching for java vs javascript and many of those pages will describe differences between a scripting language and a normal programming language, javascript is similar to vbscript and java is similar to vb.net.
Answer: VBScript is a scripting language that is used mainly for doing small automated jobs.
The most powerful Windows technology is the .NET Framework. Visual Basic has been modified to be a true object-oriented language when working with the .NET Framework and that syntax is called VB.NET.
Answer: VB Script:
Quoting from this answer:

VBScript is a sub-set of VB and is a scripting language that can be
  used to run a set of commands, similar to an old-school DOS batch
  file. Generally, a scripting language can not be used to create a
  full-fledged binary application and it can not be compiled down to a
  executable binary file.

vb script has been used a lot in writing plugins and extensions for browsers in the past. Browsers were capable to interpret the vb script.
Visual Basic .NET (aka VB .NET)
On the other hand, Visual Basic .Net was a progression of the Visual Basic language to target the common language run-time (CLR) which is the virtual execution environment (like JVM in java) of .NET framework based applications.
Historically when .NET framework came up, Microsoft introduced a completely new language C# (to compete with Java) but since most of the programmers following MS technologies were from Visual Basic background MS decided to have VB .NET option as well in parallel with C# .NET. This way for VB programmers it didn't become a binding to learn a completely new language (C#) syntax from scratch to start writing new applications targeting .NET framework.
Compilation logistics of VB series of languages :
Visual Basic => Compiled to native code packaged inside *.dll or *.exe files.
VB script => An interpreted language. It is not compiled. You can get more details here
Visual Basic .NET => VB .NET is compiled to MSIL (Microsoft Intermediate Language) code (similar to byte code in Java world) packaged inside *.dll or *.exe files.


How to recolor artwork while preserving shading?

Question: I want to change the red flower to blue but whats the fastest way to match it with the shading and make it look good? Or do I have to manually put colors?
Answer: I propose you to click on the Edit tab ("Modifier" on my screenshot), then you can lock the color harmony (at the red circles). With Shift+drag, your saturation rate will be protected, but the hue will be changed.
I hope it will help you.


Bench press with light weights

Question: Hi there i am doing bench press.I would like to know this. If someone does a lot of this workout with low weights but he does 1 set of 40 after 2 of 30 and 3 of 30 and 1 of 25.Does this part of chest become bigger?
Comment: Hi , you are right about frequency.I am doing 4 times per week for 20 minutes.I am working out more than 3 years but there were times that I wasnt doing for 3 mounths workouts.I eat nutrition but in every question I  think is the basic thing,thats why I don't mention what I eat.
Answer: Its a great way to build muscle, muscles don't know how much weight they are pushing, they only know they are being forced agaisn't resistance which is enought to grow muscles as long as there is progress. Progress can be made by increasing frequency, weight, repetitions, sets, speed, time under tension or by decreasing rest between sets.
Growth requires muscles to be fatiqued and broken down which can be done with light and heavy weights.
Nervous system strength requires heavy weight.
If you don't  care about getting stronger its fine, why would you care after all... it bring no functionality in real life to bench press 3 times your weight. Or are you a mechanic who plans on bench pressing cars to change their oil?
Comment: Frequency..I have read that workouts needs rest.What I mean is that you cant do example Monday chest and the next day again chest.As a result,frequency in a day you mean?
Comment: You can go from training chest once a week to 3 times a week, some muscles can be trained daily but not large muscles like the chest which need at least 24 hours of rest.  And yes twice a day works too

Bench press with light weights


illustrator shape doesnt blend

Question: am not a newbie in illustrator. but I dnt understand why this is happening.I took pen tool for both sadows. the tutorial am following to creat this tht guy has no boundary between shadows like mine does. i restarted pc- it doesn't go away. I re start illustrator it's still happening. I created even 3 more!! still, it is there... why these two shadows are not blending?? why is that middle line occurring every time?? please help me.
Comment: ermm.. HUH? Please slow down, realize no one here knows what you are trying to accomplish or how things "should" look. Clearly explain the steps you've taken and where a problem occurs.
Comment: you see two shadows there?? i drew it with pen tool. and lower the opacity. but there is a distinctive line between two shadows! i dont want it. usually we draw two shapes. apply same color. it dsnt show the adjacent margin right? but why it is not happening with these  shadows?? why the adjacent margin showing itself?
Comment: are you talking about the white line between the shapes? https://graphicdesign.stackexchange.com/questions/27086/a-gap-between-lines-of-joined-path-in-illustrator
Answer: Short of opening up your file and seeing what is actually going on here, I can give at least 2 ways as to how that line is showing up:

There is an extra line that you made with the pen tool that isn't accounted for (on another layer, perhaps even locked, etc.)
There is a slight overlap between the two shapes causing the line. You can use View -> Outline (ctrl-y) to see if this is the case and then snap the vertices of these shapes together to eliminate the overlap.

If none of these things are happening you can always merge the two shapes together using the Pathfinder or Shapebuilder tool.
Hope this helps!
Comment: Thank you.  am gonna try both. i merged it. but it had created more problem. then the shadow covers the whole art. it is a compound object you know i didnt print scrn the whole image. if i had you would have seen there is a cut in the shadow.. oh man. illustrator is not cute sometimes.... nyway thank you

illustrator shape doesnt blend


Trigger Zend FlashMessenger in jQuery

Question: I'm facing an issue and I was wondering if someone could point me in the right direction.
I am using Zend's FlashMessenger in my controllers, but in one of my files I handle my forms via AJAX posts. I thought Humane-flatty would be a nice replacement for Zend FlashMessenger in that case, but the layout of it is completely different.
Is there any way to trigger Zend Flashmessenger in my AJAX post?
This is how I currently call Zend FlashMessenger in my controllers:
$this->_helper->FlashMessenger(array('success' => 'Succesfully added'));

This is my jQuery:
if (data.weight !== '' && data.customer != '') {
   $.ajax({
     type: 'POST',
     url: '/index/line',
     data: data,
     success: function(res) {
       $('#open_orders').append(res);
       flashSucces.log('Orderline succesfully added.');
       //Can I call Zend flashmessenger from here?
     }
   });
}

Comment: Maybe this helps: http://stackoverflow.com/questions/1739096/working-with-zend-framework-flashmessenger-and-jquery-ui-state-classes
Answer: I suppose your URL, function line in your index controller "index/line", returns some JSON/XML or some HTML which you return and append into a div with #open_orders id.
The idea is, your ajax call needs to return a function from your controller which calls your FlashMessenger call,
$this->_helper->FlashMessenger(array('success' => 'Succesfully added'));
In other words that code needs to run from your controller, and returned to your client (callback of your ajax call in your jquery statemtent) via a direct call.
You may either return partial responses from your "res" and split them and append the correct part into your div, and the other part you append to a preceding div with a different id, so that your injected FlashMessenger code works,
OR
Where you have the following comment
//Can I call Zend flashmessenger from here?

you call another ajax call to another function in your controller where you call the FlashMessenger code in that function, so that you call both your required bits and the FlashMessenger
TLDR: You need that FlashMessenger call in your Zend(Server) side, and call that function in your controller from your client via the .ajax call
Hope this helps.
Answer: The trick to your answer lies at your view scripts (*.phtml files).
I am assuming the following index.phtml file as a view script of your indexController  file that prints the form and execute your Ajax. When you click the button 'Get External Content', the result of the Ajax response from /index/line controller will be populated in the div1 tag.
    <!DOCTYPE html>

<?php // print your form from controller here. echo $this->form; ?>

Let jQuery AJAX Change This Text

    <button>Get External Content</button>

The above code will fetch the result from lineAction at indexController ('/index/line'). Add the following lines at IndexController.php
public function lineAction()
            {
          $this->_helper->FlashMessenger('Succesfully added');

          if ($this->_helper->FlashMessenger->hasMessages())
          {$this->view->messages = $this->_helper->FlashMessenger->getMessages();}
            }

Now call the view script of your line action (line.phtml). Add the following lines in line.phtml
<?php
if ($this->messages!=Null)
            { $messages = $this->messages;
                foreach($messages as $message) {
                echo '';
             }
            }

Now execute your code. Your Ajax will execute Zend FlashMessenger with success and display an JavaScript alert message 'Succesfully added'.
I have tested the above code and it works great with Zend 1.12.
Answer: I think there are two approaches which might please your needs:
1)  Like mentioned by serdarsenay you could develop a general valid request/response model based on i.e. json or your favourite format which organizes the communiation between the client and the server side, including a place for messages. Example in json:
{
    'status': 'success',
    'message': 'Successfully added',
    'whateverYouNeed': 'Goes here'
}

This approach has probably two major problems: It requires you to write an according jQuery counterpart which knows how to handle your json responses e.g. parsing the status code and showing messages where you would like them to appear. To make it reusable you might want to design this counterpart to take a callback as well so that you are able to react somehow specifically depending on i.e. the type of form you are sending. Furthermore the server side has to know that this is an ajax request so it doesn't have to add the message to the FlashMessenger but instead to a json response in case you want the processing controller and view to work in both ways accessed directly or via ajax.
I wanted to introduce this first to justify another approach:
2) Write a wrapper on the server side which does nothing else than echoing your FlashMessenger messages and call it via ajax separately. Yes, you then have an additional GET request but considering the flexibility you get might be worth it. Your server side would remain untouched, everything would work like it did before no matter if requested directly or via ajax. The only thing you do is to add an additional ajax call to your FlashMessenger wrapper whenever you think there might be messages which should be shown to the user. And just consider the case where the ajax call fails (no response, timeout, whatever) and the page has to be reloaded by the user: No problem since your server side views will always display the stored flash messages which otherwise would have been lost although there was i.e. a successful insertion into a database about which the user was not informed.
The first approach is not closely related to your question but I felt I have to mention this alternative to justify the extra GET request for approach 2.
So some pseudo could look like that:
-- ajax/flashMessenger.php
echo flash messages

And whenever you need it on client side (i.e. after form submission, after successful user login, etc.)
-- flashMessenger.js
request to ajax/FlashMessenger.php
attach output to i.e. #messages div

Answer: I may not be understanding your question properly, but here's my solution:
You do not need flashMessenger, you just need to display a message if I understand correctly. With the default HTML of FlashMessenger you would do something like this:
function showFlash(type, message)
{
    $("body").append('

'+message+'</li
');
}

Just call showFlash("success", "Orderline succesfully added."); whenever you want the flash message to show up.
You may need to change "body" to whichever element you want to add the message to.
Answer: I assume this URI '/index/line' (the lineAction in IndexController) should return the message.
You should read from flash (or basically render the message) in order to empty the message session. Otherwise in next render in main layout it will be shown to the user.
Generally, I don't suggest setting a flash message for every message of form in first place. It would be more appropriate if you just set a flash message whenever you had a redirection. The application of flash is where you want to show a message in next page (or next visit within the same session).

Trigger Zend FlashMessenger in jQuery


Purging a software package, reinstalling it, it remembers settings

Question: I installed bluefish using sudo apt-get install bluefish.
It was very buggy so I decided to remove it using sudo apt-get purge bluefish, and then using sudo apt-get autoremove
Then I reinstalled it using sudo apt-get install bluefish again, and all the former settings were kept.
Why is that?
Comment: For clarity, the reason _why_ this happens is that each user has his own (independent) settings, and uninstalling a program is not supposed to mess with every user's settings. It's part of the Linux security protocol.
Comment: @PaddyLandau: If you know the answer to a question please write a proper answer instead of a comment.a
Comment: @DavidFoerster I think that the OP was asking about the mechanics rather than the conceptual background. But thanks anyway :)
Answer: It's because user specific settings are stored in your home directory and that isn't removed. Try to find either bluefish directory under ~/.config or ~/.bluefish directory under home and remove it to reset the user preference.
Update: As Zanna mentioned in the comment (which is now removed), it's .bluefish under home.
Comment: Thanks, it worked.
Still, Bluefish is very buggy (For example, Apply and OK button for preferences won't work), which makes me wonder: If it's a specifically for Linux editor and it's still so buggy, should I keep using it? Is it safe? (It's off topic though)
Comment: @Foobarer I don't use Bluefish now. I think you should consider using much better alternatives like Bracket (for front-end things) and/or sublime, atom etc. Everybody seems to be using those these days
Answer: Some programs keep config preferences for installed software that the app will use for its installation and or use. This data is written to hidden files/folders in your home directory. You can view them by showing hidden files in Nautilus using Ctrl + H, or in a shell using ls -a to view the files. In your case, you want to remove the software and do a clean install. So, do what you were doing: sudo apt-get purge bluefish, find the program files in your home directory, and then manually remove them. Then you can do a clean re-install.
See these links for reference:
How to completely remove application
What is the correct way to completely remove an application?
Answer: Sometimes, applications use their own folders to store their settings , so you need to remove the files from those folders. To see which folders are used by these applications, search for files with the name of the application you want to completely remove. I use the Catfish File Search application catfish for this, but any file-search app that searches through "hidden" folders will do. After you find the configuration files used for the application, delete them. You should find that upon running the application, the settings have been reset to their defaults.


etherscan request API limit

Question: i want to know the limit request on etherscan API with API key, and limit if we go on paid service. thanks in advance.
Comment: You should rather contact them.
Answer: The number of requests per second is limited to 5 request per second. There is not paid service yet.

The Etherscan Ethereum Developer APIs are provided as a community
  service and without warranty, so please just use what you need and no
  more. They support both GET/POST requests and a rate limit of 5
  requests/sec.
To use the API service please create a FREE Api-Key Token from within
  the ClientPortal->MyApiKey area which you can then use with all your
  api requests. Either a link back or mention that your app is "Powered
  by Etherscan.io APIs" would be appreciated.

source
Hope this helps
Comment: thanks, Jaime. what do you think about blockcypher API, or Infura
Comment: As far as I know infura doesn't have limits [source](https://github.com/INFURA/infura/issues/58). I found etherscan very useful and simple, I created a wrapper for python that you can find [here](https://github.com/jfdelgad/etherscanAPI). I didn't know about blockcypher until now, I took a quick look at it and it looks amazing, thanks for that. If this answered your question please accept the answer.
Comment: thanks again Jaime, just gave a good insight about infura and etherscan.
Comment: in first infura hasn't limit but it has limits now. limit is 100K req/day for free users. blockcypher has limit too. blockcypher has 3 req/sec and 200 req/hr limits.

etherscan request API limit


Gpu rendering problem

Question: I have been advised to download cuda and I downloaded nvidia cuda version 6.5,yet the cycle compute showed none. what should I do?  Help me please.
I'm using windows 7  im trying to enable graphics card nvidia geforce 320
Comment: @cegaton I'm using windows 7 64bit and blender 2.79, but I don't know what do you mean by ",what kind of GPU you are dealing with "
Comment: @cegaton I'm trying to enable graphics card
Comment: @cegaton  When I install Cuda it says "no supported version of visual studio was found. Some of the CuDa toolkit won't work properly" do I have to download the whole visual studio or is there a zip file around
Answer: Don't waste your time, your card is too old, it is not supported by blender. As stated in the link
Enabling GPU rendering for Cycles?

Cycles only supports CUDA GPUs with a CUDA compute ability of 2.0 or higher. To use CUDA, check to make sure your GPU is on this list of CUDA capable GPUs and has a ranking of at least 2.0.

Your's doesn't meet that criteria.
You can see the compute capability of CUDA cards here: https://en.wikipedia.org/wiki/CUDA

Gpu rendering problem


Which of the following series is uniformly convergent?

Question: For $x\in (-\pi, \pi) $, I want to know whether the following series following series are uniformly convergent on  $(-\pi,\pi) $:
1. $\sum _{n=1}^{\infty}{(\frac {x}{n})^n} $
2. $\sum_{n=1}^{\infty}{\frac {1}{((x+\pi)n)^2}}$.
I think series in 2 has to be uniformly convergent for,
$|\frac{1}{((x+\pi)n)^2}|$ $\leq $ $\frac {1}{n^2} $ and as $\sum {\frac {1}{n^2}} $ is convergent, by Wierstrass M-test the series in (2) is uniformly convergent.
But I don't how to proceed for the series in (1). Any help please!  Also tell if my answer to the (2)nd is correct.
Comment: I don't think your argument for (2) is right: as $x\to -\pi$ the expression blows up and is not less than $1/n^2.$
Comment: Thank you for pointing it out!
Answer: Number two is not correct: Let $S_{n}(x)=\displaystyle\sum_{k=1}^{n}\dfrac{1}{(x+\pi)^{2}}\dfrac{1}{k^{2}}=\dfrac{1}{(x+\pi)^{2}}\displaystyle
\sum_{k=1}^{n}\dfrac{1}{k^{2}}$, $S(x)=\displaystyle\sum_{k=1}^{\infty}\dfrac{1}{(x+\pi)^{2}}\dfrac{1}{k^{2}}=\dfrac{1}{(x+\pi)^{2}}\displaystyle
\sum_{k=1}^{\infty}\dfrac{1}{k^{2}}$, then $|S_{n}(x)-S(x)|=\dfrac{1}{(x+\pi)^{2}}\displaystyle
\sum_{k\geq n+1}\dfrac{1}{k^{2}}$, if it were uniformly convergent, then for some $N$, we have $|S_{n}(x)-S(x)|<1$ for all $n\geq N$ and $x\in(-\pi,\pi)$, then fix the $n$, take $x\rightarrow-\pi^{+}$ and the expression blows up.
Compliment to @spaceisdarkgreen answer: $\left|\dfrac{\pi}{n}\right|^{n}\leq\left(\dfrac{n^{1/2}}{n}\right)^{n}=\dfrac{1}{n^{n/2}}\leq\dfrac{1}{n^{2}}$ for large $n$, so the series converges.
Answer: For part (1) you have $$ \left|\frac{x}{n}\right|^n< \left|\frac{\pi}{n}\right|^n$$ and $$\sum_{n=1}^\infty  \left|\frac{\pi}{n}\right|^n$$ converges so the M-test applies here.
Part (2) is funny, cause it seems pretty benign: $$ \sum_{n=1}^\infty \frac{1}{((x+\pi)n)^2} = \frac{1}{(x+\pi)^2}\sum_{n=1}^\infty \frac{1}{n^2} = \frac{\pi^2}{6(x+\pi)}$$ and yet it doesn't uniformly converge since whatever small difference remains from the nicely converging $\sum \frac{1}{n^2}$ is blown up arbitrarily large by the divergence as $x\to -\pi$ (as user284331 shows in detail in their answer).
Comment: But how do you say the series $\sum_{n=1}^{\infty}{(\frac {\pi}{n})^n} $ converges?
Comment: @shwetha  ratio test, or once $n>\pi$ compare with a geometric series.


how to draw rectangles, resized so it will fit my widget

Question: I like to draw rectangles in a window, or in a label or whatever, but I like to keep the size small, so that it fits in my mainwindow. I think about a docked window, to start with a size of 500x300.
The size of a rectangle can be 4100x130 or 2800x2070 for example, but that almost goes out of my screen.
What I want is resizing the window and the rectangle should resize also, still fitting in the window.
How can I do this?
Using qt-4.8.4 and also opengl installed.
I made a program for DOS 22 years ago and now it should run under linux. So qt is new to me.
Comment: Show us what you've done so far please.
Comment: Sorry I didn't notice there was an answer.
Answer: [example removed]
My example was for another question.
because I solved my question a little different.
I will give a better description of my question above
I don't know the screen size of everybodies computer. So it is up to the user how large he makes a window.
Let's say the window size is 600x400
And now I like to draw something in it that is 4000x1300
So it must be scaled to fit into the little window of 600x400, no problem.
But when the user increases the size of the window, perhaps even the size of the drawing is increased, but as I understand it now, there is information missing.
When I have a piece of line from 3 points long and I pull so that it becomes 5 points long, the original line had only 3 points of information, so 2 points must be added from somewhere.
Is it possible to store the entire drawing of 4100x1300 somewhere, and from there it is scaled into my window? So when the windows size is increased, there is made a new scaled copy of the stored image?
Comment: sorry I gave an example for another question that i had.


framing in a header. Can I toenail from each side?

Question: i am doing a remodel and moved a 2-6 door over a few feet.  the original door has a 4x8 header, so I put in the same.   My understanding is the header should be affixed by 6 16d nails on each side. because the header was put up against existing framing, I can't shoot through the king stud into the header.  Can I toenail three nails per side, shooting through the header, into the king stud?
Comment: A sketch would be helpful
Answer: Yes, toenails will work. In some cases toenails hold better than nails run through the stud into the end grain. The nail head is what does a lot of the work, make sure the heads are set into the surface. It also helps the drywall set better, when you trim the door out you will find what I mean if you don't


etale homotopy and Adams conjecture

Question: I was reading Quillen's paper on "Some remarks on etale homotopy theory and a conjecture of Adams". Up to some fact about etale version of spherical fibrations which was later proved by Friedlander, Quillen gives a proof of Adams conjecture using etale homotopy theory. Somewhere in middle of paper he is saying: Assume $Q$ is a vector bundle over variety $X$ in characteristic $p$. Assume that $Q^{(p)}$ is the pullback of $Q$ over $X$ by Frobenius map $\Phi : X\to X$  then there is a morphism $ F: Q \rightarrow Q^{(p)}$ given by universal property. In local coordinates $F$ is given by $ X_i\to X_i^p$. Note that it is not a bundle map but it preserves fibers and sends $Q-0$ to $Q^{(p)}-0$ so it induces a "homomorphism" ( I am not sure in what sense) in etale topology which is purely inseparable. Then Quillen concludes that $(Q-0)_{et} \simeq (Q^{(p)}-0) _{et} $. Can someone help me understand why these two have same etale homotopy type?
Answer: The claim is that F: Q-0 --> Q^(p)-0 induces, on pullback, an equivalence on etale sites (and  hence on etale homotopy types).  In fact, more generally this holds for any "universal homeomorphism" between schemes -- this is the so-called "topological invariance of the etale site", proved in SGA somewhere.
Comment: Could you elaborate on how purely inseparability gives equivalence of etale sites?
Comment: Sam: it looks like section 45 of http://www.math.columbia.edu/algebraic_geometry/stacks-git/etale-cohomology.pdf has it.

etale homotopy and Adams conjecture


Total force exerted by the fluid on the surface is the sum of normal forces

Question: In https://en.wikipedia.org/wiki/Pressure#Formula, the normal force per area $dA$ is $d\vec{F}_n=-p\,\vec{n}\,dA$, where $p$ is the pressure. It is stated that, for any surface $S$ in contact with the fluid, the total force exerted by the fluid on that surface is the surface integral over $S$ of the right-hand side of the equation: $\vec{F}=\int_Sd\vec{F}_n=\int_S -p\,\vec{n}\,dA$. My question is why $\vec{F}=\int_Sd\vec{F}_n$, and not $\vec{F}=\int_S d\vec{F}$. I would like to understand why we sum the normal forces $d\vec{F}_n$ at each point, and not the whole forces $d\vec{F}$ at each point of $S$. Is it because the parallel component of each infinitesimal force $d\vec{F}$ is $0$ ?
Comment: Just ask yourself : can I apply a force that is parallel to the surface of water which is kept in a bowl?
Answer: Yes. For fluids of negligible viscosity, the shear forces amount to zero, and only the forces normal to the surface being considered matter. However, this doesn't work with some (non-newtonian) fluids, like cornstarch in water, because of the aforementioned high viscosity.
Comment: It diesn't even work for deforming Newtonian fluids which typically exhibit a traction vector at the surface that is not normal to the surface (due to viscous contributions to the stress tensor).
Answer: The article you cite is only about pressure, so when it discusses forces, it only deals with the contribution due to the pressure.
In general, fluids also exert skin-friction forces tangential to surfaces, and for many flows in air, water, & other fluids, they can be much larger than the contributions due to the pressure.


What is the scientific explanation for telepathy in the Star Trek universe?

Question: There seem to be many races who have telepathic abilities in the Star Trek universe. Is there any scientific explanation mentioned in any of the series that explain how it's possible?
Comment: @DVK, Troi's abilities are far beyond those of most humans. She is not reading queues, she is reading emotions directly.  And not just those of humans or humanoids, but even those of very different species, and across empty space, mind you. And she can hear her mother's thoughts.
Comment: Great question, especially since for Troi, she doesn't even need to be in the same room as the subject, just looking at them via a view screen is enough.
Comment: Troy is an empath, not a telepath. You don't need a sci-fi explanation for that - human body gives off enough physiological clues about emotions that they can be observed and processed. Most humans can do it to one degree or another.
Comment: @Dima Don't forget robots, like Data when his emotion chip is on
Comment: @Dima Mmk, I may be partially misremembering - I thought it was during one of the movies, but it's in "Descent, Part II" when Lore has the emotion chip.  Here's a sound clip:  http://www.hark.com/clips/dyvfwtgfrh-data-i-can-sense-feelings-in-you
Comment: @Izkata: Really?  I have never picked up on that...
Answer: ST:Voyager episode/s established the existence of Psionic energy and a Psionic field permeating through space. I believe psionic energy has been mentioned in TOS episodes too, but I can't recall exact episodes.
Quote from Memory-Alpha Telepathy article (which itself quotes now defunct star-trek-voyager.net):

Star Trek science consultant and writer André Bormanis has revealed
  that telepathy within the Star Trek universe works via the "psionic
  field." According to Bormanis, a psionic field is the "medium" through
  which unspoken thoughts and feelings are communicated through space.
  Some humanoids can tap into this field through a kind of sense organ
  located in the brain (e.g. the paracortex). In the same manner that
  Human eyes can sense portions of the electromagnetic field, telepaths
  can sense portions of the psionic field

Although, note that this is an in-universe explanation rather than a scientific explanation. Saying that telepathy arises from a 'psionic field' is really a case of naming-the-problem-as-the-solution.
Comment: We often see Troi using her ability on a person visible on the main screen on the Enterprise bridge. It's hard to imagine the "psionic field" carrying through imagery record with an (electromagnetic spectrum) camera, and projected on a monitor.
Comment: I don't think the field exists in normal space like electromagnetic fields. We've seen beings who have been telepathically connected over great distances. It must be permeating through a different domain, although proximity clearly has some effect (like with the telepathic pitcher plant in ST:VOY).
Comment: This was established before Voyager--in the episode ["Gambit, part II"](http://www.chakoteya.net/NextGen/257.htm) it was shown that the ancient Vulcans had actually developed a technology called the [Stone of Gol](http://en.memory-alpha.wikia.com/wiki/Stone_of_Gol) that functioned as a "psionic resonator". As a Vulcan disguised as a Romulan mercenary named Tallera said in the episode, "The Stone of Gol is real, but there is nothing supernatural or magical about it. It is a psionic resonator, a device which focuses and amplifies telepathic energy."
Answer: In Where No Man has Gone Before (TOS), Elizabeth Dehner says, "ESPers are simply people with flashes of insight."  They have no idea what causes it.  But then, in Plato's Stepchildren (TNG), they find that kironide, which is in the local foods, is what causes their telekinetic ability.
Troi never attempts to describe her abilities, but it is blocked in The Loss by the two dimensional beings.
It may be of some significance that psi abilities are not dealt with at all the the Star Trek: The Next Generation Writer's Technical Manual (At least not as of the 4th season).  In the Star Trek: The Next Generation Writers'/Directors' Guide (in other words the series bible) has a section titled The Story -- What Doesn't Work and this is the 2nd subsection:

2. We do not do stories about psi-forces or mysterious psychic powers
No matter how fantastic the events in a story, the explanation must be extrapolated from a generally accepted science theory.  (We have accepted the telepathy of Counselor Deanna Troi because many reputable scientists have acknowledged the possibility of such abilities, but you will note that we have limited Troi to "reading" only emotions.)

So they do not provide any guidance to the writers on how psi powers work, even though they have whole sections in the tech guide on things like phasers, transporters, and even smaller sections on artificial gravity.  This gives a strong indication that the producers, at least of ST:TNG, did not want to get into the causes or workings of psionics.
While I'll link to the article on telepath at Memory Alpha, I won't go into it since it's already been quoted here.  But I think it's interesting to note that, while the later series like TNG and VOY used technobabble to explain details of almost every system on a starship, very little was ever said online about psi abilities.
Comment: It's interesting that TNG's writer's guide had this, given that TOS introduced and extensively used psychic powers and other supernatural abilities. I've always wondered why Gene Roddenberry introduced pseudo-science into a science fiction show. Then again, Forbidden Planet had plot about psychic abilities so I guess it was popular at the time Star Trek was conceived.
Comment: @MgSam: It's a Roddenberry thing.  My understanding is that he was coming in from a slightly different angle (I think, in part, from criticism of TOS by fans and even from his own staff).  The series bible does say something about scientific proof of some types of telepathy and it uses that as a jumping off point.
Answer: Star Trek explains this in different ways, not always consistently (there's a lot of Star Trek -- that's going to happen).  In the TNG episodes "Dark Paige" and "Eye of the Beholer," psilosynine was a neurotransmitter and one of the main chemicals involved in Betazoid telepathy.  But in "Haven" Lwaxana Troi told Wyatt (Troi's fiance) that he'd been seeing visions of his eventual mate (not Troi -- it's complicated) because "everything is connected."
Which didn't explain why Wyatt didn't see Picard, Mr. Mott, or B'awhb, the guy who picks up after tribbles on Epsilon Draconis forty-seven.


What does network interface do? and what's difference between a network interface and a network interface card (NIC)?

Question: I'm a little confused about the network interface. Based on my understanding, a network interface does the translation between link-layer and internet layer, and does the ARP. Is that right?
Also what's difference between a network interface and a network interface card (NIC)? I know NIC is a hardware-like network interface, so why we need NIC when we already have software-like network interfaces?
At last, does every network interface must have its own IP address and MAC address? Can multiple network interfaces have the same IP address or MAC address?
Comment: Did any answer help you? if so, you should accept the answer so that the question does not keep popping up forever, looking for an answer. Alternatively, you could post and accept your own answer.
Answer:
What does network interface do?

A NIC provides data-link-layer (data framing and MAC addressing) and physical-layer connectivity (cable attachment and line encoding). Modern NICs may also provide various offloading features for the network and transport layers.

what's difference between a network interface and a network interface card (NIC)?

"NIC" used to be short for network interface card when this function required an add-on card. When it evolved to an on-board commodity, it became network interface controller. Technically, there's no difference beyond the form factor.
Strictly speaking, network interface may also refer to a port with less (or more) functionality than a NIC, e.g. a switch port or sometimes even a print server option card for a printer or a serial server.

a network interface does the translation between link-layer and internet layer, and does the ARP.

There's no translation. The internet layer (or network layer) uses the underlying link layer for transport. Internet-layer packets are encapsulated in link-layer frames (e.g. Ethernet frames). ARP is required for this encapsulation since the proper MAC address needs to be determined. Strictly speaking, ARP isn't done by the NIC but the IPv4 stack (part of the OS). The NIC just transports those ARP packets.
Picture the IP packet as a container with an overseas address. It's loaded on a truck (frame) but the truck driver needs a street address he can drive to (MAC address). His controller (ARP) looks up the harbor address (gateway) for the container ship and passes it to the driver. At the port, the container is loaded onto a ship (another frame type) and the captain uses entirely different navigation than on the truck (another network type) for the destination port. At the destination, the container goes onto the next truck, and so on.

why we need NIC when we already have software-like network interfaces?

After all, the data needs to be transported physically in the physical world. Purely virtual interfaces (e.g. a VPN interface or a vNIC inside a hypervisor) and networks require no additional hardware - but the data can never leave the physical host.
Basically, a NIC provides physical (L1) and data link layer (L2) functionality in hardware, while the OS provides network (L3) and transport layer (L4) in software. The application layer (L7) resides in the application. (Where implemented, session (L5) and presentation layer (L6) as well.)

does every network interface must have its own IP address and MAC address? Can multiple network interfaces have the same IP address or MAC address?

Within a specific L2 segment and L3 subnet, yes. (There may be virtual IP addresses or even MAC addresses in special scenarios.)
A MAC address can be present in multiple L2 segments when VLANs are trunked to a NIC, for instance. Hardware MAC addresses are said to be globally unique, but that isn't always the case.
An IPv4 address is generally unique in a subnet, but private addresses may be used elsewhere, possibly requiring network address translation (NAT) in between. A virtual IP address may be shared by multiple devices, usually in an active-passive scheme like with VRRP or HSRP.
Answer: NICs are mostly used for end devices like PCs, printers  etc . Network interfaces are used on network devices. They mostly work the same, except Network interfaces can do more like advance networking e.g. transmit frames, route packets, etc.
Sometimes, they are used interchangeably, so you don't have to worry about it much.
@zec67 has said most of other advance features.
Regards.


Why aren't costs "advertised" or at least knowable so funds aren't lost?

Question: I'm admittedly new to all of this, but as I learn about the transaction model, it seems to be a confusing business model at the very least.  I can understand that the price of gas fluctuates or can be bid up or down.  But why should a consumer have to guess how much gas is required?
Comment: Guessing is normal for any market. I am offering you smart contract development for $500.00 USD an hour. I am guessing you would buy it. If I make a wrong guess you will pass on my offer. When you `Ask` on a Oil Futures contract you are guessing, when you sell your old car you are guessing. Hopefully you can see past transactions and calculate best price to reduce the guessing factor.
Answer: In a good interface, a consumer doesn't have to guess how much gas is required.
Sending Ether from one person to another always costs the exact same amount of gas. Sending an ERC20 token (provided it follows the standard) also costs a fixed number.
Each operation (line of a smart contract) costs a known number of gas. It is quite easy for people who run websites/shops/etc. to programmatically use the knowledge and know an exact amount of gas that is required. If you interact with a smart contract using MyEtherWallet, you will see that they estimate it for you.
Comment: Just a note: the ERC20 standard doesn't tell you how you should implement the transfer. It only says that a transfer function has to exist. So the required gas can vary between implementations.


Minimizing a linear combination of convex functions

Question: Suppose a series of convex functions $f_1(x), f_2(x), f_3(x), ...$ is given (also, expressions for their derivatives $\nabla f_1, \nabla f_2,...$ are known). Now, suppose a function $g(x)$ is a linear combination of the above functions, eg, $$g(x)=a_1\cdot f_1(x)+a_2\cdot f_2(x)+a_3\cdot f_3(x)...$$ My question is: can function $g(x)$ be minimized by first optimizing each of $f_i(x)$ separately to find corresponding $x_i$ at which $f_i(x)$ is minimum, and then state that a minimum of $g(x)$ is $y=a_1x_i+a_2x_2+a_3x_3...$? I tried to argue via derivatives of each $f_i(x)$, but cannot proceed.
Comment: No. Counter example is $f_1=x^2$, $f_2=x^2+x$. These have different minima(0 and $-1/2$), which is different from the minimum of $g=af_1+bf_2$ as $-b \over 2(a+b)$, which is not a linear combination of the solutions for each function. .
Comment: @Daryl Thanks. Is there any type of functions $f(x)$ that satisfy the above property?
Comment: The only family of functions I can think of are linear functions, but I am happy to be otherwise corrected.
Answer: I think the answer is no. Consider the functions in the following picture:

The minima of the sum is the entire interval between the minima of each individual function. You can imagine if you shifted either function up or down slightly, the minima would suddenly snap to one side or the other, regardless of the coefficients $a_i$.
These functions are not differentiable but that's not really an issue - just imagine smoothing out the tip of the functions a little bit and the same basic argument applies.
Answer: The general answer is no. But, can we tell the class of functions for which this works out?
Let $x^*_1, x^*_2, ..., x^*_n$ be the minima of $f_1, f_2, ...,f_n$ respectively. Hence,
$$\
\nabla f_i(x^*_i)=0 \ \forall i\in[n]
$$
$$\
\nabla g(x) = \sum_{i=1}^n \nabla f_i(x)
$$
We want $x'=\sum_{i=1}^n a_ix^*_i$ to be the minima of $g$ which is convex function,
$$\
\nabla g(x') = \sum_{i=1}^n \nabla f_i(x') = \sum_{i=1}^n \nabla f_i\left(\sum_{i=1}^n a_ix^*_i\right)
$$
We see that in general coming up with such a class is very difficult. A rather trivial answer could be when all the functions have same minima i.e. $x^*_1, x^*_2, ..., x^*_n=b$


Calendar reminder freezes and requires reboot to get rid of

Question: I have the Macbook Pro and use the Calendar program that came with it.  I have reminders come up an hour before my appointment but it does not allow me to "CLOSE" or "SNOOZE" it and when I put my cusor over it it shows the system bust WHEEL turning.  How can I correct this without losing all my calendar data?  I have to RESTART my system in order for the reminder screen to reset.  This started happening after one of the last system updates Mountain Lion OSX
Answer: Found a Fix, although it's not a definitive solution:
"
I've been seeing this for some time now and getting quite sick of it. It happens when I've been away at work for the day and come home to find frozen notifications.
You can fix this temporarily by quitting Notification Centre from Activity Monitor but it keeps happening to me every week or so.
"


How can i host yii2 framework web app on azure

Question: Anyone knows the best way to deploy yii2 framework web app on azure?. And is there any resource of how to connect database on azure.
Answer: You can using App Service/Web App. Follow these steps:

Push your app to github/bitbucket or whatever (I am using github)
Open https://portal.azure.com and login into your account
Go to Create resource -> Web -> Web App
Fill up the form and click create button
After successfully created, open your created resource
Click Deployment Center -> Github -> Continue -> Kudu -> Continue
Choose your group, repository and branch -> Finish

Install Composer:

Click Console
Follow this instruction
Execute php composer.phar install -vv
Execute chmod +777 assets
Don't forget to check the requirement here: https://yourdomain.com/requirements.php

Setup entry point:

Click Application Setting
Choose appropriate PHP version (7.X)
Go to Virtual applications and directories (At the bottom)
Change site\wwwroot to site\wwwroot\web
Save

Your Yii2 app should be running now.
To connect Azure Database just simply create the database on Azure, copy server name into db.php. If you want to test your app from localhost using Azure Database, don't forget to whitelist your public IP address on Database Firewall Setting
Answer: You can check this blog, though it is referring using the Classic Portal you can follow similar steps in the New Portal.
https://blogs.msdn.microsoft.com/azureossds/2015/07/23/migrate-yii-framework-application-to-azure-web-app/


How to use binomial regression in Python? Or any other appropriate analysis for this data set

Question: How can I use binomial regression or any other appropriate analysis technique to find out how all of these factors affect the wins and losses of these teams?
Answer: For each team we can know prob of winning. That becomes target variable. Once prob of win is know. You can calculate binomial distribution
It is regression problem, so I will
Go for linear regression or DecisionTreeRegression. Do remember to prevent overfitting.


Steering wheel stiff while turning while driving

Question: Just bought a 2004 Honda CRV, and it runs great. The only thing is, I noticed a small tick sound coming from the steering wheel column. The sound didn't raise any red flags, but now the steering wheel starts to get really stiff as I drive and makes it hard to turn the wheel left or right. What might be going on?
Comment: In the future, JEN, please turn down the volume.
Comment: Do you hear anything like a whining noise when you turn the wheel? Are the front tire pressures correct? Do you hear any other noises while turning the wheel? How does the steering feel if you turn the wheel while standing still and engine at idle? How many miles on the vehicle? Which engine?
Answer: My first thought would be the power steering system. On most modern cars there is a power steering pump, which is powered either by the engine mechanically (like with a belt) or electrically. This pumps power steering fluid to help assist with steering and make the steering wheel feel lighter in your hands. More info here: https://en.wikipedia.org/wiki/Power_steering
I would recommend, at the very least, checking the power steering fluid level. There should be a reservoir under the hood. You can find instructions in your owners manual to help.


Why didn't Watney just go to the MAV IV, use the three years of supplies till the next mission arrived?

Question: Why did he not just take his existing 14 months of food over to the "pre mission" supply/launch vehicle, that has three years worth of supplies (for six people by the way) and just wait for the next group of astronauts to arrive. Then figure out how to get seven back instead of six. Also in that four year wait he could have figured out how to communicate with Earth and let them know he was still alive.
Answer: Novel:
That was exactly his plan - his first course of action was immediate survival (water & food)

Sol 7
So that leaves enough food to fee six people for fifty days. I'm just one guy so it'll last me three hundred days. And that's if I
  don't ration it. So I've got a fair bit of time.

He only has enough food for roughly 300+ days - so the water making and planting buy him more time, which then lets him plan more complicated actions.
By Sol 7 he is already thinking of Ares 4:

There'll be humans back on Mars in about four years when Ares 4
  arrives (assuming they didn't cancel the program in the wake of my
  'death'). Ares 4 will be landing at the Schiaparelli crater, which is
  about 3200 kilometers away from my location here in Acidalia Planitia.
  No way for me to get there on my own.

By Sol 63, he has had a chance to re-evaluate his resources and reconsider going to Ares 4

Sol 63
It's time to start thinking long term. Even if I find a way to
  tell NASA I'm alive, there's no guarantee they'll be able to save me.
  I need to be proactive. I need to figure out how to get to Ares 4...
This is going to be a research effort, with a bunch of
  experimentation. I'll have to become my own little NASA, figuring out
  how to explore far from the Hab. The good news is I have lots of time
  to figure it out. Almost four years.
Comment: @NKCampbell Perhaps put your supporting answers (Sol 64 to 382) in a spoiler box or two? That way you can elaborate without giving away anything to people who don't want to read it.
Comment: You might want to elaborate on why he didn't go through with this plan
Comment: but that would spoil Sol 64 through 382... I think I answered the basic question ;) - I think what we have in this question is the basic weakness of a book to film translation (even a good one)
Comment: To be frank - I've seen the movie, and am now curious about it too. Give us the spoiler! :]
Comment: But the short and spoiler free version is that there was a lot of engineering that had to happen to let him cross the intervening space. As it says, 3200 km in and environment where you don't have GPS, you need to make your own oxygen and power for the vehicle, etc.  He can't just up and roll out.
Comment: oh sorry, I was meaning 'spoil' as in - Sol 64 through 382 is almost literally the entirety of the book
Answer: During a CNN interview (page 140 in the ebook version) Venkat Kapoor clearly states that while the MAV for Ares 4 is already on Mars, none of the presupplies are there yet:

"Do you think he's planning to go soon? He seems to be getting ready
  for a trip."
"I hope not," Venkat said. "There's nothing at the site other than the
  MAV. None of the other presupplies."

A bit later (page 148), Venkat is speaking with Teddy:

"Problem is, the original plan was to launch presupplies a year from
  now. They're not ready yet."

So the assumption about the supply/launch vehicle having plenty of supplies is wrong (also, where does the "three years worth of supplies for six people" come from? Ares missions have food for six people for 56 days - page 19).
Answer: The MAV lands first, because it spends several years making fuel from the atmosphere. Other components are sent later, after NASA confirms that the MAV landed safely and is working.
Answer: Can we figure it out from this?  The manned trip to Mars takes 124 days ~= 4 months (possibly the unmanned trips are faster). There are "a total of fourteen unmanned missions", "start to finish, including supply missions, a Mars mission takes about three years", and for the MAV "it takes twenty-four months to fill the tank" (later we get a better estimate of 18 months).  (All of that is in the first entry "Sol 6".)
So the MAV has to launch 22 months (at least) before the humans.  The mission is 1 month, the return 4 months (if symmetrical, which needn't be the case).  So if the overall mission is 36 months the humans get there in at month 31 (and launch at month 27).  Thus the MAV has to launch at month 9 at latest.  What happens during the earlier 9 months?  Perhaps some supply (food and other materials) missions go then.  And maybe some go immediately after.  So in that case there'd be plenty of food around (he'd just have to go collect it by himself).
On the other hand, if it only takes 4 months for the supply ships to get there maybe they wait until after the MAV is there and working and only then send the later 13 missions - to get there before the humans launch. Why waste them if the MAV face-planted and busted up?  So, launch the MAV at time 0.  At month 4 it lands successfully (or not).  By month 10 it's generated 6 months of fuel and is still going strong.  Now you have a full year to launch 13 more missions and have them all get there successfully before the Ares 4 leaves earth orbit.  So maybe the food isn't there yet (since the MAV arrives when Mark does the first food shipment on this schedule wouldn't arrive until he's been there 10 months).
(I realize this isn't an answer, as it is inconclusive.  But its too long for a comment ... and maybe someone else can work on it and improve it.  And check my math.  And reconcile this with Mark's comment that he has 4 years to survive, while the entire Ares4 from start to finish ought to be 3 years.)


What are these brown spots on my cactus? Are they normal or?

Question:

My cactus has these brown spots that are spreading and I'm not sure what they are? I've tried adjusting sunlight exposure and how much I water but it doesn't seem to have changed anything. Some of the spikes are falling off too… Help a guy out please
Answer: Nope, that is not normal at all.
I am sorry to say that this looks like a rot to me, and probably it has spread out a lot. Though I have not faced such severe case of rot, still it looks like it had started with the root and now much of the central stem (if not the whole of it) is affected.
Now generally what I do with cactus that rot is

uproot it immediately
cut the portion that is already rotten with at least 1cm good portion with it or keep cutting it until you see a perfectly fresh part, else any tiny rotten portion can again start the whole process without you knowing it.
put some fungicide on the fresh cut
keep this in open air for 4/5 days so that it dries out properly
after 4/5 days repot it in well drained media, don't water it immediately, again keep it like that for 2/3 days, no direct sunlight
after 2/3 days water it thoroughly and place it in partially sunlit area
after that you start your cactus watering schedule, i.e., don't water it unless the media dries out properly, keep it in sunlight etc etc.

That is my normal procedure with cactus with rot. You can follow it, though I don't know how much the rot is spread in your case.
Or, this article suggests few things, you can go with that or google yourself about other measures. https://www.gardeningknowhow.com/ornamental/cacti-succulents/scgen/stem-rot-of-cactus.htm
Bottom line: looks like root and stem rot.
Answer: I've never grown this kind of cactus (and the affected parts don't look super clear to me), but the affected areas look a lot like parts of a pepper or tomato that some creature (such as a pill bug or slug) has munched on, and which have healed over. If this is the case, your cactus probably isn't under threat of dying by disease or something, but maybe it needs some potassium to help make it stronger against pests. The pests may be gone by now, though.
I don't see any yellowing or rotten-looking parts.
I wouldn't call this normal, though, but remember, I haven't grown this kind of cactus.


Why VVT is never used in diesels?

Question: There is only a mitsubushi diesel engine that uses VVT but other than that there is no diesel engine that uses VVT or VVL. Why gasoline engines do utilize them but diesels dont?
Answer: The "traditional" impetus for VVT - providing suitable valve timing to support the different air demands across a wide range of engine speeds (and therefore not compromising performance for either lower or higher revs) is less of a concern for diesel engines, which typically have a much smaller engine speed range so it's much easier to find a compromise valve timing that suits the operating range reasonably well.
If you consider a Honda VTEC engine such as the B16B found in the 1997-2000 Civic Type R the VTEC engages at ~ 6,100pm with the engine redlining at 8,400rpm! Diesel engines (for the most part) generally don't get anywhere near that sort of rev range with peak power for a performance diesel often coming around 3,500 - 4,000rpm and peak torque available between 1,500-2,000rpm so rather than having to accommodate a usable range of nearly 7,000rpm like the Civic it's more like 2,500rpm of range.
As Wren T's answer points out Mitsubishi have produced a VVT diesel engine for consumer cars the 41N1, the motivation here is different however - the valve timing is being controlled so as to improve efficiency and reduce NOX emissions for the Euro5 (and similar) emissions standards for diesel cars. This underlines that it's not that you can't employ VVT techniques on diesel engines, it's just that in the past there wasn't the motivation to do so.
Answer: I don't know for sure, but I'll give you my educated guess as to why they don't use VVT on diesel engines.
The purpose of VVT on gasoline is to provide better low end torque and then switch over (at some point in the RPM range ... in the case of Honda's VTEC, that's ~4000 rpm) so it provides more high end horsepower. In the case of diesels, they are made to produce low end torque already and never get into the high end range as I'm describing for gas engines. To introduce VVT type events into the equation on a diesel engine would not provide any benefit. Most diesel engines do not rev high enough to take advantage of something like this. Without benefit, there's no reason to use it.
Answer: There are engines that are diesel and use VVT. Here's an example: https://en.wikipedia.org/wiki/Mitsubishi_4N1_engine
I also came across a few scholarly abstracts that talk about applying VVT successfully to diesel engines.
Comment: Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer).
Answer: Compression ratios for gasoline engines vary from 8:1 to 12:1 with various complications from vvt, super or turbo charging to increase power. Diesel engines have around 20:1 compression ratio and require robust mechanical designs to handle high compression. VVT may be a one-off adaptation as it's not universally adapted to other diesel engines. Diesel electronic injection is the last improvement with SCR and DEF to control exhaust pollutants. Gasoline and diesel engines operate differently with engineering tailored to extract the most thermal efficiency from both fuels. As it is, thermal efficiency remains around 25%-35% with the rest as waste heat dispersed in oil, coolant and exhaust. Diesel engine thermal efficiency is between 42%-50%, much higher than gas engines. There are pros and cons for gas and diesel engines.(edited to reflect updated higher compression ratios from replies)
Comment: @WrenT. 12:1 is the current compression ratio of the 5.0L Coyote V8 as used in the Mustang GT beginning in 2018.
Comment: Higher compression ratios are used today mainly because gas is of much better quality and they've learned to use electronics and mechanical advantage to stop producing ping/knock. It was actually quite *uncommon* for cars during the muscle car era to have anywhere close to 12:1 CR. Most cars of that era had CR's of ~8.5:1. Anything above 9:1 was pushing it. Only hot roders who could get good gas would push above 10:1, and 12:1 was over the top. The reason for higher CR's today is because rule of thumb states every 1 point of CR equates to 3% rise in power.
Comment: "Compression ratios for gasoline engines vary from 8:1 to 10:1"? My (quite old) car has a 10.5:1 compression ratio and I have seen newer ones as high as 12:1.
Comment: @GlenYates is quite right. Was going to say as much.
Comment: 12:1 was common in the muscle car era. Not so much anymore.
Comment: Listen to these folks. I am a total n00b on car stuff.

Why VVT is never used in diesels?


How to block network scans with pfsense?

Question: I am using pfsense as a firewall, and I would like to know how I can stop network scans from enumerating open services and ports.
Answer: Two answers to this question:

You can't
Port Knocking

Services exist to be connected to. If you have a service, then you need to allow clients to connect to it, and once you do that, it is open to be 'enumerated'. You can't block someone from trying a service to see if it responds because you need that ability for clients to connect to you.
... Unless you obfuscate the service port. Port Knocking allows you to open a service port to an client IP only if the client IP performed certain actions (usually pinging certain port numbers in a particular sequence). This is not a 'secure' method, but it does effectively hide a port from unauthorized 'enumeration'. The problem with this scheme is that all clients need to know the secret knock before they are allowed access, which is not good for public services.
But even with Port Knocking, people can still try to enumerate your ports, they just might not get the true ports of the services.
Comment: While this might be true for pfsense (I'm not sure, never tried it) detecting and blocking a port scan in progress is certainly possible.
Comment: As long as the port scan follows very narrow characteristics. It's a reverse port-knock: if an IP hits certain ports in a certain way, then close all ports to the IP. The problem is that this measure is easily bypassed by slow scans, switching IPs, hitting common ports, etc.
Answer: I'm not sure with pfsense, but this is possible with psad:

psad makes use of Netfilter log messages to detect, alert, and (optionally) block port scans and other suspect traffic. For tcp scans psad analyzes tcp flags to determine the scan type (syn, fin, xmas, etc.) and corresponding command line options that could be supplied to nmap to generate such a scan. In addition, psad makes use of many tcp, udp, and icmp signatures contained within the Snort intrusion detection system.


Outlook 2010 inbox is spammed with meeting acceptances

Question: A teammate at work sent out a meeting request to several people.  They all accepted.  However, one of those people's meeting acceptance notes keeps spamming  the creators Inbox.  The meeting acceptance came in probably more than 100 times.  They were deleted and then shortly after a hundred more or so came in.  This is in Outlook 2010.  This is such a weird problem and I'm not really sure where to begin looking.  Unfortunately I don't have access to the actual Exchange server either.  Any ideas?
Answer: Speak to the people in charge of the Exchange Server; They're probably going to have to be the ones who deal with it, and it may be a sign of a larger server-side problem.


Show that $f(z)=z^2+z$ is a conformal mapping and preserves angle

Question: How do i show that this function preserves angle? There is no function given along which this is mapped. I know that its derivative is $f'(z)=2z+1$ so it is conformal for all points except 1 and $z_0$ not equal to zero. But how do i show this preserves angle?
Answer: An analytic function is conformal precisely where its derivative is non-$0$. Thus, conformality holds everywhere except at $z=-\frac12$.


'usr/bin/python' and 'python' run different versions

Question: On my OS X typing /usr/bin/python in to terminal runs Python 2.6.1, but typing python runs Python 2.7.2. I'd like the former to run 2.7.2 as well - how do I do this?
Answer: The version in /usr/bin/python is the version installed as part of OS X.  Type 'which python' to find out where your newer python version is located.  You've probably installed a newer version via MacPorts or the like.
It might be dangerous to change where /usr/bin/python points to in case it is needed by other apps.  You can change your python scripts so that they find the user's version of python by changing the first line from:
#!/usr/bin/python

to:
#!/bin/env python

If you really want to replace /usr/bin/python, you can do it like this:
sudo mv /usr/bin/python /usr/bin/python.dist
sudo ln -s `which python` /usr/bin/python

However, like I said, that might be dangerous.  If you need to revert this change later you can run:
sudo rm /usr/bin/python
sudo mv /usr/bin/python.dist /usr/bin/python

Please run these with care though.  If you accidentally remove your system installed python version on OS X there will be some pain involved in getting it back.
Comment: Agreed.  Also, future updates from Apple may replace the symlink and effectively revert the change, or possibly (depending on exactly how the installer works -- I haven't tested) follow the symlink and replace the 2.7.2 version you've built with something else.
Answer: It seems the /usr/bin/python is the Apple provided file. As others mentioned, do not touch it.
The file itself seems to be pointing to (Reference 1):
/Library/Frameworks/Python.framework/Versions

In this folder you should be able to find the latest installed 2.x or 3.x versions with symbolic link folder named Current/, where Current/ will point to the latest installed version.
Note, all the Python version that you have ever installed are placed in (Reference 2):
/System/Library/Frameworks/Python.framework/Versions

In my case I had to remove 2.5 folder from 'Reference 1' and upload 2.7 from 'Reference 2'. Then I removed the 'Current' link and created a new one pointing to 2.7/ folder (ln -s 2.7/ Current).
[I am not sure, the same might be needed for the other folder]
Now, when typing python --version you should see python version pointing to the latest Current/ link that you created, in my case it was Version 2.7.
I hope this helped, it worked here.


WP appending -2 to the end of my slug. Where are the originals stored so I can delete them?

Question: I've been learning about taxonomies, custom posts etc though a lot of trial and error. I finally have it working how I want, however now I am getting some conflict with my desired slugs. I can't name my category "venue" because someplace in the database, that's already taken (I assume) - even though I've deleted the category that used it. Now when I try adding the category that I want to use the "venue" slug, WP automatically makes it "venue-2", which I definitely don't want in my url as the folder. Any suggestions for this?
Comment: Clear your trash posts, pages etc. deleting items permanently.
Comment: Any progress on this question?
Comment: @kaiser, I'd love to know how to change that as well. I'd rather avoid messing with the database itself.
Comment: @MayeenulIslam That should actually be an answer - or search up an answer that you can take and mark this one as duplicate. Thanks.
Answer: This can also be caused by uploading images with the same file name as the post/page. In my case, I uploaded an image called 'careers.jpg' before I created a page called 'Careers', so the page was getting the '-2' appended. To fix it, I just changed the slug on the image, then I was able to change the slug on the page.
Comment: The media permalink field can be hidden by default, btw. Here's more info on how to find it: https://wordpress.stackexchange.com/questions/232569/change-media-item-permalink
Answer: The slug is stored in the post_name column of your posts table. I'd recommend searching that table first before manually assigning that slug, though.
Comment: thank you! this is exactly the information I needed. It's not letting me manually assign the slug, which is a failsafe I guess.
Comment: What are you using? You can do this with PHPMyAdmin; I have in the past.
Comment: @Joseph, how about custom post type taxonomy slugs? I don't even have any CPT posts left yet taxonomy keeps adding numbers to slugs...
Comment: Do a complete search of your database for the slug that you are trying to use.
Comment: Thank you. still valuable advice in 2019
Answer: There is another cause for Wordpress appending -2 at the end: When the slug only contains numbers. This is not allowed.
Example: I wanted to name my page 2016 and even though there has never been a 2016 in the database the slug always turned into 2016-2.
As far as I remember this is because numbers have a special meaning for workpress (path variables) and they couldn't be distinguished.
So my solution was to manually rename the slug to year-2016 which looks nicer than this "-2" suffix.
Comment: great found, thanks
Answer: Usually when Wordpress appends the "-2" to a slug, that means you still have the old content, that you meant to delete, in the trash. Be sure to empty your wordpress trash, then try making the slug.
To access the pages in the trash, open the Pages / All pages menu, then click on the "Bin" section that appears on the right hand side of the "All" section. Note that if there is no items in the bin, this section will not appear.
Comment: Is there a trash for slugs somewhere then? :)


Coffee Breeding Companies

Question: I've poked around but couldn't find solid information. Is coffee improvement done in mostly the private or public sector? Are there gene edited coffee varieties for commerical?
Answer: It's an interesting topic.  Genetic modification seems not to be a commercially viable approach to creating new coffee varieties.  Of course it is reasonable to ask the question, but here is a statement from the National Coffee Association, which says in part:

Are there GMOs in my coffee?
No, the NCA is not aware of any GMO coffee in the marketplace.

The tabloid news site DailyMail.co.uk carried a report last year (Sept. 27, 2021) about a "first ever genetically-engineered coffee", but the substance of the story concerns "coffee cells [produced] in a bioreactor through cellular agriculture," not genetic modification per se.
A more relevant story appeared in Jan. 2018 on Daily Coffee News by roast Magazine:

Although there is widespread consumer opposition to genetically modified foods and beverages, the scientific community does not share that opposition. And in light of the dire outlook for the future of coffee cultivation in the coming decades, it seems clear we must understand and embrace research that includes genetic engineering as a potential tool in the fight to save coffee.

Even though currently there is no genetically engineered coffee available for commercial production, Jason Long, CEO of Cafe Imports, says, "The anti-GMO thing was just a bully pulpit, basically trying to get it out there. To me, it was to bring up and highlight the labeling issue."

Still the prospect seems to be Clouds in my Coffee.

Coffee Breeding Companies


Multiseasonal models for multivariate time series

Question: Does there exist model (ideally implemented in R) which take into account multiseasonality for multivariate time series as BATS does in the univariate case?
Comment: It is a fine question.  Some on this site want only high-level, theoretical questions.  Others, myself included, enjoy niche questions like this (which can be used by Google-searchers in the future).
Comment: It's very frustrating to see on this site that people can downvote questions which are well-posed and clear without any explanation.
Answer: Found a possible answer for you at this link, which could provide you with more information on the specific package you are looking for.  According to the author, you may want to look into msts as a package for handling your type of data:

An alternative is to use a msts object (defined in the forecast package) which handles multiple seasonality time series. Then you can specify all the frequencies that might be relevant. It is also flexible enough to handle non-integer frequencies.

As an example, below is an example on how to handle multiseasonality, using taylor electricity dataset (from forcast package) with daily ($24 \times 2$) and weekly ($24 \times 2 \times 7$) cycles:
x <- msts(taylor, seasonal.periods=c(24*2,24*2*7))
fit <- tbats(x[1:1000])
plot(forecast(fit))

Additionally, in case you may want to use dummy variables as @TomWitten suggests, you can view the information on this page, which deals with forecasting double (or multiple) seasonal multivariate time series, with specific examples.
Comment: Thanks for your answer (I upvoted it). In fact, although `msts` objects can handle multivariate time series, that's not the case for `bats` and `tbats` so my problem isn't completely solved (except if using multiple linear regression with dummies as explained in the 2nd link you gave).
Answer: if you know the seasonality could you not just create a series of dummy variables to capture the effects? In my time series data i had 12 monthly dummies for example
Comment: That's true of course but that doesn't really answer my question. Thank you (+1).


Difference between Interface, abstract class, sealed class, static class and partial class in C#?

Question: Difference between Interface, abstract class, sealed class, static class and partial class in c#? If all classes available in vb.net?
Comment: Read a book, or an introduction to C#. Or if you are brave, the ECMA spec.
Comment: @leppie - The ECMA spec is surprisingly easy to follow in my opinion.
Comment: @ChaosPandion haha, I often found it simpler than msdn docs :)
Comment: @ChaosPandion: Yes, I agree, but not for a novice that do not understand the underlying concepts.
Answer:
abstract class
Should be used when there is a IS-A relationship and no instances should be allowed to be created from that abstract class.
Example: An Animal is an abstract base class where specific animals can be derived from, i.e. Horse, Pig etc.
By making Animal abstract it is not allowed to create an Animal instance.
interface
An interface should be used to implement functionality in a class. Suppose we want a horse to be able to Jump, an interface IJumping can be created. By adding this interface to Horse, all methods in IJumping should be implemented. In IJumping itself only the declarations (e.g. StartJump and EndJump are defined), in Horse the implementations of these two methods should be added.
sealed class
By making Horse sealed, it is not possible to inherit from it, e.g. making classes like Pony or WorkHorse which you like to be inheriting from Horse.
static class
Mostly used for 'utility' functions. Suppose you need some method to calculate the average of some numbers to be used in the Horse class, but you don't want to put that in Horse since it is unrelated and it also is not related to animals, you can create a class to have this kind of methods. You don't need an instance of such a utility class.
partial class
A partial class is nothing more than splitting the file of a class into multiple smaller files. A reason to do this might be to share only part of the source code to others. If the reason is that the file gets too big, think about splitting the class in smaller classes first.
Comment: excellent and very easy. could not find so easy like that. thanks a lot
Answer:
Interface: method definitions only
Abstract class: some method implementations, some methods abstract (method definition only)
Sealed class: A class from which you
may not inherit
Static class: a class    with only
static methods (no    instances
exist, all methods may be    called
without an instance)
Partial    class: A class that is
defined in 2    or more separate
class definitions in    different
modules.

Yes, they are all available in both C# and VB, although VB uses different keywords in some cases.
Answer: I guess following link will be useful for you.
http://letschattechnology.com/interface-vs-abstract-classes/
the basic logical difference is you create abstract class when there is a relation between two classes that will inherit the abstract class and you create interface for the classes which are not related to each other but do have some common functionality.
Comment: @fifamaniac04: I am sorry, link had changed. I have updated the link. You should be able to see that post now.
Comment: Did anyone else click on this link?? It didn't take me to anything code related... was a rather naughty link for me lol
Answer: Following are the differences between abstract and interface:

Abstract classes have method declaration as well as method definition whereas interfaces have method declaration only.
Abstract classes are known as partial abstract classes whereas interfaces are known as fully abstract classes.
Abstract class features are inherited by child classes whereas interface features have to be implemented in implementing classes.
Abstract classes support access specifiers whereas interfaces don't support access specifiers.
Abstract classes have normal variables as well as constant variables whereas interfaces do not have variables.
We can write constructors in abstract classes whereas we can't write constructors in interfaces.
Comment: "interfaces don't support access specifiers." - I used internal explicitly and public by default.
Answer: A normal class can be instantiated at runtime to form an Object with fields (fields are properties, functions, events, etc). A normal class can also be inherited/sub-classed.
Adding one of the extra keywords change the way the class works.

Adding public, private, protected changes the way other code can see and use this class.
Adding static to a class means you can't create an instance with the new keyword but you can only access it through static function. Example: String.IsNullOrEmpty().
Adding sealed to a class means no other class can inherit the 'sealed' class.

Interfaces are contracts that say an implementing class will supply some functionality. The IDisposable interface says that all classes implementing it will have a Dispose function.
Answer: In abstract class  can provide more functionality without affecting child class.
In interface,if we add any method to interface ,then it will affect all the child class.
Comment: I think you should elaborate more your post to ensure it provides a proper answer to OP. Please also have a look to our FAQ : http://stackoverflow.com/faq. Good luck.