title stringlengths 10 150 | body stringlengths 17 64.2k | label int64 0 3 |
|---|---|---|
Setting up pythonpath in OS X | <p>A new PHP developer here trying to learn Python/Django using the "Tango With Django" tutorial.</p>
<p>I'm up to section 2.2.2 where I have to set up the pythonpath and I'm having the following problem:</p>
<p>When I type the following in the terminal: <code>echo $pythonpath</code> I get a blank line instead of the... | 0 |
Compare Two Pivot Tables | <p>I have two pivot tables, one in Column A, one in Column B, and they are formatted the same way.</p>
<p>The pivot tables have a list of Users, and under each User a list of IDs.</p>
<p>Is there a way I can compare the two pivot tables against each other? I want to match Users in both tables and see which Users have... | 0 |
How can I count white spaces using substr_count() in PHP | <p>how can I count the number of white spaces in a file using PHP?</p>
<p>I have tried the substr function but it isn't working.</p> | 0 |
Free Calendar/Schedular Control in WPF | <p>Is there any free WPF calendar/Schedular /appointment control available , I have searched on google but couldn't find one.</p> | 0 |
iterating through java collection using jQuery | <p>I am starting with this object,</p>
<pre><code>public class myTO {
private String id;
private String name;
}
</code></pre>
<p>Which is used in this object</p>
<pre><code>public myCombiTO {
private myTO myTO;
private List<String> valueList;
private List<String> displayList;
}
... | 0 |
How do I do modulus in C++? | <p>How do I perform a mod operation between two integers in C++?</p> | 0 |
Java vs. C++ for building a GUI which has a C++ backend | <p>I currently have a C++ backend that I need to connect with a GUI, and since I've never built a GUI before, I was confused on where to start. </p>
<p>I'm comfortable writing code in C++ and Java, so I'd prefer my GUI to be in one of those languages. Also, the GUI has to be reasonably OS independent over Windows and ... | 0 |
Is is possible to make a method execute only once? | <p>I have a for loop and structure like this:</p>
<pre><code>for(....)
....
....
if(isTrue)
... do something..
.. method to be executed once (doTrick) is declared outside for loop.
....endif
endfor
public void doTrick()
...
...
..end
</code></pre>
<p>Is it possible for a method in for loop to be executed only once?<... | 0 |
download files using bash script using wget | <p>I've been trying to create a simple script that will take a list of file to be downloaded from a .txt file, then using a loop it will read the .txt what files needs to be downloaded with the help of the other separated .txt file where in the address of the files where it will be downloaded. But my problem is I don't... | 0 |
How to add two figures side by side, and insert captions to each of them? | <p>In Word, I can add two figures side by side, however, when I insert captions to each of them, the figure number doesn't change, both of them have the same figure number. How can I solve this problem?</p> | 0 |
C# MemoryStream - Timeouts are not supported on this stream | <p>I'm trying to create a csv file dynamially and output the stream to the browser.</p>
<p>Here is my api end point:</p>
<pre><code> [System.Web.Http.HttpGet]
[System.Web.Http.Route("export-to-csv")]
public FileStreamResult ExportDeposits([FromUri(Name = "")]DepositSearchParamsVM depositSearchParamsVM)
... | 0 |
Change color of matInput | <p>How do I change matInput to a custom color. I want to change the placeholder and underline color.</p>
<p>I have read through most of the posts and could not find a solution to change the underline.</p>
<pre><code> <mat-form-field class="example-full-width">
<input matInput placeholder="Favorite food"... | 0 |
How to Test React Hooks useEffect, useCallBack | <p>I'm trying to write unit test cases using Jest, Enzyme for useEffect, and useCallback for React hooks but I'm unable to succeed. Can you someone help me to write a test case for the below code.</p>
<p>ModalComponent.jsx</p>
<pre><code> const ModalComponent = ({ closeModal }) => {
const handleModal = useCall... | 0 |
How to switch on\off frontend form validation for some fields in yii2? | <p>I have got difficult form in yii2 view, where some fields show or hide. It decide from user field choises, select options in the form. I write this frontend logic with custom jquery file. All is ok. But when I submit form - hidden fields stay without validation and nothing is happend.How I can kill ofrontend validat... | 0 |
how to calculate line height from psd file? (leading+ font size) | <p>I have this psd and trying to convert it to html css. </p>
<p>But I can't calculate the line height in css from the psd.</p>
<p>How can i calculate the line height from the leading + font size?</p>
<p>thanks</p> | 0 |
Calling RESTful Web Services from PostgreSQL procedure/function | <p>I have been provided RESTful web services to push data into a remote DB of another application. I need to call these services to push data from PostgreSQL DB by sending data in JSON format as GET/POST parameters to the web service. Is it possible to call these web services from the PostgreSQL functions (periodically... | 0 |
Increment Cell Values in a Range by 1 with VBA Excel | <p>Im currently trying to implement an insert new row value and a automatic checkbox inserter.</p>
<p>I currently have the following code spread over different buttons and therefore different Subs. I have boldened the key information that i will need to increment by 1 cell. This will occur after clicking the "InsertNe... | 0 |
Flutter : Textfield in ListView.builder | <p>Hi everyone i have some data at Cloud Firestore and a ListView.builder to load the data in it. In this ListView.builder i have Network.Image, ListTile to show the title and subtitle and another ListTile which has a Textfield to add some comment and an iconbutton. My goal is to get the text of the textfield and show ... | 0 |
Python use timeout for subprocess with Popen | <p>Im running the following script with popen </p>
<pre><code>process = subprocess.Popen(['python', 'solver.py', 'newsudoku.csp', '-i', 'arc'], stdout=subprocess.PIPE)
out, err = process.communicate()
</code></pre>
<p>I need to process the output that is being stored in the out variable</p>
<p>thing is this script v... | 0 |
How to update Xcode with a new Apple ID? | <p>I've recently changed apple ID and I've downloaded xCode on mac with another apple ID.</p>
<p>Not the mac store informs me there is a new version for xCode but I need to insert password of the older Apple ID, and I can't just use the new one. It seems the app is associated with the old apple ID.</p>
<p>I can't eve... | 0 |
The entity or complex type ... cannot be constructed in a LINQ to Entities query | <p>Why does one method work but not the other, when it seems they are both doing the same thing, i.e. constructing an entity. My question then, is there a way to construct the entity in a L2E query instead of having to use just Linq or indeed both?</p>
<p>This works fine...</p>
<pre><code>var queryToList = (from ac i... | 0 |
Sorting an array of strings in C | <p>I have an assignment I've been working on for a few hours now, and I can't seem to get it quite right. The assignment is to take a random number of names (from stdin), sort them, and then output them in alphabetical order. I can't find any sites online that handle this kind of sorting specifically, and have had no l... | 0 |
ClassNotFoundException: Didn't find class "com.google.android.gms.ads.AdView" | <p>I did a lot of research and this seems to be a common error for many users but for very different reasons. None of which I found worked for me.</p>
<p>I'm getting</p>
<pre><code>java.lang.RuntimeException: Unable to start activity ComponentInfo{
[...]/[...].activities.StartActivity}: android.view.InflateException:... | 0 |
Use Google Apps Script to loop through the whole column | <p>I am trying to loop through the whole row in my google sheet and copy some of the data from one sheet to another. The list will get longer over time.</p>
<p>More specifically: If input in column B equals "blue", than copy the values from column A and C into another sheet.
Do this for all columns till the end of the... | 0 |
Avoid animation of UICollectionView after reloadItemsAtIndexPaths | <p>UICollectionView animate items after reloadItemsAtIndexPaths is called (fade animation).</p>
<p>Is there a way to avoid this animation? </p>
<p>iOS 6</p> | 0 |
Usage of 'pull' command in Jgit | <p>I'm a new user of git and am using <a href="http://wiki.eclipse.org/JGit" rel="noreferrer">JGit</a> to interact with a remote git repository. In JGit, I used <code>CloneCommand</code> to initially to clone a repo, and it worked without a issue. However, when I try to use <code>PullCommand</code>, which is the equiva... | 0 |
Weird exception: Cannot cast String to Boolean when using getBoolean | <p>I'm getting a very weird error.
I have 2 activities. On both I'm getting the <code>SharedPreferences</code> using <code>MODE_PRIVATE</code> (if it matters) by <code>sp = getPreferences(MODE_PRIVATE);</code> on each activity's <code>onCreate()</code>
I'm calling <code>sp.getBoolean(IntroActivity.SHOW_INTRO, true)</co... | 0 |
Connecting to a remote mongoDB server | <p>I have a remote machine which I connect to using SSH, I installed mongoDB on it, and I wish to use it remotely, how do I connect to it using nodejs and mongoDB compass? the localhost is the IP ?</p>
<pre><code>const db = "mongodb://what do I write here?";
const connectDB = async () => {
try {
await mongoos... | 0 |
How do I detect a mobile browser in a .NET MVC3 application | <p>I'm developing a .NET MVC3 application. </p>
<p>Is there a good way to detect if the user is using a mobile browser in the view (using RAZOR).
I'm wanting to differ the display logic if it's a mobile browser.</p>
<p>Thanks!</p> | 0 |
Search ABAddressbook iOS SDK | <p>I want to search the iPhone address book for a specific phone number, and then retrieve the contact name. I am currently looping through all contacts and extracting the multivalue properties and comparing against the value. This is taking way too much time. I have read the Apple addressbook guide, and they say:</p>
... | 0 |
how to add searchbar in uitableview? | <p>I have an <code>NSMutableArray</code> displayed in a <code>UITableView</code>, and I have added some elements there.</p>
<p>For example, element names are First, FirstTwo, Second, SecondTwo, Third, ThirdTwo.</p>
<p>Now I want to add a search bar in the screen. In that search bar when I type F, the table should onl... | 0 |
Which .NET collection is faster: enumerating foreach Dictionary<>.Values or List<>? | <p>Are one of these enumerations faster than the other or about the same? (example in C#)</p>
<p>Case 1:</p>
<pre><code>Dictionary<string, object> valuesDict;
// valuesDict loaded with thousands of objects
foreach (object value in valuesDict.Values) { /* process */ }
</code></pre>
<p>Case 2:</p>
<pre><code>... | 0 |
Spring Boot Microservice cant connect to Eureka Server | <p>I try to connect my service (auth-service) to the Eureka Server for the service registry. The Eureka server is running, but when I try to connect the auth-service nothing happens.</p>
<p>I added the configurations to application.yaml and application.properties, but nothing helped.</p>
<p>application.yaml from auth... | 0 |
Conflict in merging | <p>I have some troubles in my project angular. Who can help me ?</p>
<blockquote>
<p>ERROR in src/app/app-routing.module.ts(5,1): error TS1185: Merge conflict marker encountered.</p>
</blockquote> | 0 |
True + True = 2. Elegantly perform boolean arithmetic? | <p>I have nested lists of truth values representing SAT forumlas, like this:</p>
<pre><code>[[[0, True, False], [0, True, False], [0, True, 1]], [[0, True, True], [2, True, True], [3, False, True]], [[1, False, False], [1, False, False], [3, False, True]]]
</code></pre>
<p>representing</p>
<pre><code>([x0=0] + [x0=0... | 0 |
SVN Mergeinfo properties on paths other than the working copy root | <p>I have an SVN repository where I have trunk and a branch.</p>
<p>I intend to merge the trunk into the branch at regular intervals, however, when I do this I see many property status changes, in addition to actual file content changes.</p>
<p>On further investigation the property changes are mergeinfo properties. I... | 0 |
Update multiple values in a single statement | <p>I have a master / detail table and want to update some summary values in the master table against the detail table. I know I can update them like this:</p>
<pre><code>update MasterTbl set TotalX = (select sum(X) from DetailTbl where DetailTbl.MasterID = MasterTbl.ID)
update MasterTbl set TotalY = (select sum(Y) fr... | 0 |
SELECT * FROM in MySQLi | <p>My site is rather extensive, and I just recently made the switch to PHP5 (call me a late bloomer).</p>
<p>All of my MySQL query's before were built as such:</p>
<pre><code>"SELECT * FROM tablename WHERE field1 = 'value' && field2 = 'value2'";
</code></pre>
<p>This made it very easy, simple and friendly.</... | 0 |
Reverse a list without using built-in functions | <p>I'm using Python 3.5. </p>
<p>As part of a problem, I'm trying to design a function that takes a list as input and reverts it. So if <code>x = [a, b, c]</code> the function would make <code>x = [c, b, a]</code>.</p>
<p>The problem is, I'm not allowed to use any built-in functions, and it has got me stuck. My initi... | 0 |
How to insert a string inside another string using Go lang | <p>Most programming languages have a function that allows us to insert one string into another string. For example, I can take the string Green and the string HI, and perform an operation Green.insert(HI,2) to get the resulatant string GrHIeen. But such a function does not come with the standard GO lang library.</p>
<... | 0 |
What is the use of bag tag in Hibernate? | <p>I need to know how to use the bag tag and what is the purpose of it?</p> | 0 |
Namespace & Class Conflict | <p>I'm facing a problem with a conflict between the DateTime class and a namespace for some unknown reason was also called DateTime.</p>
<p>Assembly <strong>CompanyDateTime</strong> has namespace <strong>Company.DateTime</strong></p>
<p>My Application is in the namespace: <strong>Company</strong></p>
<p>the problem ... | 0 |
What's the difference between String(value) vs value.toString() | <p>Javascript has lot's of "tricks" around types and type conversions so I'm wondering if these 2 methods are the same or if there is some corner case that makes them different?</p> | 0 |
To open a popup window on clicking link button in grid view | <p>In the below code i have a grid view inside grid view i have a link button when i click the link button it should open a popup window .pls help me to do this.</p>
<pre><code><asp:TemplateField HeaderText="Edit" itemstyle-width="150px">
<ItemTemplate>
... | 0 |
Isotope not working with imagesLoaded? | <p>I'm using jQuery Isotope to create a horizontal layout, aligning DIVs with 100% height next to each other and center images inside each DIV vertically. So for, I'm calling Isotope like this and everything works fine in Chrome (locally):</p>
<pre><code>$(function(){
var $container = $('#container');
$contain... | 0 |
What is the longest regular expression you have seen | <p>I just found an extremely long regular expression (6000+ characters) for a WordPress email validation. That got me thinking, what is the longest one you have ever actually seen that is being used in a production environment.</p> | 0 |
R group by year | <p>I read a csv into R and now I have a list of data. </p>
<pre><code>head(data)
Date Open High Low Close Volume
1 31-Dec-14 223.09 225.68 222.25 222.41 2402097
2 30-Dec-14 223.99 225.65 221.40 222.23 2903242
3 29-Dec-14 226.90 227.91 224.02 225.71 2811828
4 26-Dec-14 221.51 228.50 221.50 227.82 33270... | 0 |
Aliases in .bash_profile not working properly | <p>I have been trying to alter the .bash_profile that is in my root directory, but have been running into some problems. I am on OS X, Yosemite, on a Macbook Pro. As I understand it, the .bash_profile file contains the script that is called automatically whenever the Terminal app is opened and the bash shell starts.
T... | 0 |
Copy a file to another directory, in which the file does not exist! PHP | <p>I'm trying to copy my file from one directory to another directory( destination in which the file does not exist)</p>
<p>As far as I understood copy function just works if you want to rename and the file already exists in the destination directory; what should I do if the file does not exist in the destination dire... | 0 |
write numpy array to CSV with row indices and header | <p>I have a numpy array.</p>
<pre><code>values = np.array([14, 21, 13, 56, 12])
</code></pre>
<p>I want to write <code>values</code> in one column of a CSV file, the row indices in another column, and a header. I found this function:</p>
<pre><code>numpy.savetxt("foo.csv", values, header="Id,Values", delimiter=",")
... | 0 |
django - import error: no module named views | <p>I've been racking my brains and can't figure out why there should be an import error when 'views' is imported. I get the following message when I visit my index page:</p>
<pre><code>"
Request Method: GET
Request URL: http://127.0.0.1:8000/moments/
Django Version: 1.6.1
Exception Type: ImportError
Exception Valu... | 0 |
Find Connected Components Networkx | <p>I need to find the connected nodes in the undirected and weighted graph. I did look up for some suggestions here but no one happens to answer that is related to my problem. These node pairs who also happen to connect with neighbors and every pair while connected spends some time in seconds connected.I am trying to f... | 0 |
Rails: redirect_to :controller=>'tips', :action => 'show', :id => @tip.permalink | <p>I tried to redirect rails to show action by passing controller, action, and params. However, rails ignores the name of action totally!</p>
<p>what I got is
<a href="http://mysite/controllername/paramId" rel="noreferrer">http://mysite/controllername/paramId</a></p>
<p>so i have error message....</p>
<p>here is t... | 0 |
Can open source code hosted at github be closed-source? | <p>Can the owner of an open source Github repository later decide to close it? What about other people's contribution to that project?</p>
<p><strong>Edit</strong> - several people focused only on the legal aspects. Besides them there exists the technical question: Is it technically possible to take a public repositor... | 0 |
UTL_FILE.FOPEN() procedure not accepting path for directory? | <p>I am trying to write in a file stored in c:\ drive named vin1.txt
and getting this error .Please suggest!</p>
<pre><code>> ERROR at line 1: ORA-29280: invalid
> directory path ORA-06512: at
> "SYS.UTL_FILE", line 18 ORA-06512: at
> "SYS.UTL_FILE", line 424 ORA-06512: at
> "SCOTT.SAL_STATUS", line 12 ... | 0 |
How to generate and add privacy policy on Google Play? | <p>I have to create and add a privacy policy to my Android app. My app accesses background geolocation data, so whatever policy I add has to include info about how location data is used. Two questions:</p>
<ol>
<li><p>Is there a standard approach to creating a privacy policy? For example, is there a template that peopl... | 0 |
Python Django Admin Clean() Method not overiding values | <p>Maybe I am missing something here, but according to the django docs, I should be able to overide values sent from an admin form from within the clean() method.
From django docs</p>
<pre><code>def clean(self):
from django.core.exceptions import ValidationError
# Don't allow draft entries to have a pub_date.
... | 0 |
Pandas - Replace values based on index | <p>If I create a dataframe like so:</p>
<pre><code>import pandas as pd, numpy as np
df = pd.DataFrame(np.random.randint(0,100,size=(100, 2)), columns=list('AB'))
</code></pre>
<p>How would I change the entry in column A to be the number 16 from row 0 -15, for example? In other words, how do I replace cells based purel... | 0 |
Remove validators from form control Angular 6 | <p>I have a form with a lot of form controls and Validators for some of the controls, like:</p>
<pre><code>title = new FormControl("", Validators.compose([
Validators.required
]));
description = new FormControl("", [
Validators.required,
Validators.minLength(1),
Validators.maxLength(2000)
]);
</code></... | 0 |
Could not find tools.jar. Please check that C:\Program Files\Java\jre1.8.0_151 contains a valid JDK installation | <p>Even though I manually configured JDK project structure <a href="https://i.stack.imgur.com/VxQ2W.jpg" rel="noreferrer">file/Project structure</a> it still shows this error
FAILURE: Build failed with an exception.</p>
<p>`What went wrong:
Execution failed for task ':sample:compileReleaseJavaWithJavac'.</p>
<blockq... | 0 |
Debugging on Moto 360 | <p>I am trying to get debugging over Bluetooth working on my Moto 360. I am following these <a href="https://developer.android.com/training/wearables/apps/bt-debugging.html" rel="noreferrer">instructions</a> but when I put in <code>adb forward tcp:4444 localabstract:/adb-hub; adb connect localhost:4444</code> all that ... | 0 |
Spring MVC Restful service response | <p>Any idea why I get a "HTTP/1.1 200 OK" when I set </p>
<pre><code>Response.status(Response.Status.NOT_FOUND)
</code></pre>
<p>I can see that this has been set correctly in the response body?</p>
<pre><code>curl -v http://my_host/api/v1/user/99999999
</code></pre>
<p><strong><em>HTTP/1.1 200 OK</em></strong></p>
... | 0 |
How to get the screen width and height in iOS? | <p>How can one get the dimensions of the screen in iOS?</p>
<p>Currently, I use:</p>
<pre><code>lCurrentWidth = self.view.frame.size.width;
lCurrentHeight = self.view.frame.size.height;
</code></pre>
<p>in <code>viewWillAppear:</code> and <code>willAnimateRotationToInterfaceOrientation:duration:</code></p>
<p>The f... | 0 |
What is the difference between Postgres DISTINCT vs DISTINCT ON? | <p>I have a Postgres table created with the following statement. This table is filled by as dump of data from another service.</p>
<pre><code>CREATE TABLE data_table (
date date DEFAULT NULL,
dimension1 varchar(64) DEFAULT NULL,
dimension2 varchar(128) DEFAULT NULL
) TABLESPACE pg_default;
</code></pre>
<... | 0 |
Python pandas groupby aggregate on multiple columns, then pivot | <p>In Python, I have a pandas DataFrame similar to the following:</p>
<pre><code>Item | shop1 | shop2 | shop3 | Category
------------------------------------
Shoes| 45 | 50 | 53 | Clothes
TV | 200 | 300 | 250 | Technology
Book | 20 | 17 | 21 | Books
phone| 300 | 350 | 400 | Technology
<... | 0 |
Django template: check for empty query set | <p>Is there a way to check for an empty query set in the Django template? In the example below, I only want the NOTES header to be displayed if there are notes. </p>
<p>If I put an {% empty %} inside the "for" then it does display whatever is inside the empty tag, so it knows it's empty.</p>
<p>I'm hoping for somethi... | 0 |
How to set linker flags for OpenMP in CMake's try_compile function | <p>I would like to verify that the current compiler can build with openmp support. The application has do deploy across a wide variety of unix systems, some of which might have old versions of OpenMP, and I would like to test for important OpenMP functionality. So, I want to build a test source file that incorporates... | 0 |
Node.js + Express: Routes vs controller | <p>New to Node.js and Express, I am trying to understand the two seems overlapping concepts, routes vs controller.</p>
<p>I have seen examples that simple does app.js + routes/*, this seems to be sufficient to route various requests needed. </p>
<p>However, I also see people talking about using controllers, and some ... | 0 |
Eclipse/Android: can't install Google APIs targets | <p>To use a MapView in my android application, I need to to run it in a "Google APIs (Google Inc.)" <a href="http://code.google.com/android/add-ons/google-apis/maps-overview.html#avdsetup" rel="nofollow">target</a>. However, I can't figure out how to download one. </p>
<p>In Eclipse, Android SDK and AVD Manager -> Thi... | 0 |
how to create a multi select box with out selected options codeigniter | <p>hi i am using <code>codeigniter</code> , i want to add a <code>multi select box</code> to my page , </p>
<p>i saw the codeigniter user guide example , but what it is doing is set the values in multi select . </p>
<p>like this </p>
<pre><code>$options = array(
'small' => 'Small Shirt',
... | 0 |
C/C++ sockets and a non-blocking recv() | <p>I'm having a problem where calling recv() system call does not block. I have a client-server structure setup at the moment, and the problem I am having is I send the server one message, while the server is set up so that it's something like:</p>
<pre><code>while (1) {
char buf[1024];
recv(fd, buf, sizeof(buf)... | 0 |
Advantages of node.js in comparison with other web technologies | <p>As I understand, <code>node.js</code> is useful for Java Script programmers, who can now develop in server-side. Besides, some Java Script code can be ported from client-side to server-side.</p>
<p>Are there any other advantages for <code>node.js</code> in comparison with other server-side technologies (Java web fr... | 0 |
System.DirectoryServices.DirectoryServicesCOMException: An operations error occurred | <p>I have the same web app working in three others servers. Anyone have any idea why is not working in the 4th server? See the error and stacktrace:</p>
<blockquote>
<p><em>An operations error occurred.</em></p>
<p><em>Description: An unhandled exception occurred during the execution of
the current web reques... | 0 |
how to fit image inside TD of HTML table | <p>I am displaying an image inside TD using:</p>
<p> </p>
<p>But image seems to be taking larger width than the width defined for the TD.</p>
<p>Please provide me some solution.</p> | 0 |
Fast pseudorandom number generator for cryptography in C | <p>I was using the following code to generate sequence of pseudo-random numbers that was used for cryptographic purposes, but then I read somewhere that it may not be very secure. Can someone give me C implementation of a better generator -- the main goal is for this method to be fast. For instance, I did some research... | 0 |
VB.net - insert/retrieve picture from mysql Database directly to/from a Picturebox | <p>I'm am having a heck of a time finding a code snippet that works for this. I have got to the point where it appears the picture is stored as a blob (perhaps incorrectly) by using this code.</p>
<pre class="lang-vb prettyprint-override"><code>Dim filename As String = txtName.Text + ".jpg"
Dim FileSize As UInt32
Dim ... | 0 |
Is Orchard or Umbraco MVC? | <p>I'm much happier with the quality of output I can get with MVC over webforms: hand crafted HTML that isn't full of additional machine generated gubbins (polite term). I realize of course that MVC is about a lot more than this, but concentrating on just that "view" part...</p>
<p>I'm looking at Orchard or Umbraco fo... | 0 |
How to create an empty dataFrame in Spark | <p>I have a set of Avro based hive tables and I need to read data from them. As Spark-SQL uses hive serdes to read the data from HDFS, it is much slower than reading HDFS directly. So I have used data bricks Spark-Avro jar to read the Avro files from underlying HDFS dir. </p>
<p>Everything works fine except when the t... | 0 |
What is the best way to determine if a date is today in JavaScript? | <p>I have a date object in JavaScript and I want to figure out if that date is today. What is the fastest way of doing this?</p>
<p>My concern was around comparing date object as one might have a different time than another but any time on today's date should return <code>true</code>.</p> | 0 |
Count 'white' pixels in opencv binary image (efficiently) | <p>I am trying to count all the white pixels in an OpenCV binary image. My current code is as follows:</p>
<pre><code> whitePixels = 0;
for (int i = 0; i < height; ++i)
for (int j = 0; j < width; ++j)
if (binary.at<int>(i, j) != 0)
++whitePixels;
</code></pre>
<p>However, after profil... | 0 |
PHP Insert into MySQL syntax error | <p>I'm having trouble submitting some data to MySQL via php, i get the following error:</p>
<p><strong>"Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''student' (UID, FirstName, LastName, DOB, EmergencyContact, Address, City... | 0 |
How do I vertically align an input in a DIV | <p>I'm creating a website, and I have a login-field that contains two inputs. I want to vertically align those items inside the DIV.</p>
<p>Here's my HTML:</p>
<pre><code><!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Instagram tweaks</title>
<... | 0 |
How to support "AddType x-mapp-php5 .php" on my development machine | <p>My ISP requires me to put the following in my .htaccess files:</p>
<pre><code>AddType x-mapp-php5 .php
</code></pre>
<p>But that breaks my development machine.</p>
<p>I don't really understand what that directive is for, but I'm sick of commenting it out for dev, and uncommenting it whenever I need to upload a ne... | 0 |
java.util.logging.Logger doesn't respect java.util.logging.Level? | <p>In plain Java SE 6 environment:</p>
<pre><code>Logger l = Logger.getLogger("nameless");
l.setLevel(Level.ALL);
l.fine("somemessage");
</code></pre>
<p>Nothing shows up in Eclipse console. <em>l.info("")</em> and above works just fine, but anything below <em>fine</em> just doesn't seem to work. What's could be wron... | 0 |
Pass a string by reference in Javascript | <p>I want to create a string and pass it by reference such that I can change a single variable and have that propagate to any other object that references it.</p>
<p>Take this example:</p>
<pre><code>function Report(a, b) {
this.ShowMe = function() { alert(a + " of " + b); }
}
var metric = new String("count");
v... | 0 |
Calculate text diffs in PHP | <p>Are there any libraries (3rd party or built-in) in <code>PHP</code> to calculate text diffs?</p> | 0 |
The element is obscured(Server did not provide stack information) automation in edge browser with selenium | <p>org.openqa.selenium.WebDriverException: Element is obscured (WARNING: The server did not provide any stacktrace information).
This code is working fine for chrome and firefox but not with edge browser.</p>
<pre><code> `public class Login {
public WebDriver driver;
By userName = By.id("ct... | 0 |
nginx configuration for Laravel 4 | <p>I am trying to setup my Laravel 4 project using nginx . Here is my nginx server block for laravel :</p>
<pre><code>server {
listen 80;
root /home/prism/www/laravel/public;
index index.php index.html index.htm;
server_name example.com;
location / {
try_files... | 0 |
How can I fake request.POST and GET params for unit testing in Flask? | <p>I would like to fake request parameters for unit testing. How can I achieve this in Flask?</p> | 0 |
"Command /usr/sbin/chown failed with exit code 1" when Archiving | <p>I am trying to archive my first iOS 4.3 Application for iPhone and I always encounter this error:</p>
<pre><code>Command /usr/sbin/chown failed with exit code 1
</code></pre>
<p>I have searched through various forums, trying solutions such as changing the Alternate Install Group (which I don't know what to change ... | 0 |
How do I remove elements at a set of indices in a vector in MATLAB? | <p>I have a vector with 100 elements. I have another vector with index positions of elements I want to remove from this vector.</p>
<p>How do I do this?</p> | 0 |
iPhone - testing if a notification exists | <p>At some point in a code one may add something like</p>
<pre><code>[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(doSomething) name:@"Hello" object:nil];
</code></pre>
<p>How do I test if this notification is already active on the queue or has been removed, to prevent adding a duplicat... | 0 |
Can't connect to MongoDB through PHP | <p>I just wanted to take a look at Mongo-DB. But i just don't get it running. I've installed it with PECL and my <code>phpinfo()</code> tells me that the extension is loaded, but when i try to get a connection with</p>
<p><code>$mongo = new Mongo();</code></p>
<p>I get this:</p>
<blockquote>
<p>Fatal error: Uncaug... | 0 |
Pipe Ipython magic output to a variable? | <p>I want to run a bash script in my ipython Notebook and save the output as a string in a python variable for further manipulation. Basically I want to pipe the output of the bash magic to a variable,
For example the output of something like this:</p>
<pre><code>%%bash
some_command [options] foo bar
</code></pre> | 0 |
std::array incomplete type error with an array of std::tuple | <p>I am getting some strange behaviour with a C++11 <code>std::array</code>. When I try to compile with <code>std::array<std::tuple<int, float>, 6> myTuples;</code> as a member variable, I get these errors:</p>
<p><code>mingw32\4.7.2\include\c++\array:-1: In instantiation of 'struct std::array<std::tupl... | 0 |
Start WSL Ubuntu in specific or current folder on Windows | <p>When installing Subsystem for Linux and Ubuntu from store on his development machine I can switch (or start) to Ubuntu shell by simply</p>
<p><a href="https://i.stack.imgur.com/RgSmf.png" rel="noreferrer"><img src="https://i.stack.imgur.com/RgSmf.png" alt="enter image description here"></a></p>
<p>But the Ubuntu s... | 0 |
i dont understand what is 0x7fffffff mean. is there any other way to code getHashValue method? | <pre><code>public int getHashValue(K key){
return (key.hashCode() & 0x7fffffff) % size;
}
</code></pre>
<p>i dont understand what is 0x7fffffff mean. is there any other way to code getHasValue method? </p> | 0 |
Twitter Bootstrap Modal data-dismiss | <p>I am trying to get modal data-dismiss action working to close the modal on click. There seems to be an issue that I cannot find documented and hopefully someone here can shed some light on it. Here is the code </p>
<pre><code><!DOCTYPE html>
<html>
<head>
<meta charset='UTF-8'/>
&l... | 0 |
Change Select List Option background colour on hover | <p>Is it possible to change the default background color of a select list option on hover?</p>
<p>HTML:</p>
<pre><code><select id="select">
<option value="1">One</option>
<option value="2">Two</option>
<option value="3">Three</option>
</select>
</code></pre>... | 0 |
How to reach bottom of listview, load more items | <p>When I reach the bottom of my ListView (Scroll down until the end), how do I load more items?
Here is my class (maybe it will help) </p>
<pre><code>public class ListFood extends Activity {
int userid;
String cat;
/** Called when the activity is first created. */
@Override
public void onCreate... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.