qid int64 1 74.7M | question stringlengths 0 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 2 48.3k | response_k stringlengths 2 40.5k |
|---|---|---|---|---|---|
458,852 | I’m trying to automate the refreshing of data in my Excel Reports. Here the script:
```
$ExcelApp = new-object -ComObject Excel.Application
$ExcelApp.Visible = $false
$ExcelApp.DisplayAlerts = $false
$Workbook = $ExcelApp.Workbooks.Open("RefreshTest.xlsx", 3, $false, 5, $null, $null, $true)
$Workbook.RefreshAll()
$Wo... | 2009/01/19 | [
"https://Stackoverflow.com/questions/458852",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | I agree that this seems to be a race condition. An idiom I use takes advantage of the fact that `!$null` evaluates to `$true`,
```
# create an object that may take some time to populate
$MyWorkBook = $ap.Workbooks.Add()
# wait for the methods of MyWorkBook to be populated
while(!$MyWorkBook.activate){start-sleep -mi... | This script works fine for me as well, as written.
I would agree with Marco that this seems like a race condition error. The error message is weird, but the fact that it works when you have human pause between the load/refresh and save portions of your script points to a long load/refresh time causing your problem.
T... |
18,793,735 | I'm not sure if something like this is possible, but I am attempting to dynamically generate a GUI based on properties that have been registered into Qt's property system. My assumption is that since I have registered a property using Q\_PROPERTY() in this fashion:
```
Q_PROPERTY(propertyType propertyName WRITE setPro... | 2013/09/13 | [
"https://Stackoverflow.com/questions/18793735",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/591604/"
] | To retrieve the signature of QObject's methods (signals, slots, etc.) you can use meta object (`QMetaObject`) information. For example the following code (taken from Qt documentation) extracts all methods' signatures of the object:
```
const QMetaObject* metaObject = obj->metaObject();
QStringList methods;
for(int i =... | I'm not sure if this will work for you, but I went the other way. I wrote the gui and tied the widgets to a data model based on properties. You might be able to use the model to get the properties to dynamically generate the gui and then tie your generated widgets to the model. I wrote a class, `QPropertyModel`, that c... |
18,793,735 | I'm not sure if something like this is possible, but I am attempting to dynamically generate a GUI based on properties that have been registered into Qt's property system. My assumption is that since I have registered a property using Q\_PROPERTY() in this fashion:
```
Q_PROPERTY(propertyType propertyName WRITE setPro... | 2013/09/13 | [
"https://Stackoverflow.com/questions/18793735",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/591604/"
] | To retrieve the signature of QObject's methods (signals, slots, etc.) you can use meta object (`QMetaObject`) information. For example the following code (taken from Qt documentation) extracts all methods' signatures of the object:
```
const QMetaObject* metaObject = obj->metaObject();
QStringList methods;
for(int i =... | I also had some thoughts about automatic UI generation based on QObject properties. But at the moment I don't work in this direction because usually, I need specific UI layout in order to make it a little bit user-friendly.
While I have nothing to say about automatic UI generation, I [have](https://gist.github.com/Wil... |
18,793,735 | I'm not sure if something like this is possible, but I am attempting to dynamically generate a GUI based on properties that have been registered into Qt's property system. My assumption is that since I have registered a property using Q\_PROPERTY() in this fashion:
```
Q_PROPERTY(propertyType propertyName WRITE setPro... | 2013/09/13 | [
"https://Stackoverflow.com/questions/18793735",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/591604/"
] | I'm not sure if this will work for you, but I went the other way. I wrote the gui and tied the widgets to a data model based on properties. You might be able to use the model to get the properties to dynamically generate the gui and then tie your generated widgets to the model. I wrote a class, `QPropertyModel`, that c... | I also had some thoughts about automatic UI generation based on QObject properties. But at the moment I don't work in this direction because usually, I need specific UI layout in order to make it a little bit user-friendly.
While I have nothing to say about automatic UI generation, I [have](https://gist.github.com/Wil... |
54,397,779 | Some `<p></p>` tags has `<img>` tag and `<h4>` tag, but I want just those `<p>` tag which has no siblings tags in it just contents.
```
<p> <img src="any url"/> </p> <p> hello world </p>
```
I want `<p>` tag which has no `<img>` tag using beautiful soup | 2019/01/28 | [
"https://Stackoverflow.com/questions/54397779",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10790439/"
] | This will get all the text in `<p>` elements but won't get it from any of the child elements in the `<p>`. Recursive needs to be equal false otherwise it will look into the child elements. I've added in another test case for you to show this: `<p><h4>Heading</h4></p>`
```
from bs4 import BeautifulSoup
html = "<p> <im... | ```
from bs4 import BeautifulSoup
txt = """
<p> <img src="any url"/> </p> <p> hello world </p>
"""
soup = BeautifulSoup(txt)
for node in soup.findAll('p'):
print(' '.join(node.findAll(text=True, recursive = False)))
```
OUTPUT:
>
> hello world
>
>
> |
54,397,779 | Some `<p></p>` tags has `<img>` tag and `<h4>` tag, but I want just those `<p>` tag which has no siblings tags in it just contents.
```
<p> <img src="any url"/> </p> <p> hello world </p>
```
I want `<p>` tag which has no `<img>` tag using beautiful soup | 2019/01/28 | [
"https://Stackoverflow.com/questions/54397779",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10790439/"
] | A solution to get all `p` tags with no child tags.
```
import bs4
html="""<p> <img src="any url"/> </p> <p> hello world </p>"""
soup=bs4.BeautifulSoup(html,"html.parser")
def has_no_tag_children(tag):
if type(tag) is bs4.element.Tag: #check if tag
if tag.name =='p': #check if it is p tag
... | ```
from bs4 import BeautifulSoup
txt = """
<p> <img src="any url"/> </p> <p> hello world </p>
"""
soup = BeautifulSoup(txt)
for node in soup.findAll('p'):
print(' '.join(node.findAll(text=True, recursive = False)))
```
OUTPUT:
>
> hello world
>
>
> |
54,397,779 | Some `<p></p>` tags has `<img>` tag and `<h4>` tag, but I want just those `<p>` tag which has no siblings tags in it just contents.
```
<p> <img src="any url"/> </p> <p> hello world </p>
```
I want `<p>` tag which has no `<img>` tag using beautiful soup | 2019/01/28 | [
"https://Stackoverflow.com/questions/54397779",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/10790439/"
] | Assuming BeautifulSoup 4.7+, you should be able to do this:
```py
import bs4
html="""<p> <img src="any url"/> </p> <p> hello world </p>"""
soup=bs4.BeautifulSoup(html,"html.parser")
kids=soup.select("p:not(:has(*))")
print(kids)
``` | ```
from bs4 import BeautifulSoup
txt = """
<p> <img src="any url"/> </p> <p> hello world </p>
"""
soup = BeautifulSoup(txt)
for node in soup.findAll('p'):
print(' '.join(node.findAll(text=True, recursive = False)))
```
OUTPUT:
>
> hello world
>
>
> |
4,525,279 | I'm using `jquery-1.4.2.min` and `jquery-ui-1.8.6.custom` to get the autocomplete data on a jsp page, here is the code snippet:
```
$(document).ready(function() { $("input#airportfrom").autocomplete({minLength: 3,
source: function(request, response) { $.ajax({
url: "MLocationLookupSearchPopUpAuto.action?LANGUAGE=${pa... | 2010/12/24 | [
"https://Stackoverflow.com/questions/4525279",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/553147/"
] | Hmm...why such a difficult one?
```
alert\((.+?)\)
``` | ```
alert\("(.[^"]*)"\)
```
The only character not permitted is " |
1,760 | For someone looking after a small 50 Windows PC network (Mainly XP - some Vista), are there any tools that can do an automatic inventory of the network e.g.
* OS
* Memory size
* Hard drive type and size
* Serial numbers
* Monitor type
etc.
At the moment, someone has to go from PC to PC writing all this stuff down. | 2009/04/30 | [
"https://serverfault.com/questions/1760",
"https://serverfault.com",
"https://serverfault.com/users/1072/"
] | I have heard great things about [Spiceworks](http://www.spiceworks.com/). Its big features are:
* creating an inventory of PCs and their installed software - Windows, Mac, Linux
* creating an inventory of routers, printers, and anything IP based.
* help desk ticketing
* network monitoring
* nice reporting | Check with your PC manufacturer. Most of the business ones have their own free inventory software that you can use. Even if you just have one of these computers, grab the software to see if it meets your needs, and it might discover other PC brands too. (Hint, hint.)
* Dell has [OpenManage](http://www1.us.dell.com/con... |
1,760 | For someone looking after a small 50 Windows PC network (Mainly XP - some Vista), are there any tools that can do an automatic inventory of the network e.g.
* OS
* Memory size
* Hard drive type and size
* Serial numbers
* Monitor type
etc.
At the moment, someone has to go from PC to PC writing all this stuff down. | 2009/04/30 | [
"https://serverfault.com/questions/1760",
"https://serverfault.com",
"https://serverfault.com/users/1072/"
] | I have heard great things about [Spiceworks](http://www.spiceworks.com/). Its big features are:
* creating an inventory of PCs and their installed software - Windows, Mac, Linux
* creating an inventory of routers, printers, and anything IP based.
* help desk ticketing
* network monitoring
* nice reporting | Assuming you are on an Active Directory domain you can very quickly develop a Windows PowerShell script to do it all remotely via WMI queries. If I could post a link, I would link you to a copy of the script I wrote.
Apart from writing a script there is the Microsoft Server Center stuff |
1,760 | For someone looking after a small 50 Windows PC network (Mainly XP - some Vista), are there any tools that can do an automatic inventory of the network e.g.
* OS
* Memory size
* Hard drive type and size
* Serial numbers
* Monitor type
etc.
At the moment, someone has to go from PC to PC writing all this stuff down. | 2009/04/30 | [
"https://serverfault.com/questions/1760",
"https://serverfault.com",
"https://serverfault.com/users/1072/"
] | [CPU-z](http://www.cpuid.com/cpuz.php) has a command line function that will write thing about the computer to a html file. That will give you memory and CPU type/speed. I believe the software [Everest](http://www.lavalys.com/news.php?article=57&selcat=PN&lang=en) can do the same for most of the other things you're loo... | Assuming you are on an Active Directory domain you can very quickly develop a Windows PowerShell script to do it all remotely via WMI queries. If I could post a link, I would link you to a copy of the script I wrote.
Apart from writing a script there is the Microsoft Server Center stuff |
1,760 | For someone looking after a small 50 Windows PC network (Mainly XP - some Vista), are there any tools that can do an automatic inventory of the network e.g.
* OS
* Memory size
* Hard drive type and size
* Serial numbers
* Monitor type
etc.
At the moment, someone has to go from PC to PC writing all this stuff down. | 2009/04/30 | [
"https://serverfault.com/questions/1760",
"https://serverfault.com",
"https://serverfault.com/users/1072/"
] | There are lots of solutions (just [google "computer inventory"](http://www.google.com/search?q=computer%20inventory)), but the one I know of is [OCS Inventory NG](http://www.ocsinventory-ng.org/), although depending on your needs you may want to look for something a bit more friendly, as this open source project is som... | Assuming you are on an Active Directory domain you can very quickly develop a Windows PowerShell script to do it all remotely via WMI queries. If I could post a link, I would link you to a copy of the script I wrote.
Apart from writing a script there is the Microsoft Server Center stuff |
1,760 | For someone looking after a small 50 Windows PC network (Mainly XP - some Vista), are there any tools that can do an automatic inventory of the network e.g.
* OS
* Memory size
* Hard drive type and size
* Serial numbers
* Monitor type
etc.
At the moment, someone has to go from PC to PC writing all this stuff down. | 2009/04/30 | [
"https://serverfault.com/questions/1760",
"https://serverfault.com",
"https://serverfault.com/users/1072/"
] | Check with your PC manufacturer. Most of the business ones have their own free inventory software that you can use. Even if you just have one of these computers, grab the software to see if it meets your needs, and it might discover other PC brands too. (Hint, hint.)
* Dell has [OpenManage](http://www1.us.dell.com/con... | Our tool is Admin Arsenal. It does require your environment to be managed via Active Directory. www.AdminArsenal.com |
1,760 | For someone looking after a small 50 Windows PC network (Mainly XP - some Vista), are there any tools that can do an automatic inventory of the network e.g.
* OS
* Memory size
* Hard drive type and size
* Serial numbers
* Monitor type
etc.
At the moment, someone has to go from PC to PC writing all this stuff down. | 2009/04/30 | [
"https://serverfault.com/questions/1760",
"https://serverfault.com",
"https://serverfault.com/users/1072/"
] | I have heard great things about [Spiceworks](http://www.spiceworks.com/). Its big features are:
* creating an inventory of PCs and their installed software - Windows, Mac, Linux
* creating an inventory of routers, printers, and anything IP based.
* help desk ticketing
* network monitoring
* nice reporting | Our tool is Admin Arsenal. It does require your environment to be managed via Active Directory. www.AdminArsenal.com |
1,760 | For someone looking after a small 50 Windows PC network (Mainly XP - some Vista), are there any tools that can do an automatic inventory of the network e.g.
* OS
* Memory size
* Hard drive type and size
* Serial numbers
* Monitor type
etc.
At the moment, someone has to go from PC to PC writing all this stuff down. | 2009/04/30 | [
"https://serverfault.com/questions/1760",
"https://serverfault.com",
"https://serverfault.com/users/1072/"
] | There are lots of solutions (just [google "computer inventory"](http://www.google.com/search?q=computer%20inventory)), but the one I know of is [OCS Inventory NG](http://www.ocsinventory-ng.org/), although depending on your needs you may want to look for something a bit more friendly, as this open source project is som... | Check with your PC manufacturer. Most of the business ones have their own free inventory software that you can use. Even if you just have one of these computers, grab the software to see if it meets your needs, and it might discover other PC brands too. (Hint, hint.)
* Dell has [OpenManage](http://www1.us.dell.com/con... |
1,760 | For someone looking after a small 50 Windows PC network (Mainly XP - some Vista), are there any tools that can do an automatic inventory of the network e.g.
* OS
* Memory size
* Hard drive type and size
* Serial numbers
* Monitor type
etc.
At the moment, someone has to go from PC to PC writing all this stuff down. | 2009/04/30 | [
"https://serverfault.com/questions/1760",
"https://serverfault.com",
"https://serverfault.com/users/1072/"
] | I have heard great things about [Spiceworks](http://www.spiceworks.com/). Its big features are:
* creating an inventory of PCs and their installed software - Windows, Mac, Linux
* creating an inventory of routers, printers, and anything IP based.
* help desk ticketing
* network monitoring
* nice reporting | [CPU-z](http://www.cpuid.com/cpuz.php) has a command line function that will write thing about the computer to a html file. That will give you memory and CPU type/speed. I believe the software [Everest](http://www.lavalys.com/news.php?article=57&selcat=PN&lang=en) can do the same for most of the other things you're loo... |
1,760 | For someone looking after a small 50 Windows PC network (Mainly XP - some Vista), are there any tools that can do an automatic inventory of the network e.g.
* OS
* Memory size
* Hard drive type and size
* Serial numbers
* Monitor type
etc.
At the moment, someone has to go from PC to PC writing all this stuff down. | 2009/04/30 | [
"https://serverfault.com/questions/1760",
"https://serverfault.com",
"https://serverfault.com/users/1072/"
] | There are lots of solutions (just [google "computer inventory"](http://www.google.com/search?q=computer%20inventory)), but the one I know of is [OCS Inventory NG](http://www.ocsinventory-ng.org/), although depending on your needs you may want to look for something a bit more friendly, as this open source project is som... | [CPU-z](http://www.cpuid.com/cpuz.php) has a command line function that will write thing about the computer to a html file. That will give you memory and CPU type/speed. I believe the software [Everest](http://www.lavalys.com/news.php?article=57&selcat=PN&lang=en) can do the same for most of the other things you're loo... |
1,760 | For someone looking after a small 50 Windows PC network (Mainly XP - some Vista), are there any tools that can do an automatic inventory of the network e.g.
* OS
* Memory size
* Hard drive type and size
* Serial numbers
* Monitor type
etc.
At the moment, someone has to go from PC to PC writing all this stuff down. | 2009/04/30 | [
"https://serverfault.com/questions/1760",
"https://serverfault.com",
"https://serverfault.com/users/1072/"
] | Assuming you are on an Active Directory domain you can very quickly develop a Windows PowerShell script to do it all remotely via WMI queries. If I could post a link, I would link you to a copy of the script I wrote.
Apart from writing a script there is the Microsoft Server Center stuff | Our tool is Admin Arsenal. It does require your environment to be managed via Active Directory. www.AdminArsenal.com |
58,783,126 | I put my SECRET\_KEY in secrets.json, and that one in .gitignore; in settings.py I read the key from the file.
Bottom line: my local server is reading the key. But when I want to produce a `git push heroku master`, an error is thrown, the file was not found. It is understandable! I added it to .gitignore. And accordin... | 2019/11/09 | [
"https://Stackoverflow.com/questions/58783126",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12278308/"
] | You're handling secrets correctly by not putting those secrets into your repository unencrypted. To fix this issue, what I usually do is to add a second check in settings.py
```
if os.path.exists('secrets.json'):
# read secrets from json file
else:
SECRET_KEY = os.environ['DJANGO_SECRET_KEY']
```
And in herok... | The secrets.json us sometimes mistaken for a corrupted language. It’s still very safe it’s just confusion in the language
Perhaps the git push heroku master has already been accepted and there is not yet an instance they reguires a secret key. |
51,268 | I am using Word 2007, but saving my documents in .doc (as opposed to .docx) formats because that's company policy.
I have the ToC set up fine, but is there a way to have it update automatically (at document open, save or otherwise)? Word help suggests that it should update upon opening the document, but that doesn't ... | 2009/10/05 | [
"https://superuser.com/questions/51268",
"https://superuser.com",
"https://superuser.com/users/11470/"
] | If there's a check mark on the option Tools > Options > Print > Update
fields (in Word 2007, Office button > Word Options > Display > Update fields
before printing), then going to Print Preview and back will update the
fields. But it's just as easy to press Ctrl+A and then F9.
If you're looking for something that does... | You will need a macro for this.
You have an example of such a macro [**here**](http://techoflaw.blogspot.com/2009/03/motd-autoupdate-fields-on-save.html), used to update the "Save date" field. It will work with all fields in the document, and a Table Of Content is also a field so that should do the trick for you.
if ... |
9,619,222 | Ok - so I've made a little image gallery - basically when you click a thumbnail, it pulls in the title from the alt tag - puts it in a div to display below the image as the title, and displays the image as a fullscreen bg
What I'm trying to do is have this title display when the page loads - and when you click, remove... | 2012/03/08 | [
"https://Stackoverflow.com/questions/9619222",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/822671/"
] | The kind of disassembly that the author shows in the article is called `inter-leaved disassembly` ( C and disassembly interleaved ) which a few IDEs like Visual Studio support. Code Blocks does not support. But Code Blocks has a separate disassembly window like this
*.
This is no longer true. Newer versions of Code::Blocks have updated that feature.
Using Code::Block... |
57,358,192 | i have an json and i changed to array.
```
$asm1n = json_decode($asm_1);
print_r ($asm1n);
```
the result is
>
> Array ( [0] => 2 [1] => 3 )
>
>
>
my problem is how to change it value based static value :
if it, 1 change to orange, 2 change apple, 3 change mango automatically
currently the value is like thi... | 2019/08/05 | [
"https://Stackoverflow.com/questions/57358192",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3238836/"
] | Try this:
```
$asm1n = ["2", "3"];
$data = array();
foreach( $asm1n as $key => $value ) {
if ( "1" === $value ) {
$data[] = "orange";
} elseif ( "2" === $value ) {
$data[] = "apple";
} elseif ( "3" === $value ) {
$data[] = "mango";
}
}
print_r($data);
``` | You could loop through your array and change it accordingly.
```php
$fruits = [
1 => 'orange',
2 => 'apple',
3 => 'mango'
];
foreach($asm1n as &$value){
foreach($fruits as $key => $fruit){
if($value==$key){
$value = fruit;
}
}
}
``` |
57,358,192 | i have an json and i changed to array.
```
$asm1n = json_decode($asm_1);
print_r ($asm1n);
```
the result is
>
> Array ( [0] => 2 [1] => 3 )
>
>
>
my problem is how to change it value based static value :
if it, 1 change to orange, 2 change apple, 3 change mango automatically
currently the value is like thi... | 2019/08/05 | [
"https://Stackoverflow.com/questions/57358192",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3238836/"
] | Try this:
```
$asm1n = ["2", "3"];
$data = array();
foreach( $asm1n as $key => $value ) {
if ( "1" === $value ) {
$data[] = "orange";
} elseif ( "2" === $value ) {
$data[] = "apple";
} elseif ( "3" === $value ) {
$data[] = "mango";
}
}
print_r($data);
``` | You just need to ensure that you have the values and to use them to get your output
```
$myValues = [
1 => "orange",
2 => "apple",
3 => "mango"
];
$rawValues = json_decode($asm_1);
$asm1n = [];
foreach ($rawValues as $value) {
$asm1n[]=$myValues[$value];
}
print_r ($asm1n);
``` |
20,090,829 | Running a .feature file gives me the following error:
```
" >....< cucumber.cli.Main --format org.jetbrains.plugins.cucumber.java.run.CucumberJvmSMFormatter --monochrome --glue C:/projects/selenium-parent/selenium/src/test/resources/InformationPage.feature
Testing started at 09:20 ...
Exception in thread "main"... | 2013/11/20 | [
"https://Stackoverflow.com/questions/20090829",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/463833/"
] | This was due to me not having the latest cucumber-jvm plugin installed. | I had
```
Caused by: java.lang.ClassNotFoundException: org.jetbrains.plugins.cucumber.java.run.CucumberJvm3SMFormatter
```
I needed this in the pom
```
<dependency>
<groupId>info.cukes</groupId>
<artifactId>cucumber-java</artifactId>
<version>1.2.2</version>
</dependency>
<dependenc... |
14,215,591 | When outputting some UGC (`$user.text`) in a mako template, I'd like to sanitise the content using the mako filter 'h' and then add some `<br>` tags in place of newlines so there is a bit of formatting.
However, it appears that mako ignores the order that I apply the 'h' filter and now my `<br>` tags are being escaped... | 2013/01/08 | [
"https://Stackoverflow.com/questions/14215591",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1286705/"
] | The behaviour you're seeing is due to the fact that `Markup.replace` assumes that the replacement string is unsafe:
```
>>> from markupsafe import Markup, escape
>>> e = escape(">x\ny")
>>> e
Markup(u'>x\ny')
>>> e.replace("\n", "<br />")
Markup(u'>x<br />y')
```
The solution is to tell `markupsafe` tha... | I wasn't able to work out what's going on with the ordering above, so if you have the answer please post it here. Instead I used a workaround...
Since the `h` tag was firing too late in the filter order, I created my own version of it and forced it to return cleaned HTML by calling `__str__`.
```
def early_html_escap... |
20,086,199 | In my current application(A), I redirect user to a different website(B) where user logs in with his/her account and finishes some activity and now that website(B) has a button to return my application(A), the redirection happens by posting a `SAMLResponse`.
When user clicks that button, user return to my application(A... | 2013/11/20 | [
"https://Stackoverflow.com/questions/20086199",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/203018/"
] | The following links are helpful although they are not exactly what you want.
Do have a look.....
Regards
[1] <http://www.coderanch.com/t/545270/java/java/Decode-SAML-Request>
[2] [Consume SAMLResponse Token](https://stackoverflow.com/questions/6681083/consume-samlresponse-token)
[3] <http://goo.gl/iW1N9V> | The "form data" part is unclear, but you can print the source code of your desired url/form to the console like this:
```
import java.io.*;
import java.net.*;
public class Client {
public String getHTML(String urlToRead) {
URL url;
HttpURLConnection conn;
BufferedReader rd;
String line;
String result = ""... |
5,841,348 | I'm directing users to a page on my site from email (possibly an email client). When they reach the site they are presented with login screen and the address where they were headed is lost.
How can I capture the entire address that they were trying to visit, so that I can redirect them to it once they log in? | 2011/04/30 | [
"https://Stackoverflow.com/questions/5841348",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/732330/"
] | basically R5 ref class does not cache the method until it is necessary. This is probably a kind of delayed evaluation.
And the caching takes place when you access the method via `$`.
So, AFAIK, there is no way to access the method via [[string]]
But you can find a workaround using .dollarForEnvRefClass like this:
``... | Report as bug on r-devel so John Chambers can fix it. |
5,841,348 | I'm directing users to a page on my site from email (possibly an email client). When they reach the site they are presented with login screen and the address where they were headed is lost.
How can I capture the entire address that they were trying to visit, so that I can redirect them to it once they log in? | 2011/04/30 | [
"https://Stackoverflow.com/questions/5841348",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/732330/"
] | Here's a class
```
.A <-
setRefClass("A",
fields=list(x="numeric"),
methods=list(foo=function() x))
```
If I had an instance `a` and wanted to construct a call to the 'foo' method using '$' I could
```
eval(substitute(a$FUN(), list(FUN="foo")))
```
So I'll create a class `Alist... | basically R5 ref class does not cache the method until it is necessary. This is probably a kind of delayed evaluation.
And the caching takes place when you access the method via `$`.
So, AFAIK, there is no way to access the method via [[string]]
But you can find a workaround using .dollarForEnvRefClass like this:
``... |
5,841,348 | I'm directing users to a page on my site from email (possibly an email client). When they reach the site they are presented with login screen and the address where they were headed is lost.
How can I capture the entire address that they were trying to visit, so that I can redirect them to it once they log in? | 2011/04/30 | [
"https://Stackoverflow.com/questions/5841348",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/732330/"
] | Here's a class
```
.A <-
setRefClass("A",
fields=list(x="numeric"),
methods=list(foo=function() x))
```
If I had an instance `a` and wanted to construct a call to the 'foo' method using '$' I could
```
eval(substitute(a$FUN(), list(FUN="foo")))
```
So I'll create a class `Alist... | Report as bug on r-devel so John Chambers can fix it. |
65,061,497 | I've been trying to aggregate and count records based on an association between 3 associations in a clean manner.
Okay, to begin I have:
**AdminUser**
```
has_many :jobs
has_many :job_applications, through: :jobs
```
**JobApplications**
```
has_one :job_application_status_profile
```
**job\_application.rb**
`... | 2020/11/29 | [
"https://Stackoverflow.com/questions/65061497",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/7234259/"
] | To fix, change your app's `build.gradle` from the following:
```
com.google.gms.googleservices.GoogleServicesPlugin = true
```
To:
```
googleServices.disableVersionCheck = true
```
There's some further discussion here:
<https://github.com/google/play-services-plugins/issues/36> | Go to Android studio SDK Manager and update or install google play services.
<https://developer.android.com/studio/intro/update.html#sdk-manager> |
58,632 | I was wondering how many official "*Republics*" there are in the *Star Wars* universe?
One, two, three? I know about the **Old Republic** and the **New Republic** but I was wondering if there are any more.
Can the answerer please use the Star Wars movies or *Thrawn trilogy* (I am reading the first book now) as refere... | 2014/06/04 | [
"https://scifi.stackexchange.com/questions/58632",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/24140/"
] | If you only use movies or Thrawn Trilogy, there were only two:
* Old [Galactic Republic](http://starwars.wikia.com/wiki/Old_Republic) (~25,000 years BBY - 19BBY)
* [The New Republic](http://starwars.wikia.com/wiki/New_Republic) (post-Palpatine) (4ABY-27 ABY, though one may quibble that post-28ABY Alliance should be co... | Generally speaking, DVK's separation into the New and Old Republic are correct. However, one could also argue that there were *three* Republics. Ruusan Reformations carried out after the New Sith Wars (Darth Bane era) ushered in a new "phase" to what we call the Old Republic. In fact, Palpatine refers to it in Attack o... |
58,632 | I was wondering how many official "*Republics*" there are in the *Star Wars* universe?
One, two, three? I know about the **Old Republic** and the **New Republic** but I was wondering if there are any more.
Can the answerer please use the Star Wars movies or *Thrawn trilogy* (I am reading the first book now) as refere... | 2014/06/04 | [
"https://scifi.stackexchange.com/questions/58632",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/24140/"
] | If you only use movies or Thrawn Trilogy, there were only two:
* Old [Galactic Republic](http://starwars.wikia.com/wiki/Old_Republic) (~25,000 years BBY - 19BBY)
* [The New Republic](http://starwars.wikia.com/wiki/New_Republic) (post-Palpatine) (4ABY-27 ABY, though one may quibble that post-28ABY Alliance should be co... | For comprehension, I rather see it as Wikipedia does. "The Old Republic" ~25000 BBY, that formed into the "Galactic Republic" in 1032 BBY, [19BBY-4ABY was the Empires rise] and then the "New Republic" as it was reorganised in 4BBY and then destroyed again in 34BBY in The Force Awakens.
So, two. But people often speak o... |
58,632 | I was wondering how many official "*Republics*" there are in the *Star Wars* universe?
One, two, three? I know about the **Old Republic** and the **New Republic** but I was wondering if there are any more.
Can the answerer please use the Star Wars movies or *Thrawn trilogy* (I am reading the first book now) as refere... | 2014/06/04 | [
"https://scifi.stackexchange.com/questions/58632",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/24140/"
] | Generally speaking, DVK's separation into the New and Old Republic are correct. However, one could also argue that there were *three* Republics. Ruusan Reformations carried out after the New Sith Wars (Darth Bane era) ushered in a new "phase" to what we call the Old Republic. In fact, Palpatine refers to it in Attack o... | For comprehension, I rather see it as Wikipedia does. "The Old Republic" ~25000 BBY, that formed into the "Galactic Republic" in 1032 BBY, [19BBY-4ABY was the Empires rise] and then the "New Republic" as it was reorganised in 4BBY and then destroyed again in 34BBY in The Force Awakens.
So, two. But people often speak o... |
56,612,459 | I tried to install a postfix with a local mail config, but i have a problem with myhostname config
I need complete de install process
Running newaliases
newaliases: warning: valid\_hostname: misplaced delimiter: yasser..name
newaliases: fatal: file /etc/postfix/main.cf: parameter myhostname: bad parameter value: ya... | 2019/06/15 | [
"https://Stackoverflow.com/questions/56612459",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3821102/"
] | * Run `sudo nano /etc/postfix/main.cf`
* Find the line `hostname =`
* Change it:
**From:**
`myhostname = yasser..name`
**To:**
`myhostname = yasser.name` (ie. remove the extra dot)
Finally, run `sudo apt install --fix-broken`
Hope it helps. | Updating the /etc/postfix/main.cf fixes this issue. The statements here apply to Ubuntu 20.04. The statements below use a different editor and also include before/after statements to confirm & verify you've correctly edited the main.cf:
```
# run cat|grep statement below to see what we currently have for the value we ... |
66,875,598 | When I add this line off code, instead of showing the image, my page gets blank. How can I fix this?
```
<img>
src={"https://media1.s-nbcnews.com/i/newscms/2019_21/2870431/190524-classic-american-cheeseburger-ew-207p_d9270c5c545b30ea094084c7f2342eb4.jpg"} alt={''}
</img>
``` | 2021/03/30 | [
"https://Stackoverflow.com/questions/66875598",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12642588/"
] | It's correct that the overload will [default insert](https://en.cppreference.com/w/cpp/named_req/DefaultInsertable) elements.
But you have to keep on reading, as default insertion means that the values inserted will be [value initialized](https://en.cppreference.com/w/cpp/language/value_initialization), and value-init... | You can do this as it is shown in the demonstrative program below:
```
#include <iostream>
#include <array>
#include <vector>
int main()
{
std::vector<std::array<double,10>> v(10, { {} } );
for ( const auto &a : v )
{
for ( const auto &item : a )
{
std::cout << item << ' ';
... |
66,875,598 | When I add this line off code, instead of showing the image, my page gets blank. How can I fix this?
```
<img>
src={"https://media1.s-nbcnews.com/i/newscms/2019_21/2870431/190524-classic-american-cheeseburger-ew-207p_d9270c5c545b30ea094084c7f2342eb4.jpg"} alt={''}
</img>
``` | 2021/03/30 | [
"https://Stackoverflow.com/questions/66875598",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12642588/"
] | It's correct that the overload will [default insert](https://en.cppreference.com/w/cpp/named_req/DefaultInsertable) elements.
But you have to keep on reading, as default insertion means that the values inserted will be [value initialized](https://en.cppreference.com/w/cpp/language/value_initialization), and value-init... | To be sure that your arrays are zero-initialized, you can add a 1-element initializer list as a second argument to the `a` constructor call:
```cpp
std::vector<std::array<double, 10>> a(10, { 0.0, });
```
This will initialize *each* element (array) using that list, as it will be using constructor version #3 describe... |
66,875,598 | When I add this line off code, instead of showing the image, my page gets blank. How can I fix this?
```
<img>
src={"https://media1.s-nbcnews.com/i/newscms/2019_21/2870431/190524-classic-american-cheeseburger-ew-207p_d9270c5c545b30ea094084c7f2342eb4.jpg"} alt={''}
</img>
``` | 2021/03/30 | [
"https://Stackoverflow.com/questions/66875598",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12642588/"
] | To be sure that your arrays are zero-initialized, you can add a 1-element initializer list as a second argument to the `a` constructor call:
```cpp
std::vector<std::array<double, 10>> a(10, { 0.0, });
```
This will initialize *each* element (array) using that list, as it will be using constructor version #3 describe... | You can do this as it is shown in the demonstrative program below:
```
#include <iostream>
#include <array>
#include <vector>
int main()
{
std::vector<std::array<double,10>> v(10, { {} } );
for ( const auto &a : v )
{
for ( const auto &item : a )
{
std::cout << item << ' ';
... |
58,136 | I want to change the TODO state of a task automatically on a give date.
I would expect something like this:
```
* FUTU Some task that only becomes actionable of a given date
:PROPERTIES:
:ACTIONABLE: some-function(<timestamp>, TODO)
:END:
```
This block should automatically change the task to a TODO state once the d... | 2020/04/28 | [
"https://emacs.stackexchange.com/questions/58136",
"https://emacs.stackexchange.com",
"https://emacs.stackexchange.com/users/15782/"
] | Not a direct answer, but I would generally use scheduling (`org-schedule`, `C-c C-s`) combined with an agenda view for this sort of workflow. The default agenda view will not include any tasks scheduled for a future date. On that date the item will start to appear.
This provides a built in way to set the date when you... | I ended up writing a small functions for this purpose
```
(defun j/org-evaluate-if-actionable ()
"Returns t if the task at point is actionable or nil if it isn't"
(and (org-entry-get (point) "ACTIONABLE")
(string< (org-read-date nil nil (org-entry-get (point) "ACTIONABLE"))
(org-read-dat... |
3,697,127 | So I'm making a snake game with teleports and the usual mice. I had a loop running like this:
```
while(snake.alive() && miceEaten < micePerLevel)
{
displayInfo(lives, score, level, micePerLevel - miceEaten);
//some code
if(miceEaten())
{
//update score...
}
//more stuff...
}
```
The ... | 2010/09/12 | [
"https://Stackoverflow.com/questions/3697127",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/257583/"
] | Build your assignment operator like this:
You should always return \*this (even if they were equal). But they never would since you were creating a local copy (so this was not your error).
```
Location& Location::operator = (Location const& other)
{
// Does it really matter if you assign to self?
x = other.... | Have you checked your code that is causing this anomaly? The [Heisenbug](http://en.wikipedia.org/wiki/Unusual_software_bug#Heisenbug) phenomena quoted here:
>
> One common example is a bug that occurs in a program that was compiled with an optimizing compiler, but not in the same program when compiled without optimiz... |
3,697,127 | So I'm making a snake game with teleports and the usual mice. I had a loop running like this:
```
while(snake.alive() && miceEaten < micePerLevel)
{
displayInfo(lives, score, level, micePerLevel - miceEaten);
//some code
if(miceEaten())
{
//update score...
}
//more stuff...
}
```
The ... | 2010/09/12 | [
"https://Stackoverflow.com/questions/3697127",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/257583/"
] | Have you checked your code that is causing this anomaly? The [Heisenbug](http://en.wikipedia.org/wiki/Unusual_software_bug#Heisenbug) phenomena quoted here:
>
> One common example is a bug that occurs in a program that was compiled with an optimizing compiler, but not in the same program when compiled without optimiz... | First of all, your Location::operator= should be like this instead:
```
Location& Location::operator = (const Location &other)
{
if(this == &other)
return *this;
x = other.x;
y = other.y;
return *this;
}
```
However, that probably doesn't explain the crash. Bad pointers on stack here don't cr... |
3,697,127 | So I'm making a snake game with teleports and the usual mice. I had a loop running like this:
```
while(snake.alive() && miceEaten < micePerLevel)
{
displayInfo(lives, score, level, micePerLevel - miceEaten);
//some code
if(miceEaten())
{
//update score...
}
//more stuff...
}
```
The ... | 2010/09/12 | [
"https://Stackoverflow.com/questions/3697127",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/257583/"
] | Build your assignment operator like this:
You should always return \*this (even if they were equal). But they never would since you were creating a local copy (so this was not your error).
```
Location& Location::operator = (Location const& other)
{
// Does it really matter if you assign to self?
x = other.... | ```
Location& Location::operator = (Location other)
{
if(this == &other)
return other;
x = other.x;
y = other.y;
return *this;
}
```
This returns a reference. When the function returns, what happens to `other`? (It dies, and you're referring to nothing.) Since this is the class you're dealing ... |
3,697,127 | So I'm making a snake game with teleports and the usual mice. I had a loop running like this:
```
while(snake.alive() && miceEaten < micePerLevel)
{
displayInfo(lives, score, level, micePerLevel - miceEaten);
//some code
if(miceEaten())
{
//update score...
}
//more stuff...
}
```
The ... | 2010/09/12 | [
"https://Stackoverflow.com/questions/3697127",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/257583/"
] | ```
Location& Location::operator = (Location other)
{
if(this == &other)
return other;
x = other.x;
y = other.y;
return *this;
}
```
This returns a reference. When the function returns, what happens to `other`? (It dies, and you're referring to nothing.) Since this is the class you're dealing ... | First of all, your Location::operator= should be like this instead:
```
Location& Location::operator = (const Location &other)
{
if(this == &other)
return *this;
x = other.x;
y = other.y;
return *this;
}
```
However, that probably doesn't explain the crash. Bad pointers on stack here don't cr... |
3,697,127 | So I'm making a snake game with teleports and the usual mice. I had a loop running like this:
```
while(snake.alive() && miceEaten < micePerLevel)
{
displayInfo(lives, score, level, micePerLevel - miceEaten);
//some code
if(miceEaten())
{
//update score...
}
//more stuff...
}
```
The ... | 2010/09/12 | [
"https://Stackoverflow.com/questions/3697127",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/257583/"
] | Build your assignment operator like this:
You should always return \*this (even if they were equal). But they never would since you were creating a local copy (so this was not your error).
```
Location& Location::operator = (Location const& other)
{
// Does it really matter if you assign to self?
x = other.... | First of all, your Location::operator= should be like this instead:
```
Location& Location::operator = (const Location &other)
{
if(this == &other)
return *this;
x = other.x;
y = other.y;
return *this;
}
```
However, that probably doesn't explain the crash. Bad pointers on stack here don't cr... |
94,095 | I just ordered a cheap Comodo PositiveSSL Certificate via a UK reseller, and I was rather surprised to find that the following files were emailed to me automatically, in a zip file:
* Root CA Certificate - AddTrustExternalCARoot.crt
* Intermediate CA Certificate - COMODORSAAddTrustCA.crt
* Intermediate CA Certificate ... | 2015/07/16 | [
"https://security.stackexchange.com/questions/94095",
"https://security.stackexchange.com",
"https://security.stackexchange.com/users/81142/"
] | You are right assuming the certificate is useless without the private key, so sending it in the mail is no big security risk and is common practice actually. The certificate is supposed to be public, connecting to your website would also provide me with your certificate, so no need to hack your email there.
**edit**
... | Yes, what you are getting in the zip file is exactly what every visitor to your site would get every time they start a TLS session - the public keys with certifying information. The private key is the only thing that should be kept hidden from unauthorized access. |
1,738,362 | I have post the similar question before,but this time the problem is different,I got stuck with the following code..can anyone help with it?thanks in advance
I have fixed mu code as suggested,thanks
```
from numpy import *
#vs,fs,rs are all m*n matrixs,got initial values in,i.e vs[0],fs[0],rs[0] are known
#want use t... | 2009/11/15 | [
"https://Stackoverflow.com/questions/1738362",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/211037/"
] | Put your inizialization **outside** the loop! Right now, you're resetting the arrays to all zeros **each time through the loop**, over and over, which is absurd. You also appear to have a typo -- you set vs twice and rs never -- so I've tried to guess what you meant.
```
from numpy import *
#vs,fs,rs are all m*n matr... | You do not start looping where the comment indicates it, but at the `for i in range(5):` line. Everything in the indented block (the "body of the for-loop") is done repeatedly for each `i`. So setting `vs` and `fs` to zero is done repeatedly, each time deleting what was calculated before. These initializations should b... |
1,738,362 | I have post the similar question before,but this time the problem is different,I got stuck with the following code..can anyone help with it?thanks in advance
I have fixed mu code as suggested,thanks
```
from numpy import *
#vs,fs,rs are all m*n matrixs,got initial values in,i.e vs[0],fs[0],rs[0] are known
#want use t... | 2009/11/15 | [
"https://Stackoverflow.com/questions/1738362",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/211037/"
] | Put your inizialization **outside** the loop! Right now, you're resetting the arrays to all zeros **each time through the loop**, over and over, which is absurd. You also appear to have a typo -- you set vs twice and rs never -- so I've tried to guess what you meant.
```
from numpy import *
#vs,fs,rs are all m*n matr... | I don't know exactly what you want to print. If you want to print every matrix every time it is updated, then you're fine. But if you want to print the matrices after all the updates have been completed, then you should bring that print statement out of the for loop.
This and what Alex and sth have said should fix you... |
24,086,595 | I'm attempting to use Swift classes in my Objective-C code, however my Swift classes don't seem to appear in the generated header. As a result, my build fails with "Use of undeclared identifier 'HelloWorld'".
I used the templates to create a project called TestApp.
I have the following Build Settings in my target:
*... | 2014/06/06 | [
"https://Stackoverflow.com/questions/24086595",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/731745/"
] | It is proper to use `#import "TestAppModule-Swift.h"` in your .m files. If you need to reference a class in a .h, use the `@class` forward declaration.
Further, if you want to use a Swift class from Objective-C, the Swift class must be marked with the `@objc` attribute. Xcode will only include classes with that attrib... | In my case, by following Apple guidelines, it did not work until I ran the project. The xcode editor kept flagging the unknown swift class, until i clicked "run". The build succeeded, and the swift method worked. |
24,086,595 | I'm attempting to use Swift classes in my Objective-C code, however my Swift classes don't seem to appear in the generated header. As a result, my build fails with "Use of undeclared identifier 'HelloWorld'".
I used the templates to create a project called TestApp.
I have the following Build Settings in my target:
*... | 2014/06/06 | [
"https://Stackoverflow.com/questions/24086595",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/731745/"
] | A more convenient way would be to inherit from NSObject. Like so:
```
class HelloWorld: NSObject {
func hello() {
println("hello world")
}
}
``` | In my case, by following Apple guidelines, it did not work until I ran the project. The xcode editor kept flagging the unknown swift class, until i clicked "run". The build succeeded, and the swift method worked. |
24,086,595 | I'm attempting to use Swift classes in my Objective-C code, however my Swift classes don't seem to appear in the generated header. As a result, my build fails with "Use of undeclared identifier 'HelloWorld'".
I used the templates to create a project called TestApp.
I have the following Build Settings in my target:
*... | 2014/06/06 | [
"https://Stackoverflow.com/questions/24086595",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/731745/"
] | Here's how I have gotten it to work. You can see a more large-scale answer [here.](https://stackoverflow.com/questions/24002369/how-to-call-objective-c-code-from-swift/24005242#24005242)
Change this:
```
class HelloWorld {
func hello() {
println("hello world")
}
}
```
To:
```
@objc class HelloW... | **tl;dr** Ensure you have a bridging header if you're doing **any** cross-calling between Objective-C and Swift.
I had the exact same problem: I could see the -Swift.h file in DerivedData but it made no mention of my Swift classes. I was importing the header file correctly, the Defines Module setting was YES, and the ... |
24,086,595 | I'm attempting to use Swift classes in my Objective-C code, however my Swift classes don't seem to appear in the generated header. As a result, my build fails with "Use of undeclared identifier 'HelloWorld'".
I used the templates to create a project called TestApp.
I have the following Build Settings in my target:
*... | 2014/06/06 | [
"https://Stackoverflow.com/questions/24086595",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/731745/"
] | A more convenient way would be to inherit from NSObject. Like so:
```
class HelloWorld: NSObject {
func hello() {
println("hello world")
}
}
``` | Maybe you defined a Swift class with the same name as an existing Objective-C class which wouldn't be unusual if you want to refactor your Objective-C code to Swift.
**As long as you have a class defined simultaneously in Swift and Objective-C the compiler quietly stops updating the bridging header altogether (`"Produ... |
24,086,595 | I'm attempting to use Swift classes in my Objective-C code, however my Swift classes don't seem to appear in the generated header. As a result, my build fails with "Use of undeclared identifier 'HelloWorld'".
I used the templates to create a project called TestApp.
I have the following Build Settings in my target:
*... | 2014/06/06 | [
"https://Stackoverflow.com/questions/24086595",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/731745/"
] | Here's how I have gotten it to work. You can see a more large-scale answer [here.](https://stackoverflow.com/questions/24002369/how-to-call-objective-c-code-from-swift/24005242#24005242)
Change this:
```
class HelloWorld {
func hello() {
println("hello world")
}
}
```
To:
```
@objc class HelloW... | A more convenient way would be to inherit from NSObject. Like so:
```
class HelloWorld: NSObject {
func hello() {
println("hello world")
}
}
``` |
24,086,595 | I'm attempting to use Swift classes in my Objective-C code, however my Swift classes don't seem to appear in the generated header. As a result, my build fails with "Use of undeclared identifier 'HelloWorld'".
I used the templates to create a project called TestApp.
I have the following Build Settings in my target:
*... | 2014/06/06 | [
"https://Stackoverflow.com/questions/24086595",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/731745/"
] | Class should be declared as @objc **public** class | In my case the class was not being compiled, because I first added it to my test target only... After adding it to my main target (Build Phases -> Compile Sources), it was actual compiled and added to the header file.
So much for TDD ;-) |
24,086,595 | I'm attempting to use Swift classes in my Objective-C code, however my Swift classes don't seem to appear in the generated header. As a result, my build fails with "Use of undeclared identifier 'HelloWorld'".
I used the templates to create a project called TestApp.
I have the following Build Settings in my target:
*... | 2014/06/06 | [
"https://Stackoverflow.com/questions/24086595",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/731745/"
] | Here's how I have gotten it to work. You can see a more large-scale answer [here.](https://stackoverflow.com/questions/24002369/how-to-call-objective-c-code-from-swift/24005242#24005242)
Change this:
```
class HelloWorld {
func hello() {
println("hello world")
}
}
```
To:
```
@objc class HelloW... | Maybe you defined a Swift class with the same name as an existing Objective-C class which wouldn't be unusual if you want to refactor your Objective-C code to Swift.
**As long as you have a class defined simultaneously in Swift and Objective-C the compiler quietly stops updating the bridging header altogether (`"Produ... |
24,086,595 | I'm attempting to use Swift classes in my Objective-C code, however my Swift classes don't seem to appear in the generated header. As a result, my build fails with "Use of undeclared identifier 'HelloWorld'".
I used the templates to create a project called TestApp.
I have the following Build Settings in my target:
*... | 2014/06/06 | [
"https://Stackoverflow.com/questions/24086595",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/731745/"
] | **tl;dr** Ensure you have a bridging header if you're doing **any** cross-calling between Objective-C and Swift.
I had the exact same problem: I could see the -Swift.h file in DerivedData but it made no mention of my Swift classes. I was importing the header file correctly, the Defines Module setting was YES, and the ... | In my case, by following Apple guidelines, it did not work until I ran the project. The xcode editor kept flagging the unknown swift class, until i clicked "run". The build succeeded, and the swift method worked. |
24,086,595 | I'm attempting to use Swift classes in my Objective-C code, however my Swift classes don't seem to appear in the generated header. As a result, my build fails with "Use of undeclared identifier 'HelloWorld'".
I used the templates to create a project called TestApp.
I have the following Build Settings in my target:
*... | 2014/06/06 | [
"https://Stackoverflow.com/questions/24086595",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/731745/"
] | Class should be declared as @objc **public** class | A more convenient way would be to inherit from NSObject. Like so:
```
class HelloWorld: NSObject {
func hello() {
println("hello world")
}
}
``` |
24,086,595 | I'm attempting to use Swift classes in my Objective-C code, however my Swift classes don't seem to appear in the generated header. As a result, my build fails with "Use of undeclared identifier 'HelloWorld'".
I used the templates to create a project called TestApp.
I have the following Build Settings in my target:
*... | 2014/06/06 | [
"https://Stackoverflow.com/questions/24086595",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/731745/"
] | It is proper to use `#import "TestAppModule-Swift.h"` in your .m files. If you need to reference a class in a .h, use the `@class` forward declaration.
Further, if you want to use a Swift class from Objective-C, the Swift class must be marked with the `@objc` attribute. Xcode will only include classes with that attrib... | Class should be declared as @objc **public** class |
62,500,553 | This is a react project that uses an API to create a card which presents a Github users information. At the moment I am implementing a delete button on each card that would delete that specific card. You can try the application on code sandbox by [clicking here.](https://codesandbox.io/s/github-app-7cpur?file=/src/inde... | 2020/06/21 | [
"https://Stackoverflow.com/questions/62500553",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13512664/"
] | There are a missing bracket in your code
```
def diameter(self):
volume = pi * (self.radius ** 2) * self.height
return 2 * sqrt(self.volume / (pi * self.height)
# ^ ^ ^ ^
# | open 2 close 2 |
# open ... | This is a simple mistake, in your `diameter` function the last line is missing a bracket, see `return 2 * sqrt(self.volume / (pi * self.height)`, should be this `return 2 * sqrt(self.volume / (pi * self.height))`.
Notice the second bracket at the end. |
62,500,553 | This is a react project that uses an API to create a card which presents a Github users information. At the moment I am implementing a delete button on each card that would delete that specific card. You can try the application on code sandbox by [clicking here.](https://codesandbox.io/s/github-app-7cpur?file=/src/inde... | 2020/06/21 | [
"https://Stackoverflow.com/questions/62500553",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13512664/"
] | There are a missing bracket in your code
```
def diameter(self):
volume = pi * (self.radius ** 2) * self.height
return 2 * sqrt(self.volume / (pi * self.height)
# ^ ^ ^ ^
# | open 2 close 2 |
# open ... | You forgot a closing bracket here at line 11
```
return 2 * sqrt(self.volume / (pi * self.height)
``` |
62,500,553 | This is a react project that uses an API to create a card which presents a Github users information. At the moment I am implementing a delete button on each card that would delete that specific card. You can try the application on code sandbox by [clicking here.](https://codesandbox.io/s/github-app-7cpur?file=/src/inde... | 2020/06/21 | [
"https://Stackoverflow.com/questions/62500553",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13512664/"
] | There are a missing bracket in your code
```
def diameter(self):
volume = pi * (self.radius ** 2) * self.height
return 2 * sqrt(self.volume / (pi * self.height)
# ^ ^ ^ ^
# | open 2 close 2 |
# open ... | class cylinder:
```
pi = 3.14
def __init__(self, height, radius):
self.radius = radius
self.height = height
def volume(self):
volume = self.height*3.14*self.radius**2
print('Volume of the cylinder is {}'. format(volume))
def surface_area(self):
area = 2*3.14*(self.radius)*(self.height)
print... |
62,500,553 | This is a react project that uses an API to create a card which presents a Github users information. At the moment I am implementing a delete button on each card that would delete that specific card. You can try the application on code sandbox by [clicking here.](https://codesandbox.io/s/github-app-7cpur?file=/src/inde... | 2020/06/21 | [
"https://Stackoverflow.com/questions/62500553",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13512664/"
] | This is a simple mistake, in your `diameter` function the last line is missing a bracket, see `return 2 * sqrt(self.volume / (pi * self.height)`, should be this `return 2 * sqrt(self.volume / (pi * self.height))`.
Notice the second bracket at the end. | You forgot a closing bracket here at line 11
```
return 2 * sqrt(self.volume / (pi * self.height)
``` |
62,500,553 | This is a react project that uses an API to create a card which presents a Github users information. At the moment I am implementing a delete button on each card that would delete that specific card. You can try the application on code sandbox by [clicking here.](https://codesandbox.io/s/github-app-7cpur?file=/src/inde... | 2020/06/21 | [
"https://Stackoverflow.com/questions/62500553",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13512664/"
] | This is a simple mistake, in your `diameter` function the last line is missing a bracket, see `return 2 * sqrt(self.volume / (pi * self.height)`, should be this `return 2 * sqrt(self.volume / (pi * self.height))`.
Notice the second bracket at the end. | class cylinder:
```
pi = 3.14
def __init__(self, height, radius):
self.radius = radius
self.height = height
def volume(self):
volume = self.height*3.14*self.radius**2
print('Volume of the cylinder is {}'. format(volume))
def surface_area(self):
area = 2*3.14*(self.radius)*(self.height)
print... |
62,500,553 | This is a react project that uses an API to create a card which presents a Github users information. At the moment I am implementing a delete button on each card that would delete that specific card. You can try the application on code sandbox by [clicking here.](https://codesandbox.io/s/github-app-7cpur?file=/src/inde... | 2020/06/21 | [
"https://Stackoverflow.com/questions/62500553",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13512664/"
] | You forgot a closing bracket here at line 11
```
return 2 * sqrt(self.volume / (pi * self.height)
``` | class cylinder:
```
pi = 3.14
def __init__(self, height, radius):
self.radius = radius
self.height = height
def volume(self):
volume = self.height*3.14*self.radius**2
print('Volume of the cylinder is {}'. format(volume))
def surface_area(self):
area = 2*3.14*(self.radius)*(self.height)
print... |
53,698 | During wintertime it is often cold enough in my apartment that proofing takes much longer than in summer. I'd like to use my oven to create a warmer environment, in which the dough would rise faster. I can go 30-50 degrees celsius, the question is what temperature is safe and at what temperature will I actually start b... | 2015/01/16 | [
"https://cooking.stackexchange.com/questions/53698",
"https://cooking.stackexchange.com",
"https://cooking.stackexchange.com/users/2217/"
] | Let me suggest a totally different approach:
Why not work **with** the cool conditions instead of against?
* You could let the dough proof for a long time, e.g. overnight in the fridge. This allows for a lot less yeast and hence a less *yeasty* taste, which is usually desired. Also, more complex flavors develop duri... | A commonly quoted temperature to never exceed with warm ingredients or proofing environments is 43°C. If using an oven, cover your dough container, check oven with a thermometer beforehand, and be aware of radiated heat effects from the elements themselves. |
53,698 | During wintertime it is often cold enough in my apartment that proofing takes much longer than in summer. I'd like to use my oven to create a warmer environment, in which the dough would rise faster. I can go 30-50 degrees celsius, the question is what temperature is safe and at what temperature will I actually start b... | 2015/01/16 | [
"https://cooking.stackexchange.com/questions/53698",
"https://cooking.stackexchange.com",
"https://cooking.stackexchange.com/users/2217/"
] | Rise from chilled @ 32C and keep rising until around 80-85% of desired height has been achieved.
Return back to the chiller, it will continue to rise for a short time, keep in the chiller until dough is firm again and stable enough to take the weight of toppings. | I've done this a few times, kinda - we have a baking stone, and I'll preheat that, make sure it's cool enough to touch, and set the dough on the warmed stone.
It works pretty well to give a warm environment, the warmth lasts because the closed oven contains heat, and there's little to no risk of overheating the yeast... |
53,698 | During wintertime it is often cold enough in my apartment that proofing takes much longer than in summer. I'd like to use my oven to create a warmer environment, in which the dough would rise faster. I can go 30-50 degrees celsius, the question is what temperature is safe and at what temperature will I actually start b... | 2015/01/16 | [
"https://cooking.stackexchange.com/questions/53698",
"https://cooking.stackexchange.com",
"https://cooking.stackexchange.com/users/2217/"
] | Let me suggest a totally different approach:
Why not work **with** the cool conditions instead of against?
* You could let the dough proof for a long time, e.g. overnight in the fridge. This allows for a lot less yeast and hence a less *yeasty* taste, which is usually desired. Also, more complex flavors develop duri... | Rise from chilled @ 32C and keep rising until around 80-85% of desired height has been achieved.
Return back to the chiller, it will continue to rise for a short time, keep in the chiller until dough is firm again and stable enough to take the weight of toppings. |
53,698 | During wintertime it is often cold enough in my apartment that proofing takes much longer than in summer. I'd like to use my oven to create a warmer environment, in which the dough would rise faster. I can go 30-50 degrees celsius, the question is what temperature is safe and at what temperature will I actually start b... | 2015/01/16 | [
"https://cooking.stackexchange.com/questions/53698",
"https://cooking.stackexchange.com",
"https://cooking.stackexchange.com/users/2217/"
] | Let me suggest a totally different approach:
Why not work **with** the cool conditions instead of against?
* You could let the dough proof for a long time, e.g. overnight in the fridge. This allows for a lot less yeast and hence a less *yeasty* taste, which is usually desired. Also, more complex flavors develop duri... | I've done this a few times, kinda - we have a baking stone, and I'll preheat that, make sure it's cool enough to touch, and set the dough on the warmed stone.
It works pretty well to give a warm environment, the warmth lasts because the closed oven contains heat, and there's little to no risk of overheating the yeast... |
53,698 | During wintertime it is often cold enough in my apartment that proofing takes much longer than in summer. I'd like to use my oven to create a warmer environment, in which the dough would rise faster. I can go 30-50 degrees celsius, the question is what temperature is safe and at what temperature will I actually start b... | 2015/01/16 | [
"https://cooking.stackexchange.com/questions/53698",
"https://cooking.stackexchange.com",
"https://cooking.stackexchange.com/users/2217/"
] | 50C (122F) would be a very high proofing temperature. The thermal death point of yeast is 55C, and you'll definitely hit a point of diminishing returns if you get too hot (most likely, you will have really rapid proofing on the outside of the loaf and an underproofed "core").
I would recommend setting your oven to th... | I've done this a few times, kinda - we have a baking stone, and I'll preheat that, make sure it's cool enough to touch, and set the dough on the warmed stone.
It works pretty well to give a warm environment, the warmth lasts because the closed oven contains heat, and there's little to no risk of overheating the yeast... |
53,698 | During wintertime it is often cold enough in my apartment that proofing takes much longer than in summer. I'd like to use my oven to create a warmer environment, in which the dough would rise faster. I can go 30-50 degrees celsius, the question is what temperature is safe and at what temperature will I actually start b... | 2015/01/16 | [
"https://cooking.stackexchange.com/questions/53698",
"https://cooking.stackexchange.com",
"https://cooking.stackexchange.com/users/2217/"
] | In the winter, I usually get fine results proofing in a bowl with a second bowl inverted on top of it, and then putting the whole thing in the oven, turned off, and just the light on. The light bulb usually produces enough heat to keep the inside of my oven at about 90˚F (32˚C?), and that gives me a good rise. | I use the pull-out warming tray on my oven set on its lowest temperature. I've never actually checked the temperature, but its rather cool. I can easily touch the bottom of the drawer without any discomfort. |
53,698 | During wintertime it is often cold enough in my apartment that proofing takes much longer than in summer. I'd like to use my oven to create a warmer environment, in which the dough would rise faster. I can go 30-50 degrees celsius, the question is what temperature is safe and at what temperature will I actually start b... | 2015/01/16 | [
"https://cooking.stackexchange.com/questions/53698",
"https://cooking.stackexchange.com",
"https://cooking.stackexchange.com/users/2217/"
] | Let me suggest a totally different approach:
Why not work **with** the cool conditions instead of against?
* You could let the dough proof for a long time, e.g. overnight in the fridge. This allows for a lot less yeast and hence a less *yeasty* taste, which is usually desired. Also, more complex flavors develop duri... | I use the pull-out warming tray on my oven set on its lowest temperature. I've never actually checked the temperature, but its rather cool. I can easily touch the bottom of the drawer without any discomfort. |
53,698 | During wintertime it is often cold enough in my apartment that proofing takes much longer than in summer. I'd like to use my oven to create a warmer environment, in which the dough would rise faster. I can go 30-50 degrees celsius, the question is what temperature is safe and at what temperature will I actually start b... | 2015/01/16 | [
"https://cooking.stackexchange.com/questions/53698",
"https://cooking.stackexchange.com",
"https://cooking.stackexchange.com/users/2217/"
] | Rise from chilled @ 32C and keep rising until around 80-85% of desired height has been achieved.
Return back to the chiller, it will continue to rise for a short time, keep in the chiller until dough is firm again and stable enough to take the weight of toppings. | I use the pull-out warming tray on my oven set on its lowest temperature. I've never actually checked the temperature, but its rather cool. I can easily touch the bottom of the drawer without any discomfort. |
53,698 | During wintertime it is often cold enough in my apartment that proofing takes much longer than in summer. I'd like to use my oven to create a warmer environment, in which the dough would rise faster. I can go 30-50 degrees celsius, the question is what temperature is safe and at what temperature will I actually start b... | 2015/01/16 | [
"https://cooking.stackexchange.com/questions/53698",
"https://cooking.stackexchange.com",
"https://cooking.stackexchange.com/users/2217/"
] | 50C (122F) would be a very high proofing temperature. The thermal death point of yeast is 55C, and you'll definitely hit a point of diminishing returns if you get too hot (most likely, you will have really rapid proofing on the outside of the loaf and an underproofed "core").
I would recommend setting your oven to th... | Rise from chilled @ 32C and keep rising until around 80-85% of desired height has been achieved.
Return back to the chiller, it will continue to rise for a short time, keep in the chiller until dough is firm again and stable enough to take the weight of toppings. |
53,698 | During wintertime it is often cold enough in my apartment that proofing takes much longer than in summer. I'd like to use my oven to create a warmer environment, in which the dough would rise faster. I can go 30-50 degrees celsius, the question is what temperature is safe and at what temperature will I actually start b... | 2015/01/16 | [
"https://cooking.stackexchange.com/questions/53698",
"https://cooking.stackexchange.com",
"https://cooking.stackexchange.com/users/2217/"
] | A commonly quoted temperature to never exceed with warm ingredients or proofing environments is 43°C. If using an oven, cover your dough container, check oven with a thermometer beforehand, and be aware of radiated heat effects from the elements themselves. | I use the pull-out warming tray on my oven set on its lowest temperature. I've never actually checked the temperature, but its rather cool. I can easily touch the bottom of the drawer without any discomfort. |
73,201,540 | I have a complex design, I don't know what to do with flutter, is there any help on how to implement this design?
[](https://i.stack.imgur.com/Qy7mX.png) | 2022/08/02 | [
"https://Stackoverflow.com/questions/73201540",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16962967/"
] | Usually to create complex designs I prefer using [Flutter Shape Maker](https://fluttershapemaker.com/).
All you need is to upload your svg picture and it will convert it to CustomPaint code in flutter. Perhaps this may help you. | ```
You can take two container in Stack Widget
and implement customPaint
```
[customPaint](https://stackoverflow.com/questions/66994068/flutter-draw-a-circle-border-with-3-multiple-colors-and-values) |
73,201,540 | I have a complex design, I don't know what to do with flutter, is there any help on how to implement this design?
[](https://i.stack.imgur.com/Qy7mX.png) | 2022/08/02 | [
"https://Stackoverflow.com/questions/73201540",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16962967/"
] | Usually to create complex designs I prefer using [Flutter Shape Maker](https://fluttershapemaker.com/).
All you need is to upload your svg picture and it will convert it to CustomPaint code in flutter. Perhaps this may help you. | You can try packges from pub.dev for this and you can customise as you need in app this designs.
[syncfusion\_flutter-chart](https://pub.dev/packages/syncfusion_flutter_charts)
Try above package for your requirements |
73,201,540 | I have a complex design, I don't know what to do with flutter, is there any help on how to implement this design?
[](https://i.stack.imgur.com/Qy7mX.png) | 2022/08/02 | [
"https://Stackoverflow.com/questions/73201540",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16962967/"
] | ```
You can take two container in Stack Widget
and implement customPaint
```
[customPaint](https://stackoverflow.com/questions/66994068/flutter-draw-a-circle-border-with-3-multiple-colors-and-values) | You can try packges from pub.dev for this and you can customise as you need in app this designs.
[syncfusion\_flutter-chart](https://pub.dev/packages/syncfusion_flutter_charts)
Try above package for your requirements |
73,201,540 | I have a complex design, I don't know what to do with flutter, is there any help on how to implement this design?
[](https://i.stack.imgur.com/Qy7mX.png) | 2022/08/02 | [
"https://Stackoverflow.com/questions/73201540",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16962967/"
] | I have tried to achieve a shape and the center painter here. Few things, I am able to achieve but for complete part, I think you need to use pie chart <https://pub.dev/packages/syncfusion_flutter_charts> specially Doughnut type.
Please check my sample as below:
This painter is used to prepare the pie.
```
class Whee... | ```
You can take two container in Stack Widget
and implement customPaint
```
[customPaint](https://stackoverflow.com/questions/66994068/flutter-draw-a-circle-border-with-3-multiple-colors-and-values) |
73,201,540 | I have a complex design, I don't know what to do with flutter, is there any help on how to implement this design?
[](https://i.stack.imgur.com/Qy7mX.png) | 2022/08/02 | [
"https://Stackoverflow.com/questions/73201540",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/16962967/"
] | I have tried to achieve a shape and the center painter here. Few things, I am able to achieve but for complete part, I think you need to use pie chart <https://pub.dev/packages/syncfusion_flutter_charts> specially Doughnut type.
Please check my sample as below:
This painter is used to prepare the pie.
```
class Whee... | You can try packges from pub.dev for this and you can customise as you need in app this designs.
[syncfusion\_flutter-chart](https://pub.dev/packages/syncfusion_flutter_charts)
Try above package for your requirements |
37,239,854 | So I have a plot that prints decimals instead of a date on the x axis. I have done the research on stackoverflow and have read that matplotlib does not handle datetime64 at all without codeing around it. I can't seem to find out why? Please note I am NOT asking how to fix it but WHY the problem exists, I know there is ... | 2016/05/15 | [
"https://Stackoverflow.com/questions/37239854",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3566313/"
] | Some of the reasons I read about were due to the difficulty and time implied in implementing this feature in some way that remains stable. The proposal is old (at least since 2012) as you can see [here](https://github.com/matplotlib/matplotlib/issues/1097).
Several workarounds have been proposed and you'll find exampl... | As of Matplotlib >= 2.2.2 (possibly lower versions as well), `numpy.datetime64` can directly be plotted.
The following produces the desired output
```
import numpy as np
import matplotlib.pyplot as plt
x = np.arange('2014-01-01', '2014-01-07', np.timedelta64(1, 'D'), dtype='datetime64[D]')
y = np.random.rand(len(x))... |
39,693,597 | How to set `Use Lambda Proxy integration` in swagger for API-Gateway?
My current swagger is bellow but I would really like to setup the proxy integration. I would let me simplify a lot of things, not to mention I could remove the `requestTemplates` and `responses` blocks from the swagger definition.
I am attempting t... | 2016/09/26 | [
"https://Stackoverflow.com/questions/39693597",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/308079/"
] | For Lambda Proxy integration, the required fields are
```
x-amazon-apigateway-integration:
type: aws_proxy
httpMethod: <method>
uri: <function_uri>
credentials: <optional_creds>
```
edit: typo
edit2: fixed type
edit3: add httpMethod | Please see this [blog post](https://rpgreen.wordpress.com/2016/09/26/bare-bones-swagger-example-for-api-gateway-simplified-proxy-features/) for a complete example of the 3 new features (greedy path, ANY method, proxy integration) for both HTTP and Lambda proxies:
```
---
swagger: "2.0"
info:
version: "2016-09-23T22:... |
39,693,597 | How to set `Use Lambda Proxy integration` in swagger for API-Gateway?
My current swagger is bellow but I would really like to setup the proxy integration. I would let me simplify a lot of things, not to mention I could remove the `requestTemplates` and `responses` blocks from the swagger definition.
I am attempting t... | 2016/09/26 | [
"https://Stackoverflow.com/questions/39693597",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/308079/"
] | For Lambda Proxy integration, the required fields are
```
x-amazon-apigateway-integration:
type: aws_proxy
httpMethod: <method>
uri: <function_uri>
credentials: <optional_creds>
```
edit: typo
edit2: fixed type
edit3: add httpMethod | ```
x-amazon-apigateway-integration:
type: aws_proxy
uri: "arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:<USER_ACCOUNT_ID>:function:<LAMBDA_FUNCTION_NAME>/invocations"
httpMethod: POST
credentials: "arn:aws:iam::<USER_ACCOUNT_ID>:role/<ROLE_NAME>"
passthrough... |
39,693,597 | How to set `Use Lambda Proxy integration` in swagger for API-Gateway?
My current swagger is bellow but I would really like to setup the proxy integration. I would let me simplify a lot of things, not to mention I could remove the `requestTemplates` and `responses` blocks from the swagger definition.
I am attempting t... | 2016/09/26 | [
"https://Stackoverflow.com/questions/39693597",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/308079/"
] | Please see this [blog post](https://rpgreen.wordpress.com/2016/09/26/bare-bones-swagger-example-for-api-gateway-simplified-proxy-features/) for a complete example of the 3 new features (greedy path, ANY method, proxy integration) for both HTTP and Lambda proxies:
```
---
swagger: "2.0"
info:
version: "2016-09-23T22:... | ```
x-amazon-apigateway-integration:
type: aws_proxy
uri: "arn:aws:apigateway:us-west-2:lambda:path/2015-03-31/functions/arn:aws:lambda:us-west-2:<USER_ACCOUNT_ID>:function:<LAMBDA_FUNCTION_NAME>/invocations"
httpMethod: POST
credentials: "arn:aws:iam::<USER_ACCOUNT_ID>:role/<ROLE_NAME>"
passthrough... |
20,539,387 | I'm trying to fetch geo index in pymongo and asyncmongo using `$near` options. But it's always returning wrong **nearby locations**. Could anyone help me to sort out the problem.
```
self.application.db.citydetails.find({"loc":{"$near":(latitude, longitude)}}, limit=20, callback=self.loadMoreSearchResponse)
``` | 2013/12/12 | [
"https://Stackoverflow.com/questions/20539387",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1866077/"
] | First, ensure your `citydetails.loc` data is stored as a GeoJSON point:
```
{loc: {type: "Point", coordinates: [ longitude, latitude ]}}
```
Please note that when saving geo spatial points, longitude must be placed at the 0 index in the `coordinates` array.
Then, change your code placing longitude before latitude i... | I didn't realize, am kind of fool here. As soon as i get the `POST` arguments, am trying to pass it in query like
```
coordinates = self.get_argument("coordinates", "")
latitude = coordinates.split("_")[0]
longitude = coordinates.split("_")[1]
self.application.db.cityinfo.find({"loc":{"$near":(longitude, latitude)}}, ... |
955,759 | Ok, I have a 64 GB SSD, and I tried to clean install the Linux on it.
But the problem is, the installation menu shows two disks: one 500 GB and another with available space of 32 GB. I tried advanced options with partitions, but nothing changed. So I installed the OS on 500 GB one, and tried to clean-safe erase the /... | 2017/09/14 | [
"https://askubuntu.com/questions/955759",
"https://askubuntu.com",
"https://askubuntu.com/users/736745/"
] | Summary concerning the size of the SSD
--------------------------------------
lsblk (size in GiB):
```
NAME SIZE OWNER GROUP MODE
sdb 29,8G root disk brw-rw----
└─sdb1 29,8G root disk brw-rw----
```
parted (size in GB):
```
Model: ATA SanDisk SSD i100 (scsi)
Disk /dev/sdb: 32,0GB
```
Both of these t... | SOLVED.
thank you again for you answers. Well the vendor is a friend of mine and when i ran on this pc hwinfo, when it had windows installed, i remember that the size was near 64. it's time i went to my vendor 'friend'. |
57,522,240 | I'm trying to set up a workflow where I'd like to work with the `Chrome DevTools` Inspector to save my `CSS` changes directly to my `.vue` file.
The `DevTools Workspaces` can do the job, but it requires a save and the automatic reload. Or I have to copy the changes from the `Inspector` to the `Sources Panel`. I'd like... | 2019/08/16 | [
"https://Stackoverflow.com/questions/57522240",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2078539/"
] | To `vue.conig.js` add:
```
css: { sourceMap: true },
```
This will enable css sourcemaps. Then just add your Vue project folder to Devtools Workspaces and you're good to go.
Keep in mind, there's a bug in Devtools: it won't link **unicode** files via workspaces, i.e. if you have any characters that are not US-A... | just make changes in .vue file at once, check in devtools if needed, and return to write in .vue file out of hand.
BTW, vue serve works GREAT! |
24,164,439 | Is there a way to know the exact type of a column in a `DataTable`? Right now I am doing this:
```
DataTable st = dataReader.GetSchemaTable();
foreach (DataColumn col in st.Columns)
{
var type = col.DataType;
}
```
Now with `type.Name` I am able to find if it is a number(`int` or `decimal`..) or `string` but the ... | 2014/06/11 | [
"https://Stackoverflow.com/questions/24164439",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2745909/"
] | You can use `NumericPrecision` and `NumericScale`:
```
using (var con = new SqlConnection(Properties.Settings.Default.MyConnectionString))
using (var cmd = new SqlCommand("SELECT * FROM dbo.Test", con))
{
con.Open();
using (var reader = cmd.ExecuteReader())
using (var schemaTable = reader.GetSchemaTable())... | The DataTable returned by dataReader.GetSchemaTable() is the schema of the underlying result. This table contains, those many records as many columns in the underlying table. So you need to loop through the rows. Each row contains the metadata of the single column of the underlying table. You can get the metadata of th... |
30,908,273 | I have two image button is disable, I wish to enable it when there is a file in fileupload control. I search through the online resources they will have a button. But how can I do it when user selected a file and both image button will be prompt?
you answer and comment will be appreaciated.
code below is javascript c... | 2015/06/18 | [
"https://Stackoverflow.com/questions/30908273",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4817293/"
] | If the element your want to get an element to is linked to an id
```
$('#' + $xDate).val();
```
or, if it's a class
```
$('.' + $xDate).val();
``` | your supposed to pass javascript variable to jquery as
```
$('#' + $xDate).val();
``` |
30,908,273 | I have two image button is disable, I wish to enable it when there is a file in fileupload control. I search through the online resources they will have a button. But how can I do it when user selected a file and both image button will be prompt?
you answer and comment will be appreaciated.
code below is javascript c... | 2015/06/18 | [
"https://Stackoverflow.com/questions/30908273",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4817293/"
] | You can try something like this.
```
<input class='inputtext' type='text'id="$xDate"/>
<input class='inputButton' type='button' onclick="submit_data('$xDate')"/>
function submit_data(mode){
var txtName = $('#'+mode).val();
}
``` | your supposed to pass javascript variable to jquery as
```
$('#' + $xDate).val();
``` |
2,647,397 | So I want to calculate the Laurent series of this function
$$ f: \mathbb{C} \to \mathbb{C}, \quad f(z) = \frac{1}{z^{2}+1}.$$
The Laurent series has to be in this form:
$$\sum\_{n=- \infty }^{ \infty } a\_{n} (z-i)^n$$
for a circular disc
$$ 0<| z-i|<p,$$
where $p$ has to be found.
With partial fraction expans... | 2018/02/12 | [
"https://math.stackexchange.com/questions/2647397",
"https://math.stackexchange.com",
"https://math.stackexchange.com/users/426245/"
] | In my opinion it is easier without partial fraction decomposition: let $z=w+i$ then for $0<|w|<2$
$$f(z) = \frac{1}{z^{2}+1}=\frac{1}{w(w+2i)}=\frac{1}{2iw(1-iw/2)}=-\frac{i}{2w}\sum\_{k=0}^{\infty}(iw/2)^k.$$
Hence the Laurent expansion of $f$ in $0<|z-i|<2$ is
$$f(z)=-\frac{i}{2(z-i)}+\sum\_{k=0}^{\infty}\frac{i^{k}(... | **Note:** Despite the question at the end regarding *how to continue* note that already all calculations were done in order to solve the problem.
>
> The function
> \begin{align\*}
> f: \mathbb{C} \to \mathbb{C}, \quad f(z) &= \frac{1}{z^{2}+1}\\
> &=\frac{i}{2}\left( \frac{1}{z+i} - \frac{1}{z-i}\right)\tag{1}
> \e... |
83 | I only use my table saw and circular saw, both with ripping blades, a few times a year. How can I tell when it's time to replace them?
I imagine I'm not going to lose them to wear, but then again, maybe I've hit an occasional nail. I don't know whether storage and rust cause degradation or if any rust is superficial a... | 2015/03/17 | [
"https://woodworking.stackexchange.com/questions/83",
"https://woodworking.stackexchange.com",
"https://woodworking.stackexchange.com/users/94/"
] | Your blade will start to show signs of dullness. These include:
* Binding
* Excessive force required to advance cut
* Excessive tearing/chipout
* Burning the wood
It helps if you can remember the "feel" of cutting with a sharp blade to help recognize these signs. One of them alone may be a result of improper techniqu... | Sometimes when people believe their saw is dull, what it really needs is a cleaning. The resins from the wood build up in the teeth over time and gum up the cutting edge. Soaking the blade in simple green or another cleaner of choice and then scrubbing the teeth with an old toothbrush can prolong cutting life. |
1,451,678 | I am building an application that that will allow people to post information in different areas of a city (for about 10 cities). Do you guys know of any existing (normalized) databases/datasets that have this kind of information? Or would I need to create one from scratch? Any pointers suggestions very much appreciated... | 2009/09/20 | [
"https://Stackoverflow.com/questions/1451678",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/176217/"
] | Normalization in this case is somewhat problematic because the atomicity requirement specifies that a single attribute stores a single value of a given domain, and so things get pretty fuzzy here when looking at coordinate systems. There are a few options. Each of these is perfectly normalized.
**Separate Points Table... | You could save it as two integers longitude and latitude (i think, if my geography is correct) |
16,780,149 | I am looking for a way to convert [Markdown](http://en.wikipedia.org/wiki/Markdown) to HTML and back, more out of interest than real need. I am aware of the loss of information on such a conversion.
I hope for an [html2text.pl](http://search.cpan.org/perldoc?html2text.pl) like conversion. If there is no such utility i... | 2013/05/27 | [
"https://Stackoverflow.com/questions/16780149",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/367180/"
] | [HTML::WikiConverter::Markdown](http://search.cpan.org/perldoc?HTML%3a%3aWikiConverter%3a%3aMarkdown) seems up to the task. | There you go: [Pandoc](http://johnmacfarlane.net/pandoc/README.html) can convert almost anything to anything. Sorry, no perl though. |
54,651,972 | I have a Spring Boot application build on Maven. I'm using Spring profiles to distinguish environment-specific configuration. I would like to prevent running tests when a specific Spring profile is active. Reason: I would like to prevent running tests with production properties (`spring.profiles.active=prod`). I would ... | 2019/02/12 | [
"https://Stackoverflow.com/questions/54651972",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4086321/"
] | ```
<profiles>
<profile>
<id>prod</id>
<properties>
<maven.test.skip>true</maven.test.skip>
</properties>
</profile>
</profiles>
``` | You can use `@IfProfileValue` annotation. But you have to add some values to your active profile and read it with mentioned annotation. You can read more here (section 3.4.3): <https://docs.spring.io/spring/docs/current/spring-framework-reference/testing.html#integration-testing>
EDIT:
Another solution is to exclude a... |
50,385,109 | Very first question here so I apologize for any mistakes and imperfections.
Basically there are three files, my main method tech\_supportv1, login\_controller containing a class used to store a bunch of methods, and login.java, a javabean.
The point is to check if a certain row exists on the tech\_support database. To... | 2018/05/17 | [
"https://Stackoverflow.com/questions/50385109",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9804281/"
] | What you want is not quite possible. When you call `wheelRepository.delete(wheel)` you essentially ask to remove the wheel from the database. But this cannot remove an instance `wheel` from all other places in your running application where this instance is now referenced. Such as `car.wheels`. So this instance will co... | You can define your `wheels` field like this:
```
@OneToMany(mappedBy = "wheel", fetch = FetchType.LAZY, cascade = CascadeType.ALL, orphanRemoval = true)
Set<Wheel> wheels;
```
This will ensure that when you remove the `Wheel` entity the `Car` entities that became orphans because of it will get removed as well. |
50,385,109 | Very first question here so I apologize for any mistakes and imperfections.
Basically there are three files, my main method tech\_supportv1, login\_controller containing a class used to store a bunch of methods, and login.java, a javabean.
The point is to check if a certain row exists on the tech\_support database. To... | 2018/05/17 | [
"https://Stackoverflow.com/questions/50385109",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/9804281/"
] | What you want is not quite possible. When you call `wheelRepository.delete(wheel)` you essentially ask to remove the wheel from the database. But this cannot remove an instance `wheel` from all other places in your running application where this instance is now referenced. Such as `car.wheels`. So this instance will co... | You are trying to delete `Wheel` which contains `Car`
But for `Car` you have not specified `CascadeType`.
So while deleting `Wheel` it does ntg to `Car`.
```
@ManyToOne(cascade = CascadeType.ALL)
```
Add this to Car inside Wheel and try. |
16,370,922 | I'm working on a project using Breeze and I came across a problem with some entities I had created using a one-to-one relationship. This is a bit of a long story, but it has a happy ending, so bear with me :)
Here is a cut down version my C# code:
```
public class Person {
[Key]
public int Id { get; set; }
... | 2013/05/04 | [
"https://Stackoverflow.com/questions/16370922",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1231739/"
] | You've uncovered a bug ... or so it seems to me. I have filed it and we'll let you know when it is fixed.
*On a different note*, your BreezeJS client code is a little more tortured than it needs to be. Why create an uninitialized detached entity ... and then add it?
The line `user.Person(user);` doesn't seem right at... | Breeze v 1.3.3 is now available on the Breeze website and we did fix an issue with 1-1 mappings. Could you confirm whether this corrects your issue? |
829 | I am exploring the world of self-made pasta at the moment.
My first experiments, doing everything entirely by hand, show that if you want to do this on a frequent basis and not just as a one-time thing, you need *tools*.
I can see a number of pasta making tools on the market: Sieves, rolling mechanisms of various c... | 2010/10/04 | [
"https://cooking.meta.stackexchange.com/questions/829",
"https://cooking.meta.stackexchange.com",
"https://cooking.meta.stackexchange.com/users/2693/"
] | I think that would be fine, as long as you make it CW (since there won't be a "correct" answer). Generic equipment discussion is definitely on topic. What might get off topic is discussion of a particular make / model of a piece of equipment. So discussion of Blenders is ok, but Blend-tec 1000 v3 would be off topic. Ke... | Even though you want to stay in the generic field, make sure to indicate *what you are expecting from the piece of equipment*; what is essential, and what is not essential. It will provide you with a better compendium that is specific to your answer while laying out what makes the different pieces valuable.
Even afte... |
829 | I am exploring the world of self-made pasta at the moment.
My first experiments, doing everything entirely by hand, show that if you want to do this on a frequent basis and not just as a one-time thing, you need *tools*.
I can see a number of pasta making tools on the market: Sieves, rolling mechanisms of various c... | 2010/10/04 | [
"https://cooking.meta.stackexchange.com/questions/829",
"https://cooking.meta.stackexchange.com",
"https://cooking.meta.stackexchange.com/users/2693/"
] | Since your question is intended to gather a *list* of relevant answers, and you don't expect one answer to be the most applicable, it should be a [community wiki](https://meta.stackexchange.com/questions/11740/what-are-community-wiki-posts).
Whether a subjective question is appropriate for the site is somewhat, well..... | Even though you want to stay in the generic field, make sure to indicate *what you are expecting from the piece of equipment*; what is essential, and what is not essential. It will provide you with a better compendium that is specific to your answer while laying out what makes the different pieces valuable.
Even afte... |
11,921,610 | So i have been playing around with a little game with some mathematical questions. The application gives you, for example, a question like 23 + 47, and that's fine and all, but when it gives you a question like 9/6 the problems appears. Since you input the result in an EditText, i need the correct input type. But! when... | 2012/08/12 | [
"https://Stackoverflow.com/questions/11921610",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1110700/"
] | ```
android:inputType="numberDecimal"
```
is for taking decimal inputs, so all the digits from 0 to 9 including the decimal point sign(.) only can be the input values. And it works fine. I don't understand where comma sign came into picture. | Try add comma ",". It may cause from different format of digits.
```
<EditText
android:inputType="number"
android:digits="0123456789.," />
``` |
14,974,604 | I'm making a web-based quiz.
When I press an answer I want the count at the top to change to the next, however it keeps skipping one digit, jumping to the next (e.i. from I to III, instead of I to III).
What am I doing wrong?
Site: <http://www.carlpapworth.com/friday-quiz/#>
Html:
```
<ul id="count">
... | 2013/02/20 | [
"https://Stackoverflow.com/questions/14974604",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1666110/"
] | The `js/custom.js` script is mentioned **twice** in the `<head>`. You should remove one of them, otherwise the click events are registered twice.
Furthermore, the expression inside `.next()` looks somewhat odd (you don't need the `#count` in there and maybe not even `li`) and the function itself can be simplified to t... | I'm not that familiar with jquery specifics, but I would debug this with adding some trace, inna spirit of:
```
function qNext(){
// Output data on what is your current question
$('.cCurrent').next('#count li').addClass('cCurrent');
// Output something - so you know for sure that this is the line that does... |
14,974,604 | I'm making a web-based quiz.
When I press an answer I want the count at the top to change to the next, however it keeps skipping one digit, jumping to the next (e.i. from I to III, instead of I to III).
What am I doing wrong?
Site: <http://www.carlpapworth.com/friday-quiz/#>
Html:
```
<ul id="count">
... | 2013/02/20 | [
"https://Stackoverflow.com/questions/14974604",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1666110/"
] | The `js/custom.js` script is mentioned **twice** in the `<head>`. You should remove one of them, otherwise the click events are registered twice.
Furthermore, the expression inside `.next()` looks somewhat odd (you don't need the `#count` in there and maybe not even `li`) and the function itself can be simplified to t... | the qnext function is working correctly
I assume the Problem is that theres also another click event, which does also slide one Question to the right, added to the answers by the slider (ulslide). Try to comment out this line and see if it works
```
nextButton: '.qAnswers a',
``` |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.