qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
18,673,860
I have got an array which I am looping through. Every time a condition is true, I want to append a copy of the `HTML` code below to a container element with some values. Where can I put this HTML to re-use in a smart way? ``` <a href="#" class="list-group-item"> <div class="image"> <img src="" /> </d...
2013/09/07
[ "https://Stackoverflow.com/questions/18673860", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1358522/" ]
Old question, but since the question asks "using jQuery", I thought I'd provide an option that lets you do this without introducing any vendor dependency. While there are a lot of templating engines out there, many of their features have fallen in to disfavour recently, with iteration (`<% for`), conditionals (`<% if`...
In order to solve this problem, I recognize two solutions: * The first one goes with AJAX, with which you'll have to load the template from another file and just add everytime you want with [`.clone()`](http://api.jquery.com/clone/). ``` $.get('url/to/template', function(data) { temp = data $('.search').keyup...
18,673,860
I have got an array which I am looping through. Every time a condition is true, I want to append a copy of the `HTML` code below to a container element with some values. Where can I put this HTML to re-use in a smart way? ``` <a href="#" class="list-group-item"> <div class="image"> <img src="" /> </d...
2013/09/07
[ "https://Stackoverflow.com/questions/18673860", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1358522/" ]
You could decide to make use of a templating engine in your project, such as: * [mustache](http://mustache.github.io/) * [underscore.js](http://underscorejs.org/) * [handlebars](http://handlebarsjs.com/) If you don't want to include another library, John Resig offers a [jQuery solution](http://ejohn.org/blog/javascri...
Here's how to use the `<template>` element and jQuery a little more efficiently, since the other jQuery answers as of the time of writing use `.html()` which forces the HTML to be serialized and re-parsed. First, the template to serve as an example: ```html <template id="example"><div class="item"> <h1 class="tit...
18,673,860
I have got an array which I am looping through. Every time a condition is true, I want to append a copy of the `HTML` code below to a container element with some values. Where can I put this HTML to re-use in a smart way? ``` <a href="#" class="list-group-item"> <div class="image"> <img src="" /> </d...
2013/09/07
[ "https://Stackoverflow.com/questions/18673860", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1358522/" ]
Add somewhere in body ``` <div class="hide"> <a href="#" class="list-group-item"> <table> <tr> <td><img src=""></td> <td><p class="list-group-item-text"></p></td> </tr> </table> </a> </div> ``` then create css ``` .hide { display: none; } ``` and add to your js ```...
In order to solve this problem, I recognize two solutions: * The first one goes with AJAX, with which you'll have to load the template from another file and just add everytime you want with [`.clone()`](http://api.jquery.com/clone/). ``` $.get('url/to/template', function(data) { temp = data $('.search').keyup...
18,673,860
I have got an array which I am looping through. Every time a condition is true, I want to append a copy of the `HTML` code below to a container element with some values. Where can I put this HTML to re-use in a smart way? ``` <a href="#" class="list-group-item"> <div class="image"> <img src="" /> </d...
2013/09/07
[ "https://Stackoverflow.com/questions/18673860", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1358522/" ]
In order to solve this problem, I recognize two solutions: * The first one goes with AJAX, with which you'll have to load the template from another file and just add everytime you want with [`.clone()`](http://api.jquery.com/clone/). ``` $.get('url/to/template', function(data) { temp = data $('.search').keyup...
Here's how to use the `<template>` element and jQuery a little more efficiently, since the other jQuery answers as of the time of writing use `.html()` which forces the HTML to be serialized and re-parsed. First, the template to serve as an example: ```html <template id="example"><div class="item"> <h1 class="tit...
18,673,860
I have got an array which I am looping through. Every time a condition is true, I want to append a copy of the `HTML` code below to a container element with some values. Where can I put this HTML to re-use in a smart way? ``` <a href="#" class="list-group-item"> <div class="image"> <img src="" /> </d...
2013/09/07
[ "https://Stackoverflow.com/questions/18673860", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1358522/" ]
You could decide to make use of a templating engine in your project, such as: * [mustache](http://mustache.github.io/) * [underscore.js](http://underscorejs.org/) * [handlebars](http://handlebarsjs.com/) If you don't want to include another library, John Resig offers a [jQuery solution](http://ejohn.org/blog/javascri...
Use HTML template instead! ========================== Since the accepted answer would represent overloading script method, I would like to suggest another which is, in my opinion, much cleaner and more secure due to XSS risks which come with overloading scripts. I made a [demo](https://codepen.io/DevWL/pen/YrjyWm?edi...
18,673,860
I have got an array which I am looping through. Every time a condition is true, I want to append a copy of the `HTML` code below to a container element with some values. Where can I put this HTML to re-use in a smart way? ``` <a href="#" class="list-group-item"> <div class="image"> <img src="" /> </d...
2013/09/07
[ "https://Stackoverflow.com/questions/18673860", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1358522/" ]
Other alternative: [Pure](http://beebole.com/pure/) I use it and it has helped me a lot. An example shown on their website: **HTML** ``` <div class="who"> </div> ``` **JSON** ``` { "who": "Hello Wrrrld" } ``` **Result** ``` <div class="who"> Hello Wrrrld </div> ```
Here's how to use the `<template>` element and jQuery a little more efficiently, since the other jQuery answers as of the time of writing use `.html()` which forces the HTML to be serialized and re-parsed. First, the template to serve as an example: ```html <template id="example"><div class="item"> <h1 class="tit...
62,892,222
I recently bought an ssl certificate and i am having a problem with google chrome when i access my website it says 'Your connection is not private NET::ERR\_CERT\_AUTHORITY\_INVALID' here is what i am doing: ``` const express = require("express"); const https = require('https'); const helmet = require("helmet"); const...
2020/07/14
[ "https://Stackoverflow.com/questions/62892222", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10457357/" ]
Appearently it took some days to have the certification marked as safe here is the code at the end: ``` const express = require("express"); const https = require('https'); const helmet = require("helmet"); const cors = require("cors"); const fs = require("fs"); const path = require("path"); const app = express(); cons...
You need to collect the site certificate and the intermediate certificates into a single buffer and pass that combined buffer as the `cert` option to `https.createServer()`. So replace this: ``` const credentials = { key: fs.readFileSync('ssl/key.pem'), cert: fs.readFileSync('ssl/crt.pem'), ca: fs.readFileSync('ssl/ce...
13,577,020
Is it bad practice to do this in a view (it's a helper method)? ``` <% get_articles %> ``` If so, where should it live? It seems logical to me to call them in their corresponding controller blocks, but I'm not sure if that's correct or how to do it. Thanks!
2012/11/27
[ "https://Stackoverflow.com/questions/13577020", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1153022/" ]
If the method lives in a helper, its designed to be called in the view. Really depends on what that method is doing if it should be there. Is it accessing the database? If so, it should be called from the controller and its results stored in a variable to be used by the view. (It also shouldn't be in a helper). If th...
No, helper methods are for views. so its not wrong if you call a helper method in your view. Take a look at this [post](http://techspry.com/ruby_and_rails/designing-helpers-in-ruby-on-rails)
9,722
Most fruit pies call for two crusts, whereas most custardy pies do not. However, my apple pies with one crust or two or substantially the same. Is the number of crusts simply traditional?
2010/12/02
[ "https://cooking.stackexchange.com/questions/9722", "https://cooking.stackexchange.com", "https://cooking.stackexchange.com/users/3633/" ]
Yes, it is mainly tradition, appearance, and how you like the ratio of crust to fruit in your pie. You can make any pie open faced, with a full top, or any type of lattice top. The other thing to consider is that a top crust provides some heat insulation to the fruit, so if you don't want the fruit to caramelize as muc...
I think it's traditional to some extent, but double crust pies have several advantages for fruit pies. For one, it keeps the fruit covered, so the fruit can simmer, much like cooking in a pot. Second, it keeps the bubbling fruit from seeping over the edges of the pie plate. Third, a top crust adds another surface to ke...
20,619,458
I need to be able to select 3 distinct picture URL's held in the database but also pull the other data in the row without it affecting the DISTINCT argument... EXAMPLE:: DataBase = ``` ID - PICTURE_URL 01 - domain.com/pic1.jpg 02 - domain.com/pic1.jpg 03 - domain.com/pic1.jpg 04 - domain.com/pic2.jpg 05 - domain.com...
2013/12/16
[ "https://Stackoverflow.com/questions/20619458", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3052268/" ]
You can use aggregate function: ``` select min(ID), PICTURE_URL from your_table group by PICTURE_URL ```
Query: **[SQLFIDDLEExample](http://sqlfiddle.com/#!2/d6e4b/4)** ``` SELECT t1.ID, t1.PICTURE_URL FROM Table1 t1 left join Table1 t2 on t1.PICTURE_URL = t2.PICTURE_URL AND t1.ID > t2.ID WHERE t2.ID is null ``` Result: ``` | ID | PICTURE_URL | |----|---------------------| | 1 | domain.com/pic1.jpg | ...
44,758
I'm a 50 yo man doing general core strengthening exercises with adjustable dumbbells at home. Generally each of the exercises I do at medium weight, 3 sets of 10 reps a few times a week. My dumbbell weight settings go up in 5 pound increments. This week I re-checked my maximum weight on all my exercises, increasing mo...
2022/01/14
[ "https://fitness.stackexchange.com/questions/44758", "https://fitness.stackexchange.com", "https://fitness.stackexchange.com/users/36787/" ]
In this scenario, I would look at approaching linear progression with a different metric, perhaps with reps instead of weight. The following is an example of implementing the "Double Progression Method". You're moving from 30 lb x 10 to 35 lb x 10 but that's too big of a jump, you can try 30 lb x 11. If you compare to...
When the weights don't come in small enough increments, one good option is to vary the reps. I particularly like this approach with weighted dips, but it works for all sorts of exercises, especially upper body pressing. A program aiming for "medium weight, 3 sets of 10 reps a few times a week" depends on sets of 10 an...
2,714,417
I'm running VS 2010 along with Expression Blend 4 beta. I created a MVVM Light project from the supplied templates and I get a System.IO.FileLoadException when I try to view the MainWindow.Xaml in VS 2010 designer window. The template already references System.Windows.Interactivity. Here are the details of the exceptio...
2010/04/26
[ "https://Stackoverflow.com/questions/2714417", "https://Stackoverflow.com", "https://Stackoverflow.com/users/148298/" ]
Yes, the issue is that the zip files need to be unblocked before you install. See <http://www.galasoft.ch/mvvm/installing/manually/#unblock> After you unblock the zip file, you can install on top of the existing DLLs, they will be overwritten with the correct version. Greetings, Laurent
If it still doesn't work and you have done what @LBugnion tells to do. Then it is propaly because you run the project from a network location. Try copy the project to a loval drive (could be your desktop). Now it shuold work :D
44,993,914
[![enter image description here](https://i.stack.imgur.com/4kVS3.png)](https://i.stack.imgur.com/4kVS3.png) I entered the Cells in Column A, B, C, D, AND I Want the result as entered in F, G, H, I, so what formula i should insert i the cells
2017/07/09
[ "https://Stackoverflow.com/questions/44993914", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8278328/" ]
F3 would be: ``` =IF(ISERROR(MATCH(ROW()-2,A:A,0)),"",ROW()-2) ``` And G3: ``` =IF(LEN(F3),INDEX(B:B,MATCH(F3,A:A,0)),"") ``` copy F3:G3 to H3:I3 and "auto fill" down as you need to [![enter image description here](https://i.stack.imgur.com/pi1uj.png)](https://i.stack.imgur.com/pi1uj.png)
If you want to use a macro instead, then just copy this code into a module in visual basic editor and run it. ``` Sub insertRows() Columns("G:J").EntireColumn.Delete Dim lrow As Long: lrow = Range("A" & Rows.Count).End(xlUp).Row Dim brng As Range: Set brng = Range("A1:D" & lrow) brng.Copy Range("G1"): Range("G1").Val...
44,993,914
[![enter image description here](https://i.stack.imgur.com/4kVS3.png)](https://i.stack.imgur.com/4kVS3.png) I entered the Cells in Column A, B, C, D, AND I Want the result as entered in F, G, H, I, so what formula i should insert i the cells
2017/07/09
[ "https://Stackoverflow.com/questions/44993914", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8278328/" ]
F3 would be: ``` =IF(ISERROR(MATCH(ROW()-2,A:A,0)),"",ROW()-2) ``` And G3: ``` =IF(LEN(F3),INDEX(B:B,MATCH(F3,A:A,0)),"") ``` copy F3:G3 to H3:I3 and "auto fill" down as you need to [![enter image description here](https://i.stack.imgur.com/pi1uj.png)](https://i.stack.imgur.com/pi1uj.png)
OMG, this one is difficult but these are the formulas you can try: From `cell F3`: ``` =IF(AND(N(F2)=0,F2<>""),1,IF(AND(NOT(COUNTIF($A$3:$A$22,MIN(INDEX($A$3:$A$22,MATCH(MAX(F$2:F2,H$2:H2),$A$3:$A$22,1)+1),INDEX($C$3:$C$22,MATCH(MAX(F$2:F2,H$2:H2),$C$3:$C$22,1)+1)))),INDEX($A$3:$A$22,MATCH(MAX(F$2:F2,H$2:H2),$A$3:$A$...
37,264,625
I have obtained an SSL cert from Lets Encrypt and added it to my SSL endpoint on Heroku, but I'm a bit nervous about simply removing Expedited SSL. Is it safe?
2016/05/16
[ "https://Stackoverflow.com/questions/37264625", "https://Stackoverflow.com", "https://Stackoverflow.com/users/813273/" ]
No problem with doing that and switching to a new certificate from differente Certificate Authority (CA) such as LetsEncrypt. I always remove the references to the old certificates. A practice I suggest is moving the old certificates to new ones by appending the .backup at the end Based on the [documentation](https://...
I removed my old Comodo SSL certificate and it worked fine. Make sure you've updated your DNS Target at your domain registrar to point to the SSL endpoint you got when you added the Let's Encrypt cert. (Usually `certified.domain.herokudns.com`)
66,063,248
Nothing will ne happened when I submit product in the the cart. I want to use AJAX without refreshing page. When I submit the console message will be displayed. I'm trying to use AJAX first. Trying to add product in the cart without refreshing page. I need help please :) ***Views Django*** ``` def add_cart(request, p...
2021/02/05
[ "https://Stackoverflow.com/questions/66063248", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11433326/" ]
First, I prefer using anonymous function, then you don't have to create a variable for "this" and can directly use "this" in the function. Can you try this code ? I think there's a problem because your two functions had the same name. ``` <script> import $ from 'jquery'; export default { name: "credi...
I believe the problem is the "this" in success function, maybe is not the vue instance. I would try change this arrow function to regular function or to create auxiliar variable. ``` onCreate: function () { var self = this; $.ajax({ url: '/Mout/GetBalance', type:...
45,909,542
How do I set the options for gulp-htmllint ? I want to exclude any rules pertaining to indent style and id or class style. However, its documentation shows the keys for those has having dashes, ex indent-style or id-class-style, but the dash breaks the code. I tried camelcasing or writing the keys as a string but that...
2017/08/27
[ "https://Stackoverflow.com/questions/45909542", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8351238/" ]
Here is an example of the contents of a .htmllintrc file: ``` { "attr-name-style": "dash", "attr-quote-style": "double", "id-class-style": "dash", "indent-style": "spaces", "indent-width": 2, "line-end-style": "lf", "attr-req-value": false, "html-req-lang": true, "title-max-length": 120, "img-req-s...
Never used gulp but just from reading the docs I can see you can define a `.htmllintrc` file and add the options there. ``` { "indent-style": false, "id-class-style": false } ```
476,620
I am running Outlook 2010 connected to an Exchange 2003 server. Often times, the spam that I received is sent to "undisclosed-recipients". I'm guessing that's because my email address (or an email address for a group I am part of) is in the BCC field. Is there a way to find out what BCC address was used to reach me? I...
2012/09/18
[ "https://superuser.com/questions/476620", "https://superuser.com", "https://superuser.com/users/143655/" ]
There is no such thing as a "BCC field"; BCC in email is performed by adding the recipient to the envelope but not the headers, which means that they are undetectable unless the email server is explicitly configured to reveal them somehow.
In the internet headers, you should see a line `Received by: xyz for <your email addr>`.
476,620
I am running Outlook 2010 connected to an Exchange 2003 server. Often times, the spam that I received is sent to "undisclosed-recipients". I'm guessing that's because my email address (or an email address for a group I am part of) is in the BCC field. Is there a way to find out what BCC address was used to reach me? I...
2012/09/18
[ "https://superuser.com/questions/476620", "https://superuser.com", "https://superuser.com/users/143655/" ]
There is no such thing as a "BCC field"; BCC in email is performed by adding the recipient to the envelope but not the headers, which means that they are undetectable unless the email server is explicitly configured to reveal them somehow.
Here is the simple test case I have created for the BCC field. 1. Create new email with BCC only. [![Screen Shot](https://i.stack.imgur.com/Tq3Kx.png)](https://i.stack.imgur.com/Tq3Kx.png) 2. Check the raw message at received end(Here I sent to Gmail). If you have a close look on the raw message in the screen shot ...
2,638,990
Let $X$ be a $n \times k$ matrix with $n > k$. If the columns of $X$ are orthonormal, then I want to show that the row norms are bounded by 1. My current solutions involves completing $X$ into an orthogonal matrix and then using the fact that $X^T X = X X^T = I$. I would like a more direct argument such as assuming tha...
2018/02/06
[ "https://math.stackexchange.com/questions/2638990", "https://math.stackexchange.com", "https://math.stackexchange.com/users/431468/" ]
This is just the Pythagorean theorem. Denote the column vectors by $f\_1, \dots, f\_k$ Let $e\_j$ be the usual unit vector with $1$ in the $j$-th position. Then $$ e\_j = \sum\_{l = 1}^k \langle e\_j, f\_l\rangle \ f\_l + u\_j, $$ where $u\_j$ is a vector perpendicular to the span of $f\_1, \dots, f\_k$. Hence $$ 1 = |...
The squared row norms of a matrix $X$ with orthonormal columns are also known as the leverage scores of $X$. See section 2.4 of [Sketching as a Tool for Numerical Linear Algebra](https://arxiv.org/abs/1411.4357) for another proof that each of these squared row norms is less than or equal to 1.
27,078,259
[I found this function](https://stackoverflow.com/a/9826656) which finds data between two strings of text, html or whatever. How can it be changed so it will find all occurrences? Every data between every occurrence of $start [some-random-data] $end. I want all the [some-random-data] of the document (It will always be...
2014/11/22
[ "https://Stackoverflow.com/questions/27078259", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3778578/" ]
I love to use explode to get string between two string. this function also works for multiple occurrences. ``` function GetIn($str,$start,$end){ $p1 = explode($start,$str); for($i=1;$i<count($p1);$i++){ $p2 = explode($end,$p1[$i]); $p[] = $p2[0]; } return $p; } ```
There was some great sollutions here, however not perfekt for extracting parts of code from say HTML which was my problem right now, as I need to get script blocks out of the HTML before compressing the HTML. So building on @raina77ow original sollution, expanded by @Cas Tuyn I get this one: ``` $test_strings = [ ...
27,078,259
[I found this function](https://stackoverflow.com/a/9826656) which finds data between two strings of text, html or whatever. How can it be changed so it will find all occurrences? Every data between every occurrence of $start [some-random-data] $end. I want all the [some-random-data] of the document (It will always be...
2014/11/22
[ "https://Stackoverflow.com/questions/27078259", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3778578/" ]
You can do this using regex: ``` function getStringsBetween($string, $start, $end) { $pattern = sprintf( '/%s(.*?)%s/', preg_quote($start), preg_quote($end) ); preg_match_all($pattern, $string, $matches); return $matches[1]; } ```
There was some great sollutions here, however not perfekt for extracting parts of code from say HTML which was my problem right now, as I need to get script blocks out of the HTML before compressing the HTML. So building on @raina77ow original sollution, expanded by @Cas Tuyn I get this one: ``` $test_strings = [ ...
27,078,259
[I found this function](https://stackoverflow.com/a/9826656) which finds data between two strings of text, html or whatever. How can it be changed so it will find all occurrences? Every data between every occurrence of $start [some-random-data] $end. I want all the [some-random-data] of the document (It will always be...
2014/11/22
[ "https://Stackoverflow.com/questions/27078259", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3778578/" ]
One possible approach: ``` function getContents($str, $startDelimiter, $endDelimiter) { $contents = array(); $startDelimiterLength = strlen($startDelimiter); $endDelimiterLength = strlen($endDelimiter); $startFrom = $contentStart = $contentEnd = 0; while (false !== ($contentStart = strpos($str, $startDelimit...
I needed to find all these occurences between specific first and last tag and change them somehow and get back changed string. So I added this small code to raina77ow approach after the function. ``` $sample = '<start>One<end> aaa <start>TwoTwo<end> Three <start>Four<end> aaaaa <start>Five<end>'; $sam...
27,078,259
[I found this function](https://stackoverflow.com/a/9826656) which finds data between two strings of text, html or whatever. How can it be changed so it will find all occurrences? Every data between every occurrence of $start [some-random-data] $end. I want all the [some-random-data] of the document (It will always be...
2014/11/22
[ "https://Stackoverflow.com/questions/27078259", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3778578/" ]
I love to use explode to get string between two string. this function also works for multiple occurrences. ``` function GetIn($str,$start,$end){ $p1 = explode($start,$str); for($i=1;$i<count($p1);$i++){ $p2 = explode($end,$p1[$i]); $p[] = $p2[0]; } return $p; } ```
I also needed the text outside the pattern. So I changed the answer from raina77ow above a little: ``` function get_delimited_strings($str, $startDelimiter, $endDelimiter) { $contents = array(); $startDelimiterLength = strlen($startDelimiter); $endDelimiterLength = strlen($endDelimiter); $startFrom = $...
27,078,259
[I found this function](https://stackoverflow.com/a/9826656) which finds data between two strings of text, html or whatever. How can it be changed so it will find all occurrences? Every data between every occurrence of $start [some-random-data] $end. I want all the [some-random-data] of the document (It will always be...
2014/11/22
[ "https://Stackoverflow.com/questions/27078259", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3778578/" ]
There was some great sollutions here, however not perfekt for extracting parts of code from say HTML which was my problem right now, as I need to get script blocks out of the HTML before compressing the HTML. So building on @raina77ow original sollution, expanded by @Cas Tuyn I get this one: ``` $test_strings = [ ...
I also needed the text outside the pattern. So I changed the answer from raina77ow above a little: ``` function get_delimited_strings($str, $startDelimiter, $endDelimiter) { $contents = array(); $startDelimiterLength = strlen($startDelimiter); $endDelimiterLength = strlen($endDelimiter); $startFrom = $...
27,078,259
[I found this function](https://stackoverflow.com/a/9826656) which finds data between two strings of text, html or whatever. How can it be changed so it will find all occurrences? Every data between every occurrence of $start [some-random-data] $end. I want all the [some-random-data] of the document (It will always be...
2014/11/22
[ "https://Stackoverflow.com/questions/27078259", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3778578/" ]
I needed to find all these occurences between specific first and last tag and change them somehow and get back changed string. So I added this small code to raina77ow approach after the function. ``` $sample = '<start>One<end> aaa <start>TwoTwo<end> Three <start>Four<end> aaaaa <start>Five<end>'; $sam...
There was some great sollutions here, however not perfekt for extracting parts of code from say HTML which was my problem right now, as I need to get script blocks out of the HTML before compressing the HTML. So building on @raina77ow original sollution, expanded by @Cas Tuyn I get this one: ``` $test_strings = [ ...
27,078,259
[I found this function](https://stackoverflow.com/a/9826656) which finds data between two strings of text, html or whatever. How can it be changed so it will find all occurrences? Every data between every occurrence of $start [some-random-data] $end. I want all the [some-random-data] of the document (It will always be...
2014/11/22
[ "https://Stackoverflow.com/questions/27078259", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3778578/" ]
One possible approach: ``` function getContents($str, $startDelimiter, $endDelimiter) { $contents = array(); $startDelimiterLength = strlen($startDelimiter); $endDelimiterLength = strlen($endDelimiter); $startFrom = $contentStart = $contentEnd = 0; while (false !== ($contentStart = strpos($str, $startDelimit...
I also needed the text outside the pattern. So I changed the answer from raina77ow above a little: ``` function get_delimited_strings($str, $startDelimiter, $endDelimiter) { $contents = array(); $startDelimiterLength = strlen($startDelimiter); $endDelimiterLength = strlen($endDelimiter); $startFrom = $...
27,078,259
[I found this function](https://stackoverflow.com/a/9826656) which finds data between two strings of text, html or whatever. How can it be changed so it will find all occurrences? Every data between every occurrence of $start [some-random-data] $end. I want all the [some-random-data] of the document (It will always be...
2014/11/22
[ "https://Stackoverflow.com/questions/27078259", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3778578/" ]
One possible approach: ``` function getContents($str, $startDelimiter, $endDelimiter) { $contents = array(); $startDelimiterLength = strlen($startDelimiter); $endDelimiterLength = strlen($endDelimiter); $startFrom = $contentStart = $contentEnd = 0; while (false !== ($contentStart = strpos($str, $startDelimit...
There was some great sollutions here, however not perfekt for extracting parts of code from say HTML which was my problem right now, as I need to get script blocks out of the HTML before compressing the HTML. So building on @raina77ow original sollution, expanded by @Cas Tuyn I get this one: ``` $test_strings = [ ...
27,078,259
[I found this function](https://stackoverflow.com/a/9826656) which finds data between two strings of text, html or whatever. How can it be changed so it will find all occurrences? Every data between every occurrence of $start [some-random-data] $end. I want all the [some-random-data] of the document (It will always be...
2014/11/22
[ "https://Stackoverflow.com/questions/27078259", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3778578/" ]
One possible approach: ``` function getContents($str, $startDelimiter, $endDelimiter) { $contents = array(); $startDelimiterLength = strlen($startDelimiter); $endDelimiterLength = strlen($endDelimiter); $startFrom = $contentStart = $contentEnd = 0; while (false !== ($contentStart = strpos($str, $startDelimit...
You can do this using regex: ``` function getStringsBetween($string, $start, $end) { $pattern = sprintf( '/%s(.*?)%s/', preg_quote($start), preg_quote($end) ); preg_match_all($pattern, $string, $matches); return $matches[1]; } ```
27,078,259
[I found this function](https://stackoverflow.com/a/9826656) which finds data between two strings of text, html or whatever. How can it be changed so it will find all occurrences? Every data between every occurrence of $start [some-random-data] $end. I want all the [some-random-data] of the document (It will always be...
2014/11/22
[ "https://Stackoverflow.com/questions/27078259", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3778578/" ]
You can do this using regex: ``` function getStringsBetween($string, $start, $end) { $pattern = sprintf( '/%s(.*?)%s/', preg_quote($start), preg_quote($end) ); preg_match_all($pattern, $string, $matches); return $matches[1]; } ```
I needed to find all these occurences between specific first and last tag and change them somehow and get back changed string. So I added this small code to raina77ow approach after the function. ``` $sample = '<start>One<end> aaa <start>TwoTwo<end> Three <start>Four<end> aaaaa <start>Five<end>'; $sam...
74,434,797
I want to validate that all `values` in a dictionary adhere to a schema while the `keys` can be whatever. Is there a better way to do this than just using a pattern that matches everything: ```json "foo": { "type": "object", "patternProperties": { "^.*$": { "$ref": "#/$defs/bar" } ...
2022/11/14
[ "https://Stackoverflow.com/questions/74434797", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16543731/" ]
Using `patternProperties` like you're doing is that best way, although you can simplify the regex to an empty string because regexes aren't implicitly anchored in JSON Schema. ```json { "type": "object", "patternProperties": { "": { "$ref": "#/$defs/bar" } } } ``` The other option is to use `additionalProp...
I would suggest to use the `additionalProperties` keyword where you can also set a schema. More details [here](https://json-schema.org/understanding-json-schema/reference/object.html#additional-properties) Using `patternProperties`, the validator needs to run a RegExp check for each property which takes time.
27,284,007
I have a file with lines like this: ``` r1 1 10 r2 10 1 #second bigger than third (10>1) r3 5 2 # "" "" (5>2) r4 10 20 ``` And I would like to reorder the lines with the second word bigger than the third, changing the [3] possition into [2] possition. Desired output: ``` r1 1 10 ...
2014/12/04
[ "https://Stackoverflow.com/questions/27284007", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4208026/" ]
The simplest modification to your existing code is this: ``` with open('test','r') as file, open('reorderedtest','w')as out: for line in file: splitLine = line.split("\t") reorderedlist = [splitLine[0], splitLine[2], splitLine[1] ] if int(splitLine[6]) > int(splitLine[7]): str = " " pri...
This will work for any number of columns, where you have `r#` in the first column, then any number of numeric columns following. ``` with open('test.txt') as fIn, open('out.txt', 'w') as fOut: for line in fIn: data = line.split() first = data[0] # r value values = sorted(map(int, data[1:...
17,767,341
Given a JS as follows: ```js for (c in chars) { for (i in data) { if (data[i].item === chars[c]) { // do my stuff; } else { /* do something else */} } } ``` and data such: ```js var chars = [ 'A', 'B', 'C', 'A', 'C' ]; var data = [ {'item':'A', 'rank': '1'}, {'it...
2013/07/20
[ "https://Stackoverflow.com/questions/17767341", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1974961/" ]
You could do this: ``` for (i = 0; i < data.length; i++) { if (chars.indexOf(data[i].item) != -1) { // Do something } else { // Do something else } } ``` However, if `chars` is large, I would create an object whose keys are the elements of `chars` and use `if (chars_obj[data[i].item])`. T...
Since you tagged your question jquery, you could use a jquery solution: ```js $.each(chars, function (cndx, chr) { $.each(data, function (dndx, datum) { if (datum.item === chr) { // do my stuff; } else { /* do something else */ } } }); ``` Not any more succinct...
17,767,341
Given a JS as follows: ```js for (c in chars) { for (i in data) { if (data[i].item === chars[c]) { // do my stuff; } else { /* do something else */} } } ``` and data such: ```js var chars = [ 'A', 'B', 'C', 'A', 'C' ]; var data = [ {'item':'A', 'rank': '1'}, {'it...
2013/07/20
[ "https://Stackoverflow.com/questions/17767341", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1974961/" ]
An alternative to simplifying the code would be to encapsulate and abstract it away into a utility that accepts callbacks, than reuse that whenever needed, like so: ```js // definition function eachChar(onMatch, onMismatch) { for (c in chars) { for (i in data) { if (data[i].item === chars[c]) {...
Since you tagged your question jquery, you could use a jquery solution: ```js $.each(chars, function (cndx, chr) { $.each(data, function (dndx, datum) { if (datum.item === chr) { // do my stuff; } else { /* do something else */ } } }); ``` Not any more succinct...
6,687,806
I've tried to use Eclipse on Linux but was not able to get it to work after about 4 hours of trying and regressed to just inserting echo comments everywhere like I had been doing. Now when I debug my Javascript in IE, I just hit F12 and a few more keys and I'm stepping through the Javascript. I'm back on Windows so I...
2011/07/14
[ "https://Stackoverflow.com/questions/6687806", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Sounds like you are looking for something like **[FirePHP](http://www.firephp.org/)** or **[ChromePHP](http://www.chromephp.com/)**. Those are Firefox and Chrome extensions which allow you to display anything that your PHP script output during runtime in either **[Firebug](http://getfirebug.com/)** (needs to be install...
FirePHP is a good dubugger for PHP scripts.
6,687,806
I've tried to use Eclipse on Linux but was not able to get it to work after about 4 hours of trying and regressed to just inserting echo comments everywhere like I had been doing. Now when I debug my Javascript in IE, I just hit F12 and a few more keys and I'm stepping through the Javascript. I'm back on Windows so I...
2011/07/14
[ "https://Stackoverflow.com/questions/6687806", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
FirePHP is a good dubugger for PHP scripts.
Netbeans for php, Chrome netbeans extension and configure Netbeans to use internal php web server. It runs out of the box.
6,687,806
I've tried to use Eclipse on Linux but was not able to get it to work after about 4 hours of trying and regressed to just inserting echo comments everywhere like I had been doing. Now when I debug my Javascript in IE, I just hit F12 and a few more keys and I'm stepping through the Javascript. I'm back on Windows so I...
2011/07/14
[ "https://Stackoverflow.com/questions/6687806", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Sounds like you are looking for something like **[FirePHP](http://www.firephp.org/)** or **[ChromePHP](http://www.chromephp.com/)**. Those are Firefox and Chrome extensions which allow you to display anything that your PHP script output during runtime in either **[Firebug](http://getfirebug.com/)** (needs to be install...
Netbeans for php, Chrome netbeans extension and configure Netbeans to use internal php web server. It runs out of the box.
69,321,976
I can't seem to figure out why the first console.log is displaying the parameter correctly but the second shows undefined. Console Log Output: ``` text undefined ``` Code: ``` ngOnInit() { this.getPuzzle(); } getPuzzle() { this.restProviderService.getPuzzle(this.gameService.getGameId()).subscribe(puzzle =>...
2021/09/24
[ "https://Stackoverflow.com/questions/69321976", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2570937/" ]
When you pass the function `this.handlePuzzle` to `setTimeout` the `this` representing your class is lost, and `handlePuzzle` receives the `setTimeout`'s `this` instead. Use an arrow function instead of passing the function itself: ```js setTimeout(() => this.handlePuzzle(), 3000); ```
Inside JS event listeners `this` refers to the event target. But inside the `handlePuzzle` method (sort of an event listener), you need `this` to refer to the current object instance (as usual in a method). You have 2 solutions: * Use an arrow callback. Arrow callbacks preserve the value of `this`. `setTimeout(()=>t...
375,360
I'm trying to associate a previously created style with a layer, according to <https://docs.geoserver.org/latest/en/api/#1.0.0/styles.yaml>, through a NodeJS code. POSTing to: > > http://...:8080/geoserver/rest/layers/camada\_de\_estacoes\_3/styles?default=true > > > Body: ``` { name: "camada_de_estacoes_3", fi...
2020/09/29
[ "https://gis.stackexchange.com/questions/375360", "https://gis.stackexchange.com", "https://gis.stackexchange.com/users/50144/" ]
Seems my `body` was missing a "root property" called `style`. The glue came from switching from "Example Value" to "Model" in the API documentation about this specific endpoint. So, `body` is now: ``` { style: { name: "camada_de_estacoes_3" } } ```
I encountered the same issue in version 2.19 of GeoServer. I logged it as a bug on the GeoServer Jira board. <https://osgeo-org.atlassian.net/browse/GEOS-10771>
4,719,386
I have a Java application that downloads information (Entities) from our server. I use a Download thread to download the data. The flow of the download process is as follows: 1. Log in - The user entity is downloaded 2. Based on the User Entity, download a 'Community' entities List and Display in drop down 3. Based o...
2011/01/18
[ "https://Stackoverflow.com/questions/4719386", "https://Stackoverflow.com", "https://Stackoverflow.com/users/119179/" ]
You might want to look into using the `Future` interface. Stop by <http://download.oracle.com/javase/6/docs/api/java/util/concurrent/package-summary.html> It has all you might need to make these tasks easier.
You have to create a "model" for your view, representing the current state of your application. For a tree e.g. it is reasonable to show a "Loading"-node when someone openes a treenode, because else the GUI hangs on opening a node. If the loading thread finishes loading the node, the "Loading"-node is replaced with th...
4,719,386
I have a Java application that downloads information (Entities) from our server. I use a Download thread to download the data. The flow of the download process is as follows: 1. Log in - The user entity is downloaded 2. Based on the User Entity, download a 'Community' entities List and Display in drop down 3. Based o...
2011/01/18
[ "https://Stackoverflow.com/questions/4719386", "https://Stackoverflow.com", "https://Stackoverflow.com/users/119179/" ]
I think the most common method to do this in recent versions of Java is to use SwingWorker: <http://download.oracle.com/javase/6/docs/api/javax/swing/SwingWorker.html> It allows you to fire off background tasks and gives you a convenient done() method that executes on the Swing EDT.
You have to create a "model" for your view, representing the current state of your application. For a tree e.g. it is reasonable to show a "Loading"-node when someone openes a treenode, because else the GUI hangs on opening a node. If the loading thread finishes loading the node, the "Loading"-node is replaced with th...
1,095,980
My new laptop's preinstalled Windows 10 was activated as soon as it was connected to the internet. But no product keys were shown to me. There is no product key label on the laptop. Somewhere I read for newer laptops the product key is embedded in Bios. How can I be sure that if I reinstall the Windows using Media Crea...
2016/07/01
[ "https://superuser.com/questions/1095980", "https://superuser.com", "https://superuser.com/users/426021/" ]
Microsoft has made it simple to activate Windows 10. On new machines the product key is stored in BIOs and is used automatically by the Windows when connected to the Internet. In Windows 10 hardware activation is used. Your Windows 10 will be automatically activated until you don't make changes to the hardware. If ...
Yes Windows 10 key is stored in the BIOS, in the event you need a restore, as long as you use the same version so either Pro or Home, it will activate automatically. You can prove this to your self, by downloading any product key finder on google and the last 5 digits will be displayed for you. Also the code is norma...
1,095,980
My new laptop's preinstalled Windows 10 was activated as soon as it was connected to the internet. But no product keys were shown to me. There is no product key label on the laptop. Somewhere I read for newer laptops the product key is embedded in Bios. How can I be sure that if I reinstall the Windows using Media Crea...
2016/07/01
[ "https://superuser.com/questions/1095980", "https://superuser.com", "https://superuser.com/users/426021/" ]
Get into command prompt by searching for it or doing the Windows key and R button and typing `cmd` (it should pop up). Then type this command in exactly as is: ``` wmic path softwarelicensingservice get OA3xOriginalProductKey ``` And your product key should pop up right after. voila
Yes Windows 10 key is stored in the BIOS, in the event you need a restore, as long as you use the same version so either Pro or Home, it will activate automatically. You can prove this to your self, by downloading any product key finder on google and the last 5 digits will be displayed for you. Also the code is norma...
1,095,980
My new laptop's preinstalled Windows 10 was activated as soon as it was connected to the internet. But no product keys were shown to me. There is no product key label on the laptop. Somewhere I read for newer laptops the product key is embedded in Bios. How can I be sure that if I reinstall the Windows using Media Crea...
2016/07/01
[ "https://superuser.com/questions/1095980", "https://superuser.com", "https://superuser.com/users/426021/" ]
``` sudo strings /sys/firmware/acpi/tables/MSDM | tail -1 ``` Use this to view your product key from a live Ubuntu distro on pendrive
Yes Windows 10 key is stored in the BIOS, in the event you need a restore, as long as you use the same version so either Pro or Home, it will activate automatically. You can prove this to your self, by downloading any product key finder on google and the last 5 digits will be displayed for you. Also the code is norma...
1,095,980
My new laptop's preinstalled Windows 10 was activated as soon as it was connected to the internet. But no product keys were shown to me. There is no product key label on the laptop. Somewhere I read for newer laptops the product key is embedded in Bios. How can I be sure that if I reinstall the Windows using Media Crea...
2016/07/01
[ "https://superuser.com/questions/1095980", "https://superuser.com", "https://superuser.com/users/426021/" ]
Microsoft has made it simple to activate Windows 10. On new machines the product key is stored in BIOs and is used automatically by the Windows when connected to the Internet. In Windows 10 hardware activation is used. Your Windows 10 will be automatically activated until you don't make changes to the hardware. If ...
Download & install Magical Jelly Bean Key Finder from here: <https://www.magicaljellybean.com/downloads/KeyFinderInstaller.exe> This app reads the product keys of Windows & many other apps (Photoshop, MS Office, IDM, etc.) from the registry & shows it to you. You can easily find out the product key of your installed w...
1,095,980
My new laptop's preinstalled Windows 10 was activated as soon as it was connected to the internet. But no product keys were shown to me. There is no product key label on the laptop. Somewhere I read for newer laptops the product key is embedded in Bios. How can I be sure that if I reinstall the Windows using Media Crea...
2016/07/01
[ "https://superuser.com/questions/1095980", "https://superuser.com", "https://superuser.com/users/426021/" ]
Get into command prompt by searching for it or doing the Windows key and R button and typing `cmd` (it should pop up). Then type this command in exactly as is: ``` wmic path softwarelicensingservice get OA3xOriginalProductKey ``` And your product key should pop up right after. voila
Microsoft has made it simple to activate Windows 10. On new machines the product key is stored in BIOs and is used automatically by the Windows when connected to the Internet. In Windows 10 hardware activation is used. Your Windows 10 will be automatically activated until you don't make changes to the hardware. If ...
1,095,980
My new laptop's preinstalled Windows 10 was activated as soon as it was connected to the internet. But no product keys were shown to me. There is no product key label on the laptop. Somewhere I read for newer laptops the product key is embedded in Bios. How can I be sure that if I reinstall the Windows using Media Crea...
2016/07/01
[ "https://superuser.com/questions/1095980", "https://superuser.com", "https://superuser.com/users/426021/" ]
``` sudo strings /sys/firmware/acpi/tables/MSDM | tail -1 ``` Use this to view your product key from a live Ubuntu distro on pendrive
Microsoft has made it simple to activate Windows 10. On new machines the product key is stored in BIOs and is used automatically by the Windows when connected to the Internet. In Windows 10 hardware activation is used. Your Windows 10 will be automatically activated until you don't make changes to the hardware. If ...
1,095,980
My new laptop's preinstalled Windows 10 was activated as soon as it was connected to the internet. But no product keys were shown to me. There is no product key label on the laptop. Somewhere I read for newer laptops the product key is embedded in Bios. How can I be sure that if I reinstall the Windows using Media Crea...
2016/07/01
[ "https://superuser.com/questions/1095980", "https://superuser.com", "https://superuser.com/users/426021/" ]
Get into command prompt by searching for it or doing the Windows key and R button and typing `cmd` (it should pop up). Then type this command in exactly as is: ``` wmic path softwarelicensingservice get OA3xOriginalProductKey ``` And your product key should pop up right after. voila
Download & install Magical Jelly Bean Key Finder from here: <https://www.magicaljellybean.com/downloads/KeyFinderInstaller.exe> This app reads the product keys of Windows & many other apps (Photoshop, MS Office, IDM, etc.) from the registry & shows it to you. You can easily find out the product key of your installed w...
1,095,980
My new laptop's preinstalled Windows 10 was activated as soon as it was connected to the internet. But no product keys were shown to me. There is no product key label on the laptop. Somewhere I read for newer laptops the product key is embedded in Bios. How can I be sure that if I reinstall the Windows using Media Crea...
2016/07/01
[ "https://superuser.com/questions/1095980", "https://superuser.com", "https://superuser.com/users/426021/" ]
``` sudo strings /sys/firmware/acpi/tables/MSDM | tail -1 ``` Use this to view your product key from a live Ubuntu distro on pendrive
Download & install Magical Jelly Bean Key Finder from here: <https://www.magicaljellybean.com/downloads/KeyFinderInstaller.exe> This app reads the product keys of Windows & many other apps (Photoshop, MS Office, IDM, etc.) from the registry & shows it to you. You can easily find out the product key of your installed w...
11,532,726
sorry for the poorly titled post. Say I have the following table: ``` C1 | C2 | c3 1 | foo | x 2 | bar | y 2 | blaz | z 3 | something| y 3 | hello | z 3 | doctor | x 4 | name | y 5 | continue | x 5 | yesterday| z 6 | tomorrow | y ``` I'm trying to come up w/ a sql statement wh...
2012/07/18
[ "https://Stackoverflow.com/questions/11532726", "https://Stackoverflow.com", "https://Stackoverflow.com/users/145129/" ]
Rather than iterating through the $object array, since this is a hash, a simple check if the key/value exists/matches should work, i.e.: ``` if (array_key_exists($obj_key, $object)) { if ($object[$obj_key] == $obj_val) { $count++ } } ```
``` if (in_array($obj_key, array_keys($objects, $obj_val)) $count++; ```
6,909,307
My query is similar to this [global.html is unable to load NPAPI plugin from safari-extension builder but its loading from the direct link](https://stackoverflow.com/questions/4519143/global-html-is-unable-to-load-npapi-plugin-from-safari-extension-builder-but-its). How can I load a NPAPI Plugin from a Safari extensio...
2011/08/02
[ "https://Stackoverflow.com/questions/6909307", "https://Stackoverflow.com", "https://Stackoverflow.com/users/384134/" ]
The simple answer is that you can't. Unlike firefox and chrome extensions, Safari extensions don't allow you to embed npapi plugins in them.
You can create toolbar in Safari extension Load npapi to the toolbar On start extension make it invisible Get toolbar object Get plugin object from toolbar object ``` try { var toolbarWindow = safari.extension.bars[0].contentWindow; safari.extension.bars[0].hide(); var doc = toolbarWindow.docum...
57,669,336
I want to change voice in pyttsx3 module to british male voice, which i do have installed since i can see it in language/speech options and in regedit (Microsoft George), and i do have other voices installed, but when i run this code i dont see all voices that are on my PC, one of those voices is british male. Out of ...
2019/08/27
[ "https://Stackoverflow.com/questions/57669336", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11982237/" ]
Well it is possible. However you will have to do some changes in registry so proceed below at your own risk. It would be a good practice to backup your registry files or even your system. **STEP 1 Open registry editor:** Press: `Windows Key + R` and run regedit as administrator. **STEP 2 Check for all the available ...
The Microsoft downloadable voices seem to be limited. If you go to their regedit path you'll see that the extra downloadable voices like Microsoft George from the GB package are saved onto a different path than the one that is accepted by pyttsx3. On top of this, on further examination, when navigating to the path of ...
57,669,336
I want to change voice in pyttsx3 module to british male voice, which i do have installed since i can see it in language/speech options and in regedit (Microsoft George), and i do have other voices installed, but when i run this code i dont see all voices that are on my PC, one of those voices is british male. Out of ...
2019/08/27
[ "https://Stackoverflow.com/questions/57669336", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11982237/" ]
Well it is possible. However you will have to do some changes in registry so proceed below at your own risk. It would be a good practice to backup your registry files or even your system. **STEP 1 Open registry editor:** Press: `Windows Key + R` and run regedit as administrator. **STEP 2 Check for all the available ...
If you downloaded the language you want to use, it is possible. Use this way: Your downloaded languages goes this path in registry: `Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech_OneCore\Voices\Tokens` Right click to `Tokens` node then export these languages from this path, save as `lang.reg` file. Then open...
157,428
``` USE GlobalSales; GO EXEC sp_helpmergepublication GlobalSales EXEC sp_helppublication GlobalSales EXEC sp_helppublication_snapshot GlobalSales GO -- Execute this batch at the Publisher. DECLARE @publication AS sysname; DECLARE @subscriptionDB AS sysname; DECLARE @subscriber AS sysname; SET @publication = N'Mitjab-...
2010/07/04
[ "https://serverfault.com/questions/157428", "https://serverfault.com", "https://serverfault.com/users/47486/" ]
You can't do replication (as publisher) with the Express Edition
So then enable publication, or run this on the database which is enabled for publication. Take a look in the replication options to configure publication and distribution.
10,728
Do I need a press to make wine from grapes? Are there cheap alternatives? If I need a press is there a cheap way I can make one?
2013/10/10
[ "https://homebrew.stackexchange.com/questions/10728", "https://homebrew.stackexchange.com", "https://homebrew.stackexchange.com/users/3538/" ]
I've made small quantities without a press, but it's very labor intensive. For a 1 gallon batch, it's reasonable but much larger than that you're going to want some automation. The manual process: 1. De-stem the grapes 2. Crush the grapes 3. Red wine? Ferment on the skin. White wine? Skip to 4. 4. Put the crushed grap...
I did it all by hand and it didn't take long. I crushed them by hand, a bunch at a time and let the juice run into a muslin bag inside a clean vessel, I let what pulp and skin came off fall into the straining bag. I discarded the rest, stems and all into a waste bucket once the juice stopped flowing. Repeat until bucke...
10,728
Do I need a press to make wine from grapes? Are there cheap alternatives? If I need a press is there a cheap way I can make one?
2013/10/10
[ "https://homebrew.stackexchange.com/questions/10728", "https://homebrew.stackexchange.com", "https://homebrew.stackexchange.com/users/3538/" ]
I've made small quantities without a press, but it's very labor intensive. For a 1 gallon batch, it's reasonable but much larger than that you're going to want some automation. The manual process: 1. De-stem the grapes 2. Crush the grapes 3. Red wine? Ferment on the skin. White wine? Skip to 4. 4. Put the crushed grap...
For small quantities, a quick blast in a food processor will suffice. For larger quantities, get two, close fitting, ***food grade*** plastic buckets, fit one with a tap at the bottom and fill it with grapes. Put the second bucket on top and fill it with water. It's not perfect and you won't get as much juice as from a...
9,571,638
I have a script already for uploading pictures, but I want the ability to select more pictures at once on upload,by holding down ctrl,I know I can use uploadify but I don't want to start over, mabe you guys know a script or something for jquery, that will work without to remove the current code, or you guys could give ...
2012/03/05
[ "https://Stackoverflow.com/questions/9571638", "https://Stackoverflow.com", "https://Stackoverflow.com/users/58839/" ]
The ability to slect multiple files in entirely the browsers features. Which cannot be changed by using a `Javascript` or `css` or `html`. Using uploadify or similar as you mentioned in your question is the right way to go. You know `uploadify` also uses the `swfobject.js`, to overcome this limitation by using an `act...
You could write your own upload system in javascript with ajax. See <http://www.html5rocks.com/en/tutorials/file/dndfiles/> Basic workflow * get local file contents * push to server via ajax With this you could do a multi-file select and/or drag and drop upload system. Best and maybe only solution if you want to sta...
118,181
I am confused with the way uniform integrability is defined in the context of random variables. Keeping with the analysis idea, I had expected this definition: If $X$ is a random variable, given $\epsilon \ge 0$ and $A \subseteq \Omega$, there must be a $\delta$ such that $\int\_{A} d\mu \le \delta$ and $\int\_{A} X(\...
2012/03/09
[ "https://math.stackexchange.com/questions/118181", "https://math.stackexchange.com", "https://math.stackexchange.com/users/24451/" ]
Three conditions are involved: > > (C) For every $\varepsilon\gt0$, there exists a finite $c$ such that, for every $X$ in $\mathcal H$, $\mathrm E(|X|:|X|\geqslant c)\leqslant\varepsilon$. > > > (C1) There exists a finite $C$ such that, for every $X$ in $\mathcal H$, $\mathrm E(|X|)\leqslant C$. > > > (C2) For ev...
There is an equivalent definition of uniform integrability which goes: Let $(\Omega,\mathcal{F},P)$ be a probability space. A set $\mathcal{H}$ of random variables is uniformly integrable if and only if $$ \sup\_{X\in \mathcal{H}}\int\_\Omega |X| dP < \infty $$ and $$ \forall \epsilon >0\, \exists \delta >0\;\foral...
823,706
I'm trying to compile the [SQLite amalgamation](http://www.sqlite.org/amalgamation.html) source into my iPhone app (to give me access to the full-text searching functionality that isn't available in the iPhone-compiled version of the binary. When I add sqlite3.c and sqlite3.h to a normal Carbon C app template, it com...
2009/05/05
[ "https://Stackoverflow.com/questions/823706", "https://Stackoverflow.com", "https://Stackoverflow.com/users/337184/" ]
Try it with this steps: 1. xcode menu -> project -> new target -> static library -> target name: SQLite 2. drop SQLite amalgamation source into the project, now you can select the target, choose SQLite 3. xcode menu -> project -> edit active target -> tab General -> Direct Dependencies -> add SQLite 4. tab General -> ...
That type of error usually means a missing framework. 1. Right- or control-click on your Project's *Frameworks* folder. 2. Select *Add > Existing Framework...* 3. Go to: *Macintosh HD > Developer > Platforms > iPhoneOS.platform > Developer > SDKs > iPhoneOS2.2sdk > usr > lib* and select *libsqlite3.dylib* 4. Rebuild y...
823,706
I'm trying to compile the [SQLite amalgamation](http://www.sqlite.org/amalgamation.html) source into my iPhone app (to give me access to the full-text searching functionality that isn't available in the iPhone-compiled version of the binary. When I add sqlite3.c and sqlite3.h to a normal Carbon C app template, it com...
2009/05/05
[ "https://Stackoverflow.com/questions/823706", "https://Stackoverflow.com", "https://Stackoverflow.com/users/337184/" ]
I've managed to do this using the amalgamation and dumped it straight into my project without having to do the linking catlan suggested (I'm not saying it's a bad idea, merely it's possible to do in the main project). I didn't need to edit anything (except for adding the necessary FTS define for the text searching) an...
That type of error usually means a missing framework. 1. Right- or control-click on your Project's *Frameworks* folder. 2. Select *Add > Existing Framework...* 3. Go to: *Macintosh HD > Developer > Platforms > iPhoneOS.platform > Developer > SDKs > iPhoneOS2.2sdk > usr > lib* and select *libsqlite3.dylib* 4. Rebuild y...
823,706
I'm trying to compile the [SQLite amalgamation](http://www.sqlite.org/amalgamation.html) source into my iPhone app (to give me access to the full-text searching functionality that isn't available in the iPhone-compiled version of the binary. When I add sqlite3.c and sqlite3.h to a normal Carbon C app template, it com...
2009/05/05
[ "https://Stackoverflow.com/questions/823706", "https://Stackoverflow.com", "https://Stackoverflow.com/users/337184/" ]
Try it with this steps: 1. xcode menu -> project -> new target -> static library -> target name: SQLite 2. drop SQLite amalgamation source into the project, now you can select the target, choose SQLite 3. xcode menu -> project -> edit active target -> tab General -> Direct Dependencies -> add SQLite 4. tab General -> ...
I've managed to do this using the amalgamation and dumped it straight into my project without having to do the linking catlan suggested (I'm not saying it's a bad idea, merely it's possible to do in the main project). I didn't need to edit anything (except for adding the necessary FTS define for the text searching) an...
8,677,053
I have set up a MySQL database for location tracking on several devices. Currently, I plan to have each device having their own table in which to store their locations at various times. I was thinking that in a device's table, there would be a timestamp table which would hold latitude, longitude, and other identifying ...
2011/12/30
[ "https://Stackoverflow.com/questions/8677053", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1122510/" ]
From what I can see, your database schema should look more or less like this: ``` create table devices ( id int not null auto_increment primary key, name ..., ... ) engine=INNODB; create table device_locations ( id int not null auto_increment primary key, device_id not null, lat ..., lng ....
Try NoSQL databases that doesn't restrict schemas. MongoDB comes in mind when you want to structure nested collection.
8,677,053
I have set up a MySQL database for location tracking on several devices. Currently, I plan to have each device having their own table in which to store their locations at various times. I was thinking that in a device's table, there would be a timestamp table which would hold latitude, longitude, and other identifying ...
2011/12/30
[ "https://Stackoverflow.com/questions/8677053", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1122510/" ]
From what I can see, your database schema should look more or less like this: ``` create table devices ( id int not null auto_increment primary key, name ..., ... ) engine=INNODB; create table device_locations ( id int not null auto_increment primary key, device_id not null, lat ..., lng ....
With according to Flickr experience with MySQL, it can be used as schema-less as well, just start keep serialized data in a column if you know what you want. MySQL is primarily production-ready solution with ready-to-use tools to backup, recover, replication and sharding tool which is ideal to maintenance. If you don'...
45,263,811
I have an input button with a centered text. Text length is changing dynamically with a js (dots animation), that causes text moving inside the button. Strict aligning with padding doesn't suit because the text in the button will be used in different languages and will have different lenghts. Need some versatile soluti...
2017/07/23
[ "https://Stackoverflow.com/questions/45263811", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6467195/" ]
I'm not aware that `zsh` has a built-in function of this sort, but it should be pretty easy to script without resorting to a single subshell or slow pipe: ```bash #!/bin/zsh paths=(${(s:/:)PWD}) cur_path='/' cur_short_path='/' for directory in ${paths[@]} do cur_dir='' for (( i=0; i<${#directory}; i++ )); do ...
Yes it is possible to collapse the directories to a first-unique-letter path and have the Z Shell expand that path upon pressing [Tab]. I simply used compinstall (zsh utility script installed with Zsh) to generate the following code. The important part to take note of for expanding path elements is on the **sixth `zsty...
203,346
Does the versioning option in SharePoint 2013 only work for Microsoft Word Documents? What about Excel or PowerPoint? Can I do Versioning with Tasks as well? Thanks
2016/12/22
[ "https://sharepoint.stackexchange.com/questions/203346", "https://sharepoint.stackexchange.com", "https://sharepoint.stackexchange.com/users/59061/" ]
Both lists and libraries can use Versioning, the file type does not matter in the case of documents. [![enter image description here](https://i.stack.imgur.com/mWPmS.jpg)](https://i.stack.imgur.com/mWPmS.jpg)
Versioning works with all document types and different list options. > > Versioning is available for list items in all default list types—including calendars, issue tracking lists, and custom lists. It is also available for all file types that can be stored in libraries, including Web Part pages. > > > [See Micr...
62,672
Suppose we detect a stellar black hole passing near the Solar system, and we have technology and time to send a manned mission to study it. Are there any experiments or observations that would help us learn more, maybe test some of our theories or the whole mission is pointless? I would like to use this as a setting,...
2016/11/29
[ "https://worldbuilding.stackexchange.com/questions/62672", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/29225/" ]
There is no point in sending a manned mission! ---------------------------------------------- As @HDE22686 noted, there *are* many interesting phenomena associated with black holes. Given the opportunity to study one up close, it is likely that missions *will* be sent. However, describing all the cool phenomena associ...
My favorite scifi author Greg Egan wrote a short story about just this. It's available free online if you're curious: [The Planck Dive](http://gregegan.customer.netspace.net.au/PLANCK/Complete/Planck.html). Quick TLDR: It's set in a very farflung transhuman society, and they do it out of pure scientific curiosity by f...
62,672
Suppose we detect a stellar black hole passing near the Solar system, and we have technology and time to send a manned mission to study it. Are there any experiments or observations that would help us learn more, maybe test some of our theories or the whole mission is pointless? I would like to use this as a setting,...
2016/11/29
[ "https://worldbuilding.stackexchange.com/questions/62672", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/29225/" ]
Send Humans! Why? Because of archaeology... As others have stated, computers can handle the mission, running a bunch of experiments and sending us back the results. Those automated experiments are, by definition, limited to studying the expected characteristics of the black hole. They can test for minute variances in...
How to find it? --------------- Black holes are by definition invisible the only way to find one is to look around to see stars being blocked out by them. How to get data? ---------------- To get data from a black hole you would have to study the effects on what it does to the surrounding area and **not** the black ...
62,672
Suppose we detect a stellar black hole passing near the Solar system, and we have technology and time to send a manned mission to study it. Are there any experiments or observations that would help us learn more, maybe test some of our theories or the whole mission is pointless? I would like to use this as a setting,...
2016/11/29
[ "https://worldbuilding.stackexchange.com/questions/62672", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/29225/" ]
For science! ============ At present we have two main theories of physics: * General relativity, which is about very heavy things and gravity. * Quantum mechanics, which is about very small things. We have not been able to fit these two together. One of the reasons for this is that we have not been able do experimen...
As someone with less of a scientific background as many of the contributors on this question, my gut reaction is that part of the case for humans exploring black holes can be made simply by considering human nature and it's role in history. We are, by nature, adventurous creatures who inevitably grow used to our surr...
62,672
Suppose we detect a stellar black hole passing near the Solar system, and we have technology and time to send a manned mission to study it. Are there any experiments or observations that would help us learn more, maybe test some of our theories or the whole mission is pointless? I would like to use this as a setting,...
2016/11/29
[ "https://worldbuilding.stackexchange.com/questions/62672", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/29225/" ]
There is no point in sending a manned mission! ---------------------------------------------- As @HDE22686 noted, there *are* many interesting phenomena associated with black holes. Given the opportunity to study one up close, it is likely that missions *will* be sent. However, describing all the cool phenomena associ...
Don't send humans! There are two basic reasons to send humans to space: 1) To cope with the unexpected. When your mission goes off the rails it's much more likely to succeed if you have a very flexible system on board: a human. Think of Apollo 11, coming down into the rock garden. The tech of the time would have cras...
62,672
Suppose we detect a stellar black hole passing near the Solar system, and we have technology and time to send a manned mission to study it. Are there any experiments or observations that would help us learn more, maybe test some of our theories or the whole mission is pointless? I would like to use this as a setting,...
2016/11/29
[ "https://worldbuilding.stackexchange.com/questions/62672", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/29225/" ]
What could be learned? ====================== There are so many things you could study by looking at a black hole. There are lots of open or partially unsolved problems that surround them: * **Does [Hawking radiation](https://en.wikipedia.org/wiki/Hawking_radiation) exist?** While it has been predicted theoretically,...
For science! ============ At present we have two main theories of physics: * General relativity, which is about very heavy things and gravity. * Quantum mechanics, which is about very small things. We have not been able to fit these two together. One of the reasons for this is that we have not been able do experimen...
62,672
Suppose we detect a stellar black hole passing near the Solar system, and we have technology and time to send a manned mission to study it. Are there any experiments or observations that would help us learn more, maybe test some of our theories or the whole mission is pointless? I would like to use this as a setting,...
2016/11/29
[ "https://worldbuilding.stackexchange.com/questions/62672", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/29225/" ]
What could be learned? ====================== There are so many things you could study by looking at a black hole. There are lots of open or partially unsolved problems that surround them: * **Does [Hawking radiation](https://en.wikipedia.org/wiki/Hawking_radiation) exist?** While it has been predicted theoretically,...
The expense of sending a manned mission vs. many unmanned probes is going to make the latter very enticing. Certainly humans can adapt to situations better, but technology has gotten to the point that most of the situations they could adapt to are unlikely enough to occur that you'd make up for those occurrences by the...
62,672
Suppose we detect a stellar black hole passing near the Solar system, and we have technology and time to send a manned mission to study it. Are there any experiments or observations that would help us learn more, maybe test some of our theories or the whole mission is pointless? I would like to use this as a setting,...
2016/11/29
[ "https://worldbuilding.stackexchange.com/questions/62672", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/29225/" ]
There is no point in sending a manned mission! ---------------------------------------------- As @HDE22686 noted, there *are* many interesting phenomena associated with black holes. Given the opportunity to study one up close, it is likely that missions *will* be sent. However, describing all the cool phenomena associ...
There's a few pitfalls to trying to study a black hole up close 1. Not much is coming out to study. Mostly black holes emit x-rays. No matter, no light, no nothing. 2. Once, say, a probe goes in, it's not coming back out. Nor is it likely going to be able to send data back past the event horizon. 3. [Time dilation](ht...
62,672
Suppose we detect a stellar black hole passing near the Solar system, and we have technology and time to send a manned mission to study it. Are there any experiments or observations that would help us learn more, maybe test some of our theories or the whole mission is pointless? I would like to use this as a setting,...
2016/11/29
[ "https://worldbuilding.stackexchange.com/questions/62672", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/29225/" ]
The expense of sending a manned mission vs. many unmanned probes is going to make the latter very enticing. Certainly humans can adapt to situations better, but technology has gotten to the point that most of the situations they could adapt to are unlikely enough to occur that you'd make up for those occurrences by the...
There's no point sending someone into a black hole in and of itself, because once they're in they have no way of sending any findings back. However, sending someone *near* a black hole could allow them to study the various features mentioned in other answers. For the purposes of your story, the mission could be one t...
62,672
Suppose we detect a stellar black hole passing near the Solar system, and we have technology and time to send a manned mission to study it. Are there any experiments or observations that would help us learn more, maybe test some of our theories or the whole mission is pointless? I would like to use this as a setting,...
2016/11/29
[ "https://worldbuilding.stackexchange.com/questions/62672", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/29225/" ]
For science! ============ At present we have two main theories of physics: * General relativity, which is about very heavy things and gravity. * Quantum mechanics, which is about very small things. We have not been able to fit these two together. One of the reasons for this is that we have not been able do experimen...
My favorite scifi author Greg Egan wrote a short story about just this. It's available free online if you're curious: [The Planck Dive](http://gregegan.customer.netspace.net.au/PLANCK/Complete/Planck.html). Quick TLDR: It's set in a very farflung transhuman society, and they do it out of pure scientific curiosity by f...
62,672
Suppose we detect a stellar black hole passing near the Solar system, and we have technology and time to send a manned mission to study it. Are there any experiments or observations that would help us learn more, maybe test some of our theories or the whole mission is pointless? I would like to use this as a setting,...
2016/11/29
[ "https://worldbuilding.stackexchange.com/questions/62672", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/29225/" ]
There is no point in sending a manned mission! ---------------------------------------------- As @HDE22686 noted, there *are* many interesting phenomena associated with black holes. Given the opportunity to study one up close, it is likely that missions *will* be sent. However, describing all the cool phenomena associ...
Send Humans! Why? Because of archaeology... As others have stated, computers can handle the mission, running a bunch of experiments and sending us back the results. Those automated experiments are, by definition, limited to studying the expected characteristics of the black hole. They can test for minute variances in...
50,730,394
I am running `knife client list` and getting the following error: ``` ERROR: Failed to authenticate to https://chef-server.dev.reach.IE.LOCAL/organizations/accenture as chef-user with key /home/svc.jenkins/helix-chef/iac_chef_standalone_wso2/.chef/chef-user.pem Response: Failed to authenticate as chef-user. Synchroni...
2018/06/06
[ "https://Stackoverflow.com/questions/50730394", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6928292/" ]
As the error says "Synchronize the clock on your host." Either your system clock or the clock on the Chef Server is incorrect (or in the wrong time zone relative to what it is set to). To limit replay attacks, we put a signed timestamp in all requests and it has to be within a fairly narrow window (minutes, but not se...
Open terminal 1. Write sudo su (to login as administrator) 2. Use the following command -> date +%T -s "11:14:00" This worked for me
556,380
I am using the command ``` sudo git clone git://git.moodle.org/moodle.git ``` to download moodle. After partial downloading, it just halts without any valid reason. How can I suspend the job at such a stage and resume it later?
2019/12/09
[ "https://unix.stackexchange.com/questions/556380", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/385605/" ]
If your `sed` is able to use the non-standard `-E` option to understand extended regular expressions, you may use ``` sed -E 's/string1|string2|string3/true/g' ``` The alternation with `|` is an extended regular expression feature not supported by basic regular expression of the type that `sed` usually supports. Th...
Is this what you are looking for? With GNU `sed`: ``` sed -E 's/(command1|command2|command3)/true/' file ```
556,380
I am using the command ``` sudo git clone git://git.moodle.org/moodle.git ``` to download moodle. After partial downloading, it just halts without any valid reason. How can I suspend the job at such a stage and resume it later?
2019/12/09
[ "https://unix.stackexchange.com/questions/556380", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/385605/" ]
Is this what you are looking for? With GNU `sed`: ``` sed -E 's/(command1|command2|command3)/true/' file ```
POSIXly, you could use `awk`: ``` awk '{gsub(/command1|command2|command3/, "true"); print}' < file ``` ([`sed -E` is likely to be specified in the next major of the POSIX standard](http://austingroupbugs.net/view.php?id=528) though, so it will probably spread to most implementations eventually).
556,380
I am using the command ``` sudo git clone git://git.moodle.org/moodle.git ``` to download moodle. After partial downloading, it just halts without any valid reason. How can I suspend the job at such a stage and resume it later?
2019/12/09
[ "https://unix.stackexchange.com/questions/556380", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/385605/" ]
If your `sed` is able to use the non-standard `-E` option to understand extended regular expressions, you may use ``` sed -E 's/string1|string2|string3/true/g' ``` The alternation with `|` is an extended regular expression feature not supported by basic regular expression of the type that `sed` usually supports. Th...
POSIXly, you could use `awk`: ``` awk '{gsub(/command1|command2|command3/, "true"); print}' < file ``` ([`sed -E` is likely to be specified in the next major of the POSIX standard](http://austingroupbugs.net/view.php?id=528) though, so it will probably spread to most implementations eventually).
23,889,614
what i'm trying to do is to save a file in a remote server which is created on openshift (i created an application with php 5.3). this is the code which sends a file: ``` private void postFile(){ try{ String postReceiverUrl = "https://openshift.redhat.com/app/console/application/537e9c0be0b8cd34170000...
2014/05/27
[ "https://Stackoverflow.com/questions/23889614", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3656442/" ]
If your app crashes always take a look at the logcat. In 99% of all cases the error message tells you exactly what's wrong and how you can fix it, just like in your case: ``` 05-27 15:32:06.857: W/System.err(18546): android.os.NetworkOnMainThreadException ``` You cannot perform complex tasks in the UI Thread, doing ...
You need to move network activity off of the UI thread, it should be handled in an `AsyncTask`. ``` private class upload extends AsyncTask<URL, Integer, Long> { private void doInBackground(URL... urls) { try { String postReceiverUrl = "https://openshift.redhat.com/app/console/application/537e...
13,558,362
In Xcode 4.5 apple introduced apple new maps. My application heavliy requires map services. And I have noticed in my application it shows the wrong current location until you delete the app and reopen it shows the right current location (Sometimes it doesn't). Just to mention I was connected to 4G when it show the wron...
2012/11/26
[ "https://Stackoverflow.com/questions/13558362", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
The old approach from apple docs seems still working in iOS6 (didn't notice this in my active app (it tracks user's route via gps)) ``` - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation { NSTimeInterval locationAge = -[newLoca...
you should check the timestamp .. if i understand your app logic correctly, you could do something like - ``` - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation { NSDate* time = newLocation.timestamp; NSTimeInte...
13,558,362
In Xcode 4.5 apple introduced apple new maps. My application heavliy requires map services. And I have noticed in my application it shows the wrong current location until you delete the app and reopen it shows the right current location (Sometimes it doesn't). Just to mention I was connected to 4G when it show the wron...
2012/11/26
[ "https://Stackoverflow.com/questions/13558362", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
you should check the timestamp .. if i understand your app logic correctly, you could do something like - ``` - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation { NSDate* time = newLocation.timestamp; NSTimeInte...
I have noticed the same problem with Xcode 4.4+. The problem only occurs (randomly, or so it seems) within Xcode: if you upload the app to the App Store, this is not a problem anymore. In the meantime, please file a bug.
13,558,362
In Xcode 4.5 apple introduced apple new maps. My application heavliy requires map services. And I have noticed in my application it shows the wrong current location until you delete the app and reopen it shows the right current location (Sometimes it doesn't). Just to mention I was connected to 4G when it show the wron...
2012/11/26
[ "https://Stackoverflow.com/questions/13558362", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
The old approach from apple docs seems still working in iOS6 (didn't notice this in my active app (it tracks user's route via gps)) ``` - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation { NSTimeInterval locationAge = -[newLoca...
I have noticed the same problem with Xcode 4.4+. The problem only occurs (randomly, or so it seems) within Xcode: if you upload the app to the App Store, this is not a problem anymore. In the meantime, please file a bug.
8,963,724
I am trying to get Junit work with Ant. I have come across questions on the topic. I guess there is some small error somewhere but I can't figure it out. Here is my Build file: ``` <?xml version="1.0" encoding="UTF-8"?> <project name="IvleFileSync" default="dist" basedir="."> <description> simp...
2012/01/22
[ "https://Stackoverflow.com/questions/8963724", "https://Stackoverflow.com", "https://Stackoverflow.com/users/611229/" ]
The classpath for the junit task does not include the output of the compile-test target. Use something like the following for the JUnit classpath: ``` <classpath> <pathelement path="${build}"/> <path refid="files-classpath" /> <path refid="junit-classpath" /> </classpath> ```
You forgot to add your own classes ("build") to the "test" target.
39,078,835
I have irregularly spaced time-series data. I have total energy usage and the duration over which the energy was used. ``` Start Date Start Time Duration (Hours) Usage(kWh) 1/3/2016 12:28:00 PM 2.233333333 6.23 1/3/2016 4:55:00 PM 1.9 11.45 1/4/2016 6:47:00 PM 7....
2016/08/22
[ "https://Stackoverflow.com/questions/39078835", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5948903/" ]
Here is a straight-forward implementation which simply sets up a Series, `result`, whose index has minute-frequency, and then loops through the rows of `df` (using `df.itertuples`) and adds the appropriate amount of power to each row in the associated interval: ``` import numpy as np import pandas as pd import matplot...
The solution I used below is the itertuples method. Please note using numpy's .sum function did not work for me. I instead used the pandas resample keyword, "how" and set it equal to sum. I also renamed the columns in my files to make the import easier. I was not time/resource constrained so I went with the itertupl...
62,821,375
I want to check bydefault one radiobutton from three option in nopcommerce 4.3 Here is my code, ``` <div class="col-md-6"> <div class="raw"> <div class="col-md-2"> <div class="radio"> <label> @Html.RadioButton("LabourChargeUnit", "false", (Model.LabourCharge...
2020/07/09
[ "https://Stackoverflow.com/questions/62821375", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7449534/" ]
Here is your widget ``` Center( child: Container( width: 200, height: 100, decoration: BoxDecoration( borderRadius: BorderRadius.only(bottomLeft: Radius.circular(20.0)), gradient: LinearGradient(begin: Alignment.topLeft, end: Alignment.bottomRight, c...
[![sample](https://i.stack.imgur.com/4MxEE.png)](https://i.stack.imgur.com/4MxEE.png) --- ``` main() => runApp(MyApp()); class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( home: SO(), debugShowCheckedModeBanner: false, ); } } class SO e...
8,026,101
How should I quit a Qt Program, e.g when loading a data file, and discovered file corruption, and user need to quit this app or re-initiate data file? Should I: 1. call `exit(EXIT_FAILURE)` 2. call `QApplication::quit()` 3. call `QCoreApplication::quit()` And difference between (2) and (3)?
2011/11/06
[ "https://Stackoverflow.com/questions/8026101", "https://Stackoverflow.com", "https://Stackoverflow.com/users/614944/" ]
While searching this very question I discovered this example in the [documentation](https://doc.qt.io/qt-5/qcoreapplication.html#quit). ``` QPushButton *quitButton = new QPushButton("Quit"); connect(quitButton, &QPushButton::clicked, &app, &QCoreApplication::quit, Qt::QueuedConnection); ``` Mutatis mutandis for your...
if you need to close your application from main() you can use this code ``` int main(int argc, char *argv[]){ QApplication app(argc, argv); ... if(!QSslSocket::supportsSsl()) return app.exit(0); ... return app.exec(); } ``` The program will terminated if OpenSSL is not installed
8,026,101
How should I quit a Qt Program, e.g when loading a data file, and discovered file corruption, and user need to quit this app or re-initiate data file? Should I: 1. call `exit(EXIT_FAILURE)` 2. call `QApplication::quit()` 3. call `QCoreApplication::quit()` And difference between (2) and (3)?
2011/11/06
[ "https://Stackoverflow.com/questions/8026101", "https://Stackoverflow.com", "https://Stackoverflow.com/users/614944/" ]
You can call `qApp->exit();`. I always use that and never had a problem with it. If you application is a command line application, you might indeed want to return an exit code. It's completely up to you what the code is.
While searching this very question I discovered this example in the [documentation](https://doc.qt.io/qt-5/qcoreapplication.html#quit). ``` QPushButton *quitButton = new QPushButton("Quit"); connect(quitButton, &QPushButton::clicked, &app, &QCoreApplication::quit, Qt::QueuedConnection); ``` Mutatis mutandis for your...
8,026,101
How should I quit a Qt Program, e.g when loading a data file, and discovered file corruption, and user need to quit this app or re-initiate data file? Should I: 1. call `exit(EXIT_FAILURE)` 2. call `QApplication::quit()` 3. call `QCoreApplication::quit()` And difference between (2) and (3)?
2011/11/06
[ "https://Stackoverflow.com/questions/8026101", "https://Stackoverflow.com", "https://Stackoverflow.com/users/614944/" ]
If you're using Qt Jambi, this should work: ``` QApplication.closeAllWindows(); ```
if you need to close your application from main() you can use this code ``` int main(int argc, char *argv[]){ QApplication app(argc, argv); ... if(!QSslSocket::supportsSsl()) return app.exit(0); ... return app.exec(); } ``` The program will terminated if OpenSSL is not installed
8,026,101
How should I quit a Qt Program, e.g when loading a data file, and discovered file corruption, and user need to quit this app or re-initiate data file? Should I: 1. call `exit(EXIT_FAILURE)` 2. call `QApplication::quit()` 3. call `QCoreApplication::quit()` And difference between (2) and (3)?
2011/11/06
[ "https://Stackoverflow.com/questions/8026101", "https://Stackoverflow.com", "https://Stackoverflow.com/users/614944/" ]
If you're using Qt Jambi, this should work: ``` QApplication.closeAllWindows(); ```
``` //How to Run App bool ok = QProcess::startDetached("C:\\TTEC\\CozxyLogger\\CozxyLogger.exe"); qDebug() << "Run = " << ok; //How to Kill App system("taskkill /im CozxyLogger.exe /f"); qDebug() << "Close"; ``` [example](https://i.stack.imgur.com/A5Tfx.png)
8,026,101
How should I quit a Qt Program, e.g when loading a data file, and discovered file corruption, and user need to quit this app or re-initiate data file? Should I: 1. call `exit(EXIT_FAILURE)` 2. call `QApplication::quit()` 3. call `QCoreApplication::quit()` And difference between (2) and (3)?
2011/11/06
[ "https://Stackoverflow.com/questions/8026101", "https://Stackoverflow.com", "https://Stackoverflow.com/users/614944/" ]
You can call `qApp->exit();`. I always use that and never had a problem with it. If you application is a command line application, you might indeed want to return an exit code. It's completely up to you what the code is.
if you need to close your application from main() you can use this code ``` int main(int argc, char *argv[]){ QApplication app(argc, argv); ... if(!QSslSocket::supportsSsl()) return app.exit(0); ... return app.exec(); } ``` The program will terminated if OpenSSL is not installed
8,026,101
How should I quit a Qt Program, e.g when loading a data file, and discovered file corruption, and user need to quit this app or re-initiate data file? Should I: 1. call `exit(EXIT_FAILURE)` 2. call `QApplication::quit()` 3. call `QCoreApplication::quit()` And difference between (2) and (3)?
2011/11/06
[ "https://Stackoverflow.com/questions/8026101", "https://Stackoverflow.com", "https://Stackoverflow.com/users/614944/" ]
QApplication is derived from QCoreApplication and thereby inherits `quit()` which is a public slot of `QCoreApplication`, so there is no difference between `QApplication::quit()` and `QCoreApplication::quit()`. As we can read in the documentation of [`QCoreApplication::quit()`](http://doc.qt.io/qt-5/qcoreapplication.h...
While searching this very question I discovered this example in the [documentation](https://doc.qt.io/qt-5/qcoreapplication.html#quit). ``` QPushButton *quitButton = new QPushButton("Quit"); connect(quitButton, &QPushButton::clicked, &app, &QCoreApplication::quit, Qt::QueuedConnection); ``` Mutatis mutandis for your...
8,026,101
How should I quit a Qt Program, e.g when loading a data file, and discovered file corruption, and user need to quit this app or re-initiate data file? Should I: 1. call `exit(EXIT_FAILURE)` 2. call `QApplication::quit()` 3. call `QCoreApplication::quit()` And difference between (2) and (3)?
2011/11/06
[ "https://Stackoverflow.com/questions/8026101", "https://Stackoverflow.com", "https://Stackoverflow.com/users/614944/" ]
QApplication is derived from QCoreApplication and thereby inherits `quit()` which is a public slot of `QCoreApplication`, so there is no difference between `QApplication::quit()` and `QCoreApplication::quit()`. As we can read in the documentation of [`QCoreApplication::quit()`](http://doc.qt.io/qt-5/qcoreapplication.h...
``` //How to Run App bool ok = QProcess::startDetached("C:\\TTEC\\CozxyLogger\\CozxyLogger.exe"); qDebug() << "Run = " << ok; //How to Kill App system("taskkill /im CozxyLogger.exe /f"); qDebug() << "Close"; ``` [example](https://i.stack.imgur.com/A5Tfx.png)
8,026,101
How should I quit a Qt Program, e.g when loading a data file, and discovered file corruption, and user need to quit this app or re-initiate data file? Should I: 1. call `exit(EXIT_FAILURE)` 2. call `QApplication::quit()` 3. call `QCoreApplication::quit()` And difference between (2) and (3)?
2011/11/06
[ "https://Stackoverflow.com/questions/8026101", "https://Stackoverflow.com", "https://Stackoverflow.com/users/614944/" ]
QApplication is derived from QCoreApplication and thereby inherits `quit()` which is a public slot of `QCoreApplication`, so there is no difference between `QApplication::quit()` and `QCoreApplication::quit()`. As we can read in the documentation of [`QCoreApplication::quit()`](http://doc.qt.io/qt-5/qcoreapplication.h...
If you're using Qt Jambi, this should work: ``` QApplication.closeAllWindows(); ```
8,026,101
How should I quit a Qt Program, e.g when loading a data file, and discovered file corruption, and user need to quit this app or re-initiate data file? Should I: 1. call `exit(EXIT_FAILURE)` 2. call `QApplication::quit()` 3. call `QCoreApplication::quit()` And difference between (2) and (3)?
2011/11/06
[ "https://Stackoverflow.com/questions/8026101", "https://Stackoverflow.com", "https://Stackoverflow.com/users/614944/" ]
QApplication is derived from QCoreApplication and thereby inherits `quit()` which is a public slot of `QCoreApplication`, so there is no difference between `QApplication::quit()` and `QCoreApplication::quit()`. As we can read in the documentation of [`QCoreApplication::quit()`](http://doc.qt.io/qt-5/qcoreapplication.h...
if you need to close your application from main() you can use this code ``` int main(int argc, char *argv[]){ QApplication app(argc, argv); ... if(!QSslSocket::supportsSsl()) return app.exit(0); ... return app.exec(); } ``` The program will terminated if OpenSSL is not installed
8,026,101
How should I quit a Qt Program, e.g when loading a data file, and discovered file corruption, and user need to quit this app or re-initiate data file? Should I: 1. call `exit(EXIT_FAILURE)` 2. call `QApplication::quit()` 3. call `QCoreApplication::quit()` And difference between (2) and (3)?
2011/11/06
[ "https://Stackoverflow.com/questions/8026101", "https://Stackoverflow.com", "https://Stackoverflow.com/users/614944/" ]
QApplication is derived from QCoreApplication and thereby inherits `quit()` which is a public slot of `QCoreApplication`, so there is no difference between `QApplication::quit()` and `QCoreApplication::quit()`. As we can read in the documentation of [`QCoreApplication::quit()`](http://doc.qt.io/qt-5/qcoreapplication.h...
You can call `qApp->exit();`. I always use that and never had a problem with it. If you application is a command line application, you might indeed want to return an exit code. It's completely up to you what the code is.
28,686,367
Here's what i don't understand as you can see my outer loop should only print 5 rows but when i add my inner loop it print 6 rows one blank and 5 0123 what happened here? why did my outer loop print 6 rows? ``` public static void main (String[] args) { int x; int y; for(x=1; x<=5; x++){ S...
2015/02/24
[ "https://Stackoverflow.com/questions/28686367", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4290376/" ]
``` public static void main (String[] args) { //dont need to declare variables here. they can be declared in loop like below for(int x=0; x<5; x++){ System.out.println(); //this is called before inner loop, printing a blank line for (int y=0; y<4; y++){ System.out.print(y); /...
The first thing the loop does is output a newline. Any characters printed in the `y` for loop after it appear on the next line. So, this prints 5 newlines, each followed by the `y` characters on the next line. The last iteration prints its characters on the 6th line, which follows the 5th newline character printed. Mo...
28,686,367
Here's what i don't understand as you can see my outer loop should only print 5 rows but when i add my inner loop it print 6 rows one blank and 5 0123 what happened here? why did my outer loop print 6 rows? ``` public static void main (String[] args) { int x; int y; for(x=1; x<=5; x++){ S...
2015/02/24
[ "https://Stackoverflow.com/questions/28686367", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4290376/" ]
``` public static void main (String[] args) { //dont need to declare variables here. they can be declared in loop like below for(int x=0; x<5; x++){ System.out.println(); //this is called before inner loop, printing a blank line for (int y=0; y<4; y++){ System.out.print(y); /...
You are printing the new line before the actual output. Move `System.out.println();` after the inner for loop: ``` public static void main (String[] args) { int x; int y; for(x=1; x<=5; x++){ for (y=0; y<4; y++){ System.out.print(y); } System.out.println(); } } ```...
28,686,367
Here's what i don't understand as you can see my outer loop should only print 5 rows but when i add my inner loop it print 6 rows one blank and 5 0123 what happened here? why did my outer loop print 6 rows? ``` public static void main (String[] args) { int x; int y; for(x=1; x<=5; x++){ S...
2015/02/24
[ "https://Stackoverflow.com/questions/28686367", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4290376/" ]
``` public static void main (String[] args) { //dont need to declare variables here. they can be declared in loop like below for(int x=0; x<5; x++){ System.out.println(); //this is called before inner loop, printing a blank line for (int y=0; y<4; y++){ System.out.print(y); /...
Your first instruction in your outer loop is ``` System.out.println(); ``` which means you are moving cursor to next line (leaving first line empty). Then ``` for (y=0; y<4; y++){ System.out.print(y); ``` happens which is responsible for printing `0123` in that line. Then again in next iteration of outer ...
28,686,367
Here's what i don't understand as you can see my outer loop should only print 5 rows but when i add my inner loop it print 6 rows one blank and 5 0123 what happened here? why did my outer loop print 6 rows? ``` public static void main (String[] args) { int x; int y; for(x=1; x<=5; x++){ S...
2015/02/24
[ "https://Stackoverflow.com/questions/28686367", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4290376/" ]
``` public static void main (String[] args) { //dont need to declare variables here. they can be declared in loop like below for(int x=0; x<5; x++){ System.out.println(); //this is called before inner loop, printing a blank line for (int y=0; y<4; y++){ System.out.print(y); /...
your outer loop first prints a blank line, then 0123 on the next try ``` int x; int y; for(x=1; x<=5; x++){ for (y=0; y<4; y++){ System.out.print(y); } System.out.println(); } ```