qid int64 1 74.7M | question stringlengths 15 58.3k | date stringlengths 10 10 | metadata list | response_j stringlengths 4 30.2k | response_k stringlengths 11 36.5k |
|---|---|---|---|---|---|
21,909,132 | I have a string which I would like to remove the first three characters from. How do I go about this using substrings, or is there any other way?
```
string temp = "01_Barnsley"
string textIWant = "Barnsley"
```
Thank you | 2014/02/20 | [
"https://Stackoverflow.com/questions/21909132",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2834084/"
] | If there is a pattern to the data, one can use that to extract out what is needed using Regular Expressions.
So if one knows there are numbers (`\d` regex for digits and with 1 or more with a `+`) followed by an under bar; that is the pattern to exclude. Now we tell the parser what we want *to capture* by saying we w... | A solution using LINQ:
```
string temp = "01_Barnsley";
string textIWant = new string(temp.Skip(3).ToArray());
``` |
25,794,744 | So I have a html ,css , and javascript files, they all form a tiny little web app which is required for a homework for my web app course, part of my homework is to make a bootstrap version off the web i just made.
My question is how do I convert my code to bootstrap to make my web responsive? what tricks/shortcuts can... | 2014/09/11 | [
"https://Stackoverflow.com/questions/25794744",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1492736/"
] | You should read bootstrap documentation here:
<http://getbootstrap.com/css/>
I'll recommend you to start by choosing what type of container your content will be using: normal one, or fluid (100% browser width). With this defined, you can start putting some responsive grid classes on your div's. | If you visit [the bootstrap documentation](http://getbootstrap.com/) you'll be able to see exactly what Bootstrap can offer you, there is no translator which will automatically change your site for you.
Its just a case of applying the bootstrap component classes to your existing markup. It shouldn't be too hard to ach... |
28,785,573 | I want to display my menu items on ActionBar with android
I found some samples but It was not what I wanted
Menu should be similar picture below(Overflow Icon or text)

My menu.xml is :
```
<menu xmlns:android="http://schemas.android.com/apk/res/an... | 2015/02/28 | [
"https://Stackoverflow.com/questions/28785573",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3404171/"
] | You can try write `updatePassword` function like `setPassword` with another variable
```
public function updatePassword($new_password) {
$this->password_hash = Yii::$app->security->generatePasswordHash($new_password);
}
```
declare a variable
```
public $new_password;
```
And add it in rules()
```
publi... | Here "$this" is your Controller which of course, doesn't have 'new\_password' property. You'd better not set new password in controller, but do it in model, for example in beforeSave method:
```
if ($this->new_password) {
$this->setPassword($this->new_password);
}
``` |
58,792,626 | I wrote down this code:
```
import shutil
files = os.listdir(path, path=None)
for d in os.listdir(path):
for f in files:
shutil.move(d+f, path)
```
I want every folder in a given directory (`path`) with files inside, the files contained in that folder are moved to the main directory(`path`) where the fo... | 2019/11/10 | [
"https://Stackoverflow.com/questions/58792626",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12351744/"
] | This should be what you are looking for, first we get all subfolders in our main folder. Then for each subfolder we get files contained inside and create our source path and destination path for shutil.move.
```
import os
import shutil
folder = r"<MAIN FOLDER>"
subfolders = [f.path for f in os.scandir(folder) if f.is... | Here another example , using a few lines with glob
```
import os
import shutil
import glob
inputs=glob.glob('D:\\my\\folder_with_sub\\*')
outputs='D:\\my\\folder_dest\\'
for f in inputs:
shutil.move(f, outputs)
``` |
38,197,951 | I'm trying to perform an insert into select with mysql.
Is it possible to insert data like this ? or is there an other way to do that ?
A = 17
```
INSERT INTO TABLE1 (x1, x2, x3)
SELECT (Y,Z) FROM TABLE2
WHERE CONDITION, A
```
Thanks, | 2016/07/05 | [
"https://Stackoverflow.com/questions/38197951",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4993741/"
] | You can do this this way:
```
getOffers(url:string) { // <----
return this._http.get(url)
.map(res => res.json())
}
```
and call it like this:
```
this._httpService.getOffers('json/test.json')
.subscribe(
data => { this.offers = <Offer[]>data.offers; },
error => alert(error),
() =>... | ```
this._httpService.getOffers(url:string)
.subscribe(
data => { this.offers = <Offer[]>data.offers; },
error => alert(error),
() => console.log("Finished")
);
getOffers(url:string) {
return this._http.get(url)
.map(re... |
27,049,765 | I have a SQL Script that creates a Database that tracks grades.
In one of my SELECT Statements which I use to display the class, Assignment #, Grade, Type... I want to also display the weighted average.
In the Grades TABLE I have a field that contains weight as an INTEGER. the Grade is also an INTEGER.
The code I us... | 2014/11/20 | [
"https://Stackoverflow.com/questions/27049765",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | To expand on Adam's correct answer, you can force decimal division like this:
```
SELECT Classes.className AS 'Class' ,
Grades.workID AS 'Assignment #' ,
CONVERT(VARCHAR(12), Grades.grade) + ' %' AS 'Grade' ,
CONVERT(VARCHAR(12), Grades.weight) + ' %' AS 'Weight' ,
schoolWorkType.workN... | You're doing integer division. You need to convert those integers to decimals before the division. |
12,131,201 | Goal: The excel sheet contains a list of activities. The goal is to compare the Date/Time of two activities. I need to identify if there is any overlap between the two. Column B contains the start date and time of each activity and column C contains the end date and time of each activity.
```
ActivityOneStartTime = Ra... | 2012/08/26 | [
"https://Stackoverflow.com/questions/12131201",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/256393/"
] | A quick search on CPAN yields [`Term::Completion`](https://metacpan.org/module/Term%3a%3aCompletion) and [`Term::Complete`](https://metacpan.org/module/Term%3a%3aComplete)
```
use Term::Completion qw( Complete );
my $result = Complete($prompt, @choices);
``` | `Term::Readline` is a factory wrapper around many possible implementations of the readline interface. The default one you get is a fairly minimal one implemented in pure perl, called `Term::Readline::Perl`; it lacks such things as tab-complete.
If however you install `Term::Readline::Gnu`, that does have tab-complete,... |
31,243,376 | I'm using wxPython (Phoenix).
I wrote a small app with a custom autocompleter, according to these [guidelines](http://wxpython.org/Phoenix/docs/html/TextCompleterSimple.html), but it fails with the following error:
```
Traceback (most recent call last):
File "try2.py", line 33, in <module>
frame = TextFrame()
... | 2015/07/06 | [
"https://Stackoverflow.com/questions/31243376",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1801090/"
] | To fetch an extension from UTI, here is **Swift 4.1** code:
```
import AVFoundation
extension AVFileType {
/// Fetch and extension for a file from UTI string
var fileExtension: String {
if let ext = UTTypeCopyPreferredTagWithClass(self as CFString, kUTTagClassFilenameExtension)?.takeRetainedValue() {
... | >
> *With the help of answer given by **@Dmih*** , I have modified it
> according to my project requirement which needs mime type string to
> upload the selected file. Which may help to someone else.
>
>
>
```
import Foundation
import MobileCoreServices
extension URL {
func mimeType() -> ... |
31,243,376 | I'm using wxPython (Phoenix).
I wrote a small app with a custom autocompleter, according to these [guidelines](http://wxpython.org/Phoenix/docs/html/TextCompleterSimple.html), but it fails with the following error:
```
Traceback (most recent call last):
File "try2.py", line 33, in <module>
frame = TextFrame()
... | 2015/07/06 | [
"https://Stackoverflow.com/questions/31243376",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1801090/"
] | iOS 14.0 +
----------
**Use the extensions**
```
import UniformTypeIdentifiers
extension NSURL {
public func mimeType() -> String {
if let pathExt = self.pathExtension,
let mimeType = UTType(filenameExtension: pathExt)?.preferredMIMEType {
return mimeType
}
else {
... | If you need to check URL contains some Image or Audio file or Video file, here is Swift 5.1 code:
```
import Foundation
import MobileCoreServices
extension URL {
func mimeType() -> String {
let pathExtension = self.pathExtension
if let uti = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenam... |
31,243,376 | I'm using wxPython (Phoenix).
I wrote a small app with a custom autocompleter, according to these [guidelines](http://wxpython.org/Phoenix/docs/html/TextCompleterSimple.html), but it fails with the following error:
```
Traceback (most recent call last):
File "try2.py", line 33, in <module>
frame = TextFrame()
... | 2015/07/06 | [
"https://Stackoverflow.com/questions/31243376",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1801090/"
] | Assuming you are receiving your data as NSData, follow this Post: <https://stackoverflow.com/a/5042365/2798777>
In Swift for example:
```
var c = [UInt32](count: 1, repeatedValue: 0)
(data as! NSData).getBytes(&c, length: 1)
switch (c[0]) {
case 0xFF, 0x89, 0x00:
println("image")
case 0x47:
println("gif")
def... | Answer that provided by Paul Lehn(most liked answer) didn't work for me, because I'm developing for iOS 16 at this moment, due to deprecation of methods that was used in his solution, I decided to refactor the code a bit:
iOS 14+
```
import AVFoundation
// url to the file in the file system
func mimeTypeForURL(_ url... |
31,243,376 | I'm using wxPython (Phoenix).
I wrote a small app with a custom autocompleter, according to these [guidelines](http://wxpython.org/Phoenix/docs/html/TextCompleterSimple.html), but it fails with the following error:
```
Traceback (most recent call last):
File "try2.py", line 33, in <module>
frame = TextFrame()
... | 2015/07/06 | [
"https://Stackoverflow.com/questions/31243376",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1801090/"
] | Swift 5.5 iOS 14.0+
```
import UniformTypeIdentifiers
extension URL {
var mimeType: String {
return UTType(filenameExtension: self.pathExtension)?.preferredMIMEType ?? "application/octet-stream"
}
func contains(_ uttype: UTType) -> Bool {
return UTType(mimeType: self.mimeType)?.conforms(... | Assuming you are receiving your data as NSData, follow this Post: <https://stackoverflow.com/a/5042365/2798777>
In Swift for example:
```
var c = [UInt32](count: 1, repeatedValue: 0)
(data as! NSData).getBytes(&c, length: 1)
switch (c[0]) {
case 0xFF, 0x89, 0x00:
println("image")
case 0x47:
println("gif")
def... |
31,243,376 | I'm using wxPython (Phoenix).
I wrote a small app with a custom autocompleter, according to these [guidelines](http://wxpython.org/Phoenix/docs/html/TextCompleterSimple.html), but it fails with the following error:
```
Traceback (most recent call last):
File "try2.py", line 33, in <module>
frame = TextFrame()
... | 2015/07/06 | [
"https://Stackoverflow.com/questions/31243376",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1801090/"
] | If anyone wants to get the MimeType from the actual URL of the file this code worked for me:
```
import MobileCoreServices
func mimeTypeForPath(path: String) -> String {
let url = NSURL(fileURLWithPath: path)
let pathExtension = url.pathExtension
if let uti = UTTypeCreatePreferredIdentifierForTag(kUTTagC... | iOS15 compatible version of [@Dmih's solution](https://stackoverflow.com/a/59280589/3826232) looks like this:
```
import UniformTypeIdentifiers
extension URL {
func mimeType() -> String {
let pathExtension = self.pathExtension
if let type = UTType(filenameExtension: pathExtension) {
if... |
31,243,376 | I'm using wxPython (Phoenix).
I wrote a small app with a custom autocompleter, according to these [guidelines](http://wxpython.org/Phoenix/docs/html/TextCompleterSimple.html), but it fails with the following error:
```
Traceback (most recent call last):
File "try2.py", line 33, in <module>
frame = TextFrame()
... | 2015/07/06 | [
"https://Stackoverflow.com/questions/31243376",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1801090/"
] | iOS 14.0 +
----------
**Use the extensions**
```
import UniformTypeIdentifiers
extension NSURL {
public func mimeType() -> String {
if let pathExt = self.pathExtension,
let mimeType = UTType(filenameExtension: pathExt)?.preferredMIMEType {
return mimeType
}
else {
... | To fetch an extension from UTI, here is **Swift 4.1** code:
```
import AVFoundation
extension AVFileType {
/// Fetch and extension for a file from UTI string
var fileExtension: String {
if let ext = UTTypeCopyPreferredTagWithClass(self as CFString, kUTTagClassFilenameExtension)?.takeRetainedValue() {
... |
31,243,376 | I'm using wxPython (Phoenix).
I wrote a small app with a custom autocompleter, according to these [guidelines](http://wxpython.org/Phoenix/docs/html/TextCompleterSimple.html), but it fails with the following error:
```
Traceback (most recent call last):
File "try2.py", line 33, in <module>
frame = TextFrame()
... | 2015/07/06 | [
"https://Stackoverflow.com/questions/31243376",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1801090/"
] | Swift 5.5 iOS 14.0+
```
import UniformTypeIdentifiers
extension URL {
var mimeType: String {
return UTType(filenameExtension: self.pathExtension)?.preferredMIMEType ?? "application/octet-stream"
}
func contains(_ uttype: UTType) -> Bool {
return UTType(mimeType: self.mimeType)?.conforms(... | Answer that provided by Paul Lehn(most liked answer) didn't work for me, because I'm developing for iOS 16 at this moment, due to deprecation of methods that was used in his solution, I decided to refactor the code a bit:
iOS 14+
```
import AVFoundation
// url to the file in the file system
func mimeTypeForURL(_ url... |
31,243,376 | I'm using wxPython (Phoenix).
I wrote a small app with a custom autocompleter, according to these [guidelines](http://wxpython.org/Phoenix/docs/html/TextCompleterSimple.html), but it fails with the following error:
```
Traceback (most recent call last):
File "try2.py", line 33, in <module>
frame = TextFrame()
... | 2015/07/06 | [
"https://Stackoverflow.com/questions/31243376",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1801090/"
] | If you need to check URL contains some Image or Audio file or Video file, here is Swift 5.1 code:
```
import Foundation
import MobileCoreServices
extension URL {
func mimeType() -> String {
let pathExtension = self.pathExtension
if let uti = UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenam... | iOS15 compatible version of [@Dmih's solution](https://stackoverflow.com/a/59280589/3826232) looks like this:
```
import UniformTypeIdentifiers
extension URL {
func mimeType() -> String {
let pathExtension = self.pathExtension
if let type = UTType(filenameExtension: pathExtension) {
if... |
31,243,376 | I'm using wxPython (Phoenix).
I wrote a small app with a custom autocompleter, according to these [guidelines](http://wxpython.org/Phoenix/docs/html/TextCompleterSimple.html), but it fails with the following error:
```
Traceback (most recent call last):
File "try2.py", line 33, in <module>
frame = TextFrame()
... | 2015/07/06 | [
"https://Stackoverflow.com/questions/31243376",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1801090/"
] | To fetch an extension from UTI, here is **Swift 4.1** code:
```
import AVFoundation
extension AVFileType {
/// Fetch and extension for a file from UTI string
var fileExtension: String {
if let ext = UTTypeCopyPreferredTagWithClass(self as CFString, kUTTagClassFilenameExtension)?.takeRetainedValue() {
... | Assuming you are receiving your data as NSData, follow this Post: <https://stackoverflow.com/a/5042365/2798777>
In Swift for example:
```
var c = [UInt32](count: 1, repeatedValue: 0)
(data as! NSData).getBytes(&c, length: 1)
switch (c[0]) {
case 0xFF, 0x89, 0x00:
println("image")
case 0x47:
println("gif")
def... |
31,243,376 | I'm using wxPython (Phoenix).
I wrote a small app with a custom autocompleter, according to these [guidelines](http://wxpython.org/Phoenix/docs/html/TextCompleterSimple.html), but it fails with the following error:
```
Traceback (most recent call last):
File "try2.py", line 33, in <module>
frame = TextFrame()
... | 2015/07/06 | [
"https://Stackoverflow.com/questions/31243376",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1801090/"
] | iOS 14.0 +
----------
**Use the extensions**
```
import UniformTypeIdentifiers
extension NSURL {
public func mimeType() -> String {
if let pathExt = self.pathExtension,
let mimeType = UTType(filenameExtension: pathExt)?.preferredMIMEType {
return mimeType
}
else {
... | **iOS 15**
```
import AVFoundation
public extension AVFileType {
/// Fetch and extension for a file from UTI string
var fileExtension: String {
guard let type = UTType(self.rawValue),
let preferredFilenameExtension = type.preferredFilenameExtension
else {
return "None... |
46,170,214 | **Fatal error**: Uncaught Error: Class 'String' not found in /var/www/html/hrportal/lib/Cake/Utility/Debugger.php:340
Stack trace: 0 /var/www/html/hrportal/lib/Cake/Utility/Debugger.php(742): Debugger::trace(Array)1 /var/www/html/hrportal/lib/Cake/Error/ErrorHandler.php(229): Debugger->outputError(Array) /var/www/html/... | 2017/09/12 | [
"https://Stackoverflow.com/questions/46170214",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5350625/"
] | CakePHP 2.6 is not compatible with PHP 7
<https://book.cakephp.org/2.0/en/installation.html> | >
> try cakephp 2.9 release if you don't want to use 3.x
>
>
> |
46,170,214 | **Fatal error**: Uncaught Error: Class 'String' not found in /var/www/html/hrportal/lib/Cake/Utility/Debugger.php:340
Stack trace: 0 /var/www/html/hrportal/lib/Cake/Utility/Debugger.php(742): Debugger::trace(Array)1 /var/www/html/hrportal/lib/Cake/Error/ErrorHandler.php(229): Debugger->outputError(Array) /var/www/html/... | 2017/09/12 | [
"https://Stackoverflow.com/questions/46170214",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5350625/"
] | >
> try cakephp 2.9 release if you don't want to use 3.x
>
>
> | For PHP 7 you have to use 2.9.x |
46,170,214 | **Fatal error**: Uncaught Error: Class 'String' not found in /var/www/html/hrportal/lib/Cake/Utility/Debugger.php:340
Stack trace: 0 /var/www/html/hrportal/lib/Cake/Utility/Debugger.php(742): Debugger::trace(Array)1 /var/www/html/hrportal/lib/Cake/Error/ErrorHandler.php(229): Debugger->outputError(Array) /var/www/html/... | 2017/09/12 | [
"https://Stackoverflow.com/questions/46170214",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5350625/"
] | CakePHP 2.6 is not compatible with PHP 7
<https://book.cakephp.org/2.0/en/installation.html> | For PHP 7 you have to use 2.9.x |
46,170,214 | **Fatal error**: Uncaught Error: Class 'String' not found in /var/www/html/hrportal/lib/Cake/Utility/Debugger.php:340
Stack trace: 0 /var/www/html/hrportal/lib/Cake/Utility/Debugger.php(742): Debugger::trace(Array)1 /var/www/html/hrportal/lib/Cake/Error/ErrorHandler.php(229): Debugger->outputError(Array) /var/www/html/... | 2017/09/12 | [
"https://Stackoverflow.com/questions/46170214",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5350625/"
] | CakePHP 2.6 is not compatible with PHP 7
<https://book.cakephp.org/2.0/en/installation.html> | According to Cakephp 2.x documentation. Below are the PHP
[Requirements](https://book.cakephp.org/2.0/en/installation.html#requirements "Requirements") for Cakephp 2.x
>
> PHP 5.3.0 or greater (CakePHP version 2.6 and below support PHP 5.2.8
> and above). CakePHP version 2.8.0 and above support PHP 7. To use PHP
> ... |
46,170,214 | **Fatal error**: Uncaught Error: Class 'String' not found in /var/www/html/hrportal/lib/Cake/Utility/Debugger.php:340
Stack trace: 0 /var/www/html/hrportal/lib/Cake/Utility/Debugger.php(742): Debugger::trace(Array)1 /var/www/html/hrportal/lib/Cake/Error/ErrorHandler.php(229): Debugger->outputError(Array) /var/www/html/... | 2017/09/12 | [
"https://Stackoverflow.com/questions/46170214",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/5350625/"
] | According to Cakephp 2.x documentation. Below are the PHP
[Requirements](https://book.cakephp.org/2.0/en/installation.html#requirements "Requirements") for Cakephp 2.x
>
> PHP 5.3.0 or greater (CakePHP version 2.6 and below support PHP 5.2.8
> and above). CakePHP version 2.8.0 and above support PHP 7. To use PHP
> ... | For PHP 7 you have to use 2.9.x |
23,793,906 | I read that time() returns always timestamp that is timezone independent. But I'm confused does it always shows the same time for everyone regardless where are they from.
For example right now it shows 1400706726 (Wed May 21 2014 23:12:06 GMT+0200 (Central European Daylight Time)). It is exact time as I have on my comp... | 2014/05/21 | [
"https://Stackoverflow.com/questions/23793906",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1801585/"
] | I guess that is 1) Listen for the Hash, and 2) trigger the click of the relevant 'tab'.
---
Now Im not 100% on the support for this event listener from jquery - but I'll add it it.
```
/* listen for the anchor hashtag change */
$(window).on('hashchange', function() {
/* trigger the click of the tab with ... | You have various options: use a hash inside your url to reference the id of your tab, and retrieve it with window.location.hash.
So let's say you have a tab with id='tab' and window.location.hash = 'tab', you can do $(window.location.hash).hide().
Another good option would be using the HTML5 history function to chang... |
23,793,906 | I read that time() returns always timestamp that is timezone independent. But I'm confused does it always shows the same time for everyone regardless where are they from.
For example right now it shows 1400706726 (Wed May 21 2014 23:12:06 GMT+0200 (Central European Daylight Time)). It is exact time as I have on my comp... | 2014/05/21 | [
"https://Stackoverflow.com/questions/23793906",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1801585/"
] | I guess that is 1) Listen for the Hash, and 2) trigger the click of the relevant 'tab'.
---
Now Im not 100% on the support for this event listener from jquery - but I'll add it it.
```
/* listen for the anchor hashtag change */
$(window).on('hashchange', function() {
/* trigger the click of the tab with ... | for the most cross-browser compatible solution ty something like this:
```
var queryString = {};
window.location.href.replace(
new RegExp("([^?=&]+)(=([^&]*))?", "g"),
function($0, $1, $2, $3) { queryString[$1] = $3; }
);
if (queryString[base.options.param]) {
var tab = $("a[href='#" + queryString[base.options.param... |
31,997,885 | I am trying to make UIAlertController that looks like this:
[](https://i.stack.imgur.com/v5fne.png)
How can we customize the UIAlertController to get the result something same as this picture ? | 2015/08/13 | [
"https://Stackoverflow.com/questions/31997885",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2296787/"
] | What you are trying to do is a popover, for current versions of iOS you can achieve the same effect for both iPad and iPhone.
1.- Start by building your design on Storyboard or a xib. and then reference it.
2.- then present it as a popover.
3.- maybe you will want to implement popoverdelegates to avoid wrong positi... | I did the custom popup windows as @Hugo posted, after a while i found a library that is done in a very neat and magnificent way which can be used to implement custom popup views with less effort:
here is the link for the library on Github:
<https://github.com/m1entus/MZFormSheetPresentationController>
It is written... |
5,450,387 | So I searched for a guide of how to shell integrate your application (add it to the right click menu) with C#, but I couldn't find how to do that only for a specific file type. I know it is possible because WinRar does that. So how can I do that? | 2011/03/27 | [
"https://Stackoverflow.com/questions/5450387",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/458152/"
] | There are usually two-ish ways you can implement this.
1. Registry Keys - You can write keys and values under HKEY\_CLASSES\_ROOT. If you look at that hive you'll see the extensions on your pc. Look at this [article](http://msdn.microsoft.com/en-us/library/cc144175%28v=vs.85%29.aspx) for the details about the keys and... | Windows Explorer right click menus are controlled by the registry. Specifically, the HKEY\_CLASSES\_ROOT hive.
A good way to get a good idea how everything works in there is to check out `HKCR\.txt` which shows what will happen for text files in the right click menu. Look at the (Default) key, which points to "txtfil... |
4,326,843 | I posted this on [programmers first](https://softwareengineering.stackexchange.com/questions/22895/vs10-crashes-when-doing-build-or-rebuild-of-c-project), but was told it belongs here. Funny, I didn't think so.
I have VS10 installed on a Windows Server 2008 R2 box, along with several other versions of VS dating back y... | 2010/12/01 | [
"https://Stackoverflow.com/questions/4326843",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/241536/"
] | How about contacting MS support directly? If this is blocking your work, you can push them to have it fixed (don't know about costs though, will probably depend on the product and specificities of your license...).
Alternatively, you can build your solution in the commandline: open a VS 2010 command prompt (shortcut i... | The P8 bucket has a strange value, at least when compared to my machine. Check [this post](https://stackoverflow.com/questions/4052770/deciphering-the-net-clr20r3-exception-parameters-p1-p10/4053325#4053325) for a way to reverse-engineer the crashing method. The crashing assembly is stored in the C:\Windows\Microsoft.N... |
4,326,843 | I posted this on [programmers first](https://softwareengineering.stackexchange.com/questions/22895/vs10-crashes-when-doing-build-or-rebuild-of-c-project), but was told it belongs here. Funny, I didn't think so.
I have VS10 installed on a Windows Server 2008 R2 box, along with several other versions of VS dating back y... | 2010/12/01 | [
"https://Stackoverflow.com/questions/4326843",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/241536/"
] | How about contacting MS support directly? If this is blocking your work, you can push them to have it fixed (don't know about costs though, will probably depend on the product and specificities of your license...).
Alternatively, you can build your solution in the commandline: open a VS 2010 command prompt (shortcut i... | For anyone still having this problem, the answer that fixed mine was that I had tried to completely wipe Internet Explorer from my computer- leading to the DLL call failure that crashed devenv.
Here is their official solution page:
<http://support.microsoft.com/kb/983279>
My question to Microsoft is... Why would a de... |
4,326,843 | I posted this on [programmers first](https://softwareengineering.stackexchange.com/questions/22895/vs10-crashes-when-doing-build-or-rebuild-of-c-project), but was told it belongs here. Funny, I didn't think so.
I have VS10 installed on a Windows Server 2008 R2 box, along with several other versions of VS dating back y... | 2010/12/01 | [
"https://Stackoverflow.com/questions/4326843",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/241536/"
] | The P8 bucket has a strange value, at least when compared to my machine. Check [this post](https://stackoverflow.com/questions/4052770/deciphering-the-net-clr20r3-exception-parameters-p1-p10/4053325#4053325) for a way to reverse-engineer the crashing method. The crashing assembly is stored in the C:\Windows\Microsoft.N... | For anyone still having this problem, the answer that fixed mine was that I had tried to completely wipe Internet Explorer from my computer- leading to the DLL call failure that crashed devenv.
Here is their official solution page:
<http://support.microsoft.com/kb/983279>
My question to Microsoft is... Why would a de... |
585,610 | I have encountered the "bootmgr is missing" error with my Windows 7 computer and I was not able to boot to Windows beforehand either. I am currently attempting to recover my files before I reformat the Windows OS on my C: drive. That said, I am booting from a USB using Ubuntu and am in the "trial" version (just trying ... | 2015/02/15 | [
"https://askubuntu.com/questions/585610",
"https://askubuntu.com",
"https://askubuntu.com/users/378889/"
] | Assigning letters to drives is the traditional way of addressing hard drives and partitions in the user interface for DOS, Windows and related operating systems. Other operating systems have different naming schemes:
* [What is the Linux drive naming scheme?](https://askubuntu.com/q/56929/40581) (Also read the answer ... | Your "C" drive will be located `/media/<possibly_a_long_series_of numbers>`
Use your file manager (Nautilus), go up(down) to root (`/`) and then into `/media`, and you will see it.
It is possible there might be ownership/permission problems in manipulating the files within this directory, or transferring them to an ... |
5,124,861 | Ok, so this has been messing with me. (double entendre?)
*ignoring variable types since that's not the issue*
Lets say you have a parent class, for example a book class, with variable ISBN. The constructor sets ISBN using `this.ISBN = bla`.
Now there's a child class. It has a constructor that calls the parent one in... | 2011/02/26 | [
"https://Stackoverflow.com/questions/5124861",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/468539/"
] | You are on the right track. The answers to your questions are yes and yes.
Here's what the complete code would look like with right syntax
```
class Book {
String ISBN;
Book(String ISBN) {
this.ISBN = ISBN;
}
}
class KidsBook extends Book {
String kidsVariable;
KidsBook(String ISBN, Stri... | The constructor would be:
```
public KidsBook(ISBN isbn, Foo kidVariable) {
super(isbn);
this.kidVariable = kidVariable;
}
```
Now, you are passing in the `isbn` parameter from `KidsBook`'s constructor to the constructor of its superclass. The constructor of that superclass is:
```
public Book(ISBN isbn) {
... |
5,124,861 | Ok, so this has been messing with me. (double entendre?)
*ignoring variable types since that's not the issue*
Lets say you have a parent class, for example a book class, with variable ISBN. The constructor sets ISBN using `this.ISBN = bla`.
Now there's a child class. It has a constructor that calls the parent one in... | 2011/02/26 | [
"https://Stackoverflow.com/questions/5124861",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/468539/"
] | You are on the right track. The answers to your questions are yes and yes.
Here's what the complete code would look like with right syntax
```
class Book {
String ISBN;
Book(String ISBN) {
this.ISBN = ISBN;
}
}
class KidsBook extends Book {
String kidsVariable;
KidsBook(String ISBN, Stri... | Here another example that hopefully clarifies some mechanics of java inheritance.
```
public class Book
{
protected String isbn;
public Book(String isbn)
{
this.isbn = isbn;
}
public Book()
{
// isbn not set
}
}
class DoubleIsbnBook extends Book
{
private String isbn;
public DoubleIsbnBoo... |
15,118,702 | I am attempting to use fortran to write out a comma-delimited file for import into another commercial package. The issue is that I have an unknown number of data columns. My output needs to look like this:
```
a_string,a_float,a_different_float,float_array_elem1,float_array_elem2,...,float_array_elemn
```
which woul... | 2013/02/27 | [
"https://Stackoverflow.com/questions/15118702",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1984620/"
] | the format close to what you want is f0.3, this will give no spaces and a fixed number of decimal places. I think if you want to also lop off trailing zeros you'll need to do a good bit of work.
The 'n' in your write statement can be larger than the number of data values, so one (old school) approach is to put a big ... | In order to make sure that no space occurs between the entries in your line, you can write them separately in character variables and then print them out using the`adjustl()` function in fortran:
```
program csv
implicit none
integer, parameter :: dp = kind(1.0d0)
integer, parameter :: nn = 3
real(dp), parame... |
66,736,384 | How do I establish connectivity between terraform and my AWS account?
Do I need to install AWS CLI first? | 2021/03/21 | [
"https://Stackoverflow.com/questions/66736384",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15123074/"
] | The advantage of having a list of all issued tokens is that you can have a full view of who has been already authenticated and has currently access to the system. You can then choose to revoke some tokens from this list based on any criteria (e.g. the age of the token, the roles associated with the user of the token, t... | I would aim for a direction of technical simplicity here, since the Authorization Server (AS) should do the hard work for you. Here are some end to end notes which explain some tricky aspects and suggest a simple direction.
**1. TOKEN ISSUING**
The user authenticates (and optionally consents) resulting in a token 'gr... |
66,736,384 | How do I establish connectivity between terraform and my AWS account?
Do I need to install AWS CLI first? | 2021/03/21 | [
"https://Stackoverflow.com/questions/66736384",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15123074/"
] | The advantage of having a list of all issued tokens is that you can have a full view of who has been already authenticated and has currently access to the system. You can then choose to revoke some tokens from this list based on any criteria (e.g. the age of the token, the roles associated with the user of the token, t... | The only deciding factor I can think of, that will require a list of all refresh tokens is the following:
Do you / will you, at any point, need to have a functionality where you can dynamically revoke valid refresh tokens, based on some arbitrary, regulatory, legal, integrity, security etc. criteria?
If so, the least... |
66,736,384 | How do I establish connectivity between terraform and my AWS account?
Do I need to install AWS CLI first? | 2021/03/21 | [
"https://Stackoverflow.com/questions/66736384",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/15123074/"
] | The only deciding factor I can think of, that will require a list of all refresh tokens is the following:
Do you / will you, at any point, need to have a functionality where you can dynamically revoke valid refresh tokens, based on some arbitrary, regulatory, legal, integrity, security etc. criteria?
If so, the least... | I would aim for a direction of technical simplicity here, since the Authorization Server (AS) should do the hard work for you. Here are some end to end notes which explain some tricky aspects and suggest a simple direction.
**1. TOKEN ISSUING**
The user authenticates (and optionally consents) resulting in a token 'gr... |
18,310,038 | I'm trying to make a file uploader with HTML5 with a progress meter. Here's my code:
```
<!DOCTYPE html>
<html>
<head>
<title>Test Progress Meter</title>
<script type="text/javascript">
function submitFile(){
var blobOrFile = document.getElementById("fileInput").files[0];
var ... | 2013/08/19 | [
"https://Stackoverflow.com/questions/18310038",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2695688/"
] | this is my code and it's work fine for me:
```
xhr.upload.onprogress = function(e){
var done = e.position || e.loaded, total = e.totalSize || e.total
var present = Math.floor(done/total*100)
document.getElementById('status').innerHTML = present + '%'
}
``` | I had the same problem like yours, then I tried my page from another computer, everything just went OK, I did use Chrome's network throttling to simulate a slow internet connection but it seems that there are still something different from real situation |
18,310,038 | I'm trying to make a file uploader with HTML5 with a progress meter. Here's my code:
```
<!DOCTYPE html>
<html>
<head>
<title>Test Progress Meter</title>
<script type="text/javascript">
function submitFile(){
var blobOrFile = document.getElementById("fileInput").files[0];
var ... | 2013/08/19 | [
"https://Stackoverflow.com/questions/18310038",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2695688/"
] | this is my code and it's work fine for me:
```
xhr.upload.onprogress = function(e){
var done = e.position || e.loaded, total = e.totalSize || e.total
var present = Math.floor(done/total*100)
document.getElementById('status').innerHTML = present + '%'
}
``` | Because the server or the gateway cache the request data immediately, write the file data to the disk or memory. At this time, the file data progress indeed is 100%. But the server's logic code has not yet finish process the file data which is just cached in the server. |
44,635,031 | `PHAsset` has a `creationDate` property that gives the creation date of the asset in UTC.
If I take a photo taken at 10:52 PM UTC-6, the `creationDate` property is 03:52 AM.
How am I supposed to know the 'true' time of the photo taken? No timezone information is supplied with the `creationDate` property, so I can't a... | 2017/06/19 | [
"https://Stackoverflow.com/questions/44635031",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3934023/"
] | Instead of keeping it editor specific, you can use [mypy](http://mypy.readthedocs.io/) to analyze your code. This way it will run on all dev environments instead of just for those who use PyCharm.
```
from urllib.request import urlopen
import sys
def get_category_links(url: str) -> None:
response = urlopen(url)
... | Firstly, you need to check whether the url type is string or not and if string then check for ValueError exception(Valid url)
```
import sys
from urllib2 import urlopen
def get_category_links(url):
if type(url) != type(""): #Check if url is string or not
print "Please give string url"
return
try:
... |
54,752,814 | Following example in [How to install mcrypt on Docker](https://stackoverflow.com/questions/47181369/how-to-install-mcrypt-on-docker/53466129#53466129) I came to this:
```
name: myapp
recipe: drupal7
config:
webroot: web
php: '7.2'
proxy:
pma:
- pma.myapp.lndo.site
services:
pma:
type: phpmyadm... | 2019/02/18 | [
"https://Stackoverflow.com/questions/54752814",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3565813/"
] | This is what you've missed:
```
services:
appserver:
build_as_root:
- apt-get update -y
- apt-get install libmcrypt-dev
- pecl install mcrypt-1.0.1
- docker-php-ext-enable mcrypt
```
You can use the following:
```
name: myapp
recipe: drupal7
config:
webroot: web
php: '7.2'
... | Made it work with:
```
services:
appserver:
build_as_root:
- apt-get update -y
- apt-get install -y libmcrypt-dev
- pecl install mcrypt
- docker-php-ext-enable mcrypt
``` |
41,571,222 | I am currently working on a cross-platform app with Xamarin and I am trying to use the NuGet package [Parse 1.7.0](https://www.nuget.org/packages/parse), but when I try to install the package via NuGet on Visual Studio 2015, I get this error :
```
Could not install package 'Parse 1.7.0'. You are trying to install this... | 2017/01/10 | [
"https://Stackoverflow.com/questions/41571222",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/4547217/"
] | If you look inside the `nupkg` of this package:
<https://www.nuget.org/packages/parse>
You will find a `lib` folder with the following targets available. Thus you are trying to target Profile259, but there is no definition in the Parse NuGet package for this. That is why it fails. You must install against one of thes... | Had the same, just remove the Silverlight platform from your targets and it should work |
36,270,491 | I need to configure the `Mask` property of a MaskedTextBox to take in a password that meets the following criteria:
* Minimum of 4 alphanumeric characters
* Maximum of 15 alphanumeric characters
I have tried setting the mask to the string "aaaa" but that did not work | 2016/03/28 | [
"https://Stackoverflow.com/questions/36270491",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1483520/"
] | According to MSDN ([see here](https://msdn.microsoft.com/en-us/library/system.windows.forms.maskedtextbox.mask%28v=vs.110%29.aspx#Anchor_2)) within the mask an `a` is used for optional alphanumeric characters, and `A` is used for required alphanumeric characters.
Therefor a mask like the following should work for you:... | This is a little late, but I'd like to answer this.
For an alphanumeric restriction to have an optional and required number of digits entered, you can use AAAaaaaa. To verify, just check the MaskCompleted and/or the MaskFull properties. MaskCompleted will check if all *required* characters are entered, and MaskFull wi... |
2,615,535 | Is it possible to index through an association with Sunspot?
For example, if a Customer has\_many Contacts, I want a 'searchable' block on my Customer model that indexes the Contact#first\_name and Contact#last\_name columns for use in searches on Customer.
acts\_as\_solr has an :include option for this. I've simply... | 2010/04/11 | [
"https://Stackoverflow.com/questions/2615535",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/313709/"
] | That's exactly how to do it. Solr is essentially document-oriented, so any data that comes from associations in your database is flattened down into your document. An :include option is just mild sugar which ends up doing the same thing that you do here. | Sure:
```
searchable do
string :sort_contact_name do
contacts.map { |contact| contact.last_name }.sort.first
end
end
```
Then you can sort by the :sort\_contact\_name field. Note that I had to reduce the set of contact names to a single name, as Solr can only sort on fields that have a single value per docum... |
72,491 | According to this Instrument Approach:
The published Minimums are a Visibility of 1300 m, and a DH of 259 feet.
In accordance with ICAO, would the Visibility and Ceiling be above the Published Minimums to be able to execute the approach or only the Visibility?
For example, if the airport reported **BKN002**, would t... | 2019/12/12 | [
"https://aviation.stackexchange.com/questions/72491",
"https://aviation.stackexchange.com",
"https://aviation.stackexchange.com/users/-1/"
] | Since you ask about ICAO, I have checked ICAO's PANS-OPS and Manual of All-Weather Operations.
"Ceiling Required" is **not** an ICAO term.
Since you tagged one of the plates SBAO (a Brazilian FIR; Atlantico ACC), I found a blog post from 2017, *[Brazil drops Ceiling requirement](https://www.linkedin.com/pulse/brazil-... | As far as I know, for ILS the only limiting thing would be visibility/RVR. For Non precision approach, you will need to worry about the ceiling. Ceiling Required above would be for a LOC approach which is a Non precision approach. |
811,458 | When browsing a SAMBA file server, File Explorer takes a very long time (60+ secs) to load a share. If I view the same share on the command line with the following command, it returns the listing instantly.
```
dir \\server\share
```
This leads me to believe it's a problem with Windows and not the file server.
How ... | 2016/10/26 | [
"https://serverfault.com/questions/811458",
"https://serverfault.com",
"https://serverfault.com/users/228663/"
] | Access to GCS resources is not recursive. Owning a project or a bucket within that project does not necessarily imply that you also have read access to some specific object. Owning the bucket does imply that you can list or delete the object, but that's it.
The owner of an object is always the user that uploaded it. B... | I've solved my similar problem using IAM, like this:
```
gsutil iam ch 'user:myacc@mydoma.in:legacyObjectOwner' gs://mybucket
```
After that, the user has owner rights. |
811,458 | When browsing a SAMBA file server, File Explorer takes a very long time (60+ secs) to load a share. If I view the same share on the command line with the following command, it returns the listing instantly.
```
dir \\server\share
```
This leads me to believe it's a problem with Windows and not the file server.
How ... | 2016/10/26 | [
"https://serverfault.com/questions/811458",
"https://serverfault.com",
"https://serverfault.com/users/228663/"
] | Access to GCS resources is not recursive. Owning a project or a bucket within that project does not necessarily imply that you also have read access to some specific object. Owning the bucket does imply that you can list or delete the object, but that's it.
The owner of an object is always the user that uploaded it. B... | I struggled with a similar situation: A service account that created an object was listed as OWNER (with `gsutil acl get gs://...`) but failed to set ACL. Then I found the following quote in <https://cloud.google.com/storage/docs/access-control/lists#predefined-acl>:
>
> You cannot apply ACLs that change the ownershi... |
811,458 | When browsing a SAMBA file server, File Explorer takes a very long time (60+ secs) to load a share. If I view the same share on the command line with the following command, it returns the listing instantly.
```
dir \\server\share
```
This leads me to believe it's a problem with Windows and not the file server.
How ... | 2016/10/26 | [
"https://serverfault.com/questions/811458",
"https://serverfault.com",
"https://serverfault.com/users/228663/"
] | Access to GCS resources is not recursive. Owning a project or a bucket within that project does not necessarily imply that you also have read access to some specific object. Owning the bucket does imply that you can list or delete the object, but that's it.
The owner of an object is always the user that uploaded it. B... | You can set Cloud IAM policy to project or bucket.
For example, if you are a project owner and you want to full access of all buckets in the project, follow the steps below.
1. Open [IAM management](https://console.cloud.google.com/iam-admin/iam)
2. Click `Edit permissions` icon associated with the user which you wa... |
811,458 | When browsing a SAMBA file server, File Explorer takes a very long time (60+ secs) to load a share. If I view the same share on the command line with the following command, it returns the listing instantly.
```
dir \\server\share
```
This leads me to believe it's a problem with Windows and not the file server.
How ... | 2016/10/26 | [
"https://serverfault.com/questions/811458",
"https://serverfault.com",
"https://serverfault.com/users/228663/"
] | You can set Cloud IAM policy to project or bucket.
For example, if you are a project owner and you want to full access of all buckets in the project, follow the steps below.
1. Open [IAM management](https://console.cloud.google.com/iam-admin/iam)
2. Click `Edit permissions` icon associated with the user which you wa... | I've solved my similar problem using IAM, like this:
```
gsutil iam ch 'user:myacc@mydoma.in:legacyObjectOwner' gs://mybucket
```
After that, the user has owner rights. |
811,458 | When browsing a SAMBA file server, File Explorer takes a very long time (60+ secs) to load a share. If I view the same share on the command line with the following command, it returns the listing instantly.
```
dir \\server\share
```
This leads me to believe it's a problem with Windows and not the file server.
How ... | 2016/10/26 | [
"https://serverfault.com/questions/811458",
"https://serverfault.com",
"https://serverfault.com/users/228663/"
] | You can set Cloud IAM policy to project or bucket.
For example, if you are a project owner and you want to full access of all buckets in the project, follow the steps below.
1. Open [IAM management](https://console.cloud.google.com/iam-admin/iam)
2. Click `Edit permissions` icon associated with the user which you wa... | I struggled with a similar situation: A service account that created an object was listed as OWNER (with `gsutil acl get gs://...`) but failed to set ACL. Then I found the following quote in <https://cloud.google.com/storage/docs/access-control/lists#predefined-acl>:
>
> You cannot apply ACLs that change the ownershi... |
32,654,988 | If I reference an assembly A.dll in my project and A.dll references B.dll. My project cannot access the exported namespaces/classes of B.dll, only A.dll. Is there something I can do so I don't have to directly reference B.dll in my project in order to access its classes? | 2015/09/18 | [
"https://Stackoverflow.com/questions/32654988",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1404270/"
] | It seems the `cornerRadius` is bigger than its height. Try the following code in your view controller:
```
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
startButton.backgroundColor = UIColor.clearColor()
startButton.layer.cornerRadius = startButton.bounds.size.height / 2
startB... | First of all make the button completely square, then round the corner by half of its width or height.
E.g:
```js
// 200*200 square button
startButton.frame.size = CGSize(width: 200, height: 200)
startButton.backgroundColor = UIColor.clearColor()
// make the corner rounded like circle
startButton.layer.cornerRad... |
32,654,988 | If I reference an assembly A.dll in my project and A.dll references B.dll. My project cannot access the exported namespaces/classes of B.dll, only A.dll. Is there something I can do so I don't have to directly reference B.dll in my project in order to access its classes? | 2015/09/18 | [
"https://Stackoverflow.com/questions/32654988",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1404270/"
] | How about creating it entirely programatically:
```
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
let button = UIButton(type: .Custom)
button.frame = CGRectMake(160, 100, 50, 50) // (x, y, width, height)
button.background... | It seems the `cornerRadius` is bigger than its height. Try the following code in your view controller:
```
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
startButton.backgroundColor = UIColor.clearColor()
startButton.layer.cornerRadius = startButton.bounds.size.height / 2
startB... |
32,654,988 | If I reference an assembly A.dll in my project and A.dll references B.dll. My project cannot access the exported namespaces/classes of B.dll, only A.dll. Is there something I can do so I don't have to directly reference B.dll in my project in order to access its classes? | 2015/09/18 | [
"https://Stackoverflow.com/questions/32654988",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1404270/"
] | How about creating it entirely programatically:
```
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
let button = UIButton(type: .Custom)
button.frame = CGRectMake(160, 100, 50, 50) // (x, y, width, height)
button.background... | First of all make the button completely square, then round the corner by half of its width or height.
E.g:
```js
// 200*200 square button
startButton.frame.size = CGSize(width: 200, height: 200)
startButton.backgroundColor = UIColor.clearColor()
// make the corner rounded like circle
startButton.layer.cornerRad... |
21,526,440 | I have array of regex pattern, i want to check the url which matches the regex and use it.
please let me know the best way to do it.
The code i have written is something like this.
```
var a = ['^\/(.*)\/product_(.*)','(.*)cat_(.*)'];
var result = a.exec("/Duracell-Coppertop-Alkaline-AA-24-Pack/product_385346");
```... | 2014/02/03 | [
"https://Stackoverflow.com/questions/21526440",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3069052/"
] | It's been more than 20 years since proper joins were introduced to SQL. FFS use them!
Try this:
```
select s.sid, s.sname
from student s
join enroll e on e.sid = s.sid
join course c on c.cno = e.cno and c.cname='computer science'
join enroll e1 on e1.sid = s.sid
join course c1 on c1.cno = e1.cno and c1.name='maths'
... | use the following code
```
select e.said, s.sname from enroll e inner join
enrool e1 on e1.sid = e.sid inner join
student s on s.sid = e.sid inner join
course c on c.cno = e.cno
where c.cname = 'computer science' and c.name = 'maths'
```
if you need to use the left join then use
```
select e.said, s.sname fro... |
49,247,236 | I want to delete all documents where a certain **field** exists
I tried to POST to the *\_delete\_by\_query* API
```
{
"query": {
"bool": {
"must": [
{ "exists":"field_name" }
]
}
}
}
```
That's giving me this *query malformed* error:
```
{
"error": {
"root_cause": [
{
... | 2018/03/13 | [
"https://Stackoverflow.com/questions/49247236",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1771679/"
] | There is an error in your query:
You don't have to use `bool` query, just use below query and it should work.
```
{
"query": {
"exists": {
"field": "name"
}
}
}
```
Read [this](https://www.elastic.co/guide/en/elasticsearch/reference/5.6/query-dsl-exists-query.html) for more details.
Hope this helps!! | You do not need to wrap the exists in a bool.
Try this
```
{
"query": {
"exists": {
"field": "field_name"
}
}
}
``` |
23,170 | I've tried multiple times to import a SVG file from illustrator CS5.5 to Blender 2.71 and 2.73. However, I do not see a mesh, curve, or anything pop up in my "Outliner" window. So I know its not so small I can't see it. I even made sure under user preferences that the "import and export of SVG 1.1 format" is "checked."... | 2015/01/14 | [
"https://blender.stackexchange.com/questions/23170",
"https://blender.stackexchange.com",
"https://blender.stackexchange.com/users/10967/"
] | This is a very common error with a simple solution.
---------------------------------------------------
The error:
Just because you saved your file in SVG format, it doesn't mean that the information it contains [vector format](https://en.wikipedia.org/wiki/Vector_graphics), and Blender's SVG importer expects vectors... | It is possibel that the import worked just fine but ended up in a different collection. You would not see anything in the viewport, but check the outliner. |
68,694,173 | I have a requirement of a query which i need to build it contains two tables and top three max records from the joined columns let me share the requirements first.
return the first,second and third scorer against each category columns to show are
```
category,student_id,name,college_name and score
order by category ... | 2021/08/07 | [
"https://Stackoverflow.com/questions/68694173",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6446710/"
] | Use DENSE\_RANK() because same marks can get multiple students per category.
```
-- MySQL (v5.8)
SELECT p.category
, s.id student_id
, s.name student_name
, s.college_name
, p.score
FROM students s
INNER JOIN (SELECT category
, student_id
, score
,... | Try `DESC LIMIT 3` instead of asc.
let me know whether this worked or not. |
72,706,233 | I have a list of words.
I figgured out how to count the occurrence of each word.
I now want to know **how many words appear how many times(?)** in that list. The output should look something like this:
4.500 Words appeard 1 time
6.000 Words appeard 2 time
...
Example:
```
list = ["hello", "time", "burger", "hello",... | 2022/06/21 | [
"https://Stackoverflow.com/questions/72706233",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/17192201/"
] | Yes; use a `Counter` to count the number of times each word appears, and then use a `Counter` on that counter to count how many words appear each number of times.
```
>>> words = ["hello", "time", "burger", "hello", "mouse", "time", "time"]
>>> from collections import Counter
>>> word_counts = Counter(words)
>>> count... | If you know how to count the occurrences of each word, the procedure is straightforward. In pseudo-code:
1. Let `A = n*[0]`, where n is the amount of words
2. For each word, let `m` be the number of times the word occurs. Then do `A[m]++`
3. For i in range n, `print(str(A[i]) + " words appear " + str(i) + "times")` |
35,965,798 | what in the following code is causeing Warning: Illegal string offset 'quantity' in ' because of PHP 5.4 version cant find a fix?
```
<?php
include "data.php";
function checkStock($id_film){
$query_stock = "SELECT stockquantity FROM table WHERE id = {$id_film}";
$result_stock... | 2016/03/13 | [
"https://Stackoverflow.com/questions/35965798",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6042818/"
] | If you'd like to debug, you could write:
```
$row = mysql_fetch_row($result_stock);
echo "<pre>";
print_r($row);
echo "</pre>";
```
That will give you an idea about what the array looks like. From your MYSQL query, it's probably going to be like:
```
Array(
"quantity" => 5
)
```
So, this should work:
```
echo... | Obligatory chastisement: Don't use the `mysql` API; it's deprecated and has been removed completely from PHP 7. Now that that's out of the way...
`$row = mysql_fetch_row($result_stock);` returns a ***single row*** of data as a ***one-dimensional array.*** Your reference to `$row[0]['quantity']` is attempting to derefe... |
35,965,798 | what in the following code is causeing Warning: Illegal string offset 'quantity' in ' because of PHP 5.4 version cant find a fix?
```
<?php
include "data.php";
function checkStock($id_film){
$query_stock = "SELECT stockquantity FROM table WHERE id = {$id_film}";
$result_stock... | 2016/03/13 | [
"https://Stackoverflow.com/questions/35965798",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/6042818/"
] | If you'd like to debug, you could write:
```
$row = mysql_fetch_row($result_stock);
echo "<pre>";
print_r($row);
echo "</pre>";
```
That will give you an idea about what the array looks like. From your MYSQL query, it's probably going to be like:
```
Array(
"quantity" => 5
)
```
So, this should work:
```
echo... | You have used mysql\_fetch\_row which returns single row of database as an array which you can access information like $row[0], $row[1], ... In your case it seems that you are accessing one field of a unique record then you have only one field to be returned if found or null if not found. If you want to access informat... |
126,019 | I've heard fans pronounce the acronym for Imperial Walkers by saying each letter (A-T-A-T) and also by saying the two parts as words (At-At). Is there any consensus on which is right?
AT-AT stands for All Terrain Armored Transport, but they're only referred to as Imperial Walkers in *Empire Strikes Back*.
Was the na... | 2016/04/24 | [
"https://scifi.stackexchange.com/questions/126019",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/54954/"
] | A.T.A.T
Source: Disney Star Wars Rebels S03 E10 aired 12/3/16 | There is no canon pronounciation of AT-AT. There are, however, some Legends products that pronounce the name. The following is sourced from <http://starwars.wikia.com/wiki/All_Terrain_Armored_Transport/Legends#First_use_discrepancy>:
>
> AT-AT is pronounced "at-at" in Star Wars: Force Commander, and Star Wars: Galact... |
126,019 | I've heard fans pronounce the acronym for Imperial Walkers by saying each letter (A-T-A-T) and also by saying the two parts as words (At-At). Is there any consensus on which is right?
AT-AT stands for All Terrain Armored Transport, but they're only referred to as Imperial Walkers in *Empire Strikes Back*.
Was the na... | 2016/04/24 | [
"https://scifi.stackexchange.com/questions/126019",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/54954/"
] | The original pronounciation (presented to us by the toy commercials) was @@.
We were aware that it was an acronym but it made sense, in-universe for the characters to colloquialize it. Along the same lines, a High Mobility Multipurpose Wheeled Vehicle is often referred to as a HUMVEE 'cause if your friend Pete is look... | *The Rise of Skywalker* - Episode 9, at 47:55, Stormtroopers clearly say A.T.A.T. right after Rey takes Zorii's hand. The case is finally solved, it was in the movie, it's golden and true. |
126,019 | I've heard fans pronounce the acronym for Imperial Walkers by saying each letter (A-T-A-T) and also by saying the two parts as words (At-At). Is there any consensus on which is right?
AT-AT stands for All Terrain Armored Transport, but they're only referred to as Imperial Walkers in *Empire Strikes Back*.
Was the na... | 2016/04/24 | [
"https://scifi.stackexchange.com/questions/126019",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/54954/"
] | Both are correct
================
According to Dave Filoni, producer of Star Wars Rebels and former director of the Clone Wars the answer is both.
In an interview during Star Wars Celebration 2016 he says:
>
> I say you can say at-at, you can say A-T-A-T, and you can say walker. I'm for all three. ... That's canon b... | The original pronounciation (presented to us by the toy commercials) was @@.
We were aware that it was an acronym but it made sense, in-universe for the characters to colloquialize it. Along the same lines, a High Mobility Multipurpose Wheeled Vehicle is often referred to as a HUMVEE 'cause if your friend Pete is look... |
126,019 | I've heard fans pronounce the acronym for Imperial Walkers by saying each letter (A-T-A-T) and also by saying the two parts as words (At-At). Is there any consensus on which is right?
AT-AT stands for All Terrain Armored Transport, but they're only referred to as Imperial Walkers in *Empire Strikes Back*.
Was the na... | 2016/04/24 | [
"https://scifi.stackexchange.com/questions/126019",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/54954/"
] | Both are correct
================
According to Dave Filoni, producer of Star Wars Rebels and former director of the Clone Wars the answer is both.
In an interview during Star Wars Celebration 2016 he says:
>
> I say you can say at-at, you can say A-T-A-T, and you can say walker. I'm for all three. ... That's canon b... | A.T.A.T
Source: Disney Star Wars Rebels S03 E10 aired 12/3/16 |
126,019 | I've heard fans pronounce the acronym for Imperial Walkers by saying each letter (A-T-A-T) and also by saying the two parts as words (At-At). Is there any consensus on which is right?
AT-AT stands for All Terrain Armored Transport, but they're only referred to as Imperial Walkers in *Empire Strikes Back*.
Was the na... | 2016/04/24 | [
"https://scifi.stackexchange.com/questions/126019",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/54954/"
] | Both are correct
================
According to Dave Filoni, producer of Star Wars Rebels and former director of the Clone Wars the answer is both.
In an interview during Star Wars Celebration 2016 he says:
>
> I say you can say at-at, you can say A-T-A-T, and you can say walker. I'm for all three. ... That's canon b... | There is no canon pronounciation of AT-AT. There are, however, some Legends products that pronounce the name. The following is sourced from <http://starwars.wikia.com/wiki/All_Terrain_Armored_Transport/Legends#First_use_discrepancy>:
>
> AT-AT is pronounced "at-at" in Star Wars: Force Commander, and Star Wars: Galact... |
126,019 | I've heard fans pronounce the acronym for Imperial Walkers by saying each letter (A-T-A-T) and also by saying the two parts as words (At-At). Is there any consensus on which is right?
AT-AT stands for All Terrain Armored Transport, but they're only referred to as Imperial Walkers in *Empire Strikes Back*.
Was the na... | 2016/04/24 | [
"https://scifi.stackexchange.com/questions/126019",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/54954/"
] | "At-At", according to LucasFilm.
================================
Joseph Lin, a journalist at *Time Magazine*, asked LucasFilm this very question. They responded that the **official pronunciation rhymes with "hat-hat".**
* <http://techland.time.com/2010/09/02/how-do-you-pronounce-at-at/>
As for the A-T-A-T pronuncia... | A.T.A.T
Source: Disney Star Wars Rebels S03 E10 aired 12/3/16 |
126,019 | I've heard fans pronounce the acronym for Imperial Walkers by saying each letter (A-T-A-T) and also by saying the two parts as words (At-At). Is there any consensus on which is right?
AT-AT stands for All Terrain Armored Transport, but they're only referred to as Imperial Walkers in *Empire Strikes Back*.
Was the na... | 2016/04/24 | [
"https://scifi.stackexchange.com/questions/126019",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/54954/"
] | "At-At", according to LucasFilm.
================================
Joseph Lin, a journalist at *Time Magazine*, asked LucasFilm this very question. They responded that the **official pronunciation rhymes with "hat-hat".**
* <http://techland.time.com/2010/09/02/how-do-you-pronounce-at-at/>
As for the A-T-A-T pronuncia... | There is no canon pronounciation of AT-AT. There are, however, some Legends products that pronounce the name. The following is sourced from <http://starwars.wikia.com/wiki/All_Terrain_Armored_Transport/Legends#First_use_discrepancy>:
>
> AT-AT is pronounced "at-at" in Star Wars: Force Commander, and Star Wars: Galact... |
126,019 | I've heard fans pronounce the acronym for Imperial Walkers by saying each letter (A-T-A-T) and also by saying the two parts as words (At-At). Is there any consensus on which is right?
AT-AT stands for All Terrain Armored Transport, but they're only referred to as Imperial Walkers in *Empire Strikes Back*.
Was the na... | 2016/04/24 | [
"https://scifi.stackexchange.com/questions/126019",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/54954/"
] | A.T.A.T
Source: Disney Star Wars Rebels S03 E10 aired 12/3/16 | *The Rise of Skywalker* - Episode 9, at 47:55, Stormtroopers clearly say A.T.A.T. right after Rey takes Zorii's hand. The case is finally solved, it was in the movie, it's golden and true. |
126,019 | I've heard fans pronounce the acronym for Imperial Walkers by saying each letter (A-T-A-T) and also by saying the two parts as words (At-At). Is there any consensus on which is right?
AT-AT stands for All Terrain Armored Transport, but they're only referred to as Imperial Walkers in *Empire Strikes Back*.
Was the na... | 2016/04/24 | [
"https://scifi.stackexchange.com/questions/126019",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/54954/"
] | The original pronounciation (presented to us by the toy commercials) was @@.
We were aware that it was an acronym but it made sense, in-universe for the characters to colloquialize it. Along the same lines, a High Mobility Multipurpose Wheeled Vehicle is often referred to as a HUMVEE 'cause if your friend Pete is look... | There is no canon pronounciation of AT-AT. There are, however, some Legends products that pronounce the name. The following is sourced from <http://starwars.wikia.com/wiki/All_Terrain_Armored_Transport/Legends#First_use_discrepancy>:
>
> AT-AT is pronounced "at-at" in Star Wars: Force Commander, and Star Wars: Galact... |
126,019 | I've heard fans pronounce the acronym for Imperial Walkers by saying each letter (A-T-A-T) and also by saying the two parts as words (At-At). Is there any consensus on which is right?
AT-AT stands for All Terrain Armored Transport, but they're only referred to as Imperial Walkers in *Empire Strikes Back*.
Was the na... | 2016/04/24 | [
"https://scifi.stackexchange.com/questions/126019",
"https://scifi.stackexchange.com",
"https://scifi.stackexchange.com/users/54954/"
] | Both are correct
================
According to Dave Filoni, producer of Star Wars Rebels and former director of the Clone Wars the answer is both.
In an interview during Star Wars Celebration 2016 he says:
>
> I say you can say at-at, you can say A-T-A-T, and you can say walker. I'm for all three. ... That's canon b... | *The Rise of Skywalker* - Episode 9, at 47:55, Stormtroopers clearly say A.T.A.T. right after Rey takes Zorii's hand. The case is finally solved, it was in the movie, it's golden and true. |
10,100 | I heard that the time for submitting presidential election papers passed on March 3, 2016.
No one seems to have registered by then.
How could a third party (Romney, Bloomberg, Trump) run as an independent or other party candidate now? | 2016/03/04 | [
"https://politics.stackexchange.com/questions/10100",
"https://politics.stackexchange.com",
"https://politics.stackexchange.com/users/7481/"
] | There is no date associated with registering as a candidate for federal office. Some states' branches of the main parties have had [recent deadlines](https://ballotpedia.org/Important_dates_in_the_2016_presidential_race), but none on March 3 that I can see.
In fact, you don't have to register *at all* unless you have ... | Another issue is that third parties don't necessarily need to register the same way as independents. Some of them have ballot access for their candidates in some states regardless. Or they may have been able to register a spot without selecting a specific candidate.
See <https://www.lp.org/2016-presidential-ballot-ac... |
13,196,817 | If an object does not have a property and I am accessing the property, we get a `MissingPropertyException`. Can I do something similar to safe null (`?.`) to guard against missing properties so it doesn't throw an exception? | 2012/11/02 | [
"https://Stackoverflow.com/questions/13196817",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/253477/"
] | One option would be:
```
def result = obj.hasProperty( 'b' ) ? obj.b : null
```
Which would return null if the object doesn't have the property...
Another would be to add `propertyMissing` to your class like so:
```
def propertyMissing( name ) {
null
}
```
This means that any missing properties would just resu... | You can also use try/catch
```
try
{ env.GERRIT_TOPIC=GERRIT_TOPIC
}
catch (e_val)
{ echo 'missing GERRIT_TOPIC'
}
``` |
24,481 | This is really puzzling me. I have 2 newsletter subscription forms on my site. On the home page, there is one at the top, below the banner, and the other is on every page located in the footer. I am also using the Ultimo theme from ThemeForest, and I had set the newsletter block from its default location in the footer ... | 2014/06/20 | [
"https://magento.stackexchange.com/questions/24481",
"https://magento.stackexchange.com",
"https://magento.stackexchange.com/users/7782/"
] | My first suggestion is that you are using the same JavaScript variable for both forms:
```
var newsletterSubscriberFormDetail = new VarienForm('newsletter-head-validate-detail');
var newsletterSubscriberFormDetail = new VarienForm('newsletter-footer-validate-detail');
```
Though it seems odd that the header works an... | ```
{{block type="newsletter/subscribe" template="newsletter/subscribe_head.phtml"}}
{{block type="newsletter/subscribe" template="newsletter/subscribe_head.phtml"}}
```
You should have a `name` property for block definition. This is how magento uniquely identifies your block. Most probably this may cause the probl... |
24,481 | This is really puzzling me. I have 2 newsletter subscription forms on my site. On the home page, there is one at the top, below the banner, and the other is on every page located in the footer. I am also using the Ultimo theme from ThemeForest, and I had set the newsletter block from its default location in the footer ... | 2014/06/20 | [
"https://magento.stackexchange.com/questions/24481",
"https://magento.stackexchange.com",
"https://magento.stackexchange.com/users/7782/"
] | As you now have most of it working other than the validation. I would imagine that for the validation to work on both forms you need "var newsletterSubscriberFormDetail" to be different on each form e.g
```
var newsletterSubscriberFormDetailHeader
```
&
```
var newsletterSubscriberFormDetailFooter
``` | ```
{{block type="newsletter/subscribe" template="newsletter/subscribe_head.phtml"}}
{{block type="newsletter/subscribe" template="newsletter/subscribe_head.phtml"}}
```
You should have a `name` property for block definition. This is how magento uniquely identifies your block. Most probably this may cause the probl... |
11,010,117 | I am building a application in codeigniter and is running in some issues with routes.
I want that if someone punch in this url: www.mywebsite.com/request-information, a controller called 'myform' should be called.
I am configuring routes file as this:
$route['request-information']='leadform';
But this doesn't work w... | 2012/06/13 | [
"https://Stackoverflow.com/questions/11010117",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1343761/"
] | You have to use `TypedValue.applyDimension` to get the pixel count of dp's. Here's an example:
```
DisplayMetrics dm = getResources().getDisplayMetrics();
float dpInPx = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DP, 300, dm);
```
That will give the the pixel value of 300dp programmatically.
Cheers | There's no setWidth(300dp). The workaround is to get the display size, and adjust the 300px variable accordingly.
I must say that there's probably a better way to create a nice layout. Have you tried using nested linearlayouts and layout\_weights? |
11,010,117 | I am building a application in codeigniter and is running in some issues with routes.
I want that if someone punch in this url: www.mywebsite.com/request-information, a controller called 'myform' should be called.
I am configuring routes file as this:
$route['request-information']='leadform';
But this doesn't work w... | 2012/06/13 | [
"https://Stackoverflow.com/questions/11010117",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1343761/"
] | You have to use `TypedValue.applyDimension` to get the pixel count of dp's. Here's an example:
```
DisplayMetrics dm = getResources().getDisplayMetrics();
float dpInPx = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DP, 300, dm);
```
That will give the the pixel value of 300dp programmatically.
Cheers | Android doen't have separate method for setting button's dimensions in dp. You have to:
```
//Find screen density scale factor
final float scale = getContext().getResources().getDisplayMetrics().density;
myButton.setWidth((int)(100 * scale));
myButton.setHeight((int)(50 * scale));
``` |
59,979,368 | I need to add a new select option in my HTML when they click it
```
<select class="statusButtonChange statusButton " data-value="49506">
<option value="0" selected=""></option>
<option value="1">Close</option>
<option value="2" disabled="" style="color:grey;">Taken</option>
</select>
```
This new option ... | 2020/01/30 | [
"https://Stackoverflow.com/questions/59979368",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/11825620/"
] | I'm not sure exactly what's wrong, but I think a better approach might be to use jQuery's append method (<https://api.jquery.com/append/>).
Consider:
```
...
$(".statusButton").on('focus', function () {
var value = "Disable";
var new_v = "";
var $statusButton = $(".statusButton");
if(k == 1){
... | This is short answer without creating too many variable.
```js
$(document).ready(function() {
var k = 1
$(".statusButton").on('focus', function() {
var value = "Disable";
if (k == 1) {
if (value == "Disable") {
$(".statusButton").append("<option value='Disable' >Disable</option>");
... |
61,913,223 | I have the following LSTM model. Can somebody helps me understand the summary of the model?
a) How the param# are calculated?
b) We have no value?
c) the param# near the dropoout why is 0?
```
model = Sequential()
model.add(LSTM(64, return_sequences=True, recurrent_regularizer=l2(0.0015), input_shape=(timestamps,
... | 2020/05/20 | [
"https://Stackoverflow.com/questions/61913223",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/13221018/"
] | Part of your question is answered here.
<https://datascience.stackexchange.com/questions/10615/number-of-parameters-in-an-lstm-model>
Simply put, the reason there are so many parameters for an LSTM model is because you have tons of data in your model and many weights need to be trained to fit the model.
Dropout laye... | 1. How parameters are calculated?
well!!. the input dimension is 6 and the hidden neurons in the first LSTM layer is 64.
so the first LSTM layer takes input [64 (initialized hidden state) + 6 (input)] in this form. so we can say the input dimension is 70 [64 (hidden state at t-1) + 6 current input at t].
Now the cal... |
77,629 | This code
```
\documentclass[10pt,a4paper]{article}
\usepackage[showframe,headheight=2in,headsep=0.1in,left=0.8in,right=0.8in,bottom=0.5in]{geometry}
\usepackage{xcolor}
\usepackage{hyperref}
\begin{document}
\begin{Form}
\noindent\textbf{DESCRIPTION OF ACTIVITY}\raisebox{-2pt}{\TextField[name=description,width=4.... | 2012/10/14 | [
"https://tex.stackexchange.com/questions/77629",
"https://tex.stackexchange.com",
"https://tex.stackexchange.com/users/16839/"
] | The mandatory argument to `\TextField` is the text that precedes the box. It's sufficient to measure it (and cut out something).
```
\documentclass{article}
\usepackage[pass,showframe]{geometry}
\usepackage{lipsum}
\usepackage{hyperref}
\newlength\TextFieldLength
\newcommand\TextFieldFill[2][]{%
\setlength\TextFiel... | It's easiest if you measure the earlier text then you can subtract its width from `\linewidth`
```
\documentclass[10pt,a4paper]{article}
\usepackage[showframe,headheight=2in,headsep=0.1in,left=0.8in,right=0.8in,bottom=0.5in]{geometry}
\usepackage{xcolor}
\usepackage{hyperref}
\newbox\formbox
\begin{document}
\begi... |
65,725,064 | In TYPO3 mailto links are decrypted by the following code snippet.
Is there a way to use this with mailto links, which contain subject and body text?
e.g.: email@example.org?subject=This is my subject&body=This is my bodytext: more text...etc.
```
// decrypt helper function
function decryptCharcode(n,start,end,of... | 2021/01/14 | [
"https://Stackoverflow.com/questions/65725064",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/-1/"
] | Try adding the property called `decorationThickness` in TextStyle.
```
Text(
'Flutter Developer',
style: TextStyle(
decoration: TextDecoration.underline,
decorationThickness: 4,
),
);
``` | Apply decorationThickness in a Text Style
The default decorationThickness is 1.0, which will use the font's base stroke thickness/width.
Text(
'This has a very BOLD strike through!',
style: TextStyle(
decoration: TextDecoration.lineThrough,
decorationThickness: 2.85,
),
) |
21,029,313 | I'm trying to write a batch file that installs a windows service using installutil.exe. I would like to use the installutil.exe that is in the latest version of the .Net Framework (located in C:\Windows\Microsoft.NET\Framework\v4.0.30319 on my machine).
Is there an easy way to change the directory in the command line ... | 2014/01/09 | [
"https://Stackoverflow.com/questions/21029313",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/1523851/"
] | Using Reed Copseys advice about inspecting the registry I found a sample on [another post](https://stackoverflow.com/a/9422501/1523851) about how to read the registry from a batch file.
Here is my batch file that finds the install directory for the .Net 4 Framework and installs my service:
```
@SET INSTALLUTILDIR=
@f... | There is no environment variable you can use as a "standard" replacement like that. The way most installers do it is by [inspecting the registry](https://stackoverflow.com/a/199783/65358) for the Framework installation path. |
35,669,950 | I am using JPA for data persistence.
I am unable to explain a behaviour in my program.
I have an entity `A` which has another entity `B` as its member.In my code I create new instance of `A` and set an instance of `B` (fetched from database) in `A`,and then I save `A` using `EntityManager`. I am using container manag... | 2016/02/27 | [
"https://Stackoverflow.com/questions/35669950",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2444661/"
] | As [this article](http://www.journaldev.com/2752/java-8-interface-changes-static-methods-default-methods-functional-interfaces) explains,
>
> One of the biggest design change in Java 8 is with the concept of interfaces. Prior to Java 7, we could have only method declarations in the interfaces. But **from Java 8, we c... | This is a relatively new feature of Java 8, which lets you write static implementations in interfaces.
Prior to Java 8 programmers were forced to define a class with static methods for their interface, e.g. [`Collections`](https://docs.oracle.com/javase/8/docs/api/java/util/Collections.html) class, which consists enti... |
23,847,553 | first I want to say I speak very little English, so excuse my spelling errors.
I am having a problem compiling some libraries in C using Code: Blocks as IDE
I have the following code:
```
//main.c
#include "lib1.h"
int main(){
}
```
And the "lib1.h" is
```
#ifndef GUARD_LIB1
#define GUARD_LIB1
MyTypedef varia... | 2014/05/24 | [
"https://Stackoverflow.com/questions/23847553",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/3672070/"
] | When compiling `main.c`, the header `lib2.h`, which contains the definition of `MyTypedef`, is never included. Therefore, when compiling `main.c`, the compiler has *no idea* what that type is.
That is, after the preprocessor runs, the compiler sees two "translation units" (the standard calls a c file and all the heade... | Move the included files from the EnzoLib.c to EnzoLib.h and only keep the #include "EnzoLib.h"
The contents of the EnzoLib.h should be something like
```
#ifndef ENZOLIB_H
#define ENZOLIB_H
#include <winsock2.h>
#include <windows.h>
#include <stdio.h>
typedef struct {
SOCKET sock;
char nombre[64];
char ... |
1,924 | What is the proper way to make a spear with a fixed blade to prevent breaking as described by Vorac in his comment [here](https://outdoors.stackexchange.com/a/364/127)? | 2012/09/05 | [
"https://outdoors.stackexchange.com/questions/1924",
"https://outdoors.stackexchange.com",
"https://outdoors.stackexchange.com/users/127/"
] | Personally I wouldn't! You run the risk of losing/breaking your blade.
Better to use the blade to sharpen a stick and fire harden the tip (till it goes brown, not black) it or attach something you don't mind loosing like a flint napped blade. | **Survival Spears**
Unless you plan to defend yourself from trees, I would focus more on the proper use of a spear fashioned from a knife.
The factors that must be considered are: (1) solidly attaching the knife and (2) how to use a spear without breaking the tip.
**Attaching the Blade**
One of the best fastening ... |
1,924 | What is the proper way to make a spear with a fixed blade to prevent breaking as described by Vorac in his comment [here](https://outdoors.stackexchange.com/a/364/127)? | 2012/09/05 | [
"https://outdoors.stackexchange.com/questions/1924",
"https://outdoors.stackexchange.com",
"https://outdoors.stackexchange.com/users/127/"
] | This is the best way that I know of, courtesy of [Field and Stream](http://www.fieldandstream.com/photos/gallery/hunting/2012/06/bushcraft-how-and-why-make-knife-spear-survival-situation?photo=0#node-1001470379). The spear they made can be seen in the picture below. The guide I've linked is step-by-step.
![enter image... | **Survival Spears**
Unless you plan to defend yourself from trees, I would focus more on the proper use of a spear fashioned from a knife.
The factors that must be considered are: (1) solidly attaching the knife and (2) how to use a spear without breaking the tip.
**Attaching the Blade**
One of the best fastening ... |
14,439,231 | I have a class and when I try to use it in another class I receive the error below.
```
using System;
using System.Collections.Generic;
using System.Linq;
namespace MySite
{
public class Reminders
{
public Dictionary<TimeSpan, string> TimeSpanText { get; set; }
// We are setting the default ... | 2013/01/21 | [
"https://Stackoverflow.com/questions/14439231",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/379008/"
] | This line:
```
private dynamic defaultReminder =
reminder.TimeSpanText[TimeSpan.FromMinutes(15)];
```
You cannot use an instance variable to initialize *another* instance variable. Why? Because the compiler can rearrange these - there is no guarantee that `reminder` will be initialized bef... | You need to put that code into the constructor of your class:
```
private Reminders reminder = new Reminders();
private dynamic defaultReminder;
public YourClass()
{
defaultReminder = reminder.TimeSpanText[TimeSpan.FromMinutes(15)];
}
```
The reason is that you can't use one instance variable to initialize anot... |
14,439,231 | I have a class and when I try to use it in another class I receive the error below.
```
using System;
using System.Collections.Generic;
using System.Linq;
namespace MySite
{
public class Reminders
{
public Dictionary<TimeSpan, string> TimeSpanText { get; set; }
// We are setting the default ... | 2013/01/21 | [
"https://Stackoverflow.com/questions/14439231",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/379008/"
] | This line:
```
private dynamic defaultReminder =
reminder.TimeSpanText[TimeSpan.FromMinutes(15)];
```
You cannot use an instance variable to initialize *another* instance variable. Why? Because the compiler can rearrange these - there is no guarantee that `reminder` will be initialized bef... | you can use like this
```
private dynamic defaultReminder => reminder.TimeSpanText[TimeSpan.FromMinutes(15)];
``` |
14,439,231 | I have a class and when I try to use it in another class I receive the error below.
```
using System;
using System.Collections.Generic;
using System.Linq;
namespace MySite
{
public class Reminders
{
public Dictionary<TimeSpan, string> TimeSpanText { get; set; }
// We are setting the default ... | 2013/01/21 | [
"https://Stackoverflow.com/questions/14439231",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/379008/"
] | This line:
```
private dynamic defaultReminder =
reminder.TimeSpanText[TimeSpan.FromMinutes(15)];
```
You cannot use an instance variable to initialize *another* instance variable. Why? Because the compiler can rearrange these - there is no guarantee that `reminder` will be initialized bef... | `private dynamic defaultReminder = reminder.TimeSpanText[TimeSpan.FromMinutes(15)];` is a field initializer and executes first (before any field without an initializer is set to its default value and before the invoked instance constructor is executed). Instance fields that have no initializer will only have a legal (d... |
14,439,231 | I have a class and when I try to use it in another class I receive the error below.
```
using System;
using System.Collections.Generic;
using System.Linq;
namespace MySite
{
public class Reminders
{
public Dictionary<TimeSpan, string> TimeSpanText { get; set; }
// We are setting the default ... | 2013/01/21 | [
"https://Stackoverflow.com/questions/14439231",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/379008/"
] | This line:
```
private dynamic defaultReminder =
reminder.TimeSpanText[TimeSpan.FromMinutes(15)];
```
You cannot use an instance variable to initialize *another* instance variable. Why? Because the compiler can rearrange these - there is no guarantee that `reminder` will be initialized bef... | i am totally surprised about the accepted answer here by the community which is totally wrong, accepted answer says:
>
> Because the compiler can rearrange these
>
>
>
as "Jeppe Stig Nielsen" says in a comment of accepted answer:
>
> The C# Language Specification states: The variable initializers are
> executed... |
14,439,231 | I have a class and when I try to use it in another class I receive the error below.
```
using System;
using System.Collections.Generic;
using System.Linq;
namespace MySite
{
public class Reminders
{
public Dictionary<TimeSpan, string> TimeSpanText { get; set; }
// We are setting the default ... | 2013/01/21 | [
"https://Stackoverflow.com/questions/14439231",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/379008/"
] | You need to put that code into the constructor of your class:
```
private Reminders reminder = new Reminders();
private dynamic defaultReminder;
public YourClass()
{
defaultReminder = reminder.TimeSpanText[TimeSpan.FromMinutes(15)];
}
```
The reason is that you can't use one instance variable to initialize anot... | you can use like this
```
private dynamic defaultReminder => reminder.TimeSpanText[TimeSpan.FromMinutes(15)];
``` |
14,439,231 | I have a class and when I try to use it in another class I receive the error below.
```
using System;
using System.Collections.Generic;
using System.Linq;
namespace MySite
{
public class Reminders
{
public Dictionary<TimeSpan, string> TimeSpanText { get; set; }
// We are setting the default ... | 2013/01/21 | [
"https://Stackoverflow.com/questions/14439231",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/379008/"
] | You need to put that code into the constructor of your class:
```
private Reminders reminder = new Reminders();
private dynamic defaultReminder;
public YourClass()
{
defaultReminder = reminder.TimeSpanText[TimeSpan.FromMinutes(15)];
}
```
The reason is that you can't use one instance variable to initialize anot... | `private dynamic defaultReminder = reminder.TimeSpanText[TimeSpan.FromMinutes(15)];` is a field initializer and executes first (before any field without an initializer is set to its default value and before the invoked instance constructor is executed). Instance fields that have no initializer will only have a legal (d... |
14,439,231 | I have a class and when I try to use it in another class I receive the error below.
```
using System;
using System.Collections.Generic;
using System.Linq;
namespace MySite
{
public class Reminders
{
public Dictionary<TimeSpan, string> TimeSpanText { get; set; }
// We are setting the default ... | 2013/01/21 | [
"https://Stackoverflow.com/questions/14439231",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/379008/"
] | You need to put that code into the constructor of your class:
```
private Reminders reminder = new Reminders();
private dynamic defaultReminder;
public YourClass()
{
defaultReminder = reminder.TimeSpanText[TimeSpan.FromMinutes(15)];
}
```
The reason is that you can't use one instance variable to initialize anot... | i am totally surprised about the accepted answer here by the community which is totally wrong, accepted answer says:
>
> Because the compiler can rearrange these
>
>
>
as "Jeppe Stig Nielsen" says in a comment of accepted answer:
>
> The C# Language Specification states: The variable initializers are
> executed... |
14,439,231 | I have a class and when I try to use it in another class I receive the error below.
```
using System;
using System.Collections.Generic;
using System.Linq;
namespace MySite
{
public class Reminders
{
public Dictionary<TimeSpan, string> TimeSpanText { get; set; }
// We are setting the default ... | 2013/01/21 | [
"https://Stackoverflow.com/questions/14439231",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/379008/"
] | you can use like this
```
private dynamic defaultReminder => reminder.TimeSpanText[TimeSpan.FromMinutes(15)];
``` | `private dynamic defaultReminder = reminder.TimeSpanText[TimeSpan.FromMinutes(15)];` is a field initializer and executes first (before any field without an initializer is set to its default value and before the invoked instance constructor is executed). Instance fields that have no initializer will only have a legal (d... |
14,439,231 | I have a class and when I try to use it in another class I receive the error below.
```
using System;
using System.Collections.Generic;
using System.Linq;
namespace MySite
{
public class Reminders
{
public Dictionary<TimeSpan, string> TimeSpanText { get; set; }
// We are setting the default ... | 2013/01/21 | [
"https://Stackoverflow.com/questions/14439231",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/379008/"
] | you can use like this
```
private dynamic defaultReminder => reminder.TimeSpanText[TimeSpan.FromMinutes(15)];
``` | i am totally surprised about the accepted answer here by the community which is totally wrong, accepted answer says:
>
> Because the compiler can rearrange these
>
>
>
as "Jeppe Stig Nielsen" says in a comment of accepted answer:
>
> The C# Language Specification states: The variable initializers are
> executed... |
14,439,231 | I have a class and when I try to use it in another class I receive the error below.
```
using System;
using System.Collections.Generic;
using System.Linq;
namespace MySite
{
public class Reminders
{
public Dictionary<TimeSpan, string> TimeSpanText { get; set; }
// We are setting the default ... | 2013/01/21 | [
"https://Stackoverflow.com/questions/14439231",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/379008/"
] | `private dynamic defaultReminder = reminder.TimeSpanText[TimeSpan.FromMinutes(15)];` is a field initializer and executes first (before any field without an initializer is set to its default value and before the invoked instance constructor is executed). Instance fields that have no initializer will only have a legal (d... | i am totally surprised about the accepted answer here by the community which is totally wrong, accepted answer says:
>
> Because the compiler can rearrange these
>
>
>
as "Jeppe Stig Nielsen" says in a comment of accepted answer:
>
> The C# Language Specification states: The variable initializers are
> executed... |
19,292,511 | I have this problem. Use UICollectionView with my class "myCustomCell" where I inserted a label that I have to change. When I use the method:
```
-(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
NSString *CellIdentifier = @"Cell";
Cust... | 2013/10/10 | [
"https://Stackoverflow.com/questions/19292511",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2486906/"
] | I hope my understanding is correct but if you want to open a link try using this.
```
Process.Start("link here");
``` | You can create new control and inherit from `System.Windows.Forms.Label`. It's pretty simple and described [here](http://mattberther.com/2005/07/10/a-winforms-hyperlink-control). |
19,292,511 | I have this problem. Use UICollectionView with my class "myCustomCell" where I inserted a label that I have to change. When I use the method:
```
-(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
NSString *CellIdentifier = @"Cell";
Cust... | 2013/10/10 | [
"https://Stackoverflow.com/questions/19292511",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2486906/"
] | I hope my understanding is correct but if you want to open a link try using this.
```
Process.Start("link here");
``` | If its a static link, why not just use regular html?
```
<a href="http://www.google.com" >link</a>
```
Or replace the actual link with some property from your codebehind |
19,292,511 | I have this problem. Use UICollectionView with my class "myCustomCell" where I inserted a label that I have to change. When I use the method:
```
-(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
NSString *CellIdentifier = @"Cell";
Cust... | 2013/10/10 | [
"https://Stackoverflow.com/questions/19292511",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/2486906/"
] | I hope my understanding is correct but if you want to open a link try using this.
```
Process.Start("link here");
``` | If u want to open a website inside your application you should use `WebBrowser` control. Add it to you winform and in your code provide the link to open the corresponding webpage. Your own customised browser. |
328,566 | I installed ubuntu on my dell inspiron 14z, currently only in my HDD. Before installing that, I switched to AHCI, turned off Intel rapid storage technology, turned off secure boot. Then while making the new partition table I choose GPT, and installed ubuntu.
But when I restarted the system, it was showing an error mes... | 2013/08/04 | [
"https://askubuntu.com/questions/328566",
"https://askubuntu.com",
"https://askubuntu.com/users/181034/"
] | It's not 100% clear what your current problem is; however:
* Your Windows is definitely installed in BIOS mode to `/dev/sda`, which is an MBR disk.
* Your Ubuntu appears to have been installed in EFI mode to `/dev/sdb`, which is a GPT disk. (Your `/home` is on `/dev/sda2`, though.)
This configuration is awkward becau... | The Legacy mode can not boot a GPT drive, there are exceptions for different hardware I think, but you must use UEFI in order to boot the GPT drive. So, after formatting your drive to GPT the installer assumes you have booted in UEFI mode and installs the OS for the UEFI mode.
Since, you had boot problems with the Le... |
60,857,223 | I have two different functions. How can I take the value of the variable from the first function to use in the second function? My Javascript code:
```
function test(){
var a = 5;
var b = 9;
var c = a + b;
}
function testB(){
var R = c + 15;
console.log(R)
}
```
My HTML code: (Just un button)... | 2020/03/25 | [
"https://Stackoverflow.com/questions/60857223",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12823885/"
] | ```js
function test(){
var a = 5;
var b = 9;
return a + b;
}
function testB(){
var R = test() + 15;
console.log(R)
}
```
```html
<button onclick="testB()">Click</button>
```
If you want to use the value of output of a funtion, you need to return the value. Here test() function returns ... | There are many approaches to this problem.
One solution is to make your variable c global. That means declaring it outside of your functions, like this:
```
var c;
function test(){
var a = 5;
var b = 9;
c = a + b;
}
```
Than you can use variable c in your second function. Also you are not calling your t... |
60,857,223 | I have two different functions. How can I take the value of the variable from the first function to use in the second function? My Javascript code:
```
function test(){
var a = 5;
var b = 9;
var c = a + b;
}
function testB(){
var R = c + 15;
console.log(R)
}
```
My HTML code: (Just un button)... | 2020/03/25 | [
"https://Stackoverflow.com/questions/60857223",
"https://Stackoverflow.com",
"https://Stackoverflow.com/users/12823885/"
] | Return the value from the `test()` function, and call it in the `testB` function:
```js
function test(){
var a = 5;
var b = 9;
var c = a + b;
return c;
}
function testB(){
var c = test();
var R = c + 15;
console.log(R)
}
```
```html
<button onclick="testB()"> Test Function</button>
``` | There are many approaches to this problem.
One solution is to make your variable c global. That means declaring it outside of your functions, like this:
```
var c;
function test(){
var a = 5;
var b = 9;
c = a + b;
}
```
Than you can use variable c in your second function. Also you are not calling your t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.