qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
109,677
On a site that I operate I use several layers of protection for our subscription content. Among the other protections, each content item is placed into a folder with a randomly generated 19-character name. That name can include numbers, lowercase letters, and uppercase letters. While it will not really lower the bene...
2012/02/15
[ "https://math.stackexchange.com/questions/109677", "https://math.stackexchange.com", "https://math.stackexchange.com/users/25055/" ]
Let's say you generate $K$-character folder names from an alphabet consisting of $A$ different symbols, and you currently have $N$ *distinctly named* folders. The chance of a particular folder name being generated is $1 / A^K$. The chance that your next folder name matches one that already exists therefore $N/A^K$. F...
There are a total of $62^{19} \approx 1.136 \times 10^{34}$ possible 19-character case-sensitive alphanumeric strings. 1. Thus, assuming you have 2500 distinct folders already, the chance of the next folder generated being a repeat is $\frac{2500}{1.136 \times 10^{34}} \approx 2.200 \times 10^{-31} $. 2. (a) If you ar...
29,820,214
I need to test a JavaScript project. There are described several modules but when I try to load them something goes wrong. ``` define([ 'core/BaseModel' ], function (BaseModel) { var MessageModel = BaseModel.extend({ defaults: { messageType: "Advertisment", receiver: "me", title: "Title", ...
2015/04/23
[ "https://Stackoverflow.com/questions/29820214", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2818992/" ]
Given that ***../../../public/js/app/models/Message*** corresponds to the `MessageModel`, what you want to do is: `var Message = require('../../../public/js/app/models/Message');` and to create a new instance: `var m = new Message();` Hope this helps.
I found a solution that works for this exact example. Instead of ``` message = Message; ``` I write ``` message = new Message(); ``` But I do exactly the same with a different module and it only gives a timeout error and keeps undefined: ``` var router; beforeAll(function(done){ require(['../../../public/js...
381,611
Multiple questions on meta indicate, that code-only answers, if they are self-explanatory and, what's more important, correct, do not fall into *low quality*: [1](https://meta.stackoverflow.com/questions/303772/failed-audit-when-commenting-on-code-only-answer), [2](https://meta.stackoverflow.com/a/258676/7606764). Mea...
2019/03/21
[ "https://meta.stackoverflow.com/questions/381611", "https://meta.stackoverflow.com", "https://meta.stackoverflow.com/users/7606764/" ]
> > *"if they are self-explanatory"*. > > > That answer is not self-explanatory. It's a code dump where the OP has to figure out what changed, and more importantly: *why*. It doesn't explain why the changes make the code work. Answers like that *are* of low quality. Maybe not enough to flag or delete them, but t...
The failure here seems to be due to two misconceptions: 1. That your only options on the first post queue are, No action needed, Edit, Flag and Skip. In actuality, there are several other options including upvote, downvote, and commenting. These options are conspicuously present in this queue as opposed to others li...
52,305,729
I'm new to React JS and am trying to implement something similar to the Angular sample application. I have a table of customers and want to seen the selected customer at the bottom of the table. I tried the following with react-router-dom: ``` // index.js import React from 'react'; import ReactDOM from 'react-dom';...
2018/09/13
[ "https://Stackoverflow.com/questions/52305729", "https://Stackoverflow.com", "https://Stackoverflow.com/users/583658/" ]
I feel the issue is with back ticks in path. Can you try with this ``` render() { return ( <React.Fragment> <Customers /> <Route path='/customer/:id' component={Customer} /> </React.Fragment> ); } ``` OR ``` render(...
Looks like you have a syntax error in the `Customer` component's `render()` method which will be causing issue when you attempt to use/render this. Try the following fix: ``` export default class Customer extends Component { render() { return (<p> Customer</p>); // <-- remove the whitespace in ...
52,305,729
I'm new to React JS and am trying to implement something similar to the Angular sample application. I have a table of customers and want to seen the selected customer at the bottom of the table. I tried the following with react-router-dom: ``` // index.js import React from 'react'; import ReactDOM from 'react-dom';...
2018/09/13
[ "https://Stackoverflow.com/questions/52305729", "https://Stackoverflow.com", "https://Stackoverflow.com/users/583658/" ]
change this: ``` import {Route} from "react-router-dom/Route"; ``` to this: ``` import Route from "react-router-dom/Route"; ``` Route is a default export when you access it directly: `"react-router-dom/Route"` You can use named exports when you import `Route` from base package ``` import {Route} from "react-rout...
I feel the issue is with back ticks in path. Can you try with this ``` render() { return ( <React.Fragment> <Customers /> <Route path='/customer/:id' component={Customer} /> </React.Fragment> ); } ``` OR ``` render(...
52,305,729
I'm new to React JS and am trying to implement something similar to the Angular sample application. I have a table of customers and want to seen the selected customer at the bottom of the table. I tried the following with react-router-dom: ``` // index.js import React from 'react'; import ReactDOM from 'react-dom';...
2018/09/13
[ "https://Stackoverflow.com/questions/52305729", "https://Stackoverflow.com", "https://Stackoverflow.com/users/583658/" ]
change this: ``` import {Route} from "react-router-dom/Route"; ``` to this: ``` import Route from "react-router-dom/Route"; ``` Route is a default export when you access it directly: `"react-router-dom/Route"` You can use named exports when you import `Route` from base package ``` import {Route} from "react-rout...
Looks like you have a syntax error in the `Customer` component's `render()` method which will be causing issue when you attempt to use/render this. Try the following fix: ``` export default class Customer extends Component { render() { return (<p> Customer</p>); // <-- remove the whitespace in ...
16,269,897
For the last month, we've had a bot scraping our site regularly, leading to a bunch of `ArgumentError: invalid %-encoding` errors because the URLs are malformed. I've looked at a bunch of issues in rack [here](https://github.com/rack/rack/issues/337) and [here](https://github.com/rack/rack/issues/225) and rails [here](...
2013/04/29
[ "https://Stackoverflow.com/questions/16269897", "https://Stackoverflow.com", "https://Stackoverflow.com/users/703019/" ]
Java is case-sensitive. The `static` keyword must be lowercase. Your code does not have `static` in all-lowercase; therefore, the compiler interprets `Static` as a return type, interprets the actual return type as the name, and then chokes on the actual name. To fix this, simply change `Static` to `static` everywhere.
In the function declaration, use 'static' instead of 'Static'
80,990
There doesn't seem to be a weight limit on [teleport](https://www.dndbeyond.com/spells/teleport) anymore but, for the purposes of looting a dungeon, what is an object? I can see how you can fill a chest and then teleport the chest and its contents. It is container and so all its contents are also teleported. How abou...
2016/05/31
[ "https://rpg.stackexchange.com/questions/80990", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/26539/" ]
### By RAW, an object is a single designated thing that isn't alive. In my opinion RAI extends to obvious containers. The teleport spell states (emphasis mine): > > This spell instantly transports you and up to eight willing creatures of your choice that you can see within range, or a single object that you can see ...
Make the table into a shipping container -- problem solved ---------------------------------------------------------- ### Preface The rules don't specify where the line is between "an object" and "not an object." Frankly, that's a good thing. This alleged imprecision gives both the DM and players room to work, to be ...
80,990
There doesn't seem to be a weight limit on [teleport](https://www.dndbeyond.com/spells/teleport) anymore but, for the purposes of looting a dungeon, what is an object? I can see how you can fill a chest and then teleport the chest and its contents. It is container and so all its contents are also teleported. How abou...
2016/05/31
[ "https://rpg.stackexchange.com/questions/80990", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/26539/" ]
### By RAW, an object is a single designated thing that isn't alive. In my opinion RAI extends to obvious containers. The teleport spell states (emphasis mine): > > This spell instantly transports you and up to eight willing creatures of your choice that you can see within range, or a single object that you can see ...
Everything that is not separable is part of the object ------------------------------------------------------ You can teleport any single object that fits into a 10-foot cube and is not held or carried, there is no weight limit. So what is an object? The [definition of object](https://rpg.stackexchange.com/questions/9...
80,990
There doesn't seem to be a weight limit on [teleport](https://www.dndbeyond.com/spells/teleport) anymore but, for the purposes of looting a dungeon, what is an object? I can see how you can fill a chest and then teleport the chest and its contents. It is container and so all its contents are also teleported. How abou...
2016/05/31
[ "https://rpg.stackexchange.com/questions/80990", "https://rpg.stackexchange.com", "https://rpg.stackexchange.com/users/26539/" ]
Make the table into a shipping container -- problem solved ---------------------------------------------------------- ### Preface The rules don't specify where the line is between "an object" and "not an object." Frankly, that's a good thing. This alleged imprecision gives both the DM and players room to work, to be ...
Everything that is not separable is part of the object ------------------------------------------------------ You can teleport any single object that fits into a 10-foot cube and is not held or carried, there is no weight limit. So what is an object? The [definition of object](https://rpg.stackexchange.com/questions/9...
36,015,250
I have many to many relation between `users` and `projects` through `user_project`. I know I could simply add `has_many :projects` in User Serializer (and vice versa in project serializer) to nest projects inside users. But I also have a few additional fields in `user_projects` table (eg. start and end dates for user'...
2016/03/15
[ "https://Stackoverflow.com/questions/36015250", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5679283/" ]
The best way to do this would be to establish a `'has-many-through'` (HMT) relationship between the `user` and `project` models and create a serializer for relationship's model. ``` class UserProjectSerializer < ActiveModel::Serializer ... end ``` This will then be used in the `UserSerializer` via: ``` has_many :...
I have had a similar problem before and I made use of [rabl](https://github.com/nesquena/rabl). There is a good tutorial on [railscasts](http://railscasts.com/episodes/322-rabl) to help you get started.
48,481,492
I'm trying to understand how classes work a bit better "under the hood" of python. If I create a class `Foo` like so ``` class Foo: bar = True ``` `Foo` is then directly accessible, such as `print(Foo)` or `print(Foo.bar)` However, if I dynamically create create a class and **don't set it to a variable** like...
2018/01/27
[ "https://Stackoverflow.com/questions/48481492", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1104854/" ]
let's compare your problem with function statements and lambdas (because they play the same role here), consider this function `f` : ``` def f (): return 1 ``` the above snippet of code is not an expression at all, it is a python statement that creates a function named `f` returning `1` upon calling it. let's now...
From [documentation](https://docs.python.org/2/library/functions.html#type) > > class **type**(name, bases, dict) > > > With three arguments, return a new type object. This is essentially a dynamic form of the class statement. The name string is the class name and becomes the **name** attribute; the bases tuple ite...
48,481,492
I'm trying to understand how classes work a bit better "under the hood" of python. If I create a class `Foo` like so ``` class Foo: bar = True ``` `Foo` is then directly accessible, such as `print(Foo)` or `print(Foo.bar)` However, if I dynamically create create a class and **don't set it to a variable** like...
2018/01/27
[ "https://Stackoverflow.com/questions/48481492", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1104854/" ]
let's compare your problem with function statements and lambdas (because they play the same role here), consider this function `f` : ``` def f (): return 1 ``` the above snippet of code is not an expression at all, it is a python statement that creates a function named `f` returning `1` upon calling it. let's now...
Using `type` with 3 argument is analogous to using the `lambda` to create a function. Without assignment the evaluated expression is garbage collected. However, just you can still create an instance of the class, just like you can immediately call a lambda function. ``` >>> lambda x: True <function <lambda> at 0x000...
48,481,492
I'm trying to understand how classes work a bit better "under the hood" of python. If I create a class `Foo` like so ``` class Foo: bar = True ``` `Foo` is then directly accessible, such as `print(Foo)` or `print(Foo.bar)` However, if I dynamically create create a class and **don't set it to a variable** like...
2018/01/27
[ "https://Stackoverflow.com/questions/48481492", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1104854/" ]
let's compare your problem with function statements and lambdas (because they play the same role here), consider this function `f` : ``` def f (): return 1 ``` the above snippet of code is not an expression at all, it is a python statement that creates a function named `f` returning `1` upon calling it. let's now...
I think you're making this too complicated. If you don't assign a value / object to a symbol, it is always "lost". Doesn't matter if the value / object is a class or something else. Example: ``` x = 2 + 2 ``` That assigns the value `4` to the symbol `x`. Compare to: ``` 2 + 2 ``` The operation is carried out but ...
48,481,492
I'm trying to understand how classes work a bit better "under the hood" of python. If I create a class `Foo` like so ``` class Foo: bar = True ``` `Foo` is then directly accessible, such as `print(Foo)` or `print(Foo.bar)` However, if I dynamically create create a class and **don't set it to a variable** like...
2018/01/27
[ "https://Stackoverflow.com/questions/48481492", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1104854/" ]
Using `type` with 3 argument is analogous to using the `lambda` to create a function. Without assignment the evaluated expression is garbage collected. However, just you can still create an instance of the class, just like you can immediately call a lambda function. ``` >>> lambda x: True <function <lambda> at 0x000...
From [documentation](https://docs.python.org/2/library/functions.html#type) > > class **type**(name, bases, dict) > > > With three arguments, return a new type object. This is essentially a dynamic form of the class statement. The name string is the class name and becomes the **name** attribute; the bases tuple ite...
48,481,492
I'm trying to understand how classes work a bit better "under the hood" of python. If I create a class `Foo` like so ``` class Foo: bar = True ``` `Foo` is then directly accessible, such as `print(Foo)` or `print(Foo.bar)` However, if I dynamically create create a class and **don't set it to a variable** like...
2018/01/27
[ "https://Stackoverflow.com/questions/48481492", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1104854/" ]
Using `type` with 3 argument is analogous to using the `lambda` to create a function. Without assignment the evaluated expression is garbage collected. However, just you can still create an instance of the class, just like you can immediately call a lambda function. ``` >>> lambda x: True <function <lambda> at 0x000...
I think you're making this too complicated. If you don't assign a value / object to a symbol, it is always "lost". Doesn't matter if the value / object is a class or something else. Example: ``` x = 2 + 2 ``` That assigns the value `4` to the symbol `x`. Compare to: ``` 2 + 2 ``` The operation is carried out but ...
48,204
My website is in PHP, running on Apache. One of my users is on a WAN with 2 IPs and his connection gets routed to our server by any one of them. PHP seems to log out the user out, if it detects change in IP. It is an open source app and I think some common popular file must have been used. Any way to prevent it?
2009/07/30
[ "https://serverfault.com/questions/48204", "https://serverfault.com", "https://serverfault.com/users/15055/" ]
I don't think apache has anything to do with that. The problem is most likely in php session although I don't think php checks the client ip by default. Are you sure there's nothing in your code checking the ip for a session?
I think it would be in PHP, not Apache. You might want to look see if the REMOTE\_ADDR is being used with $\_SERVER in generating the sessions. See [this PHP reference](http://us3.php.net/manual/en/reserved.variables.server.php), and [here is a whole thread](http://www.daniweb.com/forums/thread49898.html#) on the topic...
48,204
My website is in PHP, running on Apache. One of my users is on a WAN with 2 IPs and his connection gets routed to our server by any one of them. PHP seems to log out the user out, if it detects change in IP. It is an open source app and I think some common popular file must have been used. Any way to prevent it?
2009/07/30
[ "https://serverfault.com/questions/48204", "https://serverfault.com", "https://serverfault.com/users/15055/" ]
I don't think apache has anything to do with that. The problem is most likely in php session although I don't think php checks the client ip by default. Are you sure there's nothing in your code checking the ip for a session?
This is not PHP, or Apache -- it is a security 'option' of whatever FOSS package you are using. PHP sessions have no inherent security. If *Joe* with IP 192.168.0.1 logs into your site, he might get a session token of **ABC123**. If *Jane* then goes to her workstation, manually creates the cookie that contains the se...
30,401,920
I am trying to copy files, folders, sub folders, zip files etc from a given location to another location. I used the code below. ``` import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class C...
2015/05/22
[ "https://Stackoverflow.com/questions/30401920", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1379286/" ]
The reason this isn't working is because "My Music", "My Pictures" (or Images) and other directories are just symbolic links. See this post on how to detect symbolic links: [Java 1.6 - determine symbolic links](https://stackoverflow.com/questions/813710/java-1-6-determine-symbolic-links)
You are not handling the empty directories -- try making the following change, It will work after making the below change. ``` //list all the directory contents String files[] = src.list(); if (files!=null && files.length>0) { for (String file : files) { //construct the src and dest file ...
30,401,920
I am trying to copy files, folders, sub folders, zip files etc from a given location to another location. I used the code below. ``` import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; public class C...
2015/05/22
[ "https://Stackoverflow.com/questions/30401920", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1379286/" ]
Unfortunately, these folders (Images, Music, Videos) are NOT considered symbolic links in Java. Using Java 8, ``` Files.isSymbolicLink(srcFile.toPath()) ``` While return false, and `Files.readSymbolicLink(srcFile.toPath())` will fail with an Access Denied Exception. So you can't process them automatically. Fix you...
You are not handling the empty directories -- try making the following change, It will work after making the below change. ``` //list all the directory contents String files[] = src.list(); if (files!=null && files.length>0) { for (String file : files) { //construct the src and dest file ...
36,093,126
The error is at `script, first, second, third = argv`. I would like to understand why I am getting the error and how to fix it. ``` from sys import argv script, first, second, third = argv print("The script is called: ", script) print("The first variable is: ", first) print("The second variable is: ", second) print("...
2016/03/18
[ "https://Stackoverflow.com/questions/36093126", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6084339/" ]
`argv` variable contains command line arguments. In your code you expected 4 arguments, but got only 1 (first argument always script name). You could configure arguments in `pycharm`. Go to `Run` -> `Edit Configurations`. Then create a new python configuration. And there you could specify `Script parameters` field. Or ...
Run it from the shell like this: ``` python script.py arg1 arg2 arg3 ```
36,093,126
The error is at `script, first, second, third = argv`. I would like to understand why I am getting the error and how to fix it. ``` from sys import argv script, first, second, third = argv print("The script is called: ", script) print("The first variable is: ", first) print("The second variable is: ", second) print("...
2016/03/18
[ "https://Stackoverflow.com/questions/36093126", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6084339/" ]
Run it from the shell like this: ``` python script.py arg1 arg2 arg3 ```
You could run it like this: python script.py first, second, third
36,093,126
The error is at `script, first, second, third = argv`. I would like to understand why I am getting the error and how to fix it. ``` from sys import argv script, first, second, third = argv print("The script is called: ", script) print("The first variable is: ", first) print("The second variable is: ", second) print("...
2016/03/18
[ "https://Stackoverflow.com/questions/36093126", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6084339/" ]
Run it from the shell like this: ``` python script.py arg1 arg2 arg3 ```
I think you are running the following command: ``` python script.py ``` You are writing a program which is aksing for 4 inputs and you are giving onle one. That's why you are receiving an error. You can use the below command: ``` python script.py Hello How Are ```
36,093,126
The error is at `script, first, second, third = argv`. I would like to understand why I am getting the error and how to fix it. ``` from sys import argv script, first, second, third = argv print("The script is called: ", script) print("The first variable is: ", first) print("The second variable is: ", second) print("...
2016/03/18
[ "https://Stackoverflow.com/questions/36093126", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6084339/" ]
`argv` variable contains command line arguments. In your code you expected 4 arguments, but got only 1 (first argument always script name). You could configure arguments in `pycharm`. Go to `Run` -> `Edit Configurations`. Then create a new python configuration. And there you could specify `Script parameters` field. Or ...
You could run it like this: python script.py first, second, third
36,093,126
The error is at `script, first, second, third = argv`. I would like to understand why I am getting the error and how to fix it. ``` from sys import argv script, first, second, third = argv print("The script is called: ", script) print("The first variable is: ", first) print("The second variable is: ", second) print("...
2016/03/18
[ "https://Stackoverflow.com/questions/36093126", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6084339/" ]
`argv` variable contains command line arguments. In your code you expected 4 arguments, but got only 1 (first argument always script name). You could configure arguments in `pycharm`. Go to `Run` -> `Edit Configurations`. Then create a new python configuration. And there you could specify `Script parameters` field. Or ...
I think you are running the following command: ``` python script.py ``` You are writing a program which is aksing for 4 inputs and you are giving onle one. That's why you are receiving an error. You can use the below command: ``` python script.py Hello How Are ```
17,322,583
I'm trying to to install my rails app on a second computer. But when I run `bundle install` I get an error with the json gem: ``` Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. /Users/feuerball/.rvm/rubies/ruby-2.0.0-p195/bin/ruby extconf.rb /Users/feuerball/.rvm/rubies/ruby-2....
2013/06/26
[ "https://Stackoverflow.com/questions/17322583", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1183192/" ]
The problem was that my home folder is on a separate volume which contained a space in its name. Because of the space the second part of the name was interpreted as an option. The volumes name was something like `My Data` and thus I got the message`invalid option -D`. I just renamed this volume and now everything inst...
This seems to still be a bug... <https://github.com/flori/json/issues/163> Only caused with bundle. Can you try the gem install json? It might solve the problem after.
17,322,583
I'm trying to to install my rails app on a second computer. But when I run `bundle install` I get an error with the json gem: ``` Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. /Users/feuerball/.rvm/rubies/ruby-2.0.0-p195/bin/ruby extconf.rb /Users/feuerball/.rvm/rubies/ruby-2....
2013/06/26
[ "https://Stackoverflow.com/questions/17322583", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1183192/" ]
This seemed to happen with Json versions 1.8.0 and 1.8.1 (Ruby 2.2.3) ... I was able to upgrade to 1.8.2 and 1.8.3 with no problems ... specifying those versions ``` gem 'json', '~> 1.8.2' ``` in my bundle got me around the problem.
This seems to still be a bug... <https://github.com/flori/json/issues/163> Only caused with bundle. Can you try the gem install json? It might solve the problem after.
17,322,583
I'm trying to to install my rails app on a second computer. But when I run `bundle install` I get an error with the json gem: ``` Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. /Users/feuerball/.rvm/rubies/ruby-2.0.0-p195/bin/ruby extconf.rb /Users/feuerball/.rvm/rubies/ruby-2....
2013/06/26
[ "https://Stackoverflow.com/questions/17322583", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1183192/" ]
The problem was that my home folder is on a separate volume which contained a space in its name. Because of the space the second part of the name was interpreted as an option. The volumes name was something like `My Data` and thus I got the message`invalid option -D`. I just renamed this volume and now everything inst...
This seemed to happen with Json versions 1.8.0 and 1.8.1 (Ruby 2.2.3) ... I was able to upgrade to 1.8.2 and 1.8.3 with no problems ... specifying those versions ``` gem 'json', '~> 1.8.2' ``` in my bundle got me around the problem.
94,644
Excluding vocabulary items which are entirely new or have fallen into disuse, what are some ways in which Japanese syntax itself has changed between the 1950s and today? (I would also like to exclude phenomena such as the semi-productivity of terms like ググる, since I'd argue these are new vocabulary and not fully produ...
2022/05/23
[ "https://japanese.stackexchange.com/questions/94644", "https://japanese.stackexchange.com", "https://japanese.stackexchange.com/users/816/" ]
[言文一致](https://en.wikipedia.org/wiki/Genbun_itchi) and the shift to modern kana orthography (1946) happened shortly before this period, and they were undoubtedly much more fundamental than anything that happened after 1950. But I'll focus on the change of modern 口語 here. The list is far from complete; I just wrote down...
If you mean by "syntax" basic structures of the language and fundamental rules of how you construct a sentence (like the subject-object-verb order), I'd say nothing has changed. Most languages don't change at the fundamental level in 70 years, or in the lifetime of a person. That said, which grammatical words and cons...
30,208,595
I am building a form where I need to programmatically set bindings and the dataset (as it is variable and different documents can be loaded in to it). I've managed to get the form to load any information in to a `DataGridView` and also load that information from the `DataGridView` in to some TextBoxes for structured ed...
2015/05/13
[ "https://Stackoverflow.com/questions/30208595", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1925536/" ]
`svcState` should be provider rather than service. Because service/factory won't be accessible inside config phase. You need to change the implementation of `svcState` to provider so that it will be available in config block of angular. After provider implementation you could inject that provider using `svcStateProvid...
Here is what I changed: ``` angular .module('main', [ 'ngRoute' ]) .provider('appState', function(){ var appState; this.setState = function(newState) { appState = newState; }; this.getState = function() { return appState; }; ...
28,859
When designing an advertisement campaign how should one balance dignity and respect for offensiveness? Nobody remembers the latest ad for McDonald's or Foldger's but I can tell you all about the "[black face Dunkin Donuts](http://www.adweek.com/adfreak/dunkin-donuts-apologizes-blackface-ad-not-everyone-sorry-152172)" ...
2014/03/31
[ "https://graphicdesign.stackexchange.com/questions/28859", "https://graphicdesign.stackexchange.com", "https://graphicdesign.stackexchange.com/users/2611/" ]
*De gustibus non est disputandum* applies. What is tasteless, like what is humorous (or not), varies with culture, fashion, sensitivities and the prevailing political climate. It is also a personal matter, so my answer is personal. Like anyone, I have my own views on what is acceptable. This isn't a matter of being sn...
It's always about the brand. ============================ What does the brand stand for in it's audience's mind? Is it offensive, irreverent, tasteless? Then you have to live up to that. Anything less wouldn't be true to their intended message. If you aren't comfortable with that type of material, you shouldn't be wor...
28,859
When designing an advertisement campaign how should one balance dignity and respect for offensiveness? Nobody remembers the latest ad for McDonald's or Foldger's but I can tell you all about the "[black face Dunkin Donuts](http://www.adweek.com/adfreak/dunkin-donuts-apologizes-blackface-ad-not-everyone-sorry-152172)" ...
2014/03/31
[ "https://graphicdesign.stackexchange.com/questions/28859", "https://graphicdesign.stackexchange.com", "https://graphicdesign.stackexchange.com/users/2611/" ]
*De gustibus non est disputandum* applies. What is tasteless, like what is humorous (or not), varies with culture, fashion, sensitivities and the prevailing political climate. It is also a personal matter, so my answer is personal. Like anyone, I have my own views on what is acceptable. This isn't a matter of being sn...
Purely from a graphic designer's POV, it's a decision that each designer has to make on their own based on the particulars of the given situation. In general, being offensive isn't a typical marketing strategy, though it does get used. You as a designer have to decide if you want to work on projects that are purposef...
28,859
When designing an advertisement campaign how should one balance dignity and respect for offensiveness? Nobody remembers the latest ad for McDonald's or Foldger's but I can tell you all about the "[black face Dunkin Donuts](http://www.adweek.com/adfreak/dunkin-donuts-apologizes-blackface-ad-not-everyone-sorry-152172)" ...
2014/03/31
[ "https://graphicdesign.stackexchange.com/questions/28859", "https://graphicdesign.stackexchange.com", "https://graphicdesign.stackexchange.com/users/2611/" ]
*De gustibus non est disputandum* applies. What is tasteless, like what is humorous (or not), varies with culture, fashion, sensitivities and the prevailing political climate. It is also a personal matter, so my answer is personal. Like anyone, I have my own views on what is acceptable. This isn't a matter of being sn...
This is really Your Mileage May Vary, or in this case Your Audience's Mileage May Vary. What one audience thinks is tasteless is another audience's boring. The multi-racial family in the Cheerios ad, for example: in some corners of the U.S. it's shocking to the point of boycotting the cereal, in some areas the reactio...
28,859
When designing an advertisement campaign how should one balance dignity and respect for offensiveness? Nobody remembers the latest ad for McDonald's or Foldger's but I can tell you all about the "[black face Dunkin Donuts](http://www.adweek.com/adfreak/dunkin-donuts-apologizes-blackface-ad-not-everyone-sorry-152172)" ...
2014/03/31
[ "https://graphicdesign.stackexchange.com/questions/28859", "https://graphicdesign.stackexchange.com", "https://graphicdesign.stackexchange.com/users/2611/" ]
*De gustibus non est disputandum* applies. What is tasteless, like what is humorous (or not), varies with culture, fashion, sensitivities and the prevailing political climate. It is also a personal matter, so my answer is personal. Like anyone, I have my own views on what is acceptable. This isn't a matter of being sn...
Great answers here, I just wanted to mention something that hasn't been raised yet (except in the question), and it's the matter of **dignity**. Humor, even if slightly offensive for a group or the other, is one thing. I love humor. Playing on people's weaknesses for the sake of profit is entirely different. I don't ...
28,859
When designing an advertisement campaign how should one balance dignity and respect for offensiveness? Nobody remembers the latest ad for McDonald's or Foldger's but I can tell you all about the "[black face Dunkin Donuts](http://www.adweek.com/adfreak/dunkin-donuts-apologizes-blackface-ad-not-everyone-sorry-152172)" ...
2014/03/31
[ "https://graphicdesign.stackexchange.com/questions/28859", "https://graphicdesign.stackexchange.com", "https://graphicdesign.stackexchange.com/users/2611/" ]
I second Emilie in saying that everything will offend someone somewhere. Personally, I am pretty sick of people finding offence left right and centre. Some people are *looking for* things that will get their knickers in a twist, and as Alan so elegantly points out: pleasing everyone ends up in the bland, the invisible ...
Great answers here, I just wanted to mention something that hasn't been raised yet (except in the question), and it's the matter of **dignity**. Humor, even if slightly offensive for a group or the other, is one thing. I love humor. Playing on people's weaknesses for the sake of profit is entirely different. I don't ...
28,859
When designing an advertisement campaign how should one balance dignity and respect for offensiveness? Nobody remembers the latest ad for McDonald's or Foldger's but I can tell you all about the "[black face Dunkin Donuts](http://www.adweek.com/adfreak/dunkin-donuts-apologizes-blackface-ad-not-everyone-sorry-152172)" ...
2014/03/31
[ "https://graphicdesign.stackexchange.com/questions/28859", "https://graphicdesign.stackexchange.com", "https://graphicdesign.stackexchange.com/users/2611/" ]
*De gustibus non est disputandum* applies. What is tasteless, like what is humorous (or not), varies with culture, fashion, sensitivities and the prevailing political climate. It is also a personal matter, so my answer is personal. Like anyone, I have my own views on what is acceptable. This isn't a matter of being sn...
I second Emilie in saying that everything will offend someone somewhere. Personally, I am pretty sick of people finding offence left right and centre. Some people are *looking for* things that will get their knickers in a twist, and as Alan so elegantly points out: pleasing everyone ends up in the bland, the invisible ...
28,859
When designing an advertisement campaign how should one balance dignity and respect for offensiveness? Nobody remembers the latest ad for McDonald's or Foldger's but I can tell you all about the "[black face Dunkin Donuts](http://www.adweek.com/adfreak/dunkin-donuts-apologizes-blackface-ad-not-everyone-sorry-152172)" ...
2014/03/31
[ "https://graphicdesign.stackexchange.com/questions/28859", "https://graphicdesign.stackexchange.com", "https://graphicdesign.stackexchange.com/users/2611/" ]
I second Emilie in saying that everything will offend someone somewhere. Personally, I am pretty sick of people finding offence left right and centre. Some people are *looking for* things that will get their knickers in a twist, and as Alan so elegantly points out: pleasing everyone ends up in the bland, the invisible ...
I don't think it is marketing genius as you could get as much visibility with a great ad that is not tasteless. As for the calculation, I don't think there is a way to do the calculation by yourself, especially if you're not the target audience. Different target audience have different flexibility for humor, you like...
28,859
When designing an advertisement campaign how should one balance dignity and respect for offensiveness? Nobody remembers the latest ad for McDonald's or Foldger's but I can tell you all about the "[black face Dunkin Donuts](http://www.adweek.com/adfreak/dunkin-donuts-apologizes-blackface-ad-not-everyone-sorry-152172)" ...
2014/03/31
[ "https://graphicdesign.stackexchange.com/questions/28859", "https://graphicdesign.stackexchange.com", "https://graphicdesign.stackexchange.com/users/2611/" ]
*De gustibus non est disputandum* applies. What is tasteless, like what is humorous (or not), varies with culture, fashion, sensitivities and the prevailing political climate. It is also a personal matter, so my answer is personal. Like anyone, I have my own views on what is acceptable. This isn't a matter of being sn...
I don't think it is marketing genius as you could get as much visibility with a great ad that is not tasteless. As for the calculation, I don't think there is a way to do the calculation by yourself, especially if you're not the target audience. Different target audience have different flexibility for humor, you like...
28,859
When designing an advertisement campaign how should one balance dignity and respect for offensiveness? Nobody remembers the latest ad for McDonald's or Foldger's but I can tell you all about the "[black face Dunkin Donuts](http://www.adweek.com/adfreak/dunkin-donuts-apologizes-blackface-ad-not-everyone-sorry-152172)" ...
2014/03/31
[ "https://graphicdesign.stackexchange.com/questions/28859", "https://graphicdesign.stackexchange.com", "https://graphicdesign.stackexchange.com/users/2611/" ]
I second Emilie in saying that everything will offend someone somewhere. Personally, I am pretty sick of people finding offence left right and centre. Some people are *looking for* things that will get their knickers in a twist, and as Alan so elegantly points out: pleasing everyone ends up in the bland, the invisible ...
It's always about the brand. ============================ What does the brand stand for in it's audience's mind? Is it offensive, irreverent, tasteless? Then you have to live up to that. Anything less wouldn't be true to their intended message. If you aren't comfortable with that type of material, you shouldn't be wor...
28,859
When designing an advertisement campaign how should one balance dignity and respect for offensiveness? Nobody remembers the latest ad for McDonald's or Foldger's but I can tell you all about the "[black face Dunkin Donuts](http://www.adweek.com/adfreak/dunkin-donuts-apologizes-blackface-ad-not-everyone-sorry-152172)" ...
2014/03/31
[ "https://graphicdesign.stackexchange.com/questions/28859", "https://graphicdesign.stackexchange.com", "https://graphicdesign.stackexchange.com/users/2611/" ]
I second Emilie in saying that everything will offend someone somewhere. Personally, I am pretty sick of people finding offence left right and centre. Some people are *looking for* things that will get their knickers in a twist, and as Alan so elegantly points out: pleasing everyone ends up in the bland, the invisible ...
Purely from a graphic designer's POV, it's a decision that each designer has to make on their own based on the particulars of the given situation. In general, being offensive isn't a typical marketing strategy, though it does get used. You as a designer have to decide if you want to work on projects that are purposef...
56,071,682
I have two DF's, DF A and DF B. Both have identical schema. DF A's column C have a different value and DF B's column C have a different value, other data is exactly same. Now, If I want to combine both tables DF C, how to do it in spark? I tried to do join operation, but it is creating duplicate columns. For example: D...
2019/05/10
[ "https://Stackoverflow.com/questions/56071682", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3176086/" ]
The system is looking for a main class `restaurantclient.RestaurantClient`, so a class `RestaurantClient` in package `restaurantClient`, but your class `RestaurantClient` seems to be in the default package.
try this if you are not getting any compilation issues. You can : 1. RightClick on project node and go to Set configuration. 2. Select the main class for your application. 3. Then clean and build. Even if the above steps don't work for you then then delete the Netbeans cache by deleting the (index) folder Fore more...
25,755,297
``` std::string Concatenate(const std::string& s1, const std::string& s2, const std::string& s3, const std::string& s4, const std::string& s5) { return s1 + s2 + s3 + s4 + s5; } ``` By default, `return s1 + s2 + s3 + s...
2014/09/09
[ "https://Stackoverflow.com/questions/25755297", "https://Stackoverflow.com", "https://Stackoverflow.com/users/508343/" ]
The premise of the question that: ``` s1 + s2 + s3 + s4 + s5 + ... + sn ``` will require n allocations is incorrect. Instead it will require O(Log(n)) allocations. The first `s1 + s1` will generate a temporary. Subsequently a temporary (rvalue) will be the left argument to all subsequent `+` operations. The standar...
How about this: ``` std::string Concatenate(const std::string& s1, const std::string& s2, const std::string& s3, const std::string& s4, const std::string& s5) { std::string ret; ret.reserve(s1.length() + s2.length()...
25,755,297
``` std::string Concatenate(const std::string& s1, const std::string& s2, const std::string& s3, const std::string& s4, const std::string& s5) { return s1 + s2 + s3 + s4 + s5; } ``` By default, `return s1 + s2 + s3 + s...
2014/09/09
[ "https://Stackoverflow.com/questions/25755297", "https://Stackoverflow.com", "https://Stackoverflow.com/users/508343/" ]
There is no engineering like over engineering. In this case, I create a type `string_builder::op<?>` that reasonably efficiently collects a pile of strings to concatenate, and when cast into a `std::string` proceeds to do so. It stores copies of any temporary `std::string`s provided, and references to longer-lived on...
You can use code like: ``` std::string(s1) + s2 + s3 + s4 + s5 + s6 + .... ``` This will allocates a single unnamed temporary (copy of the first string), and then append each of the other strings to it. A smart optimizer could optimize this into the same code as the reserve+append code others have posted, as all the...
25,755,297
``` std::string Concatenate(const std::string& s1, const std::string& s2, const std::string& s3, const std::string& s4, const std::string& s5) { return s1 + s2 + s3 + s4 + s5; } ``` By default, `return s1 + s2 + s3 + s...
2014/09/09
[ "https://Stackoverflow.com/questions/25755297", "https://Stackoverflow.com", "https://Stackoverflow.com/users/508343/" ]
You can use code like: ``` std::string(s1) + s2 + s3 + s4 + s5 + s6 + .... ``` This will allocates a single unnamed temporary (copy of the first string), and then append each of the other strings to it. A smart optimizer could optimize this into the same code as the reserve+append code others have posted, as all the...
How about this: ``` std::string Concatenate(const std::string& s1, const std::string& s2, const std::string& s3, const std::string& s4, const std::string& s5) { std::string ret; ret.reserve(s1.length() + s2.length()...
25,755,297
``` std::string Concatenate(const std::string& s1, const std::string& s2, const std::string& s3, const std::string& s4, const std::string& s5) { return s1 + s2 + s3 + s4 + s5; } ``` By default, `return s1 + s2 + s3 + s...
2014/09/09
[ "https://Stackoverflow.com/questions/25755297", "https://Stackoverflow.com", "https://Stackoverflow.com/users/508343/" ]
There is no engineering like over engineering. In this case, I create a type `string_builder::op<?>` that reasonably efficiently collects a pile of strings to concatenate, and when cast into a `std::string` proceeds to do so. It stores copies of any temporary `std::string`s provided, and references to longer-lived on...
How about this: ``` std::string Concatenate(const std::string& s1, const std::string& s2, const std::string& s3, const std::string& s4, const std::string& s5) { std::string ret; ret.reserve(s1.length() + s2.length()...
25,755,297
``` std::string Concatenate(const std::string& s1, const std::string& s2, const std::string& s3, const std::string& s4, const std::string& s5) { return s1 + s2 + s3 + s4 + s5; } ``` By default, `return s1 + s2 + s3 + s...
2014/09/09
[ "https://Stackoverflow.com/questions/25755297", "https://Stackoverflow.com", "https://Stackoverflow.com/users/508343/" ]
The premise of the question that: ``` s1 + s2 + s3 + s4 + s5 + ... + sn ``` will require n allocations is incorrect. Instead it will require O(Log(n)) allocations. The first `s1 + s1` will generate a temporary. Subsequently a temporary (rvalue) will be the left argument to all subsequent `+` operations. The standar...
After some thought, I think it might be worth at least considering a slightly different approach. ``` std::stringstream s; s << s1 << s2 << s3 << s4 << s5; return s.str(); ``` Although it doesn't guarantee only a single allocation, we can expect a `stringstream` to be optimized for accumulating relatively large amo...
25,755,297
``` std::string Concatenate(const std::string& s1, const std::string& s2, const std::string& s3, const std::string& s4, const std::string& s5) { return s1 + s2 + s3 + s4 + s5; } ``` By default, `return s1 + s2 + s3 + s...
2014/09/09
[ "https://Stackoverflow.com/questions/25755297", "https://Stackoverflow.com", "https://Stackoverflow.com/users/508343/" ]
There is no engineering like over engineering. In this case, I create a type `string_builder::op<?>` that reasonably efficiently collects a pile of strings to concatenate, and when cast into a `std::string` proceeds to do so. It stores copies of any temporary `std::string`s provided, and references to longer-lived on...
After some thought, I think it might be worth at least considering a slightly different approach. ``` std::stringstream s; s << s1 << s2 << s3 << s4 << s5; return s.str(); ``` Although it doesn't guarantee only a single allocation, we can expect a `stringstream` to be optimized for accumulating relatively large amo...
25,755,297
``` std::string Concatenate(const std::string& s1, const std::string& s2, const std::string& s3, const std::string& s4, const std::string& s5) { return s1 + s2 + s3 + s4 + s5; } ``` By default, `return s1 + s2 + s3 + s...
2014/09/09
[ "https://Stackoverflow.com/questions/25755297", "https://Stackoverflow.com", "https://Stackoverflow.com/users/508343/" ]
The premise of the question that: ``` s1 + s2 + s3 + s4 + s5 + ... + sn ``` will require n allocations is incorrect. Instead it will require O(Log(n)) allocations. The first `s1 + s1` will generate a temporary. Subsequently a temporary (rvalue) will be the left argument to all subsequent `+` operations. The standar...
``` std::string combined; combined.reserve(s1.size() + s2.size() + s3.size() + s4.size() + s5.size()); combined += s1; combined += s2; combined += s3; combined += s4; combined += s5; return combined; ```
25,755,297
``` std::string Concatenate(const std::string& s1, const std::string& s2, const std::string& s3, const std::string& s4, const std::string& s5) { return s1 + s2 + s3 + s4 + s5; } ``` By default, `return s1 + s2 + s3 + s...
2014/09/09
[ "https://Stackoverflow.com/questions/25755297", "https://Stackoverflow.com", "https://Stackoverflow.com/users/508343/" ]
``` std::string combined; combined.reserve(s1.size() + s2.size() + s3.size() + s4.size() + s5.size()); combined += s1; combined += s2; combined += s3; combined += s4; combined += s5; return combined; ```
How about this: ``` std::string Concatenate(const std::string& s1, const std::string& s2, const std::string& s3, const std::string& s4, const std::string& s5) { std::string ret; ret.reserve(s1.length() + s2.length()...
25,755,297
``` std::string Concatenate(const std::string& s1, const std::string& s2, const std::string& s3, const std::string& s4, const std::string& s5) { return s1 + s2 + s3 + s4 + s5; } ``` By default, `return s1 + s2 + s3 + s...
2014/09/09
[ "https://Stackoverflow.com/questions/25755297", "https://Stackoverflow.com", "https://Stackoverflow.com/users/508343/" ]
``` std::string combined; combined.reserve(s1.size() + s2.size() + s3.size() + s4.size() + s5.size()); combined += s1; combined += s2; combined += s3; combined += s4; combined += s5; return combined; ```
There is no engineering like over engineering. In this case, I create a type `string_builder::op<?>` that reasonably efficiently collects a pile of strings to concatenate, and when cast into a `std::string` proceeds to do so. It stores copies of any temporary `std::string`s provided, and references to longer-lived on...
25,755,297
``` std::string Concatenate(const std::string& s1, const std::string& s2, const std::string& s3, const std::string& s4, const std::string& s5) { return s1 + s2 + s3 + s4 + s5; } ``` By default, `return s1 + s2 + s3 + s...
2014/09/09
[ "https://Stackoverflow.com/questions/25755297", "https://Stackoverflow.com", "https://Stackoverflow.com/users/508343/" ]
The premise of the question that: ``` s1 + s2 + s3 + s4 + s5 + ... + sn ``` will require n allocations is incorrect. Instead it will require O(Log(n)) allocations. The first `s1 + s1` will generate a temporary. Subsequently a temporary (rvalue) will be the left argument to all subsequent `+` operations. The standar...
There is no engineering like over engineering. In this case, I create a type `string_builder::op<?>` that reasonably efficiently collects a pile of strings to concatenate, and when cast into a `std::string` proceeds to do so. It stores copies of any temporary `std::string`s provided, and references to longer-lived on...
42,295,298
My application calls some functions which are placed in an external static library. I link the external static library to my application and everything works (in this case I'm using GCC). Nevertheless, the locations (addresses) of text, .data and .bss sections of the library are chosen by the linker. I can choose/chan...
2017/02/17
[ "https://Stackoverflow.com/questions/42295298", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1447290/" ]
You can use the [`archive:filename`](https://sourceware.org/binutils/docs/ld/Input-Section-Basics.html) syntax in ld. First place all the `.o` files from your external library into a static library `.a` file, if they aren't already. That is the normal way static library binaries are distributed. Then in the linker sc...
Can you just postprocess your lib to rename sections? ``` # Untested! TMP=`mktemp -d` trap "rm -rf $TMP" EXIT cd $TMP ar x path/to/your/lib.a for o in *.o; do for s in text data bss; do objcopy --rename-section .$s=.mynew$s $o done done ar rcs path/to/your/lib.a *.o ```
73,863,765
I am a beginner in Unity and I am currently making a simple game. I have a problem where the button should reappear on the object I am getting contact with. It only shows on the first object that I put the script on. What I wanted to do is to have a recyclable button that will appear whenever I have contact with objec...
2022/09/27
[ "https://Stackoverflow.com/questions/73863765", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11050464/" ]
Well your issue is that each and every instnce of your scrip will all the time overwrite ``` void Update() { uiUse.transform.position = Camera.main.WorldToScreenPoint(head.position + offset); nameBtn.transform.position = Camera.main.WorldToScreenPoint(head.position + offset); } ``` **every frame**. What you...
As far as I see you never create a new Button, I guess that Unity may think, you want the same Button on all NPCs. Maybe try to call the constructor for a new Button in the Start Method and see if it then generates a new Button per NPC.
56,134,100
I'm new to f# and want to use it to alter the format of a propositional logic formula string: I want to replace "aX" by the string "next(a)", with 'a' being an element of [a..z] and 'X' being the capital X' character. All sources i found, e.g. <https://www.dotnetperls.com/replace-fs> either replace a string by anothe...
2019/05/14
[ "https://Stackoverflow.com/questions/56134100", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11499357/" ]
You could use a [`MatchEvaluator`](https://learn.microsoft.com/en-us/dotnet/api/system.text.regularexpressions.matchevaluator?view=netframework-4.8): ``` open System.Text.RegularExpressions let s = "a & b & c & aX & !bX" Regex.Replace(s, "([a-z]X)", fun m -> "next(" + m.Value.TrimEnd('X') + ")") - ;; val it : string ...
[Regex.Replace](https://learn.microsoft.com/en-us/dotnet/api/system.text.regularexpressions.regex.replace?view=netframework-4.5.2#System_Text_RegularExpressions_Regex_Replace_System_String_System_String_System_Text_RegularExpressions_MatchEvaluator_) is your friend: ``` open System.Text.RegularExpressions let myReplac...
56,134,100
I'm new to f# and want to use it to alter the format of a propositional logic formula string: I want to replace "aX" by the string "next(a)", with 'a' being an element of [a..z] and 'X' being the capital X' character. All sources i found, e.g. <https://www.dotnetperls.com/replace-fs> either replace a string by anothe...
2019/05/14
[ "https://Stackoverflow.com/questions/56134100", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11499357/" ]
You could use a [`MatchEvaluator`](https://learn.microsoft.com/en-us/dotnet/api/system.text.regularexpressions.matchevaluator?view=netframework-4.8): ``` open System.Text.RegularExpressions let s = "a & b & c & aX & !bX" Regex.Replace(s, "([a-z]X)", fun m -> "next(" + m.Value.TrimEnd('X') + ")") - ;; val it : string ...
Apologies for necro-posting on an old thread with an accepted answer but using regex has a certain overhead, and a naïve iterative solution using lists might compare favourably in terms of performance: ``` let strXToNext (s : string) = let next c a = ')' :: c :: '(' :: 't' :: 'x' :: 'e' :: 'n' :: a let...
56,134,100
I'm new to f# and want to use it to alter the format of a propositional logic formula string: I want to replace "aX" by the string "next(a)", with 'a' being an element of [a..z] and 'X' being the capital X' character. All sources i found, e.g. <https://www.dotnetperls.com/replace-fs> either replace a string by anothe...
2019/05/14
[ "https://Stackoverflow.com/questions/56134100", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11499357/" ]
Apologies for necro-posting on an old thread with an accepted answer but using regex has a certain overhead, and a naïve iterative solution using lists might compare favourably in terms of performance: ``` let strXToNext (s : string) = let next c a = ')' :: c :: '(' :: 't' :: 'x' :: 'e' :: 'n' :: a let...
[Regex.Replace](https://learn.microsoft.com/en-us/dotnet/api/system.text.regularexpressions.regex.replace?view=netframework-4.5.2#System_Text_RegularExpressions_Regex_Replace_System_String_System_String_System_Text_RegularExpressions_MatchEvaluator_) is your friend: ``` open System.Text.RegularExpressions let myReplac...
54,221,366
I'm trying to test off route detection in mapbox navigation and it is not working. I've traced through and the OffRouteDetector.isUserOffRouteWith *is* getting called, but the status.getRouteState() is only ever returning "INITIALIZED" (which is not the expected RouteState.OFFROUTE) I suspect there's an edge case I'm ...
2019/01/16
[ "https://Stackoverflow.com/questions/54221366", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6542610/" ]
@Troy Berg Let me take a quick second to explain how the route following code works internally when a fresh route is loaded. Upon loading a new route, if the route json is valid, the `MapboxNavigator` will start in the `INITIALIZED` state. From there it will attempt to gain confidence that the GPS locations being pass...
I went ahead and just set my own offRouteEngine. I kept the original, though, and reference that in mine. The code is: ``` MapboxNavigation mbn = navigationView.retrieveMapboxNavigation(); orEngine = (OffRouteDetector)mbn.getOffRouteEngine(); mbn.setOffRouteEngine(new OffRouteDetector() { ...
63,142,638
I m using GooglePlacesAutocomplete where while typing getting the list of places but some places text containing more than that,so I wanted to wrap the text there. ``` <GooglePlacesAutocomplete placeholder='Where To ?' minLength={4} autoFocus={true} listViewDisplayed="a...
2020/07/28
[ "https://Stackoverflow.com/questions/63142638", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2714229/" ]
The width of the ListView showing the results has its width hardcoded to window.with. That is why you wrapping the text isn't working. There is a potential workaround, and that would be to split the description into multiple lines. You can do this with the [`renderRow`](https://github.com/FaridSafi/react-native-google...
You can even style the field too. Follow official doc- ``` <GooglePlacesAutocomplete placeholder='Enter Location' minLength={2} autoFocus={false} returnKeyType={'default'} fetchDetails={true} styles={{ textInputContainer: { backgroundColor: 'grey', }, textInput: { height: 38, ...
56,710,146
I have some issues to convert jQuery code to JavaScript code. For example, I have this piece of code : ``` $(document).ready(function() { doing some stuff }); ``` I tried to code like this : ``` document.getElementById("canvas").onload = function () { doing some stuff }; ``` but it's not working. Her...
2019/06/21
[ "https://Stackoverflow.com/questions/56710146", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11624270/" ]
Continuing on from the partial solution you provided, since you changing from jQuery element to a DOM node, you have to access a few properties differently as outlined below. ``` document.addEventListener("DOMContentLoaded", function(event) { var canvas = document.getElementById('canvas'); var context = canvas...
Use `addEventListener` instead of `onload` as then you can have multiple 'listeners'. Also, I don't think that canvas elements have the 'load' event, so use the document instead. Same with `document.offsetX` and `document.body.offsetX`. Your first example would be: ``` document.addEventListener('load', function() { ...
56,710,146
I have some issues to convert jQuery code to JavaScript code. For example, I have this piece of code : ``` $(document).ready(function() { doing some stuff }); ``` I tried to code like this : ``` document.getElementById("canvas").onload = function () { doing some stuff }; ``` but it's not working. Her...
2019/06/21
[ "https://Stackoverflow.com/questions/56710146", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11624270/" ]
Continuing on from the partial solution you provided, since you changing from jQuery element to a DOM node, you have to access a few properties differently as outlined below. ``` document.addEventListener("DOMContentLoaded", function(event) { var canvas = document.getElementById('canvas'); var context = canvas...
This will work try ``` $(document).ready(function() { var color = "#000000"; var sign = false; var begin_sign = false; var width_line = 5; var canvas = $("#canvas"); var cursorX, cursorY; var context = canvas[0].getContext('2d'); context.lineJoin = 'round'; context.lineCap = 'round'; }); $(document).mousedown...
42,146
I am teaching myself the very basics of design using [Affinity Designer](https://affinity.serif.com/) - and I haven't been able to figure out how to create a single shape from multiple vectors. For instance, if I am creating a basic outline of a car and need to start and stop lines - when I use the `join lines tool` ...
2014/11/13
[ "https://graphicdesign.stackexchange.com/questions/42146", "https://graphicdesign.stackexchange.com", "https://graphicdesign.stackexchange.com/users/33522/" ]
You can indeed join two separate nodes from unrelated vector lines. Do this by : 1. Select both lines using the Move Tool. 2. Using the Node Tool select both end nodes you want to join (hold down Shift to select them both). 3. Choose 'Join Curves' from the Action section of the Node context toolbar.
With the node tool (hit A) shift-select both curves you want to join together. Then, in the context toolbar at the top there are a bunch of buttons labelled "Action" - they look like this: ![enter image description here](https://i.stack.imgur.com/AWsIC.png) the fourth button along from the left is "Join Curves" (you'l...
42,146
I am teaching myself the very basics of design using [Affinity Designer](https://affinity.serif.com/) - and I haven't been able to figure out how to create a single shape from multiple vectors. For instance, if I am creating a basic outline of a car and need to start and stop lines - when I use the `join lines tool` ...
2014/11/13
[ "https://graphicdesign.stackexchange.com/questions/42146", "https://graphicdesign.stackexchange.com", "https://graphicdesign.stackexchange.com/users/33522/" ]
With the node tool (hit A) shift-select both curves you want to join together. Then, in the context toolbar at the top there are a bunch of buttons labelled "Action" - they look like this: ![enter image description here](https://i.stack.imgur.com/AWsIC.png) the fourth button along from the left is "Join Curves" (you'l...
Just to clarify a bit, I think you mean this: Say you had a line with 3 nodes, a,b, and c, with a and c being the endpoint of the nodes. You wish to attach another another line with two nodes d and e. You wish to connect the nodes b and e. As of right now, I can't seem to find functionality of the program where it att...
42,146
I am teaching myself the very basics of design using [Affinity Designer](https://affinity.serif.com/) - and I haven't been able to figure out how to create a single shape from multiple vectors. For instance, if I am creating a basic outline of a car and need to start and stop lines - when I use the `join lines tool` ...
2014/11/13
[ "https://graphicdesign.stackexchange.com/questions/42146", "https://graphicdesign.stackexchange.com", "https://graphicdesign.stackexchange.com/users/33522/" ]
With the node tool (hit A) shift-select both curves you want to join together. Then, in the context toolbar at the top there are a bunch of buttons labelled "Action" - they look like this: ![enter image description here](https://i.stack.imgur.com/AWsIC.png) the fourth button along from the left is "Join Curves" (you'l...
I think what you are looking for is the compound. E.g. I was trying to create an object out of 2 shapes where the inner shape forms a hole. So I used the complement compound (The square with the circle and the intersection is missing). For other stuff you might need the other operations for forming compounds.
42,146
I am teaching myself the very basics of design using [Affinity Designer](https://affinity.serif.com/) - and I haven't been able to figure out how to create a single shape from multiple vectors. For instance, if I am creating a basic outline of a car and need to start and stop lines - when I use the `join lines tool` ...
2014/11/13
[ "https://graphicdesign.stackexchange.com/questions/42146", "https://graphicdesign.stackexchange.com", "https://graphicdesign.stackexchange.com/users/33522/" ]
You can indeed join two separate nodes from unrelated vector lines. Do this by : 1. Select both lines using the Move Tool. 2. Using the Node Tool select both end nodes you want to join (hold down Shift to select them both). 3. Choose 'Join Curves' from the Action section of the Node context toolbar.
Just to clarify a bit, I think you mean this: Say you had a line with 3 nodes, a,b, and c, with a and c being the endpoint of the nodes. You wish to attach another another line with two nodes d and e. You wish to connect the nodes b and e. As of right now, I can't seem to find functionality of the program where it att...
42,146
I am teaching myself the very basics of design using [Affinity Designer](https://affinity.serif.com/) - and I haven't been able to figure out how to create a single shape from multiple vectors. For instance, if I am creating a basic outline of a car and need to start and stop lines - when I use the `join lines tool` ...
2014/11/13
[ "https://graphicdesign.stackexchange.com/questions/42146", "https://graphicdesign.stackexchange.com", "https://graphicdesign.stackexchange.com/users/33522/" ]
You can indeed join two separate nodes from unrelated vector lines. Do this by : 1. Select both lines using the Move Tool. 2. Using the Node Tool select both end nodes you want to join (hold down Shift to select them both). 3. Choose 'Join Curves' from the Action section of the Node context toolbar.
I think what you are looking for is the compound. E.g. I was trying to create an object out of 2 shapes where the inner shape forms a hole. So I used the complement compound (The square with the circle and the intersection is missing). For other stuff you might need the other operations for forming compounds.
42,146
I am teaching myself the very basics of design using [Affinity Designer](https://affinity.serif.com/) - and I haven't been able to figure out how to create a single shape from multiple vectors. For instance, if I am creating a basic outline of a car and need to start and stop lines - when I use the `join lines tool` ...
2014/11/13
[ "https://graphicdesign.stackexchange.com/questions/42146", "https://graphicdesign.stackexchange.com", "https://graphicdesign.stackexchange.com/users/33522/" ]
I think what you are looking for is the compound. E.g. I was trying to create an object out of 2 shapes where the inner shape forms a hole. So I used the complement compound (The square with the circle and the intersection is missing). For other stuff you might need the other operations for forming compounds.
Just to clarify a bit, I think you mean this: Say you had a line with 3 nodes, a,b, and c, with a and c being the endpoint of the nodes. You wish to attach another another line with two nodes d and e. You wish to connect the nodes b and e. As of right now, I can't seem to find functionality of the program where it att...
22,950,053
``` for (int i = 0; i < nodeList.getLength(); i++) { Element e = (Element) nodeList.item(i); event.setName(parser.getValue(e, NODE_NAME)); event.setDate(parser.getValue(e, NODE_DATE)); event.setLocation(parser.getValue(e, NODE_LOC)); Log.d("Thisworks!:", event.getName()); eventsList.addLast(ev...
2014/04/08
[ "https://Stackoverflow.com/questions/22950053", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2859891/" ]
You should be adding a new `Event` to the `eventsList` each time through the loop, not setting the values of the same `event`. `eventsList.addLast(event)` does *not* make a copy, it just adds a reference to `event` to the list. So there is only ever one `event` object, which you keep overwriting.
You're forgetting to create a new Event object in your loop. What's happening is that the **same** Event object keeps getting updated. Try this: ``` for (int i = 0; i < nodeList.getLength(); i++) { Element e = (Element) nodeList.item(i); Event event = new Event(); // You're missing this. event.setName(par...
46,573,113
[Image of Description](https://i.stack.imgur.com/Kc9Ke.png) The aim is to have the user select a shape (Square, Triangle or Circle) and then enter a boundary length. Once this information has been input I can then calculate the perimeter and area of their choice. The problem is I don't want to create new variables fo...
2017/10/04
[ "https://Stackoverflow.com/questions/46573113", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7921329/" ]
The classic solution is to use inheritance: ``` class Shape { double bLength; double area; Shape(double bLength, double area) { this.bLength = bLength; this.area = area; } } class Square extends Shape { Square(double bLength, double area) { super(bLength, area); } ...
You can use inheritance for this problem in following way : Declare a class called Shape from which all other classes would inherit ``` public class Shape { public double length = 0; public abstract double GetPerimeter(); public abstract double GetArea(); public Shape(double length) { this.l...
16,001,999
I have a couple media queries in my stylesheet, each modifying some styles, but not others. I'm using the `max-width` query: ``` @media screen and (max-width: 1024px) { #header .span6 { width: 60%; margin-left: 200px; } #error .span6 { width: 60%; margin-left: 200px; } #timer-block { width: 60%; margin-lef...
2013/04/14
[ "https://Stackoverflow.com/questions/16001999", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Set a min width 1 pixel higher than the max width of the next query Example ``` @media screen and (min-width: 769px) and (max-width: 1024px) { #header .span6 { width: 60%; margin-left: 200px; } #error .span6 { width: 60%; margin-left: 200px; } #timer-block { width: 60%; margin-left: 200px;} #timer { f...
I think you need to use `min-width` in this case to prevent collision, for example: ``` @media only screen and (min-width : 321px) and (max-width : 480px) { /* Styles */ } ```
16,001,999
I have a couple media queries in my stylesheet, each modifying some styles, but not others. I'm using the `max-width` query: ``` @media screen and (max-width: 1024px) { #header .span6 { width: 60%; margin-left: 200px; } #error .span6 { width: 60%; margin-left: 200px; } #timer-block { width: 60%; margin-lef...
2013/04/14
[ "https://Stackoverflow.com/questions/16001999", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Instead of ``` @media screen and (max-width: 480px) ``` You can use ``` @media screen and (max-width: 480px) and (min-width: 321px) ``` This way it will look only at screen sizes between 320 and 481; instead of 0 and 481
Set a min width 1 pixel higher than the max width of the next query Example ``` @media screen and (min-width: 769px) and (max-width: 1024px) { #header .span6 { width: 60%; margin-left: 200px; } #error .span6 { width: 60%; margin-left: 200px; } #timer-block { width: 60%; margin-left: 200px;} #timer { f...
16,001,999
I have a couple media queries in my stylesheet, each modifying some styles, but not others. I'm using the `max-width` query: ``` @media screen and (max-width: 1024px) { #header .span6 { width: 60%; margin-left: 200px; } #error .span6 { width: 60%; margin-left: 200px; } #timer-block { width: 60%; margin-lef...
2013/04/14
[ "https://Stackoverflow.com/questions/16001999", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Instead of ``` @media screen and (max-width: 480px) ``` You can use ``` @media screen and (max-width: 480px) and (min-width: 321px) ``` This way it will look only at screen sizes between 320 and 481; instead of 0 and 481
I think you need to use `min-width` in this case to prevent collision, for example: ``` @media only screen and (min-width : 321px) and (max-width : 480px) { /* Styles */ } ```
56,011,201
What i'm trying to do is to create a dropdown with all my "Stations" from database and when choosing one to zoom on it on map. I have just created a controller called AdminMapController with this code: ``` public class AdminMapController : Controller { private readonly ApplicationDbContext _context; ...
2019/05/06
[ "https://Stackoverflow.com/questions/56011201", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I think you should use this one in return Action: ``` var model = _context.Stations.ToList(); return View("~/Areas/Identity/Pages/Account/AdminMap.cshtml", model); ``` View: ``` @model List<Stations> <div> <select class="form-control"> <option>--Select--</option> @foreach (var item i...
Another way if you want to keep no using a model in this case would be to use "ViewData" instead: ``` ViewData["Stations"] = _context.Stations.ToList(); ``` And in the view something like this: ``` @foreach (var item in ViewData["Stations"] as IList<Stations>) ``` But I still think a model is more uselful in your...
19,005,570
We recently developed a website that essentially has 2 modes, mobile and a tablet + desktop one. The css file is laid out with mobile rules first, then there is a breakpoint for any sizes above 640px, so we could show the desktop version to the 7" tablets when on landspace. However, although it is working great for al...
2013/09/25
[ "https://Stackoverflow.com/questions/19005570", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1171878/" ]
You can use `.trigger` and target your buttons ID: ``` $("#idOfButton").trigger("click"); ``` Or the shorthand, just call a `click()` on your target ``` $("#idOfButton").click(); ```
Try [trigger()](http://api.jquery.com/trigger) ``` $("#button").on('click',function(){ $('#fileUpload').trigger("click"); }); ```
711,425
I'm very new to Ubuntu 14.04 and want to install and run Teamviewer on my PC. I have to maintain someone else's PC in another country who has Ubuntu installed. I've installed it from the "Files and Folders" but can't find the application saved anywhere. I've followed the instructions give by others to install and it s...
2015/12/20
[ "https://askubuntu.com/questions/711425", "https://askubuntu.com", "https://askubuntu.com/users/484270/" ]
run: ``` sudo teamviewer --daemon enable ``` and then open teamviewer from the GUI
If you have installed TeamViewer, by downloading the `'*.deb'` file from their website, then it should be installed in the `/opt` folder as default. Now, to launch the application, open up terminal and type: ``` /opt/teamviewer/tv_bin/script/teamviewer ``` Also, if you are unable to find the application in the `/opt...
5,485,790
I am setting up CKAN, a pylons application according to these instructions: <http://packages.python.org/ckan/deployment.html> But when I point to the server (no DNS setup yet) using IP or hostname, I only see apache's greeting page, sugesting the ckan app is not being loaded. here is my mod\_wsgi script: ``` import ...
2011/03/30
[ "https://Stackoverflow.com/questions/5485790", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34747/" ]
Your first problem is that you cannot use name based virtual hosts in Apache without having a hostname in DNS or local /etc/hosts which resolves to the IP of the server Apache is running on. The second problem is because EvalException cannot be used in a multi process server configuration. Read: <http://code.google.c...
Not an expert on the ''paste'' environment, but shouldn't be: ``` from paste.deploy.loadwsgi import loadapp ```
5,485,790
I am setting up CKAN, a pylons application according to these instructions: <http://packages.python.org/ckan/deployment.html> But when I point to the server (no DNS setup yet) using IP or hostname, I only see apache's greeting page, sugesting the ckan app is not being loaded. here is my mod\_wsgi script: ``` import ...
2011/03/30
[ "https://Stackoverflow.com/questions/5485790", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34747/" ]
Since you're deploying on apache, ensure that you are not in interactive debug mode - which uses EvalException. In your Pylons config file (ckan.emap.fgv.br.ini) ensure you have this: ``` [app:main] set debug = false ```
Not an expert on the ''paste'' environment, but shouldn't be: ``` from paste.deploy.loadwsgi import loadapp ```
5,485,790
I am setting up CKAN, a pylons application according to these instructions: <http://packages.python.org/ckan/deployment.html> But when I point to the server (no DNS setup yet) using IP or hostname, I only see apache's greeting page, sugesting the ckan app is not being loaded. here is my mod\_wsgi script: ``` import ...
2011/03/30
[ "https://Stackoverflow.com/questions/5485790", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34747/" ]
Not an expert on the ''paste'' environment, but shouldn't be: ``` from paste.deploy.loadwsgi import loadapp ```
I agree that in production debug should be disabled, but I would really like to see stacktraces of exceptions. Right now if I get 500 Server error inside CKAN (nice CKAN page with error info is shown) in logs I can find only error description with no stacktrace: `[Thu Feb 12 17:04:55.037785 2015] [:error] [pid 15293:...
5,485,790
I am setting up CKAN, a pylons application according to these instructions: <http://packages.python.org/ckan/deployment.html> But when I point to the server (no DNS setup yet) using IP or hostname, I only see apache's greeting page, sugesting the ckan app is not being loaded. here is my mod\_wsgi script: ``` import ...
2011/03/30
[ "https://Stackoverflow.com/questions/5485790", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34747/" ]
Since you're deploying on apache, ensure that you are not in interactive debug mode - which uses EvalException. In your Pylons config file (ckan.emap.fgv.br.ini) ensure you have this: ``` [app:main] set debug = false ```
Your first problem is that you cannot use name based virtual hosts in Apache without having a hostname in DNS or local /etc/hosts which resolves to the IP of the server Apache is running on. The second problem is because EvalException cannot be used in a multi process server configuration. Read: <http://code.google.c...
5,485,790
I am setting up CKAN, a pylons application according to these instructions: <http://packages.python.org/ckan/deployment.html> But when I point to the server (no DNS setup yet) using IP or hostname, I only see apache's greeting page, sugesting the ckan app is not being loaded. here is my mod\_wsgi script: ``` import ...
2011/03/30
[ "https://Stackoverflow.com/questions/5485790", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34747/" ]
Your first problem is that you cannot use name based virtual hosts in Apache without having a hostname in DNS or local /etc/hosts which resolves to the IP of the server Apache is running on. The second problem is because EvalException cannot be used in a multi process server configuration. Read: <http://code.google.c...
I agree that in production debug should be disabled, but I would really like to see stacktraces of exceptions. Right now if I get 500 Server error inside CKAN (nice CKAN page with error info is shown) in logs I can find only error description with no stacktrace: `[Thu Feb 12 17:04:55.037785 2015] [:error] [pid 15293:...
5,485,790
I am setting up CKAN, a pylons application according to these instructions: <http://packages.python.org/ckan/deployment.html> But when I point to the server (no DNS setup yet) using IP or hostname, I only see apache's greeting page, sugesting the ckan app is not being loaded. here is my mod\_wsgi script: ``` import ...
2011/03/30
[ "https://Stackoverflow.com/questions/5485790", "https://Stackoverflow.com", "https://Stackoverflow.com/users/34747/" ]
Since you're deploying on apache, ensure that you are not in interactive debug mode - which uses EvalException. In your Pylons config file (ckan.emap.fgv.br.ini) ensure you have this: ``` [app:main] set debug = false ```
I agree that in production debug should be disabled, but I would really like to see stacktraces of exceptions. Right now if I get 500 Server error inside CKAN (nice CKAN page with error info is shown) in logs I can find only error description with no stacktrace: `[Thu Feb 12 17:04:55.037785 2015] [:error] [pid 15293:...
34,879,281
Lets say I have two lists of colors and I need to compare them. I have a function of comparing colors but I'm a little bit confused of types which function gets. How to cast them? ``` public bool AreColorsSimilar(Color c1, Color c2, int tolerance) { return Math.Abs(c1.R - c2.R) < tolerance && Math.Abs(c...
2016/01/19
[ "https://Stackoverflow.com/questions/34879281", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5787061/" ]
If I understand you right: ``` var springColors = null; springColors = PaletteOfSeasons(springColors); var similarColors = GetPixels(bitmap).Intersect(springColors, new ColorComparer(tolerance)); ``` And you need this class: ``` public class ColorComparer : IEqualityComparer<Color> { private _tolerance; ...
Simply compare all pixels of the bitmap with all the colors in the palettes: ``` foreach(var pixel in GetPixels(myBitmap)) { foreach(var candidate in paletteOfSeasons) { if(AreColorsSimilar(pixel, candidate, 42) { // Hooray, found some similar colors. } } } ```
10,777,714
On Linux, I would create a child process using fork() that will be my count-down timer, and once the timer ends, the child process will send a signal to the parent process to tell it that the timer has ended. The parent process then should handle the signal accordingly. I have no idea how to do this on windows. Some p...
2012/05/27
[ "https://Stackoverflow.com/questions/10777714", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1397057/" ]
Here's an example that works with the Windows API: ``` #include <windows.h> #include <iostream> DWORD WINAPI threadProc() { for (int i = 0; ; ++i) { std::cout << i << '\n'; Sleep (1000); } return 0; } int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, ...
You can use a [Waitable Timer Objects](http://msdn.microsoft.com/en-us/library/windows/desktop/ms687012%28v=vs.85%29.aspx) either in or outside a thread. To use such kind of object just use `SetWaitableTimer` function. The function definition according to MSDN: > > Activates the specified waitable timer. When the due...
10,777,714
On Linux, I would create a child process using fork() that will be my count-down timer, and once the timer ends, the child process will send a signal to the parent process to tell it that the timer has ended. The parent process then should handle the signal accordingly. I have no idea how to do this on windows. Some p...
2012/05/27
[ "https://Stackoverflow.com/questions/10777714", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1397057/" ]
Here's an example that works with the Windows API: ``` #include <windows.h> #include <iostream> DWORD WINAPI threadProc() { for (int i = 0; ; ++i) { std::cout << i << '\n'; Sleep (1000); } return 0; } int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, ...
Here is another solution which will work cross-platform if you implement the kbhit() function for them: ``` #include <boost/thread.hpp> #include <boost/thread/mutex.hpp> #include <boost/date_time/posix_time/posix_time.hpp> #if defined(WIN32) #include <conio.h> #else // kbhit() implementation for other platfor...
10,777,714
On Linux, I would create a child process using fork() that will be my count-down timer, and once the timer ends, the child process will send a signal to the parent process to tell it that the timer has ended. The parent process then should handle the signal accordingly. I have no idea how to do this on windows. Some p...
2012/05/27
[ "https://Stackoverflow.com/questions/10777714", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1397057/" ]
Here's an example that works with the Windows API: ``` #include <windows.h> #include <iostream> DWORD WINAPI threadProc() { for (int i = 0; ; ++i) { std::cout << i << '\n'; Sleep (1000); } return 0; } int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, ...
Looking for a solution to the same problem, I found this article very helpful: <http://www.codeproject.com/Articles/1236/Timers-Tutorial> As you seem to have figured out, the best answer (in the post-Windows 2000 world) seems to be Queue Timers, à la [CreateTimerQueueTimer](http://msdn.microsoft.com/en-us/library/win...
10,777,714
On Linux, I would create a child process using fork() that will be my count-down timer, and once the timer ends, the child process will send a signal to the parent process to tell it that the timer has ended. The parent process then should handle the signal accordingly. I have no idea how to do this on windows. Some p...
2012/05/27
[ "https://Stackoverflow.com/questions/10777714", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1397057/" ]
Here's an example that works with the Windows API: ``` #include <windows.h> #include <iostream> DWORD WINAPI threadProc() { for (int i = 0; ; ++i) { std::cout << i << '\n'; Sleep (1000); } return 0; } int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, ...
try this one: ``` //Creating Digital Watch in C++ #include<iostream> #include<Windows.h> using namespace std; struct time{ int hr,min,sec; }; int main() { time a; a.hr = 0; a.min = 0; a.sec = 0; for(int i = 0; i<24; i++) { if(a.hr == 23) { a.hr = 0; } for(int j = 0; j<60; j++) { ...
10,777,714
On Linux, I would create a child process using fork() that will be my count-down timer, and once the timer ends, the child process will send a signal to the parent process to tell it that the timer has ended. The parent process then should handle the signal accordingly. I have no idea how to do this on windows. Some p...
2012/05/27
[ "https://Stackoverflow.com/questions/10777714", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1397057/" ]
You can use a [Waitable Timer Objects](http://msdn.microsoft.com/en-us/library/windows/desktop/ms687012%28v=vs.85%29.aspx) either in or outside a thread. To use such kind of object just use `SetWaitableTimer` function. The function definition according to MSDN: > > Activates the specified waitable timer. When the due...
Here is another solution which will work cross-platform if you implement the kbhit() function for them: ``` #include <boost/thread.hpp> #include <boost/thread/mutex.hpp> #include <boost/date_time/posix_time/posix_time.hpp> #if defined(WIN32) #include <conio.h> #else // kbhit() implementation for other platfor...
10,777,714
On Linux, I would create a child process using fork() that will be my count-down timer, and once the timer ends, the child process will send a signal to the parent process to tell it that the timer has ended. The parent process then should handle the signal accordingly. I have no idea how to do this on windows. Some p...
2012/05/27
[ "https://Stackoverflow.com/questions/10777714", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1397057/" ]
You can use a [Waitable Timer Objects](http://msdn.microsoft.com/en-us/library/windows/desktop/ms687012%28v=vs.85%29.aspx) either in or outside a thread. To use such kind of object just use `SetWaitableTimer` function. The function definition according to MSDN: > > Activates the specified waitable timer. When the due...
Looking for a solution to the same problem, I found this article very helpful: <http://www.codeproject.com/Articles/1236/Timers-Tutorial> As you seem to have figured out, the best answer (in the post-Windows 2000 world) seems to be Queue Timers, à la [CreateTimerQueueTimer](http://msdn.microsoft.com/en-us/library/win...
10,777,714
On Linux, I would create a child process using fork() that will be my count-down timer, and once the timer ends, the child process will send a signal to the parent process to tell it that the timer has ended. The parent process then should handle the signal accordingly. I have no idea how to do this on windows. Some p...
2012/05/27
[ "https://Stackoverflow.com/questions/10777714", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1397057/" ]
You can use a [Waitable Timer Objects](http://msdn.microsoft.com/en-us/library/windows/desktop/ms687012%28v=vs.85%29.aspx) either in or outside a thread. To use such kind of object just use `SetWaitableTimer` function. The function definition according to MSDN: > > Activates the specified waitable timer. When the due...
try this one: ``` //Creating Digital Watch in C++ #include<iostream> #include<Windows.h> using namespace std; struct time{ int hr,min,sec; }; int main() { time a; a.hr = 0; a.min = 0; a.sec = 0; for(int i = 0; i<24; i++) { if(a.hr == 23) { a.hr = 0; } for(int j = 0; j<60; j++) { ...
10,777,714
On Linux, I would create a child process using fork() that will be my count-down timer, and once the timer ends, the child process will send a signal to the parent process to tell it that the timer has ended. The parent process then should handle the signal accordingly. I have no idea how to do this on windows. Some p...
2012/05/27
[ "https://Stackoverflow.com/questions/10777714", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1397057/" ]
Here is another solution which will work cross-platform if you implement the kbhit() function for them: ``` #include <boost/thread.hpp> #include <boost/thread/mutex.hpp> #include <boost/date_time/posix_time/posix_time.hpp> #if defined(WIN32) #include <conio.h> #else // kbhit() implementation for other platfor...
Looking for a solution to the same problem, I found this article very helpful: <http://www.codeproject.com/Articles/1236/Timers-Tutorial> As you seem to have figured out, the best answer (in the post-Windows 2000 world) seems to be Queue Timers, à la [CreateTimerQueueTimer](http://msdn.microsoft.com/en-us/library/win...
10,777,714
On Linux, I would create a child process using fork() that will be my count-down timer, and once the timer ends, the child process will send a signal to the parent process to tell it that the timer has ended. The parent process then should handle the signal accordingly. I have no idea how to do this on windows. Some p...
2012/05/27
[ "https://Stackoverflow.com/questions/10777714", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1397057/" ]
Here is another solution which will work cross-platform if you implement the kbhit() function for them: ``` #include <boost/thread.hpp> #include <boost/thread/mutex.hpp> #include <boost/date_time/posix_time/posix_time.hpp> #if defined(WIN32) #include <conio.h> #else // kbhit() implementation for other platfor...
try this one: ``` //Creating Digital Watch in C++ #include<iostream> #include<Windows.h> using namespace std; struct time{ int hr,min,sec; }; int main() { time a; a.hr = 0; a.min = 0; a.sec = 0; for(int i = 0; i<24; i++) { if(a.hr == 23) { a.hr = 0; } for(int j = 0; j<60; j++) { ...
10,777,714
On Linux, I would create a child process using fork() that will be my count-down timer, and once the timer ends, the child process will send a signal to the parent process to tell it that the timer has ended. The parent process then should handle the signal accordingly. I have no idea how to do this on windows. Some p...
2012/05/27
[ "https://Stackoverflow.com/questions/10777714", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1397057/" ]
Looking for a solution to the same problem, I found this article very helpful: <http://www.codeproject.com/Articles/1236/Timers-Tutorial> As you seem to have figured out, the best answer (in the post-Windows 2000 world) seems to be Queue Timers, à la [CreateTimerQueueTimer](http://msdn.microsoft.com/en-us/library/win...
try this one: ``` //Creating Digital Watch in C++ #include<iostream> #include<Windows.h> using namespace std; struct time{ int hr,min,sec; }; int main() { time a; a.hr = 0; a.min = 0; a.sec = 0; for(int i = 0; i<24; i++) { if(a.hr == 23) { a.hr = 0; } for(int j = 0; j<60; j++) { ...
27,633,093
I am able to successfully run the WordCount example using DataflowPipelineRunner with the maven exec:java command shown in the docs. However, when I attempt to run it in my own 1.8 VM, it doesn't work. I am using these args (on Windows): ``` --project=highfive-metrics-service \ --stagingLocation=gs://highfive-dataflo...
2014/12/24
[ "https://Stackoverflow.com/questions/27633093", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4390587/" ]
There's a very high likelihood that this is an issue with staging dependencies. There's a high probability if you create a bundled jar it will just work. You can create a bundled jar by running the command ``` mvn bundle:bundle ``` This will create a single jar that should pull in all dependencies transitively. Yo...
My suggestion would be to look at the worker logs to see if we can find additional information about what's going on in the workers. There are three ways to get this information. The first is via the Dataflow UI. Go to the Google Cloud Console and then select the Dataflow option in the left hand frame. You should see ...
27,633,093
I am able to successfully run the WordCount example using DataflowPipelineRunner with the maven exec:java command shown in the docs. However, when I attempt to run it in my own 1.8 VM, it doesn't work. I am using these args (on Windows): ``` --project=highfive-metrics-service \ --stagingLocation=gs://highfive-dataflo...
2014/12/24
[ "https://Stackoverflow.com/questions/27633093", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4390587/" ]
When running pipelines using `[Blocking]DataflowPipelineRunner` from the Cloud Dataflow Java SDK, the runner automatically copies everything from your local Java class path to a staging location in Google Cloud Storage, which is being accessed by workers on-demand. `ClassNotFoundException` in the Cloud Dataflow worker...
My suggestion would be to look at the worker logs to see if we can find additional information about what's going on in the workers. There are three ways to get this information. The first is via the Dataflow UI. Go to the Google Cloud Console and then select the Dataflow option in the left hand frame. You should see ...
27,633,093
I am able to successfully run the WordCount example using DataflowPipelineRunner with the maven exec:java command shown in the docs. However, when I attempt to run it in my own 1.8 VM, it doesn't work. I am using these args (on Windows): ``` --project=highfive-metrics-service \ --stagingLocation=gs://highfive-dataflo...
2014/12/24
[ "https://Stackoverflow.com/questions/27633093", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4390587/" ]
When running pipelines using `[Blocking]DataflowPipelineRunner` from the Cloud Dataflow Java SDK, the runner automatically copies everything from your local Java class path to a staging location in Google Cloud Storage, which is being accessed by workers on-demand. `ClassNotFoundException` in the Cloud Dataflow worker...
There's a very high likelihood that this is an issue with staging dependencies. There's a high probability if you create a bundled jar it will just work. You can create a bundled jar by running the command ``` mvn bundle:bundle ``` This will create a single jar that should pull in all dependencies transitively. Yo...
2,228,430
I know that this code works on another site I've got but it's not playing ball today. I get three warnings: > > Warning: mysqli\_stmt\_bind\_param() expects parameter 1 to be mysqli\_stmt, boolean given in /homepages/14/d248783986/htdocs/subdomains/clients.bionic-comms.co.uk/httpdocs/carefree/process.php on line 33 >...
2010/02/09
[ "https://Stackoverflow.com/questions/2228430", "https://Stackoverflow.com", "https://Stackoverflow.com/users/31677/" ]
Add more error handling. When the connection fails, [mysqli\_connect\_error()](http://docs.php.net/mysqli_connect_error) can tell you more details. When preparing the statement fails [mysqli\_error()](http://docs.php.net/mysqli_error) has more infos about the error. When executing the statement fails, ask [mys...
The problem comes from `mysqli_prepare()`, which in your case returns `false`, hence the 'boolean given' error. As your query seems ok, the error must be in `$connection`. Are you sure that the connection works and is defined? The connection should be defined as something like this: ``` $connection = mysqli_connect("...
17,744
For a 3D scanning project I need to capture a video/snapshots of an object and a projector image that is projected on the object. The projector works (only) with a framerate of 60Hz, the camera supports rates in {3.75,7.5,15,30,60} Hz. I have to work in Matlab, and since it's an IEEE 1394 camera, I can only use the [CM...
2011/08/03
[ "https://electronics.stackexchange.com/questions/17744", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/5235/" ]
(1) You mention 60 Hz for both **frame and capture rates** so the following should not be an issue, and it's obvious enough, but I mention it "just in case" as such things can trip you up. I'd have expected that if your frame capture lasted exactly "one frame" that brightness variation would not be a major issue. If ...
If you want to try triggering off it VGA has its horizontal sync on pin 13, formally referenced to the sync ground on pin 10. (As Russel points out in comments, VSYNC on 14 is what should be used) There's a slight chance you might find you need some means to provide a phase delay to trigger the camera at the right rel...
15,823,756
I know this question has been answered a few hundred times, but I have run through a load of the potential solutons, but none of them seem to work in my instance. Below is my form and code for submitting the form. It fires off to a PHP script. Now I know the script itself isn't the cause of the submit, as I've tried t...
2013/04/04
[ "https://Stackoverflow.com/questions/15823756", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1513473/" ]
Some times you have to not only prevent the default behauviour for handling the event, but also to prevent executing any downstream chain of event handlers. This can be done by calling [`event.stopImmediatePropagation()`](https://api.jquery.com/event.stopimmediatepropagation/) in addition to [`event.preventDefault()`](...
while all the listed solutions are valid, in my case, what what causing my multiple form submission was the e i was passing to the function called on submit. i had ``` $('form').bind('submit', function(e){ e.preventDefault() return false }) ``` but i changed it to ``` $('form').bind('submit', function(){ eve...
15,823,756
I know this question has been answered a few hundred times, but I have run through a load of the potential solutons, but none of them seem to work in my instance. Below is my form and code for submitting the form. It fires off to a PHP script. Now I know the script itself isn't the cause of the submit, as I've tried t...
2013/04/04
[ "https://Stackoverflow.com/questions/15823756", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1513473/" ]
Also, you're binding the action to the submit button 'click'. But, what if the user presses 'enter' while typing in a text field and triggers the default form action? Your function won't run. I would change this: ``` $("#addpayment_submit").click(function(event) { event.preventDefault(); //code } ``` to thi...
Try adding the following lines. ``` event.preventDefault(); event.stopImmediatePropagation(); ``` This worked for me.
15,823,756
I know this question has been answered a few hundred times, but I have run through a load of the potential solutons, but none of them seem to work in my instance. Below is my form and code for submitting the form. It fires off to a PHP script. Now I know the script itself isn't the cause of the submit, as I've tried t...
2013/04/04
[ "https://Stackoverflow.com/questions/15823756", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1513473/" ]
Try adding the following lines. ``` event.preventDefault(); event.stopImmediatePropagation(); ``` This worked for me.
As you are using AJAX request to send data to the server there's no reason even to use `form` tag and `<input type="submit" .../>` (you can use simple button instead). Also I think Cumbo's answer should work. If it doesn't you can also try `event.stopPropagation()`.
15,823,756
I know this question has been answered a few hundred times, but I have run through a load of the potential solutons, but none of them seem to work in my instance. Below is my form and code for submitting the form. It fires off to a PHP script. Now I know the script itself isn't the cause of the submit, as I've tried t...
2013/04/04
[ "https://Stackoverflow.com/questions/15823756", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1513473/" ]
Some times you have to not only prevent the default behauviour for handling the event, but also to prevent executing any downstream chain of event handlers. This can be done by calling [`event.stopImmediatePropagation()`](https://api.jquery.com/event.stopimmediatepropagation/) in addition to [`event.preventDefault()`](...
As you are using AJAX request to send data to the server there's no reason even to use `form` tag and `<input type="submit" .../>` (you can use simple button instead). Also I think Cumbo's answer should work. If it doesn't you can also try `event.stopPropagation()`.