text
stringlengths
3
1.74M
label
class label
2 classes
source
stringclasses
3 values
DDD Request Validation Handling. <p>I stuck somewhere that I can't find a solution! There are plenty of validation questions here, but as far as I see, most of them were asking about entity validation. But what about request validation? </p> <p>I'm developing a service for web application. Basically I have 3 modules which are Web, Domain and Repo. A request for Web project has dependencies to other technologies(JAX-WS auto generated classes) and they are not suitable to be used in domain. So I convert them to new request class to make more suitable for domain service. I also add <strong>defaults()</strong> and <strong>validate()</strong> methods to the new request class. So some part of request validation is handled in <strong>validate()</strong> method. I call them at first line of corresponding method in domain service. So before starting the operation, I know whether request is valid or not. Later on, I have kind-of-validation codes. At this point, I'm not very ensure that which part of the validation truly belongs request validation and which part of it belongs domain service as business logic. I believe every piece of code belongs where it has to be! But sometimes it is hard do decide:D For instance when you need to use repository while you are validating. Let me explain with example.</p> <p>Let's say you need to do implement a method where customers can be added or deleted from account. Aside null control(validation-phase1), you might check either the customer is valid or not. You need repository. Then you check either account is open or not. You need repository. Boom! Then you do check either customer in request has been already added or you try to delete the customer who doesn't belong to account and so on... May be you think that those situations are not validation, but business logic. I think they are validation, because first, you check customers and account, then do other stuff. What do you think about using repository from validation method, what is your edge for validation? Do you consider above situation I mentioned as a validation? Thanks in advance.</p>
0non-cybersec
Stackexchange
Howto: command/tool ability check. <p>When developing a shell script that should run on various unix/linux derivates, i sometimes have the problem that some tools have to be called in a different way compared to other systems. For example if the arguments are different. I wonder what's the best way to solve this.</p> <p>Should i use <code>uname</code> to check for the operating system name and rely on this to execute the tool in different ways or are there any "better" ways, some kind of "ability" check for shell commands and tools?</p> <p>The systems in question are for example Linux, Mac OS X, Solaris and Irix -- all quite different when it comes to abilities of tools and shell commands.</p>
0non-cybersec
Stackexchange
What GPO have you used in your organization that has cut down your support calls drastically?. Some are restricting users, while others may be sheer convenience like mapping drive. What did you use or what do you wish to implement that will address a lot of your support calls.
0non-cybersec
Reddit
How to check if integer value is less or more then 3. <p>We have two values</p> <pre><code>$a $b </code></pre> <p>we need to compare the $a value with $b value</p> <p>in case $b value is less than ($a - 3) or more than ($a + 3), then it will print fail.</p> <p>example:</p> <pre><code>a=10 b=14 </code></pre> <p>then it should fail.</p> <p>For:</p> <pre><code>a=10 b=11 </code></pre> <p>then it's ok.</p> <p>For:</p> <pre><code>a=23 b=6 </code></pre> <p>then it should fail.</p>
0non-cybersec
Stackexchange
Creating a ClassLoader to load a JAR file from a byte array. <p>I'm looking to write a custom class loader that will load a <code>JAR</code> file from across a custom network. In the end, all I have to work with is a byte array of the <code>JAR</code> file.<br></p> <p>I cannot dump the byte array onto the file system and use a <code>URLClassLoader</code>.<br> My first plan was to create a <code>JarFile</code> object from a stream or byte array, but it only supports a <code>File</code> object.</p> <p>I've already written up something that uses a <code>JarInputStream</code>:</p> <pre><code>public class RemoteClassLoader extends ClassLoader { private final byte[] jarBytes; public RemoteClassLoader(byte[] jarBytes) { this.jarBytes = jarBytes; } @Override public Class&lt;?&gt; loadClass(String name, boolean resolve) throws ClassNotFoundException { Class&lt;?&gt; clazz = findLoadedClass(name); if (clazz == null) { try { InputStream in = getResourceAsStream(name.replace('.', '/') + ".class"); ByteArrayOutputStream out = new ByteArrayOutputStream(); StreamUtils.writeTo(in, out); byte[] bytes = out.toByteArray(); clazz = defineClass(name, bytes, 0, bytes.length); if (resolve) { resolveClass(clazz); } } catch (Exception e) { clazz = super.loadClass(name, resolve); } } return clazz; } @Override public URL getResource(String name) { return null; } @Override public InputStream getResourceAsStream(String name) { try (JarInputStream jis = new JarInputStream(new ByteArrayInputStream(jarBytes))) { JarEntry entry; while ((entry = jis.getNextJarEntry()) != null) { if (entry.getName().equals(name)) { return jis; } } } catch (IOException e) { e.printStackTrace(); } return null; } } </code></pre> <p>This may work fine for small <code>JAR</code> files, but I tried loading up a <code>2.7MB</code> jar file with almost <code>2000</code> classes and it was taking around <code>160 ms</code> just to iterate through all the entries let alone load the class it found.<br></p> <p>If anyone knows a solution that's faster than iterating through a <code>JarInputStream</code>'s entries each time a class is loaded, please share!<br></p>
0non-cybersec
Stackexchange
Bigăr waterfall, Banat, Romania.
0non-cybersec
Reddit
Singleton pattern in nodejs - is it needed?. <p>I recently came across <a href="http://simplapi.wordpress.com/2012/05/14/node-js-singleton-structure/" rel="noreferrer">this article</a> on how to write a singleton in Node.js. I know the documentation of <code>require</code> <a href="http://nodejs.org/api/modules.html#modules_loading_from_node_modules_folders" rel="noreferrer">states</a> that:</p> <blockquote> <p>Modules are cached after the first time they are loaded. Multiple calls to <code>require('foo')</code> may not cause the module code to be executed multiple times.</p> </blockquote> <p>So it seems that every required module can be easily used as a singleton without the singleton boilerplate-code.</p> <p><strong>Question:</strong></p> <p>Does the above article provide a round about solution to creating a singleton?</p>
0non-cybersec
Stackexchange
AEAD and nonces explained in layman&#39;s terms (Symmetric encryption example using Libsodium). <p>After almost 4 days of work, I've finally gotten <a href="https://download.libsodium.org/doc/" rel="nofollow noreferrer">Libsodium</a> <code>crypto_aead_xchacha20poly1305_ietf_encrypt</code> to work and produce the same result in <a href="https://github.com/jedisct1/libsodium.js" rel="nofollow noreferrer">JavaScript</a> and <a href="https://github.com/jedisct1/libsodium-php" rel="nofollow noreferrer">PHP</a>.</p> <p>But I'm confused.</p> <p>The PHPDoc describes the parameters as:</p> <pre><code>* @param string $plaintext Message to be encrypted * @param string $assocData Authenticated Associated Data (unencrypted) * @param string $nonce Number to be used only Once * @param string $key Encryption key * @return string </code></pre> <p>While JSDoc asks for these parameters:</p> <pre><code>/** * @param {string | Uint8Array} message * @param {string | Uint8Array} additional_data * @param {string | Uint8Array} secret_nonce * @param {Uint8Array} public_nonce * @param {Uint8Array} key * @param {uint8array} outputFormat * @returns {Uint8Array} */ </code></pre> <h2>My questions:</h2> <ol> <li>It seems like a nonce is a type of salt of a specific size that can only be used once because otherwise replay attacks can happen. Can you help me understand this further? Wikipedia and other sites got too complicated.</li> <li>To a layman, how would you describe AEAD and how to use the "Authenticated Associated Data (unencrypted)" parameter?</li> <li>In the PHP function (which I copied from <a href="https://paragonie.com/b/kIqqEWlp3VUOpRD7" rel="nofollow noreferrer">https://paragonie.com/b/kIqqEWlp3VUOpRD7</a>), does using the nonce not just as a nonce but also as the "Authenticated Associated Data" reduce the security compared to some other approach where the sender would add some value here and communicate offline to the receiver what the receiver should expect this value to be?</li> <li>Why would the JavaScript version accept different parameters? JS asks for a secret_nonce separate from a public_nonce, and in order for the results to match PHP's function, I need to supply identical values for secret_nonce and public_nonce. So what's the point?</li> </ol> <hr> <p>P.S. Here are the functions:</p> <p>JavaScript: </p> <pre><code>/** * @param {string} message * @param {Uint8Array} key * @returns {Uint8Array} */ function encryptAndPrependNonce(message, key) { let nonce = sodium.randombytes_buf(nonceBytes); var encrypted = sodium.crypto_aead_xchacha20poly1305_ietf_encrypt(message, nonce, nonce, nonce, key); var nonce_and_ciphertext = concatTypedArray(Uint8Array, nonce, encrypted); return nonce_and_ciphertext; } </code></pre> <p>PHP:</p> <pre><code>/** * @link https://paragonie.com/b/kIqqEWlp3VUOpRD7 (from the `simpleEncrypt` function) * @param string $message * @param string $keyAsBinary * @return string */ public static function encryptAndPrependNonce($message, $keyAsBinary) { $nonce = random_bytes(self::NONCE_BYTES); // NONCE = Number to be used ONCE, for each message $encrypted = ParagonIE_Sodium_Compat::crypto_aead_xchacha20poly1305_ietf_encrypt($message, $nonce, $nonce, $keyAsBinary); return $nonce . $encrypted; } </code></pre>
0non-cybersec
Stackexchange
Driver's Last Text Before Crash: 'I Need to Quit Texting While Driving'.
0non-cybersec
Reddit
Richie Havens plays the first set at Woodstock. Friday, Aug. 15, 1969. Photo by Elliott Landy. [2224 x 1451].
0non-cybersec
Reddit
Always knew Eugene was up to something.
0non-cybersec
Reddit
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
The Black Keys - Tighten Up (from Letterman).
0non-cybersec
Reddit
An idempotent operator $P$ is an orthogonal projection iff it is self adjoint. <p>$V$ is a finitte dimension vector space. If for some $P\in End(V)$ we have $P=P^2$ then $P$ is an orthogonal projection $\iff$ $P$ is self-adjoint.</p> <p>I can show that since $P$ is idempotent then $V=ker(P)\oplus Im(P)$ and $P$ is the projection on its image parallel to its kernel. If $P$ is also self-adjoint I easily get that $ker(P)$ is orthogonal to $Im(P)$ and therefore $P$ is an orthogonal projection. </p> <p>I'm not quite sure how to proceed in the other direction, thoughts?</p> <p>Edit - Answer (Thanks to Verdruss)</p> <p>As shown above $\forall v,v'\in V$ we have a unique decomposition $v=u+w,\ v'=u'+w'$ $\ \ u,u'\in U;\ \ w,w'\in W$ where $U$ and $W$ are orthogonal.</p> <p>$\left\langle P(v)\mid v'\right\rangle =\left\langle P(u+w)\mid u'+w'\right\rangle =\left\langle u\mid u'+w'\right\rangle =\left\langle u\mid u'\right\rangle +\left\langle u\mid w'\right\rangle =\left\langle u\mid u'\right\rangle $</p> <p>$\left\langle v\mid P(v')\right\rangle =\left\langle u+w\mid P(u'+w')\right\rangle =\left\langle u+w\mid u'\right\rangle =\left\langle u\mid u'\right\rangle +\left\langle w\mid u'\right\rangle =\left\langle u\mid u'\right\rangle $</p> <p>And therefore we can conclude $P$ is self-adjoint</p>
0non-cybersec
Stackexchange
RX 580 8GB + Freesync is better than GTX 1060 6GB + No G-Sync right?.
0non-cybersec
Reddit
wholesale North Face Cheap price on sale.
0non-cybersec
Reddit
Jordan Canonical form of the matrix. <p>Using Jordan Canonical theorem, prove that the matrix sequence $\lbrace A^k\rbrace\rightarrow 0$ (i.e matrix sequence tending to zero matrix) if and only if $|\lambda_i|&lt;1$ i.e the absolute value of each eigenvalue (of $A$) is less than $1$.</p> <p>Further prove that $\lbrace A^k\rbrace\rightarrow 0$ if $||A||&lt;1$, where $||\cdot||$ is a subordinate matrix norm.</p>
0non-cybersec
Stackexchange
How to read a JCR Node&#39;s properties BEFORE it&#39;s deleted in Adobe Experience Manager?. <p>I need to audit properties of a JCR Node before the OTB deleted workflow physically deletes the node. </p> <p>AEM provides a few ways to listen to deleted events. I've tried both the EventListener and a ResourceChangeListner. Both scenarios alert my code when a delete is triggered. However, I receive a "does not exist" when performing a session.getNode on the onChange path.</p> <p>To validate I'm using the correct session/user/etc, I tested that I <strong>AM</strong> able to retrieve the node's parent. So, this proves I have the correct permissions and my listener is being informed after the node is already gone. Also, I have seen this work at least once so this is, obviously, a race condition. Sometimes I am alerted before the node is gone sometimes I am not.</p> <p>So, how do I <strong><em>guarantee</em></strong> my code will be called <strong>before</strong> the JCR Node is actually gone?</p> <p>Before you reference <a href="https://stackoverflow.com/questions/32770058">this post</a>, I am applying solutions #2 and #3. Both have the same race condition result. #1 doesn't describe how to tie into the existing OTB AEM 'delete' 'workflow', is that possible?</p>
0non-cybersec
Stackexchange
How do I tell when a request is a forward in preHandle using Spring MVC?. <p>I have the following...</p> <pre><code>@GetMapping("signup") public String get(){ return "forward:/"; } @Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws IOException { ... if(!per.isPresent() &amp;&amp; !request.getRequestURL().toString().contains("signup")){ response.sendRedirect("/signup"); return false; } } </code></pre> <p>The problem here is when the forward comes it isn't signup so I redirect back. However, I also want to intercept requests that go directly to the root. </p> <p>Is there any way to tell if a request is a forward and what the original url was?</p>
0non-cybersec
Stackexchange
Shell Function: Sequence of Pipelines as Argument. <p>I have a shell function (in .bashrc) which creates a temp file, executes the arguments (including all sequence of pipelines), redirects it to a temp file and then open it in VS Code.</p> <p>I invoke the shell function as</p> <pre class="lang-bsh prettyprint-override"><code>Temp "ls | nl" </code></pre> <p>In the follwoing code, I tried to make it work. I break the entire string with IFS as a space, store it in an array. Now I want to execute the entire sequence of pipelines and redirect the final stdout to the temp file. How can I achieve this.? I know that for loop won't work here. But I want to print the entire array. </p> <pre class="lang-bsh prettyprint-override"><code>Temp() { a="$(mktemp --suffix=.md "/tmp/$1-$(GetFilename "$2")-XXX")" IFS=' ' read -r -a Array &lt;&lt;&lt; "$1" nArray=${#Array[@]} # Size of array for ((i=0; i&lt;nArray; i=i+1)); do done #"${@}" &gt; "$a" code -r "$a" } </code></pre> <hr> <p>In the interactive terminal session the following works:</p> <pre class="lang-bsh prettyprint-override"><code>cat &lt;&lt;EOF $(ls | nl) EOF </code></pre> <p>So, I tried Heredoc, instead of the for loop inside the function</p> <pre><code>cat &gt; "$a" &lt;&lt;EOF $($1) EOF </code></pre> <p>But this puts quotes around <code>|</code> and thus fails.</p> <p>The above would work, if we could remove the quotes somehow.</p> <hr> <p>This also doesn't work</p> <pre class="lang-bsh prettyprint-override"><code>cat &gt; "$a" &lt;&lt;EOF $(echo $1 | sed "s/'//g") EOF </code></pre>
0non-cybersec
Stackexchange
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
A beautiful timer app that counts down time with your music (disclaimer: I made it!).
0non-cybersec
Reddit
Ain't that true.
0non-cybersec
Reddit
Directing messages to consumers. <p>My client is attempting to send messages to the receiver. However I noticed that the receiver sometimes does not receive all the messages sent by the client thus missing a few messages (not sure where the problem is ? Client or the receiver). Any suggestions on why that might be happening. This is what I am currently doing</p> <p>On the receiver side this is what I am doing. </p> <p>This is the Event Processor</p> <pre><code> async Task IEventProcessor.ProcessEventsAsync(PartitionContext context, IEnumerable&lt;EventData&gt; messages) { foreach (var eventData in messages) { var data = Encoding.UTF8.GetString(eventData.Body.Array, eventData.Body.Offset, eventData.Body.Count); } } </code></pre> <p>This is how the client connects to the event hub</p> <pre><code>var StrBuilder = new EventHubsConnectionStringBuilder(eventHubConnectionString) { EntityPath = eventHubName, }; this.eventHubClient = EventHubClient.CreateFromConnectionString(StrBuilder.ToString()); </code></pre> <p>How do I direct my messages to specific consumers</p>
0non-cybersec
Stackexchange
Where is lighttpd.conf? Mybook world 2 whitelight webserver. <p>I'm attempting to get my Roku streaming box with a channel called Roksbox to stream content off my MyBook World 2 whitelight. I want a directory listing of a certain folder of a share, Media. It's 2012 and this should be way easier.</p> <p>I've tried the basic instructions for installing apache here <a href="http://roksbox.com/home/index.php?option=com_content&amp;view=article&amp;id=73&amp;Itemid=73" rel="nofollow noreferrer" title="roksbox site">http://roksbox.com/home/index.php?option=com_content&amp;view=article&amp;id=73&amp;Itemid=73</a>, and seemingly got apache running, but couldn't get past a 403 error. Knowing that the admin app is already running as a webserver I've decided to get away from the apache route.</p> <p>I've found this article. <a href="http://martin.hinner.info/mybook/lighttpd.php" rel="nofollow noreferrer" title="some dude&#39;s site">http://martin.hinner.info/mybook/lighttpd.php</a> The problem is that I don't even see a lighttpd directory in /etc. Is this a hidden directory or file? How can I be sure that lighttpd is what server is actually running?</p> <p>Any hints are welcome. I can provide more info like firmware and whatnot if necessary.</p>
0non-cybersec
Stackexchange
Google Chrome background tabs don&#39;t load/build until selected. <p>When browsing, I tend to middle-click things I want to read so they load in a new tab in the background. That way they're ready to read when I finish the current page.</p> <p>Recently the behavior changed in Google Chrome. Now when I select a background-loaded tab, my disk chugs for a long time instead of switching instantly. It doesn't actually build the background tab until I select it. And it takes longer for it to foreground it than it would have to just load it. (Note, I believe the page was downloaded from the internet, just not "imaged", since the disk chugs like it was paged out and it's not displaying the usual progress in the status bar at the bottom.)</p> <p>What changed? How do I get the old behavior back?</p> <p>Google Chrome: 35.0.1916.153 (Official Build 274914) m</p> <p>OS: Windows </p> <p>(I've googled for chrome, background tab, lazy load, delayed load, etc... no luck with any search terms after about an hour.)</p> <p>EDIT: This recently stopped happening on all my computers within a one-week period. It looks to me that it was a change implemented in Chrome, again.</p>
0non-cybersec
Stackexchange
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
Kolkata’s Simplicity!.
0non-cybersec
Reddit
PDF of discrete fourier transform of a sequence of gaussian random variables. <p>I have a set of numbers drawn from iid gaussian random variables:</p> <p>$P(d_0, ..., d_{N-1}) = (\sigma \sqrt{2 \pi})^{-N} exp\left(\frac{-1}{2\sigma^2} (d_0^2 + ... + d_{N-1}^2)\right)$</p> <p>What is the pdf for the discrete fourier transform $f_0, ... f_{N-1}$ of the $d_k$?</p> <p>It seems like this should be a fairly strightforward calculation but I'm getting bogged down. One thing that seems to make it tricky is the periodicity property of the $f_k$ means that you need to choose N particular real numbers to work with. I'd actually be happy with an answer that marginalizes over the phase angles, but a full answer would be great.</p> <p>Is there a good text that addresses this type of question?</p>
0non-cybersec
Stackexchange
PHP: is it possible to jump from one case to another inside a switch?. <p>I have a switch where in very rare occasions I might need to jump to another case, I am looking for something like these:</p> <pre><code>switch($var){ case: 'a' if($otherVar != 0){ // Any conditional, it is irrelevant //Go to case y; }else{ //case a } break; case 'b': //case b code break; case 'c': if($otherVar2 != 0){ // Any conditional, it is irrelevant //Go to case y; }else{ //case c } break; . . . case 'x': //case x code break; case 'y': //case y code break; default: // more code break; } </code></pre> <p>Is there any GOTO option, I red somewhere about it but can't find it, or maybe another solution? Thanks.</p>
0non-cybersec
Stackexchange
kde5: Note widget disappeared. How can I get it back?. <p>My computer freezed and after a restart, all my notes are gone. The notes are still in the folder <code>/.local/share/plasma_notes</code></p> <p>When I try to add a new widget, I don't find the note widget in the widget panel anymore. Where is it gone? And how can I get it back?</p> <p>For example: I can't find the note widget in this panel widget anymore. <a href="https://i.stack.imgur.com/h972m.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/h972m.png" alt="enter image description here"></a></p>
0non-cybersec
Stackexchange
Do C++11 regular expressions work with UTF-8 strings?. <p>If I want to use C++11's regular expressions with unicode strings, will they work with char* as UTF-8 or do I have to convert them to a wchar_t* string?</p>
0non-cybersec
Stackexchange
Sex feels no different from kissing and touching for me. 19 M. I talked to a nurse 3 years ago, she said it would come eventually. But it seems like she was wrong. Does anyone know why it is like this?
0non-cybersec
Reddit
LPT: You should never write your entire password down, but you can write the first and last couple of letters/numbers down to jot your memory. If you're like most people, you use the same variation of password for everything.. Edit: "variations of the same password"
0non-cybersec
Reddit
TIFU By surprising her in the shower.. This didn't actually happen today but a little while ago while we still lived in our apartment. My girlfriend was in the shower and I decided it would be a good idea to sneak into the bathroom and peek around the curtain and surprise her a little. I grabbed the shower curtain while she was facing away and wrapped it around myself in such a way that only my head was showing and I put on a ridiculous grin. As it turns out my GF has a legit fear of being murdered in the shower. When she turned around as I was trying my best not to giggle like a little girl, she let just stared at me like this O_O for a FULL second before she let out the most earth shattering scream I have ever heard in my life. This was my "oh shit" moment and I started to pull back away from the curtain, but not before she unleashed the fist of fucking god on me. She let loose a right hook that went through the shower curtain and ripped it off the hooks and hit me right in the face. Turns out she is strong enough to give me a black eye when she feels her life is in danger. That was fun to explain to my *all male* workplace that my GF beat the shit out of me in one hit. **Tl;dr**: GF thought I was a murderer and gave me a black eye. **Edit:** A few people have asked what happened afterwards and I'm afraid its nothing too exciting. So after I got bopped in the face she immediately started to cry and I can't blame her. I don't think she realized how hard she had managed to hit me at first as I was kind of ignoring it desperately apologizing to her. Nothing feels worse than when you legit scare the fuck out of your SO and it ends badly. After the tears were wiped away we both had a good laugh about hard she managed to hit me. I think she was even proud of herself. **Edit 2:** [Link to /u/BlessingOfChaos' story](http://www.reddit.com/r/tifu/comments/279tsk/tifu_by_punching_my_girlfriend_whilst_in_the/)
0non-cybersec
Reddit
Dank blossoms on this Cali outdoor grow..
0non-cybersec
Reddit
First major project in college woodworking. My MDO Table, start to finish..
0non-cybersec
Reddit
Old timer structural worker, c.1930. [3000x2401] (Colorized by me.).
0non-cybersec
Reddit
ONEIROMANCY- PATIENT RECORD MP1913330. __________ **PATIENT NAME:** Madison, Patricia **AGE:** 28 **TEST RESULTS:** [Oneiromancy](https://imgur.com/a/sxss31a), aka divination by means of dreams __________ *The following dream journal was procured by Agent Watkins on April 3, it has been transcripted and modified from its original format to protect the parties connected to Incident 19 as cataloged in journal 13.* *March 3* I’ve started having those dreams again. The ones about my sister. My therapist Doctor Rudy says that I need to keep track of what happens in the dreams because it could help me cope with her departure. I don’t see how having to relive an imaginary trauma over and over again is going to help me, but it’s whatever. I hate this stupid project this stupid magenta folder and these stupid dreams. The sooner I can get done with therapy and move on with my life, the better. The dream is always the same really, I see Brittany standing on a beach. I think she might be in Norway? It looks so peaceful, not like any of the trashy beaches we have here. She is standing in a white satin dress and staring toward the ocean and the moon. At first the dream is quiet, even the lapping of the waves can’t be heard. But then she starts to whistle. And the waves mimic her tune. The tune she whistles was something I couldn’t quite place at first, but after a few times hearing it I think it’s telling me that it’s a funeral march. Given what happens next in the dream, I know that it’s likely a correct assumption. The stars begin to glow, and then they swirl. They are moving toward the ocean almost like streaks of light. Each one of them going out and surrounding Britt with darkness. This is the part that always scares me, when my sister turns around and stares at me with wide empty eyes. Hordes of tentacles pour out of her mouth and show me a beastly monster pushing out of her intestines. My therapist tells me that these are all manifestations of my anxiety involved since she has left. But this doesn’t ever feel like that. It feels like a cold and distant throbbing pain, like the kind you might get when you lose a limb. I think that’s enough for today. This is bull shit. All this is doing is scaring me and I need to call Britt to make sure she is ok. *March 10* A whole week passed without the dreams. I think talking to Britt helped. But now I’ve had a lot of restless nights. Like I can’t sleep at all. It’s starting to mess with my mind. I keep seeing things that aren’t there. Strange shadows that linger in my house or whispers from an air vent. Doctor Rudy wants me to get on sleeping pills. He says that it won’t make the dreams come back, just help me to resume a healthy sleep cycle. But I think being asleep is more frightening. I can survive on power naps. And the shadows are just shadows, can’t hurt me. *March 14* I think someone broke into my house last night and drugged me. I had almost 10 hours worth of sleep and I can’t explain it. I’ve been taking 5 hour energy drinks to keep myself awake and even some herbal stuff designed to give me a boost. I just can’t sleep. Every time I do the dreams get more vivid. This time it was worse than ever before and it seemed like I could feel everything the monster was doing to Britt. It was coming from the stars that fell in the ocean. It’s trapped her and for the entire Dream it attacked her and played with her body the way a cat would a ball of yarn. It was Scratching open Britt’s body and trying to… I think infect her with itself? Impregnate maybe? It released this strange black substance into her screaming mouth that looked like little chocolate eggs like the kind you get at Easter. I tried to wake up and stop it from happening but I felt like I had fallen into a deep hole and I couldn’t claw out. I kept screaming for Britt to fight back and slashing aimlessly into the air to fight off this monster, but it didn’t do any good. I was paralyzed and frozen with fear. I couldn’t get away until the dream let me. It felt like coming up for air from drowning. I don’t have any proof that I was drugged but I have taken heavy meds before. Once tried to OD because of these stupid dreams and it felt like this numbing blackness that covered everything. This was the exact same sensation. In fact it felt ten times worse. Just an endless feeling of being strangled. *March 20* Doctor Rudy has scheduled a sleep study for me in a week. The dreams have gotten worse and I keep sleeping for longer and longer periods of time. I told him my suspicions of someone drugging me but he insisted that there would be no reason for any individual or organization to attempt to induce these nightmares. “They are just Dreams after all,” he told me. I didn’t like how he was making my concerns seem insignificant so I decided to install some security cameras in my house. Maybe I’m wrong about everything and it so then the cameras can give me peace of mind. *March 25* I’m writing this here as evidence against Doctor Rudy and his staff. I installed the cameras discovered that they are the ones drugging me. The footage shows they would use my porch sliding door to sneak in my house and dose my water while I’m at work. I think they want these dreams to keep happening. And now I’m in the hospital about to undergo the sleep study Rudy scheduled. I don’t think I can trust anyone here. The guards are watching all the exits and the stuff that the staff is giving me just makes me feel paranoid. Fuck. I probably sound like a crazy person. Listen to me though. You have to! When you get this journal you have to check those tapes cause I think I saw something else in them too. Something deadly. When I fall asleep and I experienced the dreams about Brittany, there is this… I guess you could call it presence. It’s inside my house. Like a mist. Glowing and red and causing all sorts of chaos. At first I thought it was a ghost but I don’t think that’s true anymore. This is something far more evil and ancient. And it feels directly connected to the creatures I saw rising from the beach. I hope you can make sense of all this Brittany cause I get the feeling that I will not be around much longer to do so. ________ *external notes by Doctor Rudy Watkins* *Subject MP1913330 exhibited signs of being aware of Paths for approximately 33% of the test. As a result we were able to determine that subject was actually forming a mental connection to the entity we detected.* *During the study, we were contacted by Agents 7 and 18 who were monitoring the subject's sister in Norway, who informed us that something strange was occurring near their location. About one hour into the REM sleep of the subject, a creature was spotted rising from the waves near their location. The creature proceeded to mutilate the subject’s sister in the exact same manner that she has described in her journals. Adjusted Path awareness to 57%.* *in an attempt to capture the creature, it was decided upon to keep the subject sedated. It has been determined that as long as the subject is in REM sleep, the creature remains in our dimension. Proper arrangements have been made to inform family that the subject was terminated.* *journal entries have been [archived](https://www.reddit.com/r/TheSkinnerFoundation) for further analysis* [330](https://www.reddit.com/r/KyleHarrisonwrites/?utm_source=share&utm_medium=ios_app)
0non-cybersec
Reddit
We couldn’t find him for a while.
0non-cybersec
Reddit
Multi User login authentication | React Redux. <p>I have an application with multi user login functionality. Now, I created the redux store for the login function. If User logged in, based on their type, it will redirect to the particular dashboard. If student user logged in, he should be able to only access student dashboard, he should not able to access other dashboards. Same applies for others. But, now, if any user logged in, they can able to access other user dashboards. How can i prevent them to use only their dashboards. </p> <p>Updated With Proper Code</p> <pre><code>/***AppRouter***/ import React, {Component} from 'react'; import { BrowserRouter, Route, Switch } from 'react-router-dom'; import StuDashboard from '../views/ed/dashboard/Dashboard.js'; import AdminDashboard from '../views/biz/dashboard/Dashboard.js'; import OrgDashboard from '../views/org/dashboard/Dashboard.js'; import SupAdDashboard from '../views/me/dashboard/Dashboard.js'; import UserLogin from '../views/loginUser/Login.js'; import history from '../history/history.js'; import { PrivateRoute } from './PrivateRoute.js'; import NotFoundPage from '../views/NotFoundPage.js'; import Authorization from './Authorization'; class AppRouter extends Component { render () { return( &lt;BrowserRouter history={history}&gt; &lt;Switch&gt; &lt;Route path="/" component={Landing} exact /&gt; &lt;Route path="/confirmation" component={EmailCon}/&gt; &lt;PrivateRoute path="/student/dashboard" component={Authorization(StuDashboard),["Student"]}/&gt; &lt;PrivateRoute path="/admin/dashboard" component={Authorization(AdminDashboard),["Admin"}/&gt; &lt;PrivateRoute path="/org/dashboard" component={Authorization(OrgDashboard),["Org"]}/&gt; &lt;PrivateRoute path="/SuperAdmin/dashboard" component={Authorization(SupAdDashboard),["SuperAdmin"]}/&gt; &lt;Route path="/login" component={UserLogin}/&gt; &lt;Route path="" component={NotFoundPage} /&gt; &lt;/Switch&gt; &lt;/BrowserRouter&gt; ); } } export default AppRouter; /***PrivateRoute***/ import React from 'react'; import { Route, Redirect } from 'react-router-dom'; export const PrivateRoute = ({ component: Component, ...rest }) =&gt; ( &lt;Route {...rest} render={props =&gt; ( localStorage.getItem('token') ? &lt;Component {...props} /&gt; : &lt;Redirect to={{ pathname: '/login', state: { from: props.location } }} /&gt; )} /&gt; ) /***Authorization***/ import React, { Component } from 'react'; import { connect } from "react-redux"; const Authorization = (WrappedComponent, allowedRoles) =&gt;{ class WithAuthorization extends Component { render() { const userType = this.props.user if (allowedRoles.includes(userType)) { return &lt;WrappedComponent {...this.props} /&gt; } else { return &lt;h1&gt;You are not allowed to view this page!&lt;/h1&gt; } } } const mapStateToProps = state =&gt; ({ user: state.login.userName, userType: state.login.userType }) return connect(mapStateToProps)(WithAuthorization); } export default Authorization; /***Action.js***/ import axios from "axios"; import { LOGIN_PENDING, LOGIN_COMPLETED, LOGIN_ERROR, LOGOUT } from "./types"; import ApiUrl from "../../constants/ApiUrl.js"; import qs from "qs"; import history from '../../history/history.js'; const startLogin = () =&gt; { return { type: LOGIN_PENDING }; }; const loginComplete = data =&gt; ({ type: LOGIN_COMPLETED, data }); const loginError = err =&gt; ({ type: LOGIN_ERROR, err }); export const loginUser = (email, password) =&gt; { return dispatch =&gt; { dispatch(startLogin()); let headers = { "Content-Type": "application/x-www-form-urlencoded" }; const data = qs.stringify({ grant_type: "password", username: email, password: password, }); axios .post(`${ApiUrl}/Token`, data, { headers: headers }) .then(function (resp) { dispatch(loginComplete(resp.data)); localStorage.setItem("token", resp.data.access_token); switch (resp.data.userType) { case 'Admin': { history.push('/admin/dashboard'); break; } case 'Student': { history.push('/student/dashboard'); break; } case 'Organization': { history.push('/org/dashboard'); break; } case 'SuperAdmin': { history.push('/SuperAdmin/dashboard'); break; } default: history.push('/'); } window.location.reload(); return; }) .catch(err =&gt; dispatch(loginError(err))); }; }; export const logOut = () =&gt; { localStorage.clear(); return { type: LOGOUT, }; } </code></pre>
0non-cybersec
Stackexchange
Why is fzf failing in this case. <p>I've found <a href="https://github.com/junegunn/fzf" rel="nofollow noreferrer"><code>fzf</code></a> to be a very useful utility, but for some reason it is failing me in this one particular instance.</p> <pre><code>$ brew outdated | fzf -m --tac | brew upgrade </code></pre> <p>Instead of letting me choose which items to upgrade, it displays a menu for a moment, and then proceeds to upgrade <em>everything</em>. I've never had it behave this way before. What am I overlooking?</p>
0non-cybersec
Stackexchange
Someone hit my car and this was left at the scene.
0non-cybersec
Reddit
Need a next gen 4 player co op of this please..
0non-cybersec
Reddit
cygwin basic command trouble. <p>I'm using Cygwin to simulate Linux environment on my Windows 7 machine for learning some basic commands and functions. Right now, I am just practicing moving through directories and different file pathways I've created. I have read that I can move backward (or upward) in my file path by typing <code>cd . .</code>, but this is not working. For example, my pwd: <code>/home/temp/stuff/things</code>, but when I type in <code>cd . .</code> on the next command it reads the same pwd. Am I doing something wrong or am I misunderstanding the <code>cd . .</code> command?</p>
0non-cybersec
Stackexchange
Customize Chrome auto-completion in address bar?. <p>is there a way to customize Chrome's auto-completion? For instance it doesn't show past urls correctly:</p> <p>Here some examples of very often visited urls:</p> <ol> <li><p>it shows visited url thepiratebay.se/browse/201/0/9/0 for sequence '201' but its not showing thepiratebay.am/browse/201/0/9/0</p></li> <li><p>it shows foo.com/A/B for sequence 'foo' but it doesn't show foo.com:4000/something else. It also doesn't offer it for the sequence '4000'</p></li> </ol> <p>That are just a few examples but its obvious to me that something is wrong. </p> <p>I guess I have to tweak the sources of Chromium, right. Because I can't find in the settings. To no surprise, Firefox doesn't have problems with this at all.</p> <p>well, thank you for any hint! g</p>
0non-cybersec
Stackexchange
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
Anonymous Hackers Set Up Hedge Fund; Massive SAIC Breach; U.S. Infrastructure Vulnerable to Cyber Attack.
1cybersec
Reddit
classifying map of associated bundles. <p>Let $G\leq GL(\mathbb{R}^n)$ be a group and $\xi$ be a principal $G$-bundle over a space $X$. </p> <p>Let $\eta=\xi[\mathbb{R}^n]$ be the associated vector bundle of $\xi$.</p> <p>Let $f_\xi: X\to BG$ be the classifying map of $\xi$. </p> <p>Let $f_\eta:X\to G_n(\mathbb{R}^\infty)$ be the classifying map of $\eta$. </p> <p>Let $i_*: BG\to G_n(\mathbb{R}^\infty)$ the induced map by inclusion $i:G\to GL(\mathbb{R}^n)$.</p> <p>Are $i_*\circ f_\xi\simeq f_\eta$ homotopy equivalent?</p>
0non-cybersec
Stackexchange
$\lim\limits_{t\rightarrow\infty}\int\limits_{E}\phi(x+t)dx=0$. <p>Suppose <span class="math-container">$E\subset\mathbb{R}$</span> has finite Lebesgue measure and <span class="math-container">$\varphi\in L^1(\mathbb{R})$</span>. Show that <span class="math-container">$\lim\limits_{t\rightarrow\infty}\int\limits_{E}\varphi(x+t)dx=0$</span>.</p> <p>I guess first I have to show <span class="math-container">$\lim\limits_{t\rightarrow\infty}\varphi(x+t)=0$</span> for <span class="math-container">$x\in\mathbb{R}$</span> and use the Lebesgue Dominated Convergence Theorem but I am not sure.</p>
0non-cybersec
Stackexchange
funny title here.
0non-cybersec
Reddit
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
[Homemade] Buffalo cauliflower pizza.
0non-cybersec
Reddit
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
Is &quot;constexpr if&quot; better than switch statement?. <p>C++17 introduces "constexpr if" that is instantiated depending on a compile-time condition.</p> <p>Does it mean that it's better to use "constexpr if" in template functions rather than switch statement?</p> <p>For example:</p> <pre><code>template&lt;int val&gt; void func() { if constexpr(val == 0) {} else if constexpr(val == 1) {} else ... if constexpr(val == k) {} else {} } // vs template&lt;int val&gt; void func() { switch (val) { case 0: break; case 1: break; ... case k: break; default: break; } } </code></pre>
0non-cybersec
Stackexchange
TIL that mosquitoes can use your breathe, your sweat, your heat, your movement, and any "loud" clothing you're wearing to find you..
0non-cybersec
Reddit
ITAP of a park in Auckland, New Zealand, autumn colours as the sun is setting.
0non-cybersec
Reddit
Do streetlights change when no ones using them like in the movie cars?.
0non-cybersec
Reddit
Did you hear abut the hungry clock?. It went back four seconds.
0non-cybersec
Reddit
M4SONIC - Virus (Live Launchpad Original).
0non-cybersec
Reddit
What's one of the most unexplainable/disturbing moments you've experienced?.
0non-cybersec
Reddit
[Wiedey] Seahawks re-enact the Sherman tip after touchdown.
0non-cybersec
Reddit
Encrusted, Canada - [OC] - [1668x1112].
0non-cybersec
Reddit
[50/50] A fierce warrior is ready for battle (sfw) | a corpse of a dog who got caught in a lawnmower (nsfw).
0non-cybersec
Reddit
why dataset.output_shapes returns demension(none) after batching. <p>I'm using the Dataset API for input pipelines in TensorFlow (version: r1.2). I built my dataset and batched it with a batch size of 128. The dataset fed into the RNN.</p> <p>Unfortunately, the <em><code>dataset.output_shape</code></em> returns dimension(none) in the first dimension, so the RNN raises an error:</p> <pre><code>Traceback (most recent call last): File "untitled1.py", line 188, in &lt;module&gt; tf.app.run(main=main, argv=[sys.argv[0]] + unparsed) File "/home/harold/anaconda2/envs/tensorflow_py2.7/lib/python2.7/site-packages/tensorflow/python/platform/app.py", line 48, in run _sys.exit(main(_sys.argv[:1] + flags_passthrough)) File "untitled1.py", line 121, in main run_training() File "untitled1.py", line 57, in run_training is_training=True) File "/home/harold/huawei/ConvLSTM/ConvLSTM.py", line 216, in inference initial_state=initial_state) File "/home/harold/anaconda2/envs/tensorflow_py2.7/lib/python2.7/site-packages/tensorflow/python/ops/rnn.py", line 566, in dynamic_rnn dtype=dtype) File "/home/harold/anaconda2/envs/tensorflow_py2.7/lib/python2.7/site-packages/tensorflow/python/ops/rnn.py", line 636, in _dynamic_rnn_loop "Input size (depth of inputs) must be accessible via shape inference," ValueError: Input size (depth of inputs) must be accessible via shape inference, but saw value None. </code></pre> <p>I think this error is caused by the shape of input, the first dimension should be batch size but not none. </p> <p>here is the code:</p> <pre><code>origin_dataset = Dataset.BetweenS_Dataset(FLAGS.data_path) train_dataset = origin_dataset.train_dataset test_dataset = origin_dataset.test_dataset shuffle_train_dataset = train_dataset.shuffle(buffer_size=10000) shuffle_batch_train_dataset = shuffle_train_dataset.batch(128) batch_test_dataset = test_dataset.batch(FLAGS.batch_size) iterator = tf.contrib.data.Iterator.from_structure( shuffle_batch_train_dataset.output_types, shuffle_batch_train_dataset.output_shapes) (images, labels) = iterator.get_next() training_init_op = iterator.make_initializer(shuffle_batch_train_dataset) test_init_op = iterator.make_initializer(batch_test_dataset) print(shuffle_batch_train_dataset.output_shapes) </code></pre> <p>I print <code>output_shapes</code> and it gives:</p> <pre><code>(TensorShape([Dimension(None), Dimension(36), Dimension(100)]), TensorShape([Dimension(None)])) </code></pre> <p>I suppose that it should be 128, because I have batched dataset:</p> <pre><code>(TensorShape([Dimension(128), Dimension(36), Dimension(100)]), TensorShape([Dimension(128)])) </code></pre>
0non-cybersec
Stackexchange
Windows 8 isn&#39;t available for download. <p>Just downloaded the <code>Windows 8 Upgrade Assistant</code> and only got the following message:</p> <p>"Windows 8 isn't available for download", "Sorry, Windows 8 isn't available for online purchase in the country/region you're in."</p> <p>I which region is then a download available?</p> <p><img src="https://i.stack.imgur.com/2KuX1.jpg" alt="enter image description here"></p>
0non-cybersec
Stackexchange
getchar/putchar returns boxes with question marks when printing inputted characters. <p>Playing around with code examples from K&amp;R in Codeblocks on Windows 10 (Danish language). The following example works as expected:</p> <pre><code>#include &lt;stdio.h&gt; int main() { char c = 'a'; putchar(c); } </code></pre> <p>However, the following prints a series of boxes with question marks, the same number as the number of characters I type:</p> <pre><code>#include &lt;stdio.h&gt; int main() { char c; while (c = getchar() != '\n') { putchar(c); } } </code></pre> <p>So it looks like an encoding issue. When run, a command prompt opens with "C:\Users\username\Desktop\filename.exe" in the header, and my username contains the Danish character "å" which is replaced by a "Õ". The command prompt uses the CP 850 character set.</p> <p>(By the way, I'm not checking if the character equals <code>EOF</code>, since that produces odd results. Pressing enter prints the expected number of boxes, plus one for <code>\n</code>, but it doesn't end the program.)</p>
0non-cybersec
Stackexchange
mod_rewrite and VirtualHosts: how to redirect 1 site, but keep the others?. <p>I host 4 virtual hosts at a dedicated CentOS 5.6 server:</p> <pre><code># rpm -qa|grep http httpd-2.2.3-45.el5.centos.1 </code></pre> <p>One of them is my Drupal 7.2 site and another was holding static texts and fotos belonging to my wife - here is the excerpt from httpd.conf:</p> <pre><code>&lt;VirtualHost 85.214.19.116:80&gt; DocumentRoot /var/www/html/preferans.de ServerName preferans.de ServerAlias preferans.de *.preferans.de ErrorLog logs/preferans.de/error_log CustomLog logs/preferans.de/access_log common &lt;IfModule mod_rewrite.c&gt; &lt;Directory "/var/www/html/preferans.de"&gt; RewriteEngine on # needed by Drupal 7 for "clean URLs" RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !=/favicon.ico RewriteRule ^ index.php [L] &lt;/Directory&gt; &lt;/IfModule&gt; &lt;/VirtualHost&gt; &lt;VirtualHost 85.214.19.116:80&gt; DocumentRoot /var/www/html/larissa-farber.de ServerName larissa-farber.de ServerAlias larissa-farber.de *.larissa-farber.de ErrorLog logs/larissa-farber.de/error_log CustomLog logs/larissa-farber.de/access_log common &lt;/VirtualHost&gt; </code></pre> <p>Now my wife has decided to move her files to Tumblr blog service.</p> <p>As a quick measure I've put the following index.php into her dir:</p> <pre><code># cat /var/www/html/larissa-farber.de/index.php &lt;?php header('Location: http://larissa-farber.tumblr.com/'); ?&gt; </code></pre> <p>This works ok, but I'd rather use the mod_rewrite to do the redirect (that is - until I figure out how to transfer her web address to Tumblr completely, which should be possible too).</p> <p>From reading the docs I understand, that I need something like:</p> <pre><code>RewriteRule ^(.*)$ http://larissa-farber.tumblr.com/$1 [R=301,L] </code></pre> <p>But where to put it and how to keep my other 3 virtual sites working?</p> <p>Thank you! Alex</p> <p>(This is not a promotion of any of the sites above, I'm just too lazy to use fake addresses here and don't see a reason for that).</p>
0non-cybersec
Stackexchange
Resume Samples For Accountant | Accountant Resume Samples - Resume Samples Sownload.
0non-cybersec
Reddit
Run Java in Firefox on Linux. <p>It is my first time using Linux. What I would like is to run an app called SiteScope that requires Java.</p> <p>I have already installed Java on my Linux, however when I open the browser I still get the message "A plugin is needed to display this content".</p> <p>Any help to make it work, using the Oracle JRE (not OpenJDK's Iced Tea), will be appreciated.</p> <p><a href="https://i.stack.imgur.com/LD9ui.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LD9ui.png" alt="enter image description here"></a></p>
0non-cybersec
Stackexchange
Toshiba satellite can&#39;t boot. <p>I've a Toshiba satellite laptop and I tried to get Ubuntu along with the windows. There was a black out after the Ubuntu installation was complete so I forced off my laptop but when I restarted, dual boot was working and I chose Ubuntu, but my touchpad didn't work properly, so I went to windows, deleted Ubuntu partition and started afresh. </p> <p>But this time Ubuntu installation couldn't be completed as it said there was some problem with GRUB. So I went back to windows, tried to repair the boot problems with easy BCD there I learned it was in EFI mode, so I went back to boot menu, changed it to CSM and when I saved the settings and exit, my laptop wouldn't restart.The only thing I see is a black screen (power on), not even the Toshiba logo, no keys working and it wont boot from an Ubuntu pendrive either. </p> <p>What is happening?</p>
0non-cybersec
Stackexchange
Is there a C project Default Directory Layout?. <p>I've always wanted to know if there is a default directory layout for C projects. You know, which folders should i put which files and such.</p> <p>So I've downloaded lots of project's source codes on <a href="http://sourceforge.net/" rel="noreferrer">SourceForge</a> and they were all different than each other. Generally, I found more or less this structure:</p> <pre><code> /project (root project folder, has project name) | |____/bin (the final executable file) | | |____/doc (project documentation) | | | |____/html (documentation on html) | | | |____/latex (documentation on latex) | | |____/src (every source file, .c and .c) | | | |____/test (unit testing files) | | |____/obj (where the generated .o files will be) | | |____/lib (any library dependences) | | |____BUGS (known bugs) | |____ChangeLog (list of changes and such) | |____COPYING (project license and warranty info) | |____Doxyfile (Doxygen instructions file) | |____INSTALL (install instructions) | | |____Makefile (make instructions file) | |____README (general readme of the project) | |____TODO (todo list) </code></pre> <p>Is there a default standard somewhere?</p> <p>Edit: Sorry, really. I realised there are numerous similar questions for recommended C project directory files. But I've seen people say what they think is best. I'm looking for a standard, something that people usually follow.</p> <p>Related Questions:</p> <p><a href="https://stackoverflow.com/questions/2410243/c-starting-a-big-project-file-directory-structure-and-names-good-example-req">C - Starting a big project. File/Directory structure and names. Good example required</a></p> <p><a href="https://stackoverflow.com/questions/1451086/folder-structure-for-a-c-project">Folder structure for a C project</a></p> <p><a href="https://stackoverflow.com/questions/2407668/file-and-folder-structure-of-a-app-project-based-in-c">File and Folder structure of a App/Project based in C</a></p> <p><a href="https://stackoverflow.com/questions/742391/project-organization-in-c-best-practices">Project Organization in C Best Practices</a></p>
0non-cybersec
Stackexchange
After editing and saving gedit(29705), I get warnings. alerts below. <p>** (gedit: 30499): WARNING **: 17: 09: 35.099: Document metadata could not be set: Attribute metadata :: gedit-spell-language assignment not supported</p> <p>** (gedit: 30499): WARNING **: 17: 09: 35.099: Setting document metadata failed: Attribute metadata :: gedit-encoding assignment not supported</p> <p>** (gedit: 30499): WARNING **: 17: 09: 39.106: Setting document metadata failed: Attribute metadata :: gedit-position assignment not supported</p>
0non-cybersec
Stackexchange
ELI5: Why do we still use USB and not fibre optic for file transfer. My Soundbar uses fibre optic, so it can't be a cost issue.. It takes ages to copy from one hard drive to another using USB, surely fibre optic would be faster?
0non-cybersec
Reddit
Is there any app similar to Cheddar for iOS with hashtag task management?. [Here's a link](https://itunes.apple.com/app/cheddar/id536464274) however the app is poorly maintained and doesn't have much functionality...
0non-cybersec
Reddit
Why tuples are not enumerable in Elixir?. <p>I need an efficient structure for array of thousands of elements of the same type with ability to do random access.</p> <p>While list is most efficient on iteration and prepending, it is too slow on random access, so it does not fit my needs.</p> <p>Map works better. Howerver it causes some overheads because it is intended for key-value pairs where key may be anything, while I need an array with indexes from 0 to N. As a result my app worked too slow with maps. I think this is not acceptable overhead for such a simple task like handling ordered lists with random access.</p> <p>I've found that tuple is most efficient structure in Elixir for my task. When comparing to map on my machine it is faster</p> <ol> <li>on iteration - 1.02x for 1_000, 1.13x for 1_000_000 elements</li> <li>on random access - 1.68x for 1_000, 2.48x for 1_000_000</li> <li>and on copying - 2.82x for 1_000, 6.37x for 1_000_000.</li> </ol> <p>As a result, my code on tuples is 5x faster than the same code on maps. It probably does not need explanation why tuple is more efficient than map. The goal is achieved, but everybody tells "don't use tuples for a list of similar elements", and nobody can explain this rule (example of such cases <a href="https://stackoverflow.com/a/31193180/5796559">https://stackoverflow.com/a/31193180/5796559</a>).</p> <p>Btw, there are tuples in Python. They are also immutable, but still iterable.</p> <p>So,</p> <p><strong>1. Why</strong> tuples are not enumerable in Elixir? Is there any technical or logical limitation?</p> <p><strong>2.</strong> And <strong>why</strong> should not I use them as lists of similar elements? Is there any downsides?</p> <p><strong>Please note:</strong> the questions is "why", not "how". The explanation above is just an example where tuples works better than lists and maps.</p>
0non-cybersec
Stackexchange
What should I do if i forget password in MySQL?. <p>I am using <code>MySQL5.5</code>. I trying to login in mysql from terminal by using <strong>"sudo -u root -p"</strong> But i could not remember password. </p> <p>How can i fix this problem? </p>
0non-cybersec
Stackexchange
Factorio devs say G2A hasn’t been “exactly prompt” to compensate over fraudulent key sales.
0non-cybersec
Reddit
Is this proof for $(\mathbb{Z},+) \ncong (\mathbb{Q},+)$ valid?. <p>In an introductory cryptography course, our teacher demonstrated a proof for $(\mathbb{Z},+) \ncong (\mathbb{Q},+)$. I'm not convinced, even though the statement may be correct (I don't know).</p> <p>Earlier in the course, we had seen the isomorphism of the Klein-4 group as $(\{0,1\}^2,+)$ and the 2D symmetry group of a rectangle not being a square (using identity, vertical reflection, horizontal reflection and 180 degree rotation). </p> <p>Now, our teacher made a list of different equations and whether or not they could be solved in the sets $\mathbb{Z}^+, \mathbb{Z}, \mathbb{Q}$ and $\mathbb{R}$. This to show that some equations can be solved in certain sets but not in others (like $x=3$ being solvable in all four sets, but $3x=5$ only in the latter two and $x^2=-1$ in none of the considered sets). </p> <p>Then, she stated that if we have some equation using an operation $\odot$ that is solvable in $A$ but not in $B$, then $(A,\odot) \ncong (B,\odot)$ (supposing of course that $(A,\odot)$ and $(B,\odot)$ are groups). This already is a rather vague description, isn't it? </p> <p>She then proposed the equation $x+x=3$ which is solvable in $\mathbb{Q}$ but not in $\mathbb{Z}$. While that is obviously correct, I'm not sure if this argument is sound and if it actually proves the two groups not being isomorph.</p> <p>I have difficulties to express my concerns. Somehow, I would expect the constant $3$ in that equation to be some number from the particular set instead of some constant. I'm not convinced by the argument because if we'd map all odd numbers from $\mathbb{Q}$ to even numbers in $\mathbb{Z}$, the equation would in fact be solvable in $\mathbb{Z}$. </p> <p>What I'd like to know is:</p> <ul> <li>Is the proof given by my teacher valid (and why)?</li> <li>If not, are these groups still isomorph (out of curiosity)?</li> </ul>
0non-cybersec
Stackexchange
Played it cool.
0non-cybersec
Reddit
Make maven&#39;s surefire show stacktrace in console. <p>I'd like to see the stacktrace of unit tests in the console. Does surefire support this?</p>
0non-cybersec
Stackexchange
Why &#39;continue&#39; doesn&#39;t work within an angular foreach?. <p>I have an angular app as the following and I have a angular.forEach function where I want to skip some values with the <code>continue</code> keyword but I can't.</p> <pre><code>&lt;div ng-app="app"&gt; &lt;div ng-controller="test"&gt; test {{printPairs()}} &lt;/div&gt; &lt;/div&gt; angular.module("app", []) .controller("test", function($scope){ var array = [1,2,3,4,5,6]; $scope.printPairs = function(){ angular.forEach(array, function (elem) { if(elem % 2 === 1){ continue; } //More logic below... }) }; }); </code></pre> <p>Someone knows why is this happening?</p>
0non-cybersec
Stackexchange
Future Samsung phones may feature explosion-proof batteries - Sammobile.
0non-cybersec
Reddit
How do I load and edit a bitmap file at the pixel level in Swift for iOS?. <p>I want to manipulate an image at the pixel level in Swift. This question was answered for objective c: <a href="https://stackoverflow.com/questions/22897433/how-do-i-access-and-manipulate-jpeg-image-pixels">How do I access and manipulate JPEG image pixels?</a>, but I would like to see the equivalent source for Swift.</p>
0non-cybersec
Stackexchange
Spider-tailed horned viper lures in bird.
0non-cybersec
Reddit
How do I change the bank account details associated with my Facebook app?. <p>We have an app on Facebook that utilises Facebook credits, we have changed our company bank account but cannot find out how to change the details within the developer payment section in the relevant app. </p>
0non-cybersec
Stackexchange
On my way to complete my ultimate collection..
0non-cybersec
Reddit
[Homemade] Industry standard coleslaw.
0non-cybersec
Reddit
Dismantling a fileless campaign: Microsoft Defender ATP next-gen protection exposes Astaroth attack.
1cybersec
Reddit
MRW she says she didn't climax.
0non-cybersec
Reddit
Eagles WR Torrey Smith and Wife Pay Adoption Fee for 46 Baltimore Animals.
0non-cybersec
Reddit
It's almost a dance.
0non-cybersec
Reddit
Problem downloading Oracle JDK 7. <p>I'm using Ubuntu 12.04 LTS. I'm trying to install Oracle JDK 7. When I tried to directly download the jdk-7u51-linux-x64.tar.gz from the official website, the download started and after downloading couple of MBs it stopped (you can try it as well, worked the same way for a friend). Using a guide.</p> <p>led me to </p> <pre><code>Oracle JDK 7 is NOT installed. dpkg: error processing oracle-java7-installer (--configure): subprocess installed post-installation script returned error exit status 1 Errors were encountered while processing: oracle-java7-installer E: Sub-process /usr/bin/dpkg returned an error code (1) </code></pre> <p>which is normal, as it is downloading from the same link. Exact report <a href="http://postimg.org/image/gdbym90bf/" rel="nofollow">here</a></p> <p>I tried to download and install the .rpm file. I converted it to deb and installed it. It appears as installed in the Software center, but could not find it via terminal (java -version returns suggestions for installing packages). Image from the Software center <a href="http://postimg.org/image/780kh9lq3/" rel="nofollow">here</a></p> <p>I tried everything here.</p> <p>and could not find anything on the internet. </p>
0non-cybersec
Stackexchange
How to add Text for some duration of video in iOS SDK. <p>I have video having duration 4:00. Now I want to add text in video file as per the frames of video. Say for example from 00:30 to 1:50 duration I want to add text "Welcome". Now from 3:00 to 4:00 duration of video I want to add text "Awesome". How to achieve this functionality. I have referred below tutorial. It adds text in whole video not for some duration of video. <a href="https://www.raywenderlich.com/30200/avfoundation-tutorial-adding-overlays-and-animations-to-videos" rel="noreferrer">https://www.raywenderlich.com/30200/avfoundation-tutorial-adding-overlays-and-animations-to-videos</a></p> <p>Any help will be appriciated.</p> <p>I am adding lines of code for add text on whole video:</p> <pre><code>- (void)applyVideoEffectsToComposition:(AVMutableVideoComposition *)composition size:(CGSize)size { // 1 - Set up the text layer CATextLayer *subtitle1Text = [[CATextLayer alloc] init]; [subtitle1Text setFont:@"Helvetica-Bold"]; [subtitle1Text setFontSize:36]; [subtitle1Text setFrame:CGRectMake(0, 0, size.width, 100)]; [subtitle1Text setString:_subTitle1.text]; [subtitle1Text setAlignmentMode:kCAAlignmentCenter]; [subtitle1Text setForegroundColor:[[UIColor whiteColor] CGColor]]; // 2 - The usual overlay CALayer *overlayLayer = [CALayer layer]; [overlayLayer addSublayer:subtitle1Text]; overlayLayer.frame = CGRectMake(0, 0, size.width, size.height); [overlayLayer setMasksToBounds:YES]; CALayer *parentLayer = [CALayer layer]; CALayer *videoLayer = [CALayer layer]; parentLayer.frame = CGRectMake(0, 0, size.width, size.height); videoLayer.frame = CGRectMake(0, 0, size.width, size.height); [parentLayer addSublayer:videoLayer]; [parentLayer addSublayer:overlayLayer]; composition.animationTool = [AVVideoCompositionCoreAnimationTool videoCompositionCoreAnimationToolWithPostProcessingAsVideoLayer:videoLayer inLayer:parentLayer]; } </code></pre>
0non-cybersec
Stackexchange
[Homemade] Empanadas.
0non-cybersec
Reddit
Prove summations are equal. <p>Prove that:</p> <p>$$\sum_{r=1}^{p^n} \frac{p^n}{gcd(p^n,r)} = \sum_{k=0}^{2n} (-1)^k p^{2n-k} = p^{2n} - p^ {2n-1} + p^{2n-2} - ... + p^{2n-2n}$$</p> <p>I'm not exactly sure how to do this unless I can say:</p> <p><em>Assume</em> $\sum_{r=1}^{p^n} \frac{p^n}{gcd(p^n,r)}$ = $\sum_{k=0}^{2n} (-1)^k p^{2n-k}$</p> <p>and show by induction that the sums equal each other and show the inductive step that you can take the expanded sum part with $n+1$ and get to $\sum_{k=0}^{2n+1} (-1)^k p^{2(n+1)-k}$</p> <p>However, I'm not even sure that I am allowed to do this.. Any suggestion in how to prove this? I'm not looking for a whole proof just a push in the direction of how to solve this.</p>
0non-cybersec
Stackexchange
[Linguistics] Why do some country call their country "motherland" and others "fatherland"?. E.g. germans call Germany fatherland, russians, turks call their country motherland.
0non-cybersec
Reddit
Off you pop to the gulag.
0non-cybersec
Reddit
How to use spot instance with amazon elastic beanstalk?. <p>I have one infra that use amazon elastic beanstalk to deploy my application. I need to scale my app adding some spot instances that EB do not support.</p> <p>So I create a second autoscaling from a launch configuration with spot instances. The autoscaling use the same load balancer created by beanstalk.</p> <p>To up instances with the last version of my app, I copy the user data from the original launch configuration (created with beanstalk) to the launch configuration with spot instances (created by me).</p> <p>This work fine, but:</p> <ol> <li><p>how to update spot instances that have come up from the second autoscaling when the beanstalk update instances managed by him with a new version of the app?</p> </li> <li><p>is there another way so easy as, and elegant, to use spot instances and enjoy the benefits of beanstalk?</p> </li> </ol> <p><strong>UPDATE</strong></p> <p>Elastic Beanstalk add support to spot instance since 2019... see: <a href="https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/elasticbeanstalk/latest/relnotes/release-2019-11-25-spot.html</a></p>
0non-cybersec
Stackexchange
Android Navigation Component has lag when navigating through NavigationDrawer. <p>I am updating my app to Navigation Architecture Components and I see that it has a lag replacing fragments which is visible in the NavigationDrawer that does not close smoothly.</p> <p>Until now, I was following this approach:</p> <p><a href="https://vikrammnit.wordpress.com/2016/03/28/facing-navigation-drawer-item-onclick-lag/" rel="noreferrer">https://vikrammnit.wordpress.com/2016/03/28/facing-navigation-drawer-item-onclick-lag/</a></p> <p>So I navigate in <code>onDrawerClosed</code> instead than in <code>onNavigationItemSelected</code> to avoid the glitch.</p> <p>This has been a very common issue, but it is back again. Using the Navigation Component, it is laggy again and I don't see a way to have it implemented in <code>onDrawerClosed</code>.</p> <p>These are some older answers prior to Navigation Component</p> <p><a href="https://stackoverflow.com/questions/25534806/navigation-drawer-lag-on-android">Navigation Drawer lag on Android</a></p> <p><a href="https://stackoverflow.com/questions/17491557/drawerlayouts-item-click-when-is-the-right-time-to-replace-fragment?noredirect=1&amp;lq=1">DrawerLayout&#39;s item click - When is the right time to replace fragment?</a></p> <p>Thank you very much.</p>
0non-cybersec
Stackexchange