input stringlengths 51 42.3k | output stringlengths 18 55k |
|---|---|
'UITableView' failed to obtain a cell from its dataSource <p>I updated Xcode and since then I'v problems with my dataBase.
code:</p>
<pre><code>override func numberOfSections(in tableView: UITableView) -> Int {
// return the number of sections
return 1
}
override func tableView(_ tableView: UITableView, nu... | <p>Add this to your <code>viewDidLoad</code> method:</p>
<pre><code>tableView.register(LeadsTableViewCell.self, forCellReuseIdentifier: "Cell")
</code></pre>
<p>This is assuming you don't have a prototype cell in the tableView in your storyboard. If you do have a prototype cell, ensure the Reuse Identifier is <code>"... |
How to stop CI builds in Jenkins from accidentally publishing to release repository? <p>Sometimes, the developers accidentally check in a version in POM without "SNAPSHOT" in it. This builds the mvn project and publishes the artifacts to release repository. Is there a Jenkins plugin that can help me in avoiding this si... | <p>A good solution around this is to leverage the Maven Enforcer Plugin. Up to version 1.4.1, it does not have a built-in rule to fail if the current project is a SNAPSHOT version (see the enhancement request <a href="https://issues.apache.org/jira/browse/MENFORCER-204" rel="nofollow">MENFORCER-204</a>), but we can sti... |
How to get a content script to run again when a link is followed <p>I've got a content script that works successfully when I load edmodo.com, but when I follow a link in the posts the script doesn't modify the new content. I know I've got to be missing something obvious, but I'm still learning how Chrome Extensions wor... | <p>Clicking a link from <code>https://www.edmodo.com/home#/</code> to <code>/home#/quiz/start/quiz_run_id/12078109</code> won't cause navigation, so there isn't really a link to follow. All it does is change the location hash. That's why your script does not run again, it's still the same document.</p>
<p>Your links a... |
Can I run a C# WF App if I only have .NET 4.6? <p>I want to create a C# application to run during a Windows build using WinPE that only has .NET 4.6.
Does this have the capacity to run a C# application utilizing the following:</p>
<pre><code>using System.IO;
using System;
using System.Collections.Generic;
using Syste... | <p>Yes, the .NET Framework is backwards compatible</p>
<p>Please see this link:</p>
<p><a href="https://msdn.microsoft.com/en-us/library/ff602939(v=vs.110).aspx" rel="nofollow">https://msdn.microsoft.com/en-us/library/ff602939(v=vs.110).aspx</a></p>
<p>Excerpt from that page:</p>
<blockquote>
<p>The .NET Framewor... |
Insertion Sort For Singly Linked List Java <p>I'm trying to make an Insertion Sort for a Linked List class to sort in ascending. I'm not really sure what I need to do. I can't find a way to go back to the beginning of the list.</p>
<pre><code>public static void LLInsertionSort (LinkedList LL){
IntNode currentNode... | <p>You need to start each time from the <strong>first Node in your list</strong>. </p>
<pre><code>public static IntList LLInsertionSort(Node head)
{
IntNode current = head;
IntNode tail = null;
while(current != null&& tail != head )
{
IntNode next = current;
for( ; next.next != tail;... |
How to create a sigfile of extension .SF/.DSA & use it with androiddeployqt command? <p>I have Qt application to deploy on Android. I am using command line build to generate an apk signed with my <code>.keystore</code> file. I am well able to do it using following command where I am using <code>androiddeployqt</code>.<... | <p>Okay, I had to look at the oracle docs..as long as you have a keystore cert you supply the sigfile names it it creates those files for you per:</p>
<p><a href="https://docs.oracle.com/javase/tutorial/deployment/jar/signing.html" rel="nofollow">https://docs.oracle.com/javase/tutorial/deployment/jar/signing.html</a><... |
spring boot not using consul properties <p>I have an application annotated like this</p>
<pre><code>@SpringBootApplication(exclude = {DefaultNotificationServiceConfig.class})
@EnableDiscoveryClient
@EnableSwagger2
@EnableSpringDataWebSupport
@EnableJpaRepositories(basePackages = {"com.repositories.jpa"})
@EnableMongoR... | <p>Stupid mistake, I defined the environment variables but not the VM argument</p>
<pre><code>-Dspring.profiles.active=dev,im3
</code></pre>
<p>it doesn't work if I remove</p>
<pre><code>spring:
profiles:
active: dev,im3
</code></pre>
<p>from com/app, it seems redundant that I need both</p>
|
Can range based for loop work for assignment? <p>Is it possible to use/implement a ranged base loop to assign numbers to an array?</p>
<p>What I want: </p>
<pre><code>for (auto i : X){
i = 1;
} //I want this to fill the array with 1.
</code></pre>
| <blockquote>
<p>Is it possible to use/implement a ranged base loop to assign numbers to an array?</p>
</blockquote>
<p>Yes, use a reference:</p>
<pre><code>for (auto & i : X){
// ^
i = 1;
}
</code></pre>
|
Rename file in-place using Spring Integration FileWritingMessageHandler <p>I am attempting to write a simple test of renaming files in-place using a FileWritingMessageHandler, however I can't seem to figure out how to properly specify the target destination directory.</p>
<p>Since I am recursively scanning a directory... | <blockquote>
<p>The 'payload.name' in the DefaultFileNameGenerator resolves properly, but 'payload.path' does not.</p>
</blockquote>
<p>Well, I'm not sure what should be in your case, but for me that always returns the <strong>full</strong>, absolute path for source file, including the root directory to scan.</p>
<... |
Hover state does not work when applying z-index <p>The problem is I have 2 divs: one container a link and another a box shaped container. The link has a <code>position:fixed;</code> and it flies over the container div, so I tried to give the link a z-index with a negative value, turns out the
hover state does not work... | <p>Have you tried assigning a z-index to #div-2? </p>
<p>You'll need to assign it a position to be able to give it a z-index. Try this:</p>
<pre><code>#div-2 a{
width:13%;
height:auto;
padding:0.5em 2.3em;
display:block;
position:fixed;
font-weight:500;
font-size:1.09em;
text-align: center;
background-color: none;
te... |
how to Define a struct type to represent the combination of a name and a zip code in C++? <p>I am a C++ newbie. I am more familiar with Java programming using Eclipse software.</p>
<p>I was asked to do the following:</p>
<blockquote>
<p>Create an array of 20 structs. </p>
<p>Read names and zip codes from an i... | <p>Depends on how you want to represent the zipcode.<br>
I recommend using a string.</p>
<p>Here's the struct: </p>
<pre><code>struct Name_Zipcode
{
std::string name;
std::string zipcode;
};
</code></pre>
<p>Some useful methods to add:</p>
<ul>
<li>Constructors (default and copy)</li>
<li>Assignment</li>
<li>D... |
Laravel Change output of the view in controller <p>I need to change all @ in my parts of static and dynamic in view to [at].
So I have : </p>
<pre><code>return view('myview')->with('items',Model::all());
</code></pre>
<p>When I try this my result is String : </p>
<pre><code>return ChangeSymbols(view('myview')->... | <p>Here is one way to achieve what you want:</p>
<pre><code>$template = view('emails.welcome')->render();
$template = str_replace("@","[at]",$template);
return $template;
</code></pre>
<p>This is just an example. Note the <a href="https://laravel.com/api/5.2/Illuminate/View/View.html#method_render" rel="nofollow... |
NetBeans 8.1 Cannot connect to the remote repository <p>I'm trying to setup github with netbeans using the https path. I go to the push menu and enter the info it needs for repo URL and username/password but when I hit next it just says "Cannot connect to the remote repository at <em>my repository</em>" I've done ... | <p>Found the culprit. Apparently Covenant Eyes is blocking all network connectivity within NetBeans. After reinstalling Covenant Eyes it appears to working now. For now i'm going to mark this as solved unless something else comes up.</p>
|
GridStack is not positioning elements properly on page after they hit a specific y-axis point <p>When I am loading a saved layout, if the layout has a height larger than what is already loaded on the page at $('.grid-stack').attr('data-gs-current-height'), the elements with a y-axis which goes over that load at the to... | <p>I found a way to solve my particular issue although I don't assume this is the way it was intended to be fixed as it does have additional problems associated with it it. If anyone in the future has a way that is better suited please post it and I will mark your answer as the correct way in the event it works. </p>
... |
Insert python variable value into SQL table <p>I have a password system that stores the password for a python program in an SQL table. I want the user to be able to change the password in a tkinter window but I am not sure how to use the value of a python variable as the value for the SQL table. Here is a sample code:<... | <p>There are two valid ways to use <code>VALUES()</code>: with a label or a string literal. A string literal is a string in single or double quotes.</p>
<p>Since you didn't put <code>newPassword</code> in quotes, Sqlite assumes <code>newPassword</code> is a label, i.e. a column name. It goes looking for the value of... |
postgres: dynamic conditional in function query <p>I have a Postgres function where I need to dynamically add a conditional parameter if it was passed into the function. Here's the function:</p>
<pre><code>CREATE OR REPLACE FUNCTION public.get_appointments(
for_business_id INTEGER,
range_start DATE,
ran... | <p>Just add the following</p>
<pre><code>... AND (for_staff_id IS NULL OR staff_id = for_staff_id)
</code></pre>
<p>or this</p>
<pre><code>... AND coalesce(staff_id = for_staff_id, true)
</code></pre>
<p>in the <code>WHERE</code> clause of the <code>SELECT</code> statement.</p>
|
What's the regex to capture values which init string until end word? <p>My Entries:</p>
<pre><code>String e1 = "MyString=1234 MyString=5678";
String e2 = "MyString=1234\nMyString=5678";
</code></pre>
<p>What i'm doing:</p>
<pre><code>String pattern = "MyString=(.*)";
Pattern patternObj = Pattern.compile(pattern);
Ma... | <p>There's only one group that will be matched multiple times. You have to keep matching and printing group 1:</p>
<pre><code>int i = 0;
while (matcher.find()) {
System.out.println("G" + (++i) + ": " + matcher.group(1));
}
</code></pre>
<p>Also, you need to update your pattern so it doesn't match the next <code>M... |
display image from a PHP for loop <p>So I have an array that contains information about items..I have also an image folder with the name of the files coinciding with one of the array values specifically $arr[$key]['isbn'];</p>
<p>I have made a for loop to go through the array and display the images along with some inf... | <p>Your code is wrong, try the following:</p>
<pre><code>for($row = 0; $row < 6;$row++){
echo '<img src="'.$arr[$row]['isbn'].'.jpg" alt="Mountain View" style="width:304px;height:228px;">'.$arr[$row]['title'].'<br/>by '.$arr[$row]['author'].'<br/><input type="radio" name="booktype" value="... |
PHP: session error <p>I don't know how to solve this problem. What should I do?</p>
<p>Here is the error I get: </p>
<blockquote>
<p>Warning: session_start() [function.session-start]: open(/tmp/sess_a08ea88dc4be1f7dfa7ab9767ee7d04e, O_RDWR) failed: Permission denied (13) in /home/a9321792/public_html/results.php on... | <p>You have a few options:</p>
<ul>
<li><a href="http://php.net/manual/en/function.session-save-path.php" rel="nofollow">Change the session path</a> to a writable folder</li>
<li>Make sure the user PHP runs under can write and create files in /tmp</li>
</ul>
|
Azure AD: prompt user/admin to re-consent after changing application permissions <p>I am building a SaaS app that will be authenticating users using azure AD.
Let's say I am asking for just 1 delegated permission from user during consent prompt and user accepts it.</p>
<p>Later on my app evolves and need to get more d... | <p>The âadmin_consentâ is used for an administrator should be prompted to consent on behalf of all users in their organization. If you just require the usersâs consent, you can use âconsentâ. </p>
<p>An other easy way is that you can redirect to the login page to add the prompt parameter to re-consent when ... |
String indexing <p>Python 3.5</p>
<p>Here is my Code:</p>
<pre><code>str1 = input("Please enter a full sentence: ").lower()
print("Thank you, You entered:" , str1)
str2 = input("Now please enter a word included in your sentence in anyway you like: ").lower()
if str2 in str1:
print("That word was found!")
else:
... | <pre><code>print("That word was found at index %i!"% (str1.split().index(str2)))
</code></pre>
<p>This will print the index of the first occurrence of str2 in str1.<br>
The full code is:</p>
<pre><code>str1 = input("Please enter a full sentence: ").lower()
print("Thank you, You entered:" , str1)
str2 = input("Now pl... |
npm: not found when building Docker container <p>I had a developer create a Docker file for me -- and it's worked for months flawlessly. Recently I formatted my mac to clean some space, and re-ran the command to build the Docker container, and I got the following error:</p>
<p><a href="http://i.stack.imgur.com/KNUSc.p... | <p>By looking at your screenshot it seems like you are not installing npm.
Please add npm to your apt-get install RUN command.</p>
|
Simulating virtual machine, have trouble with incrementing pc versus jumps <p>I'm writing a virtual machine in C and I have all the various functions working, however I'm having trouble putting them together. Specifically I'm running into the problem that I need a way to increment the program counter without it interfe... | <p>This part of your instruction decode <code>select</code> statement seems wrong</p>
<pre><code> case CAL:
arlist[(*arcntr)++] = *sp + 1;
stack[*sp + 1] = base(ir.l, *bp, stack);
stack[*sp + 2] = *bp;
stack[*sp + 3] = *pc - 1;
*bp = *sp + 1;
*pc = ir.m;
break;
</code></pre>
<p>Normally y... |
Linker errors when compiling libgit2 static Library <p>I've successfully built a cross-platform static library for OSX with the following steps:</p>
<pre><code>mkdir build
cd build
cmake -DBUILD_SHARED_LIBS=OFF "-DCMAKE_OSX_ARCHITECTURES=x86_64;i386" ..
cmake --build .
</code></pre>
<p>I have also mostly-successfully... | <p>The most likely cause is an old version of OSX and libgit2. Some versions of libgit2 assume that the Security framework on OSX/macOS always provides SecureTransport (the library providing the cryptographic/TLS symbols you are missing).</p>
<p>This is not the case for the older opearating systems. This was fixed in ... |
Reporting Services: come back from the sub-report to parent report and have it auto-run <p>The environment is SQL Server Reporting Services 2012. I have two reporting services reports: parent report lists some records and those records are presented and hyperlinks. These hyperlinks can be clicked and this will take y... | <p>Thank you, bitnine, for your input! I do have somewhat complicated parameters in my report, some of which are cascaded. I had to ensure that all of them either had defaults specified or had values provided by the "Action" mapping (as specified on the sub-report's "Back to Parent" link. After that, things started w... |
Symfony2 form collection of one entity <p>I have an entity called 'Candidate'. It is not that special. On its own, it's doing fine: I can make a form from a type and persist it.</p>
<pre><code>class CandidateType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$bui... | <p>From the symfony documentation - you can embed a collection of forms using jquery. By using the data prototype and many javascript/jquery, you should be able to do the tricks.</p>
<p>Here is the doc, I use it to manage multiple adress add for a user and it works well !</p>
<p><a href="http://symfony.com/doc/curren... |
If/else Javascript statement not working properly with DataTables <p>I have the following Javascript code that initializes a DataTables chart on my website.</p>
<p>Basically, my intention with this script is to AJAX in different data based upon the URL the user is currently on. I have written an if/else statement that... | <p>I can't see an error, but maybe if you change the code in this way, should be more easy to debug and find the error.</p>
<pre><code>var URL = window.location.href;
var ajaxURL = '';
if (URL.indexOf("london") !== -1) {
ajaxURL = 'aging-projects-london.php';
}else if (URL.indexOf("nw") !== -1) {
ajaxURL = 'aging... |
Which Version Control systems integrate with Bitrix24? <p>I'm about to embark on an HTML remediation project. My client is using Bitrix as a task/issue tracker, but isn't currently using anything for Source/Version control.</p>
<p>I've searched up 'Bitrix' and assume that they mean 'Bitrix24'.</p>
<p>Is there a Versi... | <p>Bitrix has no such feature out from the box - see old topic on Bitrix support forum - <a href="https://www.bitrix24.com/support/forum/forum47/topic10287/" rel="nofollow">https://www.bitrix24.com/support/forum/forum47/topic10287/</a></p>
<p>I think it is because of CRM-nature of the Bitrix.</p>
<p>You could link yo... |
Pandas: Drop quasi-duplicates by column values <p>I have a list that, let's say, looks like this (which I'm putting into a DF):</p>
<pre><code>[
['john', '1', '1', '2016'],
['john', '1', '10', '2016'],
['sally', '3', '5', '2016'],
['sally', '4', '1', '2016']
]
</code></pre>
<p><code>columns</code> are <code>['name', ... | <p>You can sort the data frame by <code>year, month, day</code> and then take the first row from each <code>name</code>:</p>
<pre><code>df.sort_values(by = ['year', 'month', 'day']).groupby('name').first()
# month day year
# name
# john 1 1 2016
#sally 3 5 2016
</code></pre>
<p><em>Data</em>:... |
How Do Firefox Extensions Use IP Address With Anonymous Proxy? Original IP May Be Exposed? <p><strong>Research On Firefox Extensions Connections</strong></p>
<p>I have read the FAQ's on Firefox Extensions (<a href="https://addons.mozilla.org/en-us/faq" rel="nofollow">https://addons.mozilla.org/en-us/faq</a>) and have ... | <p>Firefox extensions are usually not limited in what they can do, only extensions based on the <a href="https://developer.mozilla.org/en-US/Add-ons/WebExtensions" rel="nofollow">WebExtensions framework</a> are sandboxed - currently the majority of Firefox extensions is still either classic XUL-based extensions or base... |
ECMAScript 5 - Error Missing class properties transform <p>I am implementing the <code>Class extend</code> and i get this error <em>Missing class properties transform</em>.</p>
<p>The Component was</p>
<pre><code>import React from ('react')
const Manna = React.createClass({,
initVal: {
likes: 10,
}
... | <p>Try with <em>=</em></p>
<pre><code>import React from 'react';
export default class Manna extends React.Component {
InitVal = {
likes: 10
}
render() {
// code
return {
// code
}
}
};
</code></pre>
<p>Check <a href="http://babeljs.io/docs/plugins/transform-class-properties/" rel=... |
Swift dynamic type checking for structs? <p>I'm confused about dynamic type checking in Swift.</p>
<p>Specifically, I have a weirdo case where I want to, essentially, write (or find) a function:</p>
<pre><code>func isInstanceOf(obj: Any, type: Any.Type) -> Bool
</code></pre>
<p>In Objective-C, this is <code>isKin... | <p>Actually you can use <code>is</code> operator. </p>
<blockquote>
<p>Use the type check operator (is) to check whether an instance is of a certain subclass type. The type check operator returns true if the instance is of that subclass type and false if it is not.</p>
</blockquote>
<p>Since <code>struct</code> can... |
Common interface for Jedis and JedisCluster <p>I see that Jedis and JedisCluster don't implement a common java interface, and I am wondering why. My software will be running in different environments where redis may or may not run in cluster mode, so how do I implement a common piece of code using Jedis that will run i... | <p>Hello I was interested in something similar. Could you get a solution yet / any suggestions to implement this?</p>
|
Multithread queue of jobs <p>I have a queue of jobs which can be populated by multiple threads (<code>ConcurrentQueue<MyJob></code>). I need to implement continuous execution of this jobs asynchronously(not by main thread), but <strong>only by one</strong> thread at the same time. I've tried something like this:<... | <p>Your problem statement looks like a <a href="https://en.wikipedia.org/wiki/Producer%E2%80%93consumer_problem" rel="nofollow">producer-consumer</a> problem, with a caveat that you only want a single consumer.</p>
<p>There is no need to reimplement such functionality manually.
Instead, I suggest to use <a href="https... |
MASM 8086 gibberish in front of text <p>I am getting into Assembly programming, and I have started to use MASM. I defined a macro for printing, and another for string input. It seems to work fine, but printing the string will not work if I use the macro, and I'm not sure why.</p>
<pre><code>;Zanglang
.model small
.... | <p>I used MASM 6.15 to assemble your sample and then ran the binary under DOSbox.</p>
<p>Your code works, but the strange behavior originates from your incorrect newline sequence. DOS needs a CRLF instead of a LFCR which is what you have. In this order, DOS ignores the LF (10) and then processes the CR (13). Once D... |
How to display the language name in English from the language code? <p>I am using the following code, but that returns the name of the language in that language, while I want to display the language name in English.</p>
<pre><code>var loc = new java.util.Locale(code)
return loc.getDisplayLanguage(loc)
</code></pre>
<... | <p><a href="https://docs.oracle.com/javase/7/docs/api/java/util/Locale.html#getDisplayLanguage()" rel="nofollow"><code>Locale.getDisplayLanguage()</code></a> displays the language in the default locale. To force it to display in English, you can use <a href="https://docs.oracle.com/javase/7/docs/api/java/util/Locale.ht... |
Checksum for a list of numbers <p>I have a large number of lists of integers. I want to check if any of the lists are duplicates. I was thinking a good way of doing this would be to calculate a basic checksum, then only doing an element by element check if the checksums coincide. But I can't find a checksum algorithm w... | <p>Calculate the checksums with <code>hash()</code>:</p>
<pre><code>checksums = \
list(
map(
lambda l:
hash(tuple(l)),
list_of_lists
)
)
</code></pre>
<p>To know how many duplicates you have:</p>
<pre><code>from collections import Counter
counts = Coun... |
Send an image link to telegram without display image url <p>I need send an image url to telegram without display image url and hidden url. I see a telegram bot and it's do it very well and send long message with image I'm attach this bot result image see it.
Now how can do it in my custom bot? It's possible hidden url ... | <p>According to the <a href="https://core.telegram.org/bots/api#available-methods" rel="nofollow">Telegram API</a>, it seems if you set <code>disable_web_page_preview</code> to <code>true</code>, you should get the result you want.</p>
<p>The final message should look something like this:</p>
<pre><code>{
chat_id... |
What is the purpose of classlist file <p>Can someone please explain the purpose of "classlist" file and rt.jar files in java?</p>
<p>I need to figure out whether the particular project is shipping Swing Layout Extensions package or not.</p>
<p>Inside my project directory I see "swing" references in two places:</p>
<... | <blockquote>
<p>To speed up the startup time of the JVM, the Sun developers decided it
is a good idea to precompile the standard runtime classes for a
platform during installation of the JVM. These precompiled classes can
be found e.g. at:</p>
<p>$JAVA_HOME\jre\bin\client\classes.jsa</p>
</blockquote>
<p>... |
Canvas Get Image Data returning 0 always <p>I am trying to invert the color of an image. Now the image loads ok, but when I try to call getImageData and putImageData back onto the canvas. The canvas is simply blank. Then I printed out all imageData, it appears like that it is always 0 for some reason. I am seriously tr... | <p>You need to wait for the image to load</p>
<pre><code>window.onload = function() {
var c = document.getElementById("myCanvas");
var ctx = c.getContext("2d");
var img = new Image();
img.src = "hand.jpg";
//================================================================
// this event will onl... |
Autofac register same interface with different constructors <p>I am using latest Autofac and would like to register the same type and interface twice based on different constructors</p>
<p>My class/interface</p>
<pre><code>public partial class MyDbContext : System.Data.Entity.DbContext, IMyDbContext
{
public MyDb... | <p>This seems to work but not confident it is best possible. I created new IMyDbContextReadonly interface for class MyDbContextReadonly which has the constructor that I want to use.</p>
<pre><code> public interface IMyDbContextReadonly : IMyDbContext { }
public class MyDbContextReadonly : MyDbContext, IMyDbContex... |
Spring App won't work with JSP <p>I am new to Spring Framework. Trying to make a Java based Spring MVC project. Here is my main application class</p>
<pre><code>@SpringBootApplication
@ComponentScan
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplicati... | <p>Add following to <code>application.properties</code></p>
<pre><code>spring.mvc.view.prefix: /WEB-INF/jsp/
spring.mvc.view.suffix: .jsp
</code></pre>
<p>Edit :You can refer sample project <a href="https://github.com/sidgate/webexample" rel="nofollow">here</a></p>
<p>Below step is not required, but worth a try.</p>... |
how does express server work with wepback middlewares to enable hot reloading? <p>I'm just learning about node, express, and webpack and feel somewhat confused about middleware. Looking at the code below, my understanding is that after I start the web server and open up <a href="http://localhost:7770/" rel="nofollow">h... | <p>I'm not super familiar with what webpack modules you're using and if they include a livereload server or not.</p>
<p>Based on what you wrote, this is what is probably going on:</p>
<ol>
<li>Middleware is run when the server receives a request from the client</li>
<li>I believe webpack is generating your 'bundle.js... |
How to get element to float inside of body instead of element <p>I have an image that is floating around inside of a div using javascript. The div is in the first section of a page on a long scroll. So the image bounces around in the first div, but when I scroll down it stays in that div. I want the image move down the... | <p>You need to set the CSS as such:</p>
<pre><code>position: absolute;
left: 50%;
top: 50%;
</code></pre>
|
do you get downtime when you increase Azure SQL DTUs from 10 to 20? <p>We have an Azure SQL database that occasionally has 50-90% usage. The current scale setting is S0 Standard (10 DTUs). Is there downtime on the server if I switch to S1 Standard (20 DTUs)? If so, what kind of downtime should I expect with a database ... | <p>you don't need downtime when you Increase DTU's or change service tiers,I have changed many times on my test instances as well.</p>
<p>Our database is nearly 150 GB and we have changed service tier from P1 to P3,this operation completed in about 15 minutes and there is no downtime.I remember there was a MSDN page ... |
Unable to set value via protocol <p>In my Objective C code I had this:</p>
<p></p>
<pre><code>if ([view conformsToProtocol:@protocol(UITextInputTraits)]) {
id<UITextInputTraits> field = view;
field.enablesReturnKeyAutomatically = YES;
}
</code></pre>
<p>Now I'm trying to convert that to swift, so I did... | <p>The problem is caused by Swift's peculiar way of dealing with optional protocol requirements. Optional protocol properties have no setter. (I regard this as a bug in the language.) You'll have to work around it.</p>
<p>You can say (horrible):</p>
<pre><code>switch view {
case let field as UITextField:
field.en... |
Meteor Application hosted in Azure using Accounts package causes mongodb connection error <p>The Meteor Accounts package triggers an interval to expire session tokens.
I am not sold this is an Azure thing, maybe it is.</p>
<p>source / accounts-base.js <a href="https://github.com/meteor/meteor/blob/f9f94e21d10676aaa4a8... | <p>Ok, so looks like the issue was resolved by adding the above connection string details: &connectTimeoutMS=60000&socketTimeoutMS=60000</p>
|
Node.js Server Side applications written in Typescript vs JS (ES5) <p>Note: By regular js I refer to the <strong>ES5</strong> version of js. </p>
<p>I am currently setting up the foundation to a project. The tech stack that I currently have choosen to go with is <strong>Node.js</strong> for the back-end w/ <strong>Ang... | <blockquote>
<p>Is it optimal to write the back and front end utilizing the Javascript superset Typescript?</p>
</blockquote>
<p>I would say yes : <a href="https://medium.com/@basarat/typescript-won-a4e0dfde4b08" rel="nofollow">https://medium.com/@basarat/typescript-won-a4e0dfde4b08</a> </p>
<p>But of course it is ... |
Passing variable to SYSPROC.ADMIN_CMD <p>I have a bit of a problem whereby I need to pass a variable value to SYSPROC.ADMIN_CMD.</p>
<p>Here is the deal:</p>
<pre><code>DECLARE vDate TIMESTAMP;
SET vDate = timestamp_iso (MyDateFunctionGoesHere());
CALL SYSPROC.ADMIN_CMD ('LOAD FROM (select vDate...) OF CURSOR inse... | <p>Because <code>ADMIN_CMD</code> takes one argument that is a string, it's easiest to build your SQL statement as a VARCHAR, and then pass that variable to <code>ADMIN_CMD</code>. Setting <code>vDate</code> is unnecessary. </p>
<pre><code>DECLARE vCMD VARCHAR(1024);
SET vCMD = 'LOAD FROM (select ' || CHAR(MyDate... |
Visual Studio 2015 Update 3 issues with UWP apps <p>I had VS2015 U2 properly installed and working properly.
after updating to VS2015 U3, UWP projects are not working properly and give the following errors :</p>
<p>Error when creating a UWP blank app<br>
<img src="http://i.stack.imgur.com/tBwE5.jpg" alt="Error when cr... | <p>try downloading microsoft web platform installer here is the link. It tells you what you need to download. I am not sure if it will work but give it a try.
<a href="https://www.microsoft.com/web/downloads/platform.aspx" rel="nofollow">https://www.microsoft.com/web/downloads/platform.aspx</a>.</p>
|
How long for Firebase Remote Config to push? <p>How long does it take for a remote config to push? I have the following code, which continues to print false and the old value for at least a few minutes after pushing a new update on the web.</p>
<pre><code>remoteConfig.fetchWithCompletionHandler { (status, error) ->... | <p>The default behavior is to cache for 12 hours, according to <a href="https://firebase.google.com/docs/remote-config/ios" rel="nofollow">the documentation</a>. The function</p>
<pre><code>fetchWithExpirationDuration(expirationDuration: NSTimeInterval, completionHandler: FIRRemoteConfigFetchCompletion?)
</code></pre>... |
Confused on an If-else statement in C++ <p>working on a project for class and all of the code works except for one portion that I think I may have messed up the whole code and may need to be re-written (which is why I'm asking here). The program asks you to pick one of three choices and then you pick how many of that i... | <p>You just need to add an else after each of your principal ifs, like:</p>
<pre><code>if (choice == "sandwich")
{
....
} else if (choice == "platter")
{
...
} else if (choice == "salad")
{
...
} else {
cout << "\n Option unavailable, try again." << endl;
}
</code></pre>
|
Join strings in tagging function <p>ES6 introduces string interpolation. But this strings are not only interpolation - they also <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#Tagged_template_literals" rel="nofollow">can be used with tag function to process values</a>.</p>
... | <p>You could use <code>String.raw</code> function:</p>
<pre><code>function toUrl(s, ...vals) {
vals = vals.map(encodeURIComponent);
return String.raw({ raw: s }, ...vals);
}
</code></pre>
|
Defer dropping a temporary table in MySQL with ActiveRecord <p>I'm trying to solve a performance issue where we are running a WHERE IN clause on a ton of non-sequential IDs. According to <a href="https://explainextended.com/2009/08/18/passing-parameters-in-mysql-in-list-vs-temporary-table/" rel="nofollow">this</a> and ... | <p>So after quite a bit of research, I answered my own questions:</p>
<ol>
<li><p>There is no way to defer the dropping of the table, however, I was able to force the relation to execute the query now using the <code>ActiveRecord::Relation#load</code> method. </p></li>
<li><p>In our application (and I'm sure many othe... |
Iterating through multiple text files and comparing <p>I'm trying to write a function that puts text files into a list and then iterates through the files to find exact and partial copies to weed out people who may have cheated by plagarising their work. I start by using my class roster and adding .txt to their name to... | <p>Try this. You may need to modify it for your file structure, but it should be close.</p>
<pre><code>import re
from itertools import product
def hash_sentences(document):
# remove all characters except those below, replace with a space
# split into a list
cleaned_text = re.sub(r'[^A-z0-9,;:\.\?! ]', ' ... |
Best way to render line that is being updated frequently by the device <p>So right now I have a persistent stream of data coming into the device and I want to draw a trend line live as the data is coming in. </p>
<p>Here's how I'm feeding test data into the system</p>
<pre><code> self.timer = [NSTimer scheduledTim... | <p>This is a fairly standard optimization problem. First, you need to make sure you're drawing your lines efficiently. There are a ton of things around that:</p>
<ul>
<li><p>Turning off any fancy options that you don't really want in your <code>CGContext</code> (if you're using a <code>CGPath</code>, else on your <cod... |
jquery animate inside a for loop <p>I have an animation where I'm not sure what's going wrong. My fadeIn/Out delays are not respected. I am attempting to fade out a tile, replace it with a new tile and fade it in. This is done 4 times in this case but it could vary thus the for loop.</p>
<p>Here is a shortened version... | <p>The second parameter of first animate is error.should function.</p>
|
How to use a javascript filepath in another javascript file in Rails <p>I have 2 javascript files in a Rails application in <code>/app/vendor/assets/javascripts/</code> path. Suppose those files are <code>jsfile-1.js</code> and <code>jsfile-2.js</code>. In <code>jsfile-2.js</code> I have following code</p>
<pre><code>... | <p>Few thing to remember here...</p>
<ol>
<li>if <strong>you are adding</strong> js files in <code>application.js</code>,..you dont need to add them again in view files.</li>
<li>if <strong>you are not adding</strong> js files in <code>application.js</code>,then you have to add them in <code>asset.rb</code> and then r... |
When I choose an option from a select, this option should be hidden in the other select <p>I'm doing an exercise in HTML and PHP that calculates the distances from the cities. Professor asked to implement a select in such a way that when you choose City A in one select dropdown, you shouldn't be able to choose City A i... | <p>I think this will solve what you want but note that you have to make only one file (Distancia.php)</p>
<pre><code><?php
$cities = array('SP' =>"São Paulo" ,'RJ' =>"Rio de Janeiro");
$cities2 = $cities;
$city1 = $_GET['op1'];
if (isset($city1)){
unset($cities2[trim($city1)]);
}
if (isset($_GET['o... |
I can't earn correct result when I use IsNan function in javascript <p>I can't earn correct result when I use IsNan function in javascript
WHEN I INPUT NUBER (EX 2342, 1111 ...) IsNan function result is true.
I think inNan function recognize letter not a number.
How can I fixed it?</p>
<pre><code> <%@ page language... | <p>Use this </p>
<pre><code>if(isNaN(updateno)){
alert("YOU HAVE TO INPUT NUMBER VALUE");
}
</code></pre>
|
How append in jquery in for loop with setInterval without getting an infinite loop <p>I am making a listing system that updates checking new data from a json file every <strong>3 seconds</strong> by appending the <strong>response.list[i].firstname</strong> to document.getElementById("list"). but i am getting unlimited ... | <p>This is happening because every 3 seconds you read JSON file and append it to the already rendered (with all the data appended in previous runs) list with </p>
<pre><code>document.getElementById("list").appendChild(newElement);
</code></pre>
<p>If you want to show only the content of the file once, then you should... |
Linking to Google Search in href <p>I am dynamically creating a table, and I'd like to display the title of the books to be links to a Google search of the title. I have looked at many solutions here, but all suggest something like this:</p>
<p><code>"<td><a href='http://google.com/q={$title}'>'$title'<... | <p>try this one:</p>
<pre><code>echo "<TR>";
echo "<TD><a href='http://google.com/?gws_rd=cr,ssl#q={$title}'>$title</a></TD>";
echo "</TR>";
</code></pre>
<p>it is not perfect way to search, use google search script for best result.
<a href="https://developers.google.com/custom-sea... |
Firebase error: Permission denied. Unable to read/write from Firebase Database <p>I need to give read/write access only to authenticated users, but it seems like Firebase is not recognizing that the user is authenticated.</p>
<p>After I sign in the user with email and password, I am assuming user is authenticated and ... | <p>Your code is a mixture of API calls from the legacy 2.x.x. SDK, for example:</p>
<p><code>sRef.authWithPassword(email,password,new Firebase.AuthResultHandler()</code></p>
<p>and the new 9.x.x SDK:</p>
<p><code>firebaseAuth.signInWithEmailAndPassword()</code></p>
<p>The two SDKs are not compatible. You need to u... |
All combinations of N elements <p>I needed help in a algorithm: I have an N number of APs (access point), and each of these APs share a channel and a frequency</p>
<p>channels go of 1 to X
Frequency go of 1 to Y</p>
<p>I need to find all the possibilities for values, So I thought in a logical like that, first do all ... | <p>I fixed it :D</p>
<pre><code>j=0;
key = cont = 1;
K=pow(F,AP);
K2=K;
K=K/F;
FREQ=calloc(K2,sizeof(int*));
for(i=0;i<K2;i++)
FREQ[i]=calloc(AP,sizeof(int));
for(j=0;j<AP;j++)
{
for(i=0;i<K... |
Removing extra characters from a string with a specific pattern PHP <p>I am moving data from the output of a python function to php and then converting it to JSON and sending it to a javascript function that calls it with AJAX. </p>
<p>The format should look like this:</p>
<pre><code>{"data_name" : [1.02, 3.013, -24.... | <p>I agree with Sammitch. </p>
<p>The quick fix for 2. is <a href="http://php.net/manual/en/function.stripslashes.php" rel="nofollow">stripslashes</a></p>
<p>For the rest, you may be able to create patterns with <a href="http://php.net/manual/en/function.preg-replace.php" rel="nofollow">preg_replace</a> that can filt... |
twemoji combines 2 emoticons into one <p>The Unicode Emoticon for D = &#x1F1E9; and E = &#x1F1EA;</p>
<p>The Unicode Emoticon for the German (DE) Flag is &#x1F1E9;&#x1F1EA;</p>
<p>If I have a D and E Emoticon without anything between them then twemoji will combine them into the German flag image. Any ... | <p>Insert <code>U+200C</code> (ZERO WIDTH NON-JOINER) between the characters to prevent them from joining together to form a single grapheme/glyph. In HTML, you can use the entities <code>&#8204;</code> or <code>&zwnj;</code>.</p>
|
How do I stop this loop from repeating once the user has entered the correct answer? <p>I'm only just beginning to learn to code in java and I've tried to figure this out for a <strong>while</strong> now, I've tried various methods and I've tried looking through similar questions but I can't find my answer.</p>
<p>I'm... | <p>Your problem is that you are computing <strong>valid</strong> <em>outside</em> of your loop.
In other words: you compute it once; before you enter the loop; and then, within your loop you never touch its value again.</p>
<p>Therefore, the "only" thing that your loop does is to raise that dialog over and over again.... |
Parse text with Applscripts <p>I could use some help writing an Applescript to parse some text from a .txt file and output to a separate .txt file. I need a script to 1) identify a section (delisted by â»=â), 2) identify if a specific set of characters exists in a section, â[*]â, 3) print section header with a... | <p>Reading and writing text file is quite easy with Applescript :</p>
<p>Read :</p>
<pre><code>set myFile to choose file "Select your txt file" -- ask user to select txt file
set myText to (read myFile) as string -- content the text file is in variable myText
</code></pre>
<p>Write content of text variable newText i... |
Java Time's week-of-week-based-year pattern parsing with DateTimeFormatter <p>I need to output the current date in the format <code>week-based-year</code>-<code>week-of-week-based-year</code>, i.e. using the <a href="https://en.wikipedia.org/wiki/ISO_week_date" rel="nofollow">ISO week date</a> where the week always sta... | <p>The documentation of <a href="http://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatterBuilder.html#appendPattern-java.lang.String-" rel="nofollow"><code>DateTimeFormatterBuilder</code></a> specifies that "Y" appends the localized week-based year. Thus, the meaning of the week-based year and week f... |
How to execute fadein() and fadeout() ONLY ONCE, in a loop and setInterval? <p>I am making a listing system that updates, checking new data from a JSON file every 3 seconds. Also I am adding effects fadeIn() and fadeOut() but
the fadeIn() and fadeOut() are executing everytime it loops and (setInterval(list, 3000);). <... | <p>try adding variable and assign true if your element is showed (just for checker if element is already showed)</p>
<pre><code>var displayed = false;
list();
setInterval(list, 3000);
function list() {
$.getJSON('list.php',function(response){
var timeout = 400;
if (displayed == false) {
... |
Swift cannot import SwiftyJSON and Alamofire by cocoapods on Xcode 8 <p>I need use SwiftyJSON and Alamofire in my Swift project, so I use cocoapods.</p>
<p>My podfile is :</p>
<pre><code>platform :ios, '9.0'
target 'SwiftSalt' do
use_frameworks!
pod 'SwiftyJSON'
pod 'Alamofire', '~> 4.0'
end
post_insta... | <p>Change config.build_settings to swift 2.3. Because swiftyJSON is still on swift 2.3</p>
<pre><code> post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['SWIFT_VERSION'] = '2.3'
end
end
</code></pre>
<p>end</p... |
how to allow my iframe cotent to go full screen, or a better alternative to iframe? <h2>Background</h2>
<p>I have a domain <a href="http://www.example.com" rel="nofollow">http://www.example.com</a></p>
<p>I have some content at another ugly URL like <a href="http://www.othersite.com/blahblahblah/foo" rel="nofollow">h... | <p>Oh, I just found there is a <code>allowFullScreen="true"</code> switch for the <code>iframe</code> tag!</p>
<p>Works in Chrome, but doesn't seem to work in Internet Explorer 11 :(</p>
|
Index and search document having words with spaces in elasticsearch <p>due to a particular document process production I have a bunch of documents with malformed words, having spaces within them. These could be important words to search for and for the moment I don't have the possibility to obtain another format of doc... | <p>I would try to start from <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/analysis-ngram-tokenizer.html" rel="nofollow">NGram tokenizer</a>. Which tokenize only numbers and letters, so even using spaces it will be able to find a match. </p>
|
Consider certain string as variable <p>my php script gets a json config file. In this case, $json->autowelcome is "Hello {user}, welcome!"</p>
<p>I want php to interpreter the {user} as $user. How can i do that?</p>
<pre><code> // Answer to tickle every 5 seconds
if (time() - dataAPI::get($key) >= 5... | <p>I can suggest you to use str_replace. Easier way.</p>
<p>Exemple:</p>
<pre><code>$string = 'Hello {name}!';
$search[] = '{id}'; $replace[] = $user->getID();
$search[] = '{name}'; $replace[] = $user->getNick();
$search[] = '{regname}'; $replace[] = $user->getRegname();
return st... |
How to have a JTextArea appear above Graphics, both within a JComponent? <p>I'm struggling a bit with trying to create a notepad-type thing in Java. So far, I have a class as below, that is really a <code>JComponent</code> (<code>UtilityComponent</code> extends <code>JComponent</code>). In it, you can see that I am ren... | <p>I've figured it out after a lot of heartache. I've changed it so my window (Jframe thing) first includes a background JLayeredPane, then I add my graphics first to the JLayeredPane.DAFAULT_LAYER, then my JTextArea to something higher. THe little bit I had trouble with for hours was that I needed to set the location ... |
Calculate cost of clustering in pyspark data frame <p>I have a data frame of million records and I have used <code>pyspark</code> <code>ml</code> .</p>
<p>KMeans to identify clusters , Now I want to find the within set sum of squares error((WSSSE) for the number of clusters that I have used.</p>
<p>my spark version ... | <p>I have computed the <a href="http://stackoverflow.com/questions/39216760/compute-cost-of-kmeans">cost of k-means prior to version 2.0</a>.</p>
<p>As for the "slow"-ness you are mentioning: For 100m points, with 8192 centroids, it took me 50 minutes to compute the cost, with 64 executors and 202092 partitions, with ... |
Get the latest Build Number from artifactory for multiple jobs through Groovy script.Running from jenkins <p>I am trying to write a small groovy script which will give the latest build number from the snapshot artifactory repository and running the script from jenkins.I am able to get the latest build number successful... | <p>Below code is working fine and giving me the latest build number from the snapshot repository for the respected jobs. </p>
<pre><code>import groovy.json.*
import hudson.model.*
import jenkins.model.Jenkins
def applicationdataLatestBuild = getLatestBuild('PoidonServices')
def CareDiscoveryProductsLatestBuild = get... |
Take picture and save it on internal storage <p>I'm trying to take a picture and save it in the internal storage so this way, only my app will have access to the pictures
how can i do this? I'm trying a lot of things without success, even the official documentation from google is broken, here's my actual code, that sav... | <p>If you save your picture on SD card or external storage any app can access it. Try to get the private directory and save your photo there.</p>
<p>Take from <a href="https://developer.android.com/guide/topics/data/data-storage.html" rel="nofollow">here</a></p>
<p>To create and write a private file to the internal ... |
jsonpath find string value in the jsonarray independent of array index <p>I have a Gatling JSON objects of array. The object contains error messages e.g.</p>
<pre><code>"error": [
{
"errorCode": "111",
"errorMessage": "very dynamic error :- at [Source: java.io.PushbackInputStream@5d0edb12; line: 6, col... | <p>You can filter the array with the following:</p>
<pre><code>JsonPath.query("$.error[?(@.errorMessage=='Fixed Error Message')]", json)
</code></pre>
<p><strong>EDIT 1:</strong> </p>
<p>This would be preferred to check if the message was actually found:</p>
<pre><code>jsonPath("$.error[?(@.errorMessage=='Fixed Err... |
Although I've defined value for my object attributes but they all become null ?Why? <p>I have an <code>ArrayList</code> called <code>building</code> which stores the instances of a super class called <code>Residence</code>. (At this point I've defined only one of the sub classes called <code>Manager</code>). What I am... | <p>You have to remove the variables from Manager class if you want to initialize them.</p>
<pre><code>public class Manager extends Residence {
public Manager() {
super();
}
public Manager(String p, String u, String pas, String acc, String type, String no) {
super(p , u , pas, acc, type , no);
... |
Printing the list new Redditors for a given month from the BigQuery reddit corpus <p>I want to print the list of redditors, who have not posted NOR commented in the last 12 months, for each month of 2010. I'm using the reddit comment/post corpus on BigQuery for this purpose.</p>
<p>This is what I am running to get ne... | <p>It works if you remove duplicates:</p>
<pre><code>SELECT author
FROM [fh-bigquery:reddit_comments.2010]
WHERE created_utc <= 1264982399
AND author NOT IN (
SELECT author
FROM [fh-bigquery:reddit_comments.2009]
GROUP BY 1
)
AND author NOT IN (
SELECT author
FROM [fh-bigquery:reddit_posts.full_corpus_201... |
How can I make my resize function include the elements of the previous vector? <p>How can I make my <code>resize</code> function include the elements of the previous vector? This is basically mimicking a <code>vector</code> and I have created The <code>push_back</code> and <code>pop_back</code> functions. </p>
<p>I ha... | <p>I have tried to perform what have you asked. No bound checking is added in this </p>
<pre><code>template <class TT>
class SimpleVector {
TT* arr;
int size;
public:
SimpleVector() {}
SimpleVector(TT n) {
this->arr = new TT[n];
this->size = 0;
}
int getLength() {
... |
RxJS 5 with Angular 2: replay subscription on schedule determined by previous result <p>In my <code>Angular 2</code> <code>typescript 2</code> app, I query the server for a value that needs to be updated periodically. The delay between updates is variable (the server sends an expiration date along with the value).</p>... | <p>call doObservableStuff initially when ever it is necessory</p>
<pre><code>getData(){
// server returns {expires:number, price:number}
this.http.get('...').map(res => res.json())
.subscribe( data =>
{
this.price = data.price;
doObservableStuff(data.expires-Date.now()... |
Getting error running this code for word search <pre><code>import sys
GameMatrix = [ ['S','E','A','N','T','A','R','C','I','T','R','U','R','T','O','I','I','Y'],
['O','C','U','P','O','N','A','P','S','A','N','D','D','U','N','E','R','L'],
['C','O','A','U','S','E','A','R','L','M','O','O... | <p>i tried changing it, but I'm not getting the desired output. I'm doing word search in python but the output now I'm getting is: </p>
<p>Last login: Tue Sep 20 18:43:59 on ttys000
dhcp-10-100-10-29:~ fahadwali$ python wordsearch.py
[['S', 'E', 'A', 'N', 'T', 'A', 'R', 'C', 'I', 'T', 'R', 'U', 'R', 'T', 'O', 'I', 'I'... |
Number refuses to divide <p>I have made a simple function called "Approx" which multiplies two numbers together then divides them by two. When I use the function by itself it works great but it seems in the hunk of code I have it doesn't divide the number in half and I have no idea why. This is my code where is the err... | <p>Your function works the way you describe it, however I don't understand how you use it in the rest of the code.</p>
<p>It seems like you are trying to approximate square roots using a variant of Newton's method, but it's hard to understand how you implement it. Some variables in your code are not used (what is <cod... |
Lift factor value <p>I have a transaction matrix like this:</p>
<pre><code> "u1" "u10" "u2" "u3" ...
_____________________________________
"A", | 1 0 1 1 ...
"B", | 0 1 0 0
"u10"| 0 0 0 0 .
"u11"| 0 0 0 0 .
"u2" | 0 0 0 0 .
"u4" | 0 0 0 0 ... | <p>I guess what you want is something like the following:</p>
<p>My first assumption is, the matrix you start with is not a user-item transaction matrix, rather an item-item co-occurrence matrix, where the entry i,j represents # transactions where the item i was bought given item j was brought. Here is a small co-occu... |
End while loop for character substitution <p>This is taken out from Keyshanc Encryption Algorithm. <a href="https://github.com/Networc/keyshanc" rel="nofollow">https://github.com/Networc/keyshanc</a></p>
<p>My question is: How can I possibly manipulate this main method for having multiple encryption outputs with the k... | <p>You are taking input in two places, so you have to put two tests.</p>
<p>When you are in the <code>while</code> loop, you have to break out of the <code>while</code> loop, and also break out of the <code>for(;;)</code> loop. You can set <code>i=5;</code> to force the <code>for(;;)</code> loop to stop.</p>
<pre><co... |
Using PHP to update an MYSQL Database <p>I'm doing an assessment where I need to create a form that connects to PHP MyAdmin but I keep getting Parse error: syntax error, unexpected end of file in C:\xampp\htdocs\import.php on line 40. Please I don't know how to fix it.</p>
<pre><code><!DOCTYPE html>
<title&g... | <p>You forget curly braces in your code . Make Sure that All The brackets are closed before </p>
<pre><code> ?>
</code></pre>
<p>Closing Canonical Tag .
This Error tells you that your code has not an ending point .
So please put </p>
<pre><code> }
</code></pre>
<p>these braces before your ending . </p>
|
How join Row in one table mysql php <p>How join row in one table if row in table like this</p>
<p>NAME TABLE1</p>
<pre><code>id uid uid1 name qty price status
1 002 null null null null order
2 002 03002 abc null 10000 cart
3 002 null abc 8 10000 finish
</code></pre>
<p>and get 1 row from output join like... | <p>USE SELECT FROM WHERE IS NOT NULL ORDER BY
<pre><code>SELECT DISTINCT (
SELECT uid FROM test WHERE uid IS NOT NULL ORDER BY id DESC LIMIT 1) a_uid,
(SELECT uid1 FROM test WHERE uid1 IS NOT NULL ORDER BY id DESC LIMIT 1) a_uid1,
(SELECT name FROM test WHERE name IS NOT NULL ORDER BY id DESC LIMIT 1
) a_name,... |
Seting the number of executors for my Spark Streaming application <p>I am runnning my Spark Streaming application in the Yarn cluster mode. I want to limit the number of executors to just one node? How to do this in Spark?</p>
| <p>You can control the number of executors by two ways:</p>
<p><strong><code>Option 1:</code></strong> Directly with Spark Submit Command:</p>
<pre><code>spark-submit -class ClassName --num-executors 1 .... other parameters
</code></pre>
<p><strong><code>Option 2:</code></strong> Inside Conf flag with Spark Submit c... |
command line debug build project Undefined symbols for architecture i386 <p>Running <code>xcodebuild -target szapp</code> returns: </p>
<pre><code>CONFIGURATION_BUILD_DIR=$/Users/szmall/Documents/new12/trunk/head/ShiZu -configuration Debug build -sdk iphonesimulator9.2 ONLY_ACTIVE_ARCH=NO VALID_ARCHS='arm64 armv7s ar... | <p>Remove <code>i386</code> from Target's Build Settings -> Architectures -> Valid Architectures, there is no need to specify it. But if your library does not contain code for <code>i386</code> - you will have problems trying to run it on older simulators.</p>
<p>BTW, you can check supported architectures using comman... |
Port isn't closing when I Exit out of a server <p>Hello everyone So I have this annoying problem where my port isn't closing. For example I'm using an express generator to give me an outline/skeleton of a node js/express server.</p>
<pre><code>Port 3000 is already in use
</code></pre>
<p>Usually I would just able to ... | <p>Ctrl+Z in Unix-based operating systems just suspends the application.</p>
<p>If you do </p>
<pre><code>ps aux|grep node
</code></pre>
<p>and then </p>
<pre><code>kill -9 processid
</code></pre>
<p>you should be able to reclaim the port.</p>
<p>Going forward, Ctrl+C to shut down the application.</p>
|
selecting the value from column having highest digit count after decimal places <p>I have the below table named SAXTION_EG and it this table contain various colulms out of which there is one column named STR_RATE and in this columncontain values like </p>
<pre><code> STR_RATE
1.11317
123.08546759
8.49111
</code... | <p>You can try some thing like this. Logic is first get the position of the decimal point. Then get the string after the decimal. After that count the no of chars in that substring. Then use the MAX to get the aggregated max value</p>
<pre><code>SELECT MAX(LENGTH(SUBSTR(STR_RATE, INSTR(STR_RATE, '.')+ 1)))
FROM your_t... |
Rename fields in nested arrays using JOLT tranformation <p>I want to rename fields in an array nested in an another array using JOLT transformation library.
1. One field to rename is a top level field in an array
2. Two fields to rename are inside a nested array </p>
<p>I have tried using wildcards but they are not g... | <p>Spec </p>
<pre><code>[
{
"operation": "shift",
"spec": {
"country": "country",
"state": {
"*": { // state array index
"stateName": "state[&1].stateName",
"location": "state[&1].location",
"cities": {
"*": { // city array index
... |
difference between StartNTService and StartSonar <p>I am using SonarQube Server for Java. I noticed that there are 2 batch files.
1) StartNTService
2) StartSonar</p>
<p>I would like to know what is the difference between these two?</p>
| <p><code>StartSonar.bat</code> is to start SonarQube in your command prompt (<a href="http://docs.sonarqube.org/display/SONAR/Get+Started+in+Two+Minutes" rel="nofollow">documentation</a>).</p>
<p><code>StartNTService.bat</code> is to start SonarQube as a Windows Service (after having installed it as a service with <co... |
React - when to use props.children and when to add element to React.createElement? <p>I'm getting started with React. In library components I often see <code>props.children</code> being required prop (also required <code>child.key</code>). In tutorials I see you can put children nodes into <code>React.createElement(tag... | <p>They are two sides to the same coin:</p>
<pre><code>var MyComponent = React.createClass({
propTypes: {
summary: React.PropTypes.string,
// Children are what we accept, and we display them in our <details>
children: React.PropTypes.element
},
render: function() {
return (<details>
... |
REGEX: How to replace four digits preceded by "w/" and "h"? <p>I'm using the following regex to replace the digits in <code>w/4096/h/2048</code> with custom values. But now I want to be able to replace any kind of four digits after <code>w/</code> and <code>/h</code></p>
<pre><code>imgSrc.replace('w/4096/h/2048', 'w/'... | <p>Use <code>[0-9]</code> to match a digit, and the quantifier <code>{4}</code> to match four of them:</p>
<pre><code>imgSrc.replace('w/[0-9]{4}/h/[0-9]{4}', 'w/' + w + '/h/' + h)
</code></pre>
<p>As a short-hand for <code>[0-9]</code> you can use <code>\d</code>:</p>
<pre><code>imgSrc.replace('w/\d{4}/h/\d{4}', 'w/... |
Using Clojure multimethods defined across multiple namespaces <p>Although the below example seems a bit strange, it's because I'm trying to reduce a fairly large problem I've got at present to a minimal example. I'm struggling to work out how to call into multimethods when they're sitting behind a couple of abstraction... | <h3>Initial notes</h3>
<p>It's hard to tell if you mixed up some things in the process of simplifying the example, or if they weren't quite right out of the gate. For an example of what I'm referring to, consider <code>purchase-item</code>, though the issues are similar for <code>get-item-price</code>:</p>
<ul>
<li>T... |
Language Fallback not working for Fields with Standard Values (Sitecore 8.1) <p>We had an issue where we enabled fallback language settings at the item level on a base template so that it would apply to all of our items. It worked for about 90% of our items but not for others even though the sitecore content editor ind... | <p>Here are some steps to make language fallback work for all items by applying item level settings to a base template.</p>
<p><strong>Step 1</strong></p>
<p>First step to enable language fall-back is to set up the fall-back tree.
We can build a hierarchical structure (or simple linear) for languages to fall back to... |
Is there a way to return a dictionary value without quotations? <p>Sorry if this is somewhere out there but I just couldn't find a solution to what I was looking for. I want to return the value of my dictionary without the quotations and can't figure out what I'm doing wrong.</p>
<pre><code>def read_wiktionary():
ans... | <p>The quotation is just used as a separator between different keys and values so it cannot be removed.The quotation doesn't affect your values in the dictionary.</p>
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.