qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
24,000
I'm drawing a automaton figure, and I want to name it says 'M1' below the figure? A minimal example would be greatly appreciated. Thank you. ``` \begin{tikzpicture}[shorten >=1pt,node distance=2cm,on grid,auto] \node[state,initial] (q_0) {$q_0$}; \node[state,accepting] (q_1) [right=of...
2011/07/24
[ "https://tex.stackexchange.com/questions/24000", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/4322/" ]
Just include your code in a `figure` environment. In that way you'll be able to add a caption to it as a normal figure: ``` \begin{figure} \centering \begin{tikzpicture} <code> \end{tikzpicture} \caption{M1} \label{fig:M1} \end{figure} ```
I've a similar solution using `caption`: ``` \usepackage{caption} ``` where in a beamer slide I would add caption via: ``` \captionof{figure}{\textbf{Confusion Matrix}} ``` as in: ``` \begin{frame}[fragile] \frametitle{Confusion Matrix} \begin{tikzpicture}[ box/.style={draw,rectangle,minimum size=2cm,text widt...
24,000
I'm drawing a automaton figure, and I want to name it says 'M1' below the figure? A minimal example would be greatly appreciated. Thank you. ``` \begin{tikzpicture}[shorten >=1pt,node distance=2cm,on grid,auto] \node[state,initial] (q_0) {$q_0$}; \node[state,accepting] (q_1) [right=of...
2011/07/24
[ "https://tex.stackexchange.com/questions/24000", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/4322/" ]
Just include your code in a `figure` environment. In that way you'll be able to add a caption to it as a normal figure: ``` \begin{figure} \centering \begin{tikzpicture} <code> \end{tikzpicture} \caption{M1} \label{fig:M1} \end{figure} ```
If you want to have a caption, label and your tikzpicture at the exact position you wrote it without floating around, you're best of with this option: ``` \begin{center} \begin{tikzpicture} <code> \end{tikzpicture} \captionof{figure}{your Caption} \label{fig:your Label} \end{center} ```
24,000
I'm drawing a automaton figure, and I want to name it says 'M1' below the figure? A minimal example would be greatly appreciated. Thank you. ``` \begin{tikzpicture}[shorten >=1pt,node distance=2cm,on grid,auto] \node[state,initial] (q_0) {$q_0$}; \node[state,accepting] (q_1) [right=of...
2011/07/24
[ "https://tex.stackexchange.com/questions/24000", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/4322/" ]
This is my solution using an extra node with text, it works pretty well. ``` \begin{tikzpicture}[shorten >=1pt,node distance=2cm,on grid,auto] \node[state,initial] (q_1) {$q_1$}; \node[state,accepting] (q_2) [right=of q_1] {$q_2$}; \node[state] ...
I've a similar solution using `caption`: ``` \usepackage{caption} ``` where in a beamer slide I would add caption via: ``` \captionof{figure}{\textbf{Confusion Matrix}} ``` as in: ``` \begin{frame}[fragile] \frametitle{Confusion Matrix} \begin{tikzpicture}[ box/.style={draw,rectangle,minimum size=2cm,text widt...
24,000
I'm drawing a automaton figure, and I want to name it says 'M1' below the figure? A minimal example would be greatly appreciated. Thank you. ``` \begin{tikzpicture}[shorten >=1pt,node distance=2cm,on grid,auto] \node[state,initial] (q_0) {$q_0$}; \node[state,accepting] (q_1) [right=of...
2011/07/24
[ "https://tex.stackexchange.com/questions/24000", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/4322/" ]
This is my solution using an extra node with text, it works pretty well. ``` \begin{tikzpicture}[shorten >=1pt,node distance=2cm,on grid,auto] \node[state,initial] (q_1) {$q_1$}; \node[state,accepting] (q_2) [right=of q_1] {$q_2$}; \node[state] ...
If you want to have a caption, label and your tikzpicture at the exact position you wrote it without floating around, you're best of with this option: ``` \begin{center} \begin{tikzpicture} <code> \end{tikzpicture} \captionof{figure}{your Caption} \label{fig:your Label} \end{center} ```
24,000
I'm drawing a automaton figure, and I want to name it says 'M1' below the figure? A minimal example would be greatly appreciated. Thank you. ``` \begin{tikzpicture}[shorten >=1pt,node distance=2cm,on grid,auto] \node[state,initial] (q_0) {$q_0$}; \node[state,accepting] (q_1) [right=of...
2011/07/24
[ "https://tex.stackexchange.com/questions/24000", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/4322/" ]
I've a similar solution using `caption`: ``` \usepackage{caption} ``` where in a beamer slide I would add caption via: ``` \captionof{figure}{\textbf{Confusion Matrix}} ``` as in: ``` \begin{frame}[fragile] \frametitle{Confusion Matrix} \begin{tikzpicture}[ box/.style={draw,rectangle,minimum size=2cm,text widt...
If you want to have a caption, label and your tikzpicture at the exact position you wrote it without floating around, you're best of with this option: ``` \begin{center} \begin{tikzpicture} <code> \end{tikzpicture} \captionof{figure}{your Caption} \label{fig:your Label} \end{center} ```
69,730,440
The threat level is calculated correctly but the rest of the attributes are either not displayed or in the wrong order.[enter image description here](https://i.stack.imgur.com/pNsLs.png) Here is the code if u can help me: ``` class animal(): def __init__(self, animal_species="unknown", age=0, threat_level="peacef...
2021/10/26
[ "https://Stackoverflow.com/questions/69730440", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17255136/" ]
You do not use the `email.send()` function if you intend on having the customer be able to reply to a Support Case. Instead, you need to create a Case record (or load an existing one) and then send your email message through that Case record. Upload the following example script to your File Cabinet and create a Suite...
Using the relatedRecords.activityId will automatically send the email with case reply to address. ``` email.send({ author: me.id, recipients: you.id, subject: 'New Case', body: emailBody, // attachments:...
1,750,588
Both [EWGI](http://code.google.com/p/ewgi/) and [Webmachine](http://bitbucket.org/justin/webmachine/wiki/Home) provide abstractions of HTTP in Erlang. I would like to know what the key conceptual differences are in their approach?
2009/11/17
[ "https://Stackoverflow.com/questions/1750588", "https://Stackoverflow.com", "https://Stackoverflow.com/users/173478/" ]
EWGI provides an abstract place for HTTP middleware, and is essentially blind to anything deeper than the existence of a Request/Response pair. This is a tried and true pattern for stacking layers of systems to build a coherent whole, but it does not help to make that whole system to be correct or understandable. Webm...
EWGI is supposed to be a common API for writing request handlers, an API that many web servers implement. EWGI is inspired by Python's WSGI. Webmachine is just a standalone application with its own API that it is alone in implementing.
22,037,882
I am using rails 4. I have to do client side validation, so, I have installed gem ``` gem 'client_side_validations', git: 'git://github.com/bcardarella/client_side_validations.git', branch: '4-0-beta' ``` But throws error while bundling . ``` Updating git://github.com/bcardarella/client_side_validations.git Fetch...
2014/02/26
[ "https://Stackoverflow.com/questions/22037882", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2310209/" ]
Change this line : `<p name="count" value="$count"></p>` to the : `<input type="hidden" name="count" value="<?=$count?>" />`
Instead of ``` <p name="count" value="$count"></p> ``` Use ``` <input type="hidden" name="count" value="<?php echo $count;?>"> ```
22,037,882
I am using rails 4. I have to do client side validation, so, I have installed gem ``` gem 'client_side_validations', git: 'git://github.com/bcardarella/client_side_validations.git', branch: '4-0-beta' ``` But throws error while bundling . ``` Updating git://github.com/bcardarella/client_side_validations.git Fetch...
2014/02/26
[ "https://Stackoverflow.com/questions/22037882", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2310209/" ]
You can use hidden elements like the following use ``` <input type="hidden" value="<?php echo $count; ?>" name="count"/> ``` instead of ``` <p name="count" value="$count"></p> ```
this line will not work : `<p name="count" value="$count"></p>` you can use `<input type="hidden" name="count" value="<?php echo $count; ?>" />`
22,037,882
I am using rails 4. I have to do client side validation, so, I have installed gem ``` gem 'client_side_validations', git: 'git://github.com/bcardarella/client_side_validations.git', branch: '4-0-beta' ``` But throws error while bundling . ``` Updating git://github.com/bcardarella/client_side_validations.git Fetch...
2014/02/26
[ "https://Stackoverflow.com/questions/22037882", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2310209/" ]
``` <p name="count" value="$count"></p> ``` This is not an input element so you cant post directly. You can however use jquery to get the value and POST using js. You need to have the value inside input type text or hidden if you want to do the way you are doing now.
this line will not work : `<p name="count" value="$count"></p>` you can use `<input type="hidden" name="count" value="<?php echo $count; ?>" />`
22,037,882
I am using rails 4. I have to do client side validation, so, I have installed gem ``` gem 'client_side_validations', git: 'git://github.com/bcardarella/client_side_validations.git', branch: '4-0-beta' ``` But throws error while bundling . ``` Updating git://github.com/bcardarella/client_side_validations.git Fetch...
2014/02/26
[ "https://Stackoverflow.com/questions/22037882", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2310209/" ]
``` <p name="count" value="$count"></p> ``` you can not use directly any html tag for post data **only use html form fields** for posting data. for use html tag values post you need to use js/ajax/php ``` <p name="count"><?php echo $count;?></p> ``` or better you use ``` <textarea name="count"><?php echo $count;?...
Change this line : `<p name="count" value="$count"></p>` to the : `<input type="hidden" name="count" value="<?=$count?>" />`
22,037,882
I am using rails 4. I have to do client side validation, so, I have installed gem ``` gem 'client_side_validations', git: 'git://github.com/bcardarella/client_side_validations.git', branch: '4-0-beta' ``` But throws error while bundling . ``` Updating git://github.com/bcardarella/client_side_validations.git Fetch...
2014/02/26
[ "https://Stackoverflow.com/questions/22037882", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2310209/" ]
You can use hidden elements like the following use ``` <input type="hidden" value="<?php echo $count; ?>" name="count"/> ``` instead of ``` <p name="count" value="$count"></p> ```
Instead of ``` <p name="count" value="$count"></p> ``` Use ``` <input type="hidden" name="count" value="<?php echo $count;?>"> ```
22,037,882
I am using rails 4. I have to do client side validation, so, I have installed gem ``` gem 'client_side_validations', git: 'git://github.com/bcardarella/client_side_validations.git', branch: '4-0-beta' ``` But throws error while bundling . ``` Updating git://github.com/bcardarella/client_side_validations.git Fetch...
2014/02/26
[ "https://Stackoverflow.com/questions/22037882", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2310209/" ]
Change this line : `<p name="count" value="$count"></p>` to the : `<input type="hidden" name="count" value="<?=$count?>" />`
this line will not work : `<p name="count" value="$count"></p>` you can use `<input type="hidden" name="count" value="<?php echo $count; ?>" />`
22,037,882
I am using rails 4. I have to do client side validation, so, I have installed gem ``` gem 'client_side_validations', git: 'git://github.com/bcardarella/client_side_validations.git', branch: '4-0-beta' ``` But throws error while bundling . ``` Updating git://github.com/bcardarella/client_side_validations.git Fetch...
2014/02/26
[ "https://Stackoverflow.com/questions/22037882", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2310209/" ]
``` <p name="count" value="$count"></p> ``` This is not an input element so you cant post directly. You can however use jquery to get the value and POST using js. You need to have the value inside input type text or hidden if you want to do the way you are doing now.
You can use hidden elements like the following use ``` <input type="hidden" value="<?php echo $count; ?>" name="count"/> ``` instead of ``` <p name="count" value="$count"></p> ```
22,037,882
I am using rails 4. I have to do client side validation, so, I have installed gem ``` gem 'client_side_validations', git: 'git://github.com/bcardarella/client_side_validations.git', branch: '4-0-beta' ``` But throws error while bundling . ``` Updating git://github.com/bcardarella/client_side_validations.git Fetch...
2014/02/26
[ "https://Stackoverflow.com/questions/22037882", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2310209/" ]
you have to put your `$count` variable in a `hidden field` in your form.. The data which are put in form inputs only get posted in form submit.. `<input type="hidden" name="count" value="<?php echo $count ?>">`
this line will not work : `<p name="count" value="$count"></p>` you can use `<input type="hidden" name="count" value="<?php echo $count; ?>" />`
22,037,882
I am using rails 4. I have to do client side validation, so, I have installed gem ``` gem 'client_side_validations', git: 'git://github.com/bcardarella/client_side_validations.git', branch: '4-0-beta' ``` But throws error while bundling . ``` Updating git://github.com/bcardarella/client_side_validations.git Fetch...
2014/02/26
[ "https://Stackoverflow.com/questions/22037882", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2310209/" ]
``` <p name="count" value="$count"></p> ``` you can not use directly any html tag for post data **only use html form fields** for posting data. for use html tag values post you need to use js/ajax/php ``` <p name="count"><?php echo $count;?></p> ``` or better you use ``` <textarea name="count"><?php echo $count;?...
Instead of ``` <p name="count" value="$count"></p> ``` Use ``` <input type="hidden" name="count" value="<?php echo $count;?>"> ```
22,037,882
I am using rails 4. I have to do client side validation, so, I have installed gem ``` gem 'client_side_validations', git: 'git://github.com/bcardarella/client_side_validations.git', branch: '4-0-beta' ``` But throws error while bundling . ``` Updating git://github.com/bcardarella/client_side_validations.git Fetch...
2014/02/26
[ "https://Stackoverflow.com/questions/22037882", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2310209/" ]
``` <p name="count" value="$count"></p> ``` you can not use directly any html tag for post data **only use html form fields** for posting data. for use html tag values post you need to use js/ajax/php ``` <p name="count"><?php echo $count;?></p> ``` or better you use ``` <textarea name="count"><?php echo $count;?...
this line will not work : `<p name="count" value="$count"></p>` you can use `<input type="hidden" name="count" value="<?php echo $count; ?>" />`
2,064,287
I've seen a lot of articles about integrating ZF and Doctrine. There is also a proposal for ZF [here](http://framework.zend.com/wiki/display/ZFPROP/Zend_Application_Resource_Doctrine+-+Matthew+Lurz) but they have always two possible structures. Either they put all models into one top level model directory or they put i...
2010/01/14
[ "https://Stackoverflow.com/questions/2064287", "https://Stackoverflow.com", "https://Stackoverflow.com/users/249768/" ]
We are working on a solution to this at the company I work at right now. We are following the Zend modular directory structure currently, and we have our models folder in each module directory, with a base directory like this: ``` |----application |--------modules |------------content |----------------models |------...
I keep mine in one directory. As the saying goes, developer time is expensive, and CPU time is cheap, so optimize for the developer. Also, KISS, and YAGNI. Don't optimize until you need to optimize. Until then, trust auto loader. For what it's worth, the site I use this on is fairly busy and performance has never been...
2,064,287
I've seen a lot of articles about integrating ZF and Doctrine. There is also a proposal for ZF [here](http://framework.zend.com/wiki/display/ZFPROP/Zend_Application_Resource_Doctrine+-+Matthew+Lurz) but they have always two possible structures. Either they put all models into one top level model directory or they put i...
2010/01/14
[ "https://Stackoverflow.com/questions/2064287", "https://Stackoverflow.com", "https://Stackoverflow.com/users/249768/" ]
We are working on a solution to this at the company I work at right now. We are following the Zend modular directory structure currently, and we have our models folder in each module directory, with a base directory like this: ``` |----application |--------modules |------------content |----------------models |------...
Wouldn't the User Model belong to the User Module anyway? And shouldn't the Game Module more likely have some sort of Interface to connect to a User Model? Like not directly using the User Model in the Game Module but rather passing a User Adapter to the Game Module by configuration? To me after all, Modules make les...
2,064,287
I've seen a lot of articles about integrating ZF and Doctrine. There is also a proposal for ZF [here](http://framework.zend.com/wiki/display/ZFPROP/Zend_Application_Resource_Doctrine+-+Matthew+Lurz) but they have always two possible structures. Either they put all models into one top level model directory or they put i...
2010/01/14
[ "https://Stackoverflow.com/questions/2064287", "https://Stackoverflow.com", "https://Stackoverflow.com/users/249768/" ]
I didn't try it but maybe this would solve a part of the problem <http://www.doctrine-project.org/documentation/manual/1_2/en/yaml-schema-files#features-examples:packages:package-custom-path>
I keep mine in one directory. As the saying goes, developer time is expensive, and CPU time is cheap, so optimize for the developer. Also, KISS, and YAGNI. Don't optimize until you need to optimize. Until then, trust auto loader. For what it's worth, the site I use this on is fairly busy and performance has never been...
2,064,287
I've seen a lot of articles about integrating ZF and Doctrine. There is also a proposal for ZF [here](http://framework.zend.com/wiki/display/ZFPROP/Zend_Application_Resource_Doctrine+-+Matthew+Lurz) but they have always two possible structures. Either they put all models into one top level model directory or they put i...
2010/01/14
[ "https://Stackoverflow.com/questions/2064287", "https://Stackoverflow.com", "https://Stackoverflow.com/users/249768/" ]
I didn't try it but maybe this would solve a part of the problem <http://www.doctrine-project.org/documentation/manual/1_2/en/yaml-schema-files#features-examples:packages:package-custom-path>
Wouldn't the User Model belong to the User Module anyway? And shouldn't the Game Module more likely have some sort of Interface to connect to a User Model? Like not directly using the User Model in the Game Module but rather passing a User Adapter to the Game Module by configuration? To me after all, Modules make les...
56,477,208
I want to get the Lazy instance in another class the problem is that the T type is only set in the main class the first class where the instance is is this: ``` public class singleton<T> where T : class, new() { private readonly static Lazy<T> val = new Lazy<T>(() => new T()); public static T instance { get ...
2019/06/06
[ "https://Stackoverflow.com/questions/56477208", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11608915/" ]
I would use xhr rather than a browser and store data in an array for each page and write that out to sheet. You could really dimension one array to hold all results in advance based on results per page and number of pages but the below is still efficient ``` Option Explicit Public Sub GetListings() Dim html As HTM...
The info class is also used for the advertisements. You first need to go to the collection where the classname is "search-results organic" and in there find all the "info" classes. This means that you need an extra collection variable: ``` Set HTML = IE.document Set OrganicLinks = HTML.getElementsByClassName("search-...
63,808,481
I am migrating my project from angular 7 to 10. I have done an import as `import { AgmJsMarkerClustererModule } from '@agm/js-marker-clusterer';` When I try to compile the project, I get the following error. ``` ERROR in The target entry-point "@agm/js-marker-clusterer" has missing dependencies: - @agm/core/services/g...
2020/09/09
[ "https://Stackoverflow.com/questions/63808481", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
@agm/js-marker-clusterer has been replaced with @agm/markerclusterer
I had the same issue. after these two library has the version changed from 3.0.0-beta to 1.1.0 ``` @agm/core @agm/snazzy-info-window ``` compiled successfully
63,808,481
I am migrating my project from angular 7 to 10. I have done an import as `import { AgmJsMarkerClustererModule } from '@agm/js-marker-clusterer';` When I try to compile the project, I get the following error. ``` ERROR in The target entry-point "@agm/js-marker-clusterer" has missing dependencies: - @agm/core/services/g...
2020/09/09
[ "https://Stackoverflow.com/questions/63808481", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Use v `1.1.0` for `agm` related dependencies and during install add flag `--legacy-peer-deps`. Example: `npm i @agm/core@1.1.0 --legacy-peer-deps`
I had the same issue. after these two library has the version changed from 3.0.0-beta to 1.1.0 ``` @agm/core @agm/snazzy-info-window ``` compiled successfully
63,808,481
I am migrating my project from angular 7 to 10. I have done an import as `import { AgmJsMarkerClustererModule } from '@agm/js-marker-clusterer';` When I try to compile the project, I get the following error. ``` ERROR in The target entry-point "@agm/js-marker-clusterer" has missing dependencies: - @agm/core/services/g...
2020/09/09
[ "https://Stackoverflow.com/questions/63808481", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
@agm/js-marker-clusterer has been replaced with @agm/markerclusterer
Use v `1.1.0` for `agm` related dependencies and during install add flag `--legacy-peer-deps`. Example: `npm i @agm/core@1.1.0 --legacy-peer-deps`
9,024
The technique I mean is where the profile page will say "You have completed 60% of your profile, fill in your x, y and z to get to 100%". I think this is a very powerful technique but I can't remember what it's called so I can't direct my boss to any articles about it. I think it ends in 'bar'.
2011/07/15
[ "https://ux.stackexchange.com/questions/9024", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/6185/" ]
The ui control or pattern for this is *Completeness Meter* (See the [ui pattern](http://ui-patterns.com/patterns/CompletenessMeter) for this). It's sometimes called a *Progress Bar*, but that term also has a much more generic use - such as in the case of a download percentage, and less specific to the sort of profile c...
This is a form of gamification, too. As users will want to reach 100% completion, like in a game, they will strive to complete their set tasks. Especially if there is some form of reward at the end of the 100%. <http://www.dropbox.com> do this especially well where they reward their users with extra storage if they com...
9,024
The technique I mean is where the profile page will say "You have completed 60% of your profile, fill in your x, y and z to get to 100%". I think this is a very powerful technique but I can't remember what it's called so I can't direct my boss to any articles about it. I think it ends in 'bar'.
2011/07/15
[ "https://ux.stackexchange.com/questions/9024", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/6185/" ]
The ui control or pattern for this is *Completeness Meter* (See the [ui pattern](http://ui-patterns.com/patterns/CompletenessMeter) for this). It's sometimes called a *Progress Bar*, but that term also has a much more generic use - such as in the case of a download percentage, and less specific to the sort of profile c...
You are probably referring to "Endowed Progress Effect" Reference: <https://www.researchgate.net/publication/23547282_The_Endowed_Progress_Effect_How_Artificial_Advancement_Increases_Effort> <https://medium.com/@davidteodorescu/design-perfect-ux-tasks-the-endowed-progress-effect-7461ca20076c>
9,024
The technique I mean is where the profile page will say "You have completed 60% of your profile, fill in your x, y and z to get to 100%". I think this is a very powerful technique but I can't remember what it's called so I can't direct my boss to any articles about it. I think it ends in 'bar'.
2011/07/15
[ "https://ux.stackexchange.com/questions/9024", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/6185/" ]
This is a form of gamification, too. As users will want to reach 100% completion, like in a game, they will strive to complete their set tasks. Especially if there is some form of reward at the end of the 100%. <http://www.dropbox.com> do this especially well where they reward their users with extra storage if they com...
You are probably referring to "Endowed Progress Effect" Reference: <https://www.researchgate.net/publication/23547282_The_Endowed_Progress_Effect_How_Artificial_Advancement_Increases_Effort> <https://medium.com/@davidteodorescu/design-perfect-ux-tasks-the-endowed-progress-effect-7461ca20076c>
69,659,504
I have a very specific question about data cleaning in R and am not sure how should I achieve this. Basically, you can find below an example data frame. ``` test <- data.frame(personID = c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), sequenceTrip = c(1, 1, 2, 2, 3, 3, 4, 4), departureHour = c(9L, ...
2021/10/21
[ "https://Stackoverflow.com/questions/69659504", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16408453/" ]
You could simplify the solution you have ``` intraday_df[intraday_df.index.floor().isin(days)] ```
Try this one too: `intraday_df[pd.Series(intraday_df.index.date).isin(days)]`
69,659,504
I have a very specific question about data cleaning in R and am not sure how should I achieve this. Basically, you can find below an example data frame. ``` test <- data.frame(personID = c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), sequenceTrip = c(1, 1, 2, 2, 3, 3, 4, 4), departureHour = c(9L, ...
2021/10/21
[ "https://Stackoverflow.com/questions/69659504", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16408453/" ]
Use [`DatetimeIndex.floor`](http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DatetimeIndex.floor.html) or [`DatetimeIndex.normalize`](http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DatetimeIndex.normalize.html) for remove times and ouput is `datetimes`, so possible match by `days`: ``...
You could simplify the solution you have ``` intraday_df[intraday_df.index.floor().isin(days)] ```
69,659,504
I have a very specific question about data cleaning in R and am not sure how should I achieve this. Basically, you can find below an example data frame. ``` test <- data.frame(personID = c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), sequenceTrip = c(1, 1, 2, 2, 3, 3, 4, 4), departureHour = c(9L, ...
2021/10/21
[ "https://Stackoverflow.com/questions/69659504", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16408453/" ]
Use [`DatetimeIndex.floor`](http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DatetimeIndex.floor.html) or [`DatetimeIndex.normalize`](http://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DatetimeIndex.normalize.html) for remove times and ouput is `datetimes`, so possible match by `days`: ``...
Try this one too: `intraday_df[pd.Series(intraday_df.index.date).isin(days)]`
8,610,663
Please someone help a very desperate and weary novice. I have searched everywhere for an answer but to no avail. I want to capture the keyCode/charCode to test whether the enter key has been pressed (I have been using keydown but I'm not fussed as long as I get something working). I have tried every conceivable soluti...
2011/12/22
[ "https://Stackoverflow.com/questions/8610663", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1112575/" ]
Nothing works because you named the parameter `evt` and not `event`. In your code, `window.event` and `event` are both referring to `window.event`, which does not exist in Firefox. You should normalize the event first, for example using ``` var event = evt || window.event; ``` or rename the parameter from `evt` to...
This is the code that I now have and it is fully operational in all five main browsers: I now call the functions as follows: ``` <input name="forename" type="text" size="30" maxlength="30" onkeydown="testForEnter(this,event);" onblur="isValidName(this);"> ``` My function is as follows: ``` // testForEnter() disabl...
8,610,663
Please someone help a very desperate and weary novice. I have searched everywhere for an answer but to no avail. I want to capture the keyCode/charCode to test whether the enter key has been pressed (I have been using keydown but I'm not fussed as long as I get something working). I have tried every conceivable soluti...
2011/12/22
[ "https://Stackoverflow.com/questions/8610663", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1112575/" ]
Nothing works because you named the parameter `evt` and not `event`. In your code, `window.event` and `event` are both referring to `window.event`, which does not exist in Firefox. You should normalize the event first, for example using ``` var event = evt || window.event; ``` or rename the parameter from `evt` to...
Try using ``` var keycode = evt.charCode; ``` It seems to work in both browsers.
8,610,663
Please someone help a very desperate and weary novice. I have searched everywhere for an answer but to no avail. I want to capture the keyCode/charCode to test whether the enter key has been pressed (I have been using keydown but I'm not fussed as long as I get something working). I have tried every conceivable soluti...
2011/12/22
[ "https://Stackoverflow.com/questions/8610663", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1112575/" ]
This is the code that I now have and it is fully operational in all five main browsers: I now call the functions as follows: ``` <input name="forename" type="text" size="30" maxlength="30" onkeydown="testForEnter(this,event);" onblur="isValidName(this);"> ``` My function is as follows: ``` // testForEnter() disabl...
Try using ``` var keycode = evt.charCode; ``` It seems to work in both browsers.
48,610,332
Consider the following javascript data structure: ``` let sensors = { sensor1: { min: 1.00, max: 9.00, data: [ { timestamp: 1517760374400, value: 1.00 }, { timestamp: 1517760374500, value: 2.00 }, { timestamp: 1517760374600, v...
2018/02/04
[ "https://Stackoverflow.com/questions/48610332", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3973406/" ]
Data structure: * Queue size of N to store N item. * Min / Max Heap to track the min / max item. * A hash map to track the frequency of each item. When you there is a coming data, update the frequency of the new item, if not there in the heap, add it. When you need to pop an item, decrease the frequency, while frequ...
Sounds fun. I think that you're going to run into a problem where you just don't know a priori whether a value is going to be an extreme (max/min) value in the future. My thought would be to add an expiration counter to your current max & min values. This counter decrements each time you *don't* replace your rolling ...
66,303,222
``` const [startDate, setStartDate] = useState(new Date()); const apiCall = () => { let timeStamp = Number(startDate.getTime()); axios.get( `https://min-api.cryptocompare.com/data/price?fsym=BTC&tsyms=BTC,USD,EUR&ts=${timeStamp}&extraParams=ProfitsCrypto` ) .then((res) => { conso...
2021/02/21
[ "https://Stackoverflow.com/questions/66303222", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15253939/" ]
You are attempting to update the table `FACTGAD` in a trigger that fires on updates of the table `FACTGAD`. In other words, the update fires the trigger, which updates, which fires the trigger, etc. etc. This will eventually trigger the error *"Too many concurrent executions of the same request"*. You should not use `...
Generally speaking it is impossible to get sum of detail records in master table reliable. The best approach is adding and subtracting data by triggers on detail table but under load it end up in update conflicts. Your trigger will end up in completely wrong values in concurrent environment. Usually calculation of agg...
63,914,909
I currently have a carousel in flutter where I can add and delete images, but the problem is that I can add after the last picture in the carousel. Likewise I can delete just the last picture, in order. How can I choose what picture to delete or where to add it based on the user position in the carousel? I use two b...
2020/09/16
[ "https://Stackoverflow.com/questions/63914909", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13012352/" ]
1. add `int pageIndex = 0;` 2. add `onPageChanged` property to `CarouselSlider`: ``` onPageChanged: (index, reason) { pageIndex = index; } ``` 3. change `getImage()`: ``` Future getImage() async { final pickedFile = await picker.getImage(source: ImageSource.gallery); setState(() { //imgList.add(ImageConfi...
Works !!! Amazing!! ``` import 'dart:io'; import 'package:carousel_slider/carousel_slider.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:image_picker/image_picker.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; class ProductCarousel ext...
32,845,371
I'm using [codeigniter-gcm](https://github.com/antongorodezkiy/codeigniter-gcm) library on top of codeigniter to send messages to Google Cloud Messaging service. It sends the message and the message is received at the mobile device, but if I send multiple messages, only the latest message appears on the device (as if i...
2015/09/29
[ "https://Stackoverflow.com/questions/32845371", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4936063/" ]
After three exhausting days I found the solution. I'm posting it here in hope of saving someone else's time... I had to add a parameter to the data object inside the greater JSON object, named "notId" with a unique integer value (which I chose to use a random integer from a wide range). Now why Google didn't include t...
You need to pass a unique ID to each notification. Once you have clicked on the notification you use that ID to remove it. ``` ... mNotificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE); mNotificationManager.cancel(SIMPLE_NOTFICATION_ID_A); ... ``` But I'm sure you shouldn't have so ...
47,895,354
I frequently look up AD computer names by their description and I was hoping there was a way that I could take that output and put it into `Resolve-DNSName` to also get the IP address. This is what I type in to get the computer name based on the AD Description: ``` $Description = Read-Host `n `n "Enter Description" G...
2017/12/19
[ "https://Stackoverflow.com/questions/47895354", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9120000/" ]
The way you're pulling the information from AD is really inefficient. A best-practice mantra for the pipeline is: **Filter left, Format right** ``` $Description = Read-Host -Prompt 'Enter Description' ## $PC becomes a PSCustomObject with three properties $PC = Get-ADComputer -Filter "Description -like '*$Descripti...
`Get-ADComputer` has a property that is called `IPv4Address`. It's not an Active Directory attribute, but a property that is enumerated on execution. It basically does a DNS request, just like you did with `Resolve-DNSName` but without any additional command. This gives you the following handy oneliner ``` Get-ADCompu...
5,538,354
I'm new to 3D, so asking for help. I need to make walking simulator on AS3: first-person view, moving through rooms and corridors. I don't need any physics, only moving and looking. Could someone tell me, what's the best actionscript-3 3d framework to implement needed functionality? Explanation is welcome :) Thanks!
2011/04/04
[ "https://Stackoverflow.com/questions/5538354", "https://Stackoverflow.com", "https://Stackoverflow.com/users/592882/" ]
Away3D. Best open source (and probably best of all) 3D engine on flash. You can either do this using the old away3D version for flash player 10 and under, or using away3D for the new Molehill 3D api's. Links: Away3D 4.0 (Molehill APIS) <http://away3d.com/> Away3D 3.5 For Flash 10 and under <http://away3d.com/away3d...
I see that [Away 3d](http://away3d.com/) has been mentioned already the other options are [Alternativa](http://blog.alternativaplatform.com/en/) and [nd3d](http://www.nulldesign.de/projects/nd3d-as3-3d-engine/) beyond that you might want to look into [flare3d](http://www.flare3d.com/) and unity3d. Papervision looks ...
17,176
According to Wikipedia, the Trade and Development Bank of Mongolia (<http://en.wikipedia.org/wiki/Trade_and_Development_Bank_of_Mongolia>) is the oldest bank in Mongolia. This is further supported by a [2013 article](http://bond-yields.com/7-65-yields-with-trade-development-bank-of-mongolia-short-bonds-b1-rated-sept-20...
2014/11/19
[ "https://history.stackexchange.com/questions/17176", "https://history.stackexchange.com", "https://history.stackexchange.com/users/184/" ]
The Wikipedia article is inexact. The TDB is the oldest existing *commercial* bank in Mongolia. Before 1990 all the banks in Mongolia (and the Soviet Union in general) were state-owned banks. The first bank in Mongolia was the Trade and Industry Bank of Mongolia, opened in June 1924. This bank became a possession of t...
You are referring to 2 Mongolias. The State of Mongolia was formerly called the Mongolian People's Republic. Formerly a part of China, it proclaimed independence with the support of Russia. On March 13th 1921 a Provisional People's Government was established, and then on November 26th, 1924 the government proclaimed t...
30,144,875
I'm not extensively knowledgeable in terms on the thread.h api of the C++11 (in fact I'm not familiar with thread progranmming either, but I read on it recently quite a lot and know about the concurrency and stuff like that) but I started using it and I'm facing a problem that I haven't really ever faced yet. I have t...
2015/05/09
[ "https://Stackoverflow.com/questions/30144875", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1822700/" ]
Use a [`condition_variable`](http://en.cppreference.com/w/cpp/thread/condition_variable): ``` std::condition_variable cv; int thread1(bunch of args) { [do stuff] while (some condition) { [do stuff] cv.notify_one(); } } int thread2(bunch of args) { std::mutex mtx; std::uniqu...
You can use `std::condition_variable`. It allows for you to notify a thread from another thread by using the `notify_one` or `notify_all` methods to resume one, or all threads waiting on the condition variable, repectively. In you code you can use it like this: ``` std::condition_variable my_var; void thread1(args) {...
36,517,173
I have a JS object I would like to save in Local Storage for future use, and I cannot parse it to a string. Code: ``` JSON.stringify({ a: 5, b: function (param) { return param; } }) ``` Result: ``` "{"a":5}" ``` How do I save it for future use, if not with JSON? (And creating my own Lexer-Pa...
2016/04/09
[ "https://Stackoverflow.com/questions/36517173", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5561875/" ]
Usually a question like this indicates an X/Y problem: You need to do X, you think Y will help you do that, so you try to do Y, can't, and ask how to do Y. It would frequently be more useful to ask how to do X instead. But answering the question asked: You **could** use replacer and reviver functions to convert the fu...
One simple way of doing this is ``` var dstr = JSON.stringify( { a: 5 , b: x => x } , (k,v) => typeof v === "function" ? "" + v : v ); ```
36,517,173
I have a JS object I would like to save in Local Storage for future use, and I cannot parse it to a string. Code: ``` JSON.stringify({ a: 5, b: function (param) { return param; } }) ``` Result: ``` "{"a":5}" ``` How do I save it for future use, if not with JSON? (And creating my own Lexer-Pa...
2016/04/09
[ "https://Stackoverflow.com/questions/36517173", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5561875/" ]
I have created `JSON.parseIt()` and `JSON.stringifyIt()` functions based on the first answer without using ***`eval`*** ```js JSON.stringifyIt = (obj)=>{ return( JSON.stringify(obj, function(key, value) { if (typeof value === "function") { return "/Function(" + value.toString() ...
For someone that still need include, for whatever reason, the function definition in JSON, this code can help (but can be slow depending object size): ``` function Object2JsonWithFunctions(o, space = null) { var functionList = {} var fnSeq = 0; var snrepl = function(k,v){ if(typeof v === 'function'){ fnSe...
36,517,173
I have a JS object I would like to save in Local Storage for future use, and I cannot parse it to a string. Code: ``` JSON.stringify({ a: 5, b: function (param) { return param; } }) ``` Result: ``` "{"a":5}" ``` How do I save it for future use, if not with JSON? (And creating my own Lexer-Pa...
2016/04/09
[ "https://Stackoverflow.com/questions/36517173", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5561875/" ]
I'd recommend this approach: Store arguments and the body in your json: ``` {"function":{"arguments":"a,b,c","body":"return a*b+c;"}} ``` Now parse json and instantiate the function: ``` var f = new Function(function.arguments, function.body); ``` I think it's save
I have created `JSON.parseIt()` and `JSON.stringifyIt()` functions based on the first answer without using ***`eval`*** ```js JSON.stringifyIt = (obj)=>{ return( JSON.stringify(obj, function(key, value) { if (typeof value === "function") { return "/Function(" + value.toString() ...
36,517,173
I have a JS object I would like to save in Local Storage for future use, and I cannot parse it to a string. Code: ``` JSON.stringify({ a: 5, b: function (param) { return param; } }) ``` Result: ``` "{"a":5}" ``` How do I save it for future use, if not with JSON? (And creating my own Lexer-Pa...
2016/04/09
[ "https://Stackoverflow.com/questions/36517173", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5561875/" ]
One simple way of doing this is ``` var dstr = JSON.stringify( { a: 5 , b: x => x } , (k,v) => typeof v === "function" ? "" + v : v ); ```
For someone that still need include, for whatever reason, the function definition in JSON, this code can help (but can be slow depending object size): ``` function Object2JsonWithFunctions(o, space = null) { var functionList = {} var fnSeq = 0; var snrepl = function(k,v){ if(typeof v === 'function'){ fnSe...
36,517,173
I have a JS object I would like to save in Local Storage for future use, and I cannot parse it to a string. Code: ``` JSON.stringify({ a: 5, b: function (param) { return param; } }) ``` Result: ``` "{"a":5}" ``` How do I save it for future use, if not with JSON? (And creating my own Lexer-Pa...
2016/04/09
[ "https://Stackoverflow.com/questions/36517173", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5561875/" ]
You can't store functions in JSON. The value in JSON may contain only **string**, **number**, **object**, **array**, `true`, `false` or `null`: [![enter image description here](https://i.stack.imgur.com/RV35n.gif)](https://i.stack.imgur.com/RV35n.gif) Check out it [on JSON site](http://www.json.org/).
One simple way of doing this is ``` var dstr = JSON.stringify( { a: 5 , b: x => x } , (k,v) => typeof v === "function" ? "" + v : v ); ```
36,517,173
I have a JS object I would like to save in Local Storage for future use, and I cannot parse it to a string. Code: ``` JSON.stringify({ a: 5, b: function (param) { return param; } }) ``` Result: ``` "{"a":5}" ``` How do I save it for future use, if not with JSON? (And creating my own Lexer-Pa...
2016/04/09
[ "https://Stackoverflow.com/questions/36517173", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5561875/" ]
I've taken to storing the function name, along with the parameter values, in an array, with the first item in the array being the function name prepended with a `$`, to separate them from normal arrays. ``` { "object": { "your-function": ["$functionName", "param-1", "param-2"], "color": ["$getColor...
For someone that still need include, for whatever reason, the function definition in JSON, this code can help (but can be slow depending object size): ``` function Object2JsonWithFunctions(o, space = null) { var functionList = {} var fnSeq = 0; var snrepl = function(k,v){ if(typeof v === 'function'){ fnSe...
36,517,173
I have a JS object I would like to save in Local Storage for future use, and I cannot parse it to a string. Code: ``` JSON.stringify({ a: 5, b: function (param) { return param; } }) ``` Result: ``` "{"a":5}" ``` How do I save it for future use, if not with JSON? (And creating my own Lexer-Pa...
2016/04/09
[ "https://Stackoverflow.com/questions/36517173", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5561875/" ]
I'd recommend this approach: Store arguments and the body in your json: ``` {"function":{"arguments":"a,b,c","body":"return a*b+c;"}} ``` Now parse json and instantiate the function: ``` var f = new Function(function.arguments, function.body); ``` I think it's save
For someone that still need include, for whatever reason, the function definition in JSON, this code can help (but can be slow depending object size): ``` function Object2JsonWithFunctions(o, space = null) { var functionList = {} var fnSeq = 0; var snrepl = function(k,v){ if(typeof v === 'function'){ fnSe...
36,517,173
I have a JS object I would like to save in Local Storage for future use, and I cannot parse it to a string. Code: ``` JSON.stringify({ a: 5, b: function (param) { return param; } }) ``` Result: ``` "{"a":5}" ``` How do I save it for future use, if not with JSON? (And creating my own Lexer-Pa...
2016/04/09
[ "https://Stackoverflow.com/questions/36517173", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5561875/" ]
Usually a question like this indicates an X/Y problem: You need to do X, you think Y will help you do that, so you try to do Y, can't, and ask how to do Y. It would frequently be more useful to ask how to do X instead. But answering the question asked: You **could** use replacer and reviver functions to convert the fu...
I have created `JSON.parseIt()` and `JSON.stringifyIt()` functions based on the first answer without using ***`eval`*** ```js JSON.stringifyIt = (obj)=>{ return( JSON.stringify(obj, function(key, value) { if (typeof value === "function") { return "/Function(" + value.toString() ...
36,517,173
I have a JS object I would like to save in Local Storage for future use, and I cannot parse it to a string. Code: ``` JSON.stringify({ a: 5, b: function (param) { return param; } }) ``` Result: ``` "{"a":5}" ``` How do I save it for future use, if not with JSON? (And creating my own Lexer-Pa...
2016/04/09
[ "https://Stackoverflow.com/questions/36517173", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5561875/" ]
Usually a question like this indicates an X/Y problem: You need to do X, you think Y will help you do that, so you try to do Y, can't, and ask how to do Y. It would frequently be more useful to ask how to do X instead. But answering the question asked: You **could** use replacer and reviver functions to convert the fu...
For someone that still need include, for whatever reason, the function definition in JSON, this code can help (but can be slow depending object size): ``` function Object2JsonWithFunctions(o, space = null) { var functionList = {} var fnSeq = 0; var snrepl = function(k,v){ if(typeof v === 'function'){ fnSe...
36,517,173
I have a JS object I would like to save in Local Storage for future use, and I cannot parse it to a string. Code: ``` JSON.stringify({ a: 5, b: function (param) { return param; } }) ``` Result: ``` "{"a":5}" ``` How do I save it for future use, if not with JSON? (And creating my own Lexer-Pa...
2016/04/09
[ "https://Stackoverflow.com/questions/36517173", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5561875/" ]
I'd recommend this approach: Store arguments and the body in your json: ``` {"function":{"arguments":"a,b,c","body":"return a*b+c;"}} ``` Now parse json and instantiate the function: ``` var f = new Function(function.arguments, function.body); ``` I think it's save
You can't store functions in JSON. The value in JSON may contain only **string**, **number**, **object**, **array**, `true`, `false` or `null`: [![enter image description here](https://i.stack.imgur.com/RV35n.gif)](https://i.stack.imgur.com/RV35n.gif) Check out it [on JSON site](http://www.json.org/).
69,807,288
I have the lines from a CSV file: 1. **315,"Misérables, Les (1995)",Drama|War** 2. **315,Big Bully (1996),Comedy|Drama** I want to split the line and make a list of 3 elements and I need a general REGEX expression that splits where it encounters ',' but since the title may have a comma (As shown in the first line), I...
2021/11/02
[ "https://Stackoverflow.com/questions/69807288", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11580094/" ]
If you're trying to parse a `.csv` file, don't do it by hand, Python already has loads of libraries that will do it for you. Otherwise if your string has quotation marks when there is a comma inside the title, and doesn't have them when there is not, you can do it like this: ``` >>> x = '315,"Misérables, Les (1995)",...
Actually, you do not need to use REGEX for this problem. QUOTING will solve this. For example: `filereader = csv.reader(csv_input_file, delimiter=',', quotechar='"')` give it a try to solve your problem
34,330,560
I have written a regular expression as follows: `"^[\+]{0,1}([\#]|[\*]|[\d]){1,15}$"` In summary this matches an optional '+' sign followed by up to 15 characters which might be '#', '\*' or a digit. However, this means that '+#' will match and this is not a valid result as I always need at least one number. Typica...
2015/12/17
[ "https://Stackoverflow.com/questions/34330560", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5052668/" ]
Try this regex (my first idea initially): ``` ^(?=.*[0-9])[+]?([#*\d]{1,15})$ ``` ![Regular expression visualization](https://www.debuggex.com/i/xI2G95A2ZM_4mtq8.png) You can replace `[0-9]` with `\d`. **DEMO:** <https://regex101.com/r/bM9oE6/3>
This should work in your case: ``` ^(\+{0,1}[\d#]{1,15})$ ``` Demo: <https://regex101.com/r/fU1eC2/1> **Edit:** If you need # after + in string use `^[+#]?([\d#]{1,15})(?<!#)$` matches "+`#7897897`" If don't, use `^[+#]*([\d#]{1,15})(?<!#)$` matches "+#`7897897`"
34,330,560
I have written a regular expression as follows: `"^[\+]{0,1}([\#]|[\*]|[\d]){1,15}$"` In summary this matches an optional '+' sign followed by up to 15 characters which might be '#', '\*' or a digit. However, this means that '+#' will match and this is not a valid result as I always need at least one number. Typica...
2015/12/17
[ "https://Stackoverflow.com/questions/34330560", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5052668/" ]
Try this regex (my first idea initially): ``` ^(?=.*[0-9])[+]?([#*\d]{1,15})$ ``` ![Regular expression visualization](https://www.debuggex.com/i/xI2G95A2ZM_4mtq8.png) You can replace `[0-9]` with `\d`. **DEMO:** <https://regex101.com/r/bM9oE6/3>
I'd use ``` ^(?=.*\d)\+?[#*\d]{1,15}$ ``` **Explanation:** ``` ^ : begining of line (?= : lookahead .*\d : at least one digit ) \+? : optional + [#*\d]{1,15} : 1 to 15 character in class [#*\d] $ : end of line ``` **matched:** ``` +1234 44567899...
34,330,560
I have written a regular expression as follows: `"^[\+]{0,1}([\#]|[\*]|[\d]){1,15}$"` In summary this matches an optional '+' sign followed by up to 15 characters which might be '#', '\*' or a digit. However, this means that '+#' will match and this is not a valid result as I always need at least one number. Typica...
2015/12/17
[ "https://Stackoverflow.com/questions/34330560", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5052668/" ]
This solutions requires at least one digit in the string, using lookahead (the `(?=...)` section): ``` ^(?=.*\d)\+?[#*\d]{1,15}$ ``` **Legenda** ``` ^ # Start of the string (or line with m/multiline flag) (?=.*\d) # Lookahead that checks for at least one digit in the match \+? ...
Try this regex (my first idea initially): ``` ^(?=.*[0-9])[+]?([#*\d]{1,15})$ ``` ![Regular expression visualization](https://www.debuggex.com/i/xI2G95A2ZM_4mtq8.png) You can replace `[0-9]` with `\d`. **DEMO:** <https://regex101.com/r/bM9oE6/3>
34,330,560
I have written a regular expression as follows: `"^[\+]{0,1}([\#]|[\*]|[\d]){1,15}$"` In summary this matches an optional '+' sign followed by up to 15 characters which might be '#', '\*' or a digit. However, this means that '+#' will match and this is not a valid result as I always need at least one number. Typica...
2015/12/17
[ "https://Stackoverflow.com/questions/34330560", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5052668/" ]
I'd use ``` ^(?=.*\d)\+?[#*\d]{1,15}$ ``` **Explanation:** ``` ^ : begining of line (?= : lookahead .*\d : at least one digit ) \+? : optional + [#*\d]{1,15} : 1 to 15 character in class [#*\d] $ : end of line ``` **matched:** ``` +1234 44567899...
This should work in your case: ``` ^(\+{0,1}[\d#]{1,15})$ ``` Demo: <https://regex101.com/r/fU1eC2/1> **Edit:** If you need # after + in string use `^[+#]?([\d#]{1,15})(?<!#)$` matches "+`#7897897`" If don't, use `^[+#]*([\d#]{1,15})(?<!#)$` matches "+#`7897897`"
34,330,560
I have written a regular expression as follows: `"^[\+]{0,1}([\#]|[\*]|[\d]){1,15}$"` In summary this matches an optional '+' sign followed by up to 15 characters which might be '#', '\*' or a digit. However, this means that '+#' will match and this is not a valid result as I always need at least one number. Typica...
2015/12/17
[ "https://Stackoverflow.com/questions/34330560", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5052668/" ]
This solutions requires at least one digit in the string, using lookahead (the `(?=...)` section): ``` ^(?=.*\d)\+?[#*\d]{1,15}$ ``` **Legenda** ``` ^ # Start of the string (or line with m/multiline flag) (?=.*\d) # Lookahead that checks for at least one digit in the match \+? ...
This should work in your case: ``` ^(\+{0,1}[\d#]{1,15})$ ``` Demo: <https://regex101.com/r/fU1eC2/1> **Edit:** If you need # after + in string use `^[+#]?([\d#]{1,15})(?<!#)$` matches "+`#7897897`" If don't, use `^[+#]*([\d#]{1,15})(?<!#)$` matches "+#`7897897`"
34,330,560
I have written a regular expression as follows: `"^[\+]{0,1}([\#]|[\*]|[\d]){1,15}$"` In summary this matches an optional '+' sign followed by up to 15 characters which might be '#', '\*' or a digit. However, this means that '+#' will match and this is not a valid result as I always need at least one number. Typica...
2015/12/17
[ "https://Stackoverflow.com/questions/34330560", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5052668/" ]
This solutions requires at least one digit in the string, using lookahead (the `(?=...)` section): ``` ^(?=.*\d)\+?[#*\d]{1,15}$ ``` **Legenda** ``` ^ # Start of the string (or line with m/multiline flag) (?=.*\d) # Lookahead that checks for at least one digit in the match \+? ...
I'd use ``` ^(?=.*\d)\+?[#*\d]{1,15}$ ``` **Explanation:** ``` ^ : begining of line (?= : lookahead .*\d : at least one digit ) \+? : optional + [#*\d]{1,15} : 1 to 15 character in class [#*\d] $ : end of line ``` **matched:** ``` +1234 44567899...
379,438
I need to increase the RAM in our DELL servers. I tried using `lshw` to see what is already installed, but I cannot see if the RAM installed is a UDIMM or RDIMM. ``` Handle 0x1100, DMI type 17, 28 bytes Memory Device Array Handle: 0x1000 Error Information Handle: Not Provided Total Width: 72 bits Data ...
2012/04/14
[ "https://serverfault.com/questions/379438", "https://serverfault.com", "https://serverfault.com/users/84365/" ]
You could visit the [Dell Memory Selector](http://accessories.us.dell.com/sna/memconfig.aspx?~srd=true&c=us&cs=04&l=en&manufact=694&s=bsd&scat=prod&sk=ram&stype=1&family=PowerEdge%20Servers) and input your server model to see all of your options for the specific hardware. You already have the information you need, tho...
Type the service tag number from the tag on the machine into support.dell.com. It will give you a detailed description of all parts that shipped with the server.
29,287,351
I'm using `estout` to prepare regression tables for LaTeX. It seems when storing a nonlinear model, there is an extra row in the output that I can't seem to turn off or remove. As an MWE, consider: ``` sysuse auto, clear eststo clear eststo: poisson mpg rep78 esttab, tex nomti nodepvars ``` This will produce outpu...
2015/03/26
[ "https://Stackoverflow.com/questions/29287351", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1928834/" ]
Add the option `eqlabels(none)` to your esttab.
@Dimitriy has posted the solution. As a side note, consider *why* this is happening: The matrix of coefficients for `regress` looks like: ``` . matrix list e(b) e(b)[1,2] rep78 _cons y1 2.3842975 13.169421 ``` while that for `poisson`: ``` . matrix list e(b) e(b)[1,2] mpg: mpg: ...
9,840,839
I declared a static variable in DLLA and I would like to access from another DLLB How can I share a variable between two DLL which are running in the same process? The problem is: In the following code the localB variable cannot be retreived. How can I read variable B inside the Main method? * DLLA ``` namespace A ...
2012/03/23
[ "https://Stackoverflow.com/questions/9840839", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1214129/" ]
When using the xsp.theme.mobile.pagePrefix parameter a different theme file is used for the page depending on the mobile device being used. This theme file does not load in the dojo tundra css files and doesn't load in the oneUI css files that are necessary for the dojo date picker control to work. You could use the n...
Declan has the right response, just note the HTML 5 doesn't work in Android devices, just the iPhone (maybe some Blackberrys...) Howard
9,840,839
I declared a static variable in DLLA and I would like to access from another DLLB How can I share a variable between two DLL which are running in the same process? The problem is: In the following code the localB variable cannot be retreived. How can I read variable B inside the Main method? * DLLA ``` namespace A ...
2012/03/23
[ "https://Stackoverflow.com/questions/9840839", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1214129/" ]
When using the xsp.theme.mobile.pagePrefix parameter a different theme file is used for the page depending on the mobile device being used. This theme file does not load in the dojo tundra css files and doesn't load in the oneUI css files that are necessary for the dojo date picker control to work. You could use the n...
@Howard, A dojo date picker nor native date picker works on Ipad when used with mobile extensions provided by Lotus. The date picker format is lost for ever. However both contols works fine on ipad when not used along with mobile extensions.
9,840,839
I declared a static variable in DLLA and I would like to access from another DLLB How can I share a variable between two DLL which are running in the same process? The problem is: In the following code the localB variable cannot be retreived. How can I read variable B inside the Main method? * DLLA ``` namespace A ...
2012/03/23
[ "https://Stackoverflow.com/questions/9840839", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1214129/" ]
When using the xsp.theme.mobile.pagePrefix parameter a different theme file is used for the page depending on the mobile device being used. This theme file does not load in the dojo tundra css files and doesn't load in the oneUI css files that are necessary for the dojo date picker control to work. You could use the n...
I agree with Declan that HTML5 would be the solution for IOS5, and I think it's the trend in future browser development. However, in case your mobile Web app needs to support both iPhone, iPad and Android now, you may have to consider an alternative solution. For example, you can try using mobiscroll, which is a jQue...
9,840,839
I declared a static variable in DLLA and I would like to access from another DLLB How can I share a variable between two DLL which are running in the same process? The problem is: In the following code the localB variable cannot be retreived. How can I read variable B inside the Main method? * DLLA ``` namespace A ...
2012/03/23
[ "https://Stackoverflow.com/questions/9840839", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1214129/" ]
Declan has the right response, just note the HTML 5 doesn't work in Android devices, just the iPhone (maybe some Blackberrys...) Howard
@Howard, A dojo date picker nor native date picker works on Ipad when used with mobile extensions provided by Lotus. The date picker format is lost for ever. However both contols works fine on ipad when not used along with mobile extensions.
9,840,839
I declared a static variable in DLLA and I would like to access from another DLLB How can I share a variable between two DLL which are running in the same process? The problem is: In the following code the localB variable cannot be retreived. How can I read variable B inside the Main method? * DLLA ``` namespace A ...
2012/03/23
[ "https://Stackoverflow.com/questions/9840839", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1214129/" ]
I agree with Declan that HTML5 would be the solution for IOS5, and I think it's the trend in future browser development. However, in case your mobile Web app needs to support both iPhone, iPad and Android now, you may have to consider an alternative solution. For example, you can try using mobiscroll, which is a jQue...
Declan has the right response, just note the HTML 5 doesn't work in Android devices, just the iPhone (maybe some Blackberrys...) Howard
9,840,839
I declared a static variable in DLLA and I would like to access from another DLLB How can I share a variable between two DLL which are running in the same process? The problem is: In the following code the localB variable cannot be retreived. How can I read variable B inside the Main method? * DLLA ``` namespace A ...
2012/03/23
[ "https://Stackoverflow.com/questions/9840839", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1214129/" ]
I agree with Declan that HTML5 would be the solution for IOS5, and I think it's the trend in future browser development. However, in case your mobile Web app needs to support both iPhone, iPad and Android now, you may have to consider an alternative solution. For example, you can try using mobiscroll, which is a jQue...
@Howard, A dojo date picker nor native date picker works on Ipad when used with mobile extensions provided by Lotus. The date picker format is lost for ever. However both contols works fine on ipad when not used along with mobile extensions.
5,799,936
XML newbie, have no idea what I'm doing. I need a well explained, simple way to do this please. From a previous page I use query strings to get an id example: test.php?id=AT I need to display all the employee names within the department that they select. Below is a snipit of my XML document. ``` <SOT> <DEPARTMEN...
2011/04/27
[ "https://Stackoverflow.com/questions/5799936", "https://Stackoverflow.com", "https://Stackoverflow.com/users/726390/" ]
What you need is the condition variable. All the worker threads call wait() which will suspend them. The parent thread then puts a work item on a queue and calls signal on the condition variable. This will wake one thread that is sleeping. It can remove the job from the queue execute the job then call wait on the c...
Classical producer-consumer synchronization with multiple consumers (the worker threads consume work requests). The well-known technique is to have a semaphore, each worker thread does `down()` and each time you have a work request, do `up()`. Than pick the request from mutex-locked workqueue. Since one `up()` will onl...
5,799,936
XML newbie, have no idea what I'm doing. I need a well explained, simple way to do this please. From a previous page I use query strings to get an id example: test.php?id=AT I need to display all the employee names within the department that they select. Below is a snipit of my XML document. ``` <SOT> <DEPARTMEN...
2011/04/27
[ "https://Stackoverflow.com/questions/5799936", "https://Stackoverflow.com", "https://Stackoverflow.com/users/726390/" ]
What you need is the condition variable. All the worker threads call wait() which will suspend them. The parent thread then puts a work item on a queue and calls signal on the condition variable. This will wake one thread that is sleeping. It can remove the job from the queue execute the job then call wait on the c...
The easiest way to do this is `semaphores`. This is how a semaphore works: A semaphore is basically a variable that takes null/positive values. Processes can interact with it in two ways: increase, or decrease the semaphore. **Increasing the semaphore adds 1 to this magical variable**, and that's about it. **It's in ...
5,799,936
XML newbie, have no idea what I'm doing. I need a well explained, simple way to do this please. From a previous page I use query strings to get an id example: test.php?id=AT I need to display all the employee names within the department that they select. Below is a snipit of my XML document. ``` <SOT> <DEPARTMEN...
2011/04/27
[ "https://Stackoverflow.com/questions/5799936", "https://Stackoverflow.com", "https://Stackoverflow.com/users/726390/" ]
What you need is the condition variable. All the worker threads call wait() which will suspend them. The parent thread then puts a work item on a queue and calls signal on the condition variable. This will wake one thread that is sleeping. It can remove the job from the queue execute the job then call wait on the c...
The usual way this is implemented is to have a queue `queue` of outstanding work, a mutex `mutex` protecting the queue, and a wait condition `queue_not_empty`. Then, each worker thread does the following (using pseudo-api): ``` while (true) { Work * work = 0; mutex.lock(); while ( queue.empty() ) if...
5,799,936
XML newbie, have no idea what I'm doing. I need a well explained, simple way to do this please. From a previous page I use query strings to get an id example: test.php?id=AT I need to display all the employee names within the department that they select. Below is a snipit of my XML document. ``` <SOT> <DEPARTMEN...
2011/04/27
[ "https://Stackoverflow.com/questions/5799936", "https://Stackoverflow.com", "https://Stackoverflow.com/users/726390/" ]
What you need is the condition variable. All the worker threads call wait() which will suspend them. The parent thread then puts a work item on a queue and calls signal on the condition variable. This will wake one thread that is sleeping. It can remove the job from the queue execute the job then call wait on the c...
Since a network chat program is presumably I/O-bound rather than CPU-bound, you don't really need threads. You can handle all your I/O in a single thread using a facility such as [Boost.Asio](http://www.boost.org/doc/libs/1_37_0/doc/html/boost_asio.html) or the [GLib main loop](http://developer.gnome.org/glib/unstable/...
5,799,936
XML newbie, have no idea what I'm doing. I need a well explained, simple way to do this please. From a previous page I use query strings to get an id example: test.php?id=AT I need to display all the employee names within the department that they select. Below is a snipit of my XML document. ``` <SOT> <DEPARTMEN...
2011/04/27
[ "https://Stackoverflow.com/questions/5799936", "https://Stackoverflow.com", "https://Stackoverflow.com/users/726390/" ]
Classical producer-consumer synchronization with multiple consumers (the worker threads consume work requests). The well-known technique is to have a semaphore, each worker thread does `down()` and each time you have a work request, do `up()`. Than pick the request from mutex-locked workqueue. Since one `up()` will onl...
The easiest way to do this is `semaphores`. This is how a semaphore works: A semaphore is basically a variable that takes null/positive values. Processes can interact with it in two ways: increase, or decrease the semaphore. **Increasing the semaphore adds 1 to this magical variable**, and that's about it. **It's in ...
5,799,936
XML newbie, have no idea what I'm doing. I need a well explained, simple way to do this please. From a previous page I use query strings to get an id example: test.php?id=AT I need to display all the employee names within the department that they select. Below is a snipit of my XML document. ``` <SOT> <DEPARTMEN...
2011/04/27
[ "https://Stackoverflow.com/questions/5799936", "https://Stackoverflow.com", "https://Stackoverflow.com/users/726390/" ]
The usual way this is implemented is to have a queue `queue` of outstanding work, a mutex `mutex` protecting the queue, and a wait condition `queue_not_empty`. Then, each worker thread does the following (using pseudo-api): ``` while (true) { Work * work = 0; mutex.lock(); while ( queue.empty() ) if...
The easiest way to do this is `semaphores`. This is how a semaphore works: A semaphore is basically a variable that takes null/positive values. Processes can interact with it in two ways: increase, or decrease the semaphore. **Increasing the semaphore adds 1 to this magical variable**, and that's about it. **It's in ...
5,799,936
XML newbie, have no idea what I'm doing. I need a well explained, simple way to do this please. From a previous page I use query strings to get an id example: test.php?id=AT I need to display all the employee names within the department that they select. Below is a snipit of my XML document. ``` <SOT> <DEPARTMEN...
2011/04/27
[ "https://Stackoverflow.com/questions/5799936", "https://Stackoverflow.com", "https://Stackoverflow.com/users/726390/" ]
Since a network chat program is presumably I/O-bound rather than CPU-bound, you don't really need threads. You can handle all your I/O in a single thread using a facility such as [Boost.Asio](http://www.boost.org/doc/libs/1_37_0/doc/html/boost_asio.html) or the [GLib main loop](http://developer.gnome.org/glib/unstable/...
The easiest way to do this is `semaphores`. This is how a semaphore works: A semaphore is basically a variable that takes null/positive values. Processes can interact with it in two ways: increase, or decrease the semaphore. **Increasing the semaphore adds 1 to this magical variable**, and that's about it. **It's in ...
74,402,595
In List component we have this method. ``` List<Widget> generateList(goalList) { return List.generate( goalList.length, (int index) { return GoalCardBase( goalId: goalList.id, child: GoalCardData(goal: goalList[index]), ); }, ); } ``` i am trying to so...
2022/11/11
[ "https://Stackoverflow.com/questions/74402595", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20459122/" ]
Try sorting the list before rendering/returning it in the code. `goalList.sort((b, a) => a['startDate'].compareTo(b['startDate']);`
This is the code I tried on dartpad and it works: ``` void main(){ cls _cls = cls("title",DateTime.now()); cls cls2 = cls("title2",DateTime.now().subtract(Duration(days:1))); List<cls> clist = [_cls,cls2]; for(var v in clist){ print(v.startDate.toString()); } clist.sort((a,b) => a.startDate!.compareT...
17,208,539
I have a folder outside `/application` folder of CodeIgniter called `myfolder`. My CI application uses Native PHP sessions and it all works fine. CI version is the latest 3.0-development. I need to access some of the session data in myfolder/myfile.php. If I do a `session_start()` and then `print_r($_SESSION);` the...
2013/06/20
[ "https://Stackoverflow.com/questions/17208539", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1421214/" ]
The current [Session\_native.php](https://github.com/EllisLab/CodeIgniter/blob/develop/system/libraries/Session/drivers/Session_native.php) doesn't seem to change any of the built in session library's preference or interfere with how the session data is saved, i think the following should work: * Get a hold of the ses...
You can get in cookeis ``` <?php print_r($_COOKIE['ci_session']); ```
17,208,539
I have a folder outside `/application` folder of CodeIgniter called `myfolder`. My CI application uses Native PHP sessions and it all works fine. CI version is the latest 3.0-development. I need to access some of the session data in myfolder/myfile.php. If I do a `session_start()` and then `print_r($_SESSION);` the...
2013/06/20
[ "https://Stackoverflow.com/questions/17208539", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1421214/" ]
Its a trick but do work. Place this little naughty code just before login redirect. And now you can use `ci_session` with php native session too ,have fun ! ``` <?php session_start(); echo $_SESSION['ci_session'] = $this->session->userdata['ci_session']; ?> ```
You can get in cookeis ``` <?php print_r($_COOKIE['ci_session']); ```
17,208,539
I have a folder outside `/application` folder of CodeIgniter called `myfolder`. My CI application uses Native PHP sessions and it all works fine. CI version is the latest 3.0-development. I need to access some of the session data in myfolder/myfile.php. If I do a `session_start()` and then `print_r($_SESSION);` the...
2013/06/20
[ "https://Stackoverflow.com/questions/17208539", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1421214/" ]
The current [Session\_native.php](https://github.com/EllisLab/CodeIgniter/blob/develop/system/libraries/Session/drivers/Session_native.php) doesn't seem to change any of the built in session library's preference or interfere with how the session data is saved, i think the following should work: * Get a hold of the ses...
Save the session data which you wants to refer from outside the folder into cookies, which may helps you. So use cookies to refer data from outside the folder and make sure when you set cookies it should be in proper accessible path
17,208,539
I have a folder outside `/application` folder of CodeIgniter called `myfolder`. My CI application uses Native PHP sessions and it all works fine. CI version is the latest 3.0-development. I need to access some of the session data in myfolder/myfile.php. If I do a `session_start()` and then `print_r($_SESSION);` the...
2013/06/20
[ "https://Stackoverflow.com/questions/17208539", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1421214/" ]
Its a trick but do work. Place this little naughty code just before login redirect. And now you can use `ci_session` with php native session too ,have fun ! ``` <?php session_start(); echo $_SESSION['ci_session'] = $this->session->userdata['ci_session']; ?> ```
Save the session data which you wants to refer from outside the folder into cookies, which may helps you. So use cookies to refer data from outside the folder and make sure when you set cookies it should be in proper accessible path
4,754
**Input**: a word (2-100 characters) Convert this word to a palindrome: * delete character - 13 points * add character - 12 points * increase character - 5 points ('d' > 'e') * decrease character - 4 points ('n' > 'm') * switch 2 characters - 7 points What is the minimal points needed to make the word palindrome? (C...
2012/01/24
[ "https://codegolf.stackexchange.com/questions/4754", "https://codegolf.stackexchange.com", "https://codegolf.stackexchange.com/users/3623/" ]
Spent about an hour and got a working solution that I believe should give an optimal result: ``` public class PalindromeFinder : IComparer<Tuple<int,string>> { public PalindromeFinder() { heap = new IntervalHeap<Tuple<int, string>>(this); handles = new Dictionary<string, IPr...
C++ --- Made this under the assumption that simply changing the character costs the same as switching two characters(7 points) & that comparing costs 0 points. A pretty basic & dumb solution, but it works. ``` int main(int argc, char *argv[]) { int c, l, p; p = 0; if(argc != 2) { cout<<"Incorrect...
51,015,182
I'm trying to pass an object into a constructor as a parameter. Is the following code allowed? Particularly the portion where I pass `Toyota` and `Corolla` into `Car car`, and then into `String brand` and `String model`. ``` public class Car { private String brand, model; public Car(String brand, String model...
2018/06/25
[ "https://Stackoverflow.com/questions/51015182", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8919391/" ]
Customer doesn't have a constructor that takes 3 Strings, so you have to pass a String and a Car object in: Change ``` Customer customer = new Customer("John", "Toyota", "Corolla"); ``` to ``` Customer customer = new Customer("John", new Car("Toyota", "Corolla")); ``` Solution 2 is to give Customer a 3 String c...
Change your `Service` class to:- ``` public class Service { Customer customer = new Customer("John", new Car("Toyota", "Corolla")); } ```
67,439,713
I have a script that runs daily to check the status of orders for different sellers. The output populates a table that looks like this, which tells me the failure status of an order: ``` | date | failure | order | seller_id | |------------|-------------------------|-------|-----------| | 2021-04-...
2021/05/07
[ "https://Stackoverflow.com/questions/67439713", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6058499/" ]
Maybe it's because nginx's DNS resolver for upstream servers only works in the commercial version, nginx plus? <https://www.nginx.com/products/nginx/load-balancing/#service-discovery>
Was struggling on the same thing exactly for the same thing (Docker Swarm) and actually to make it work I required to let the `upstream` away from my configuration. Something that works well (tested 5' ago on NGINX 2.22) : ``` location ~* /api/parameters/(.*)$ { resolver 127.0.0.11 ipv6=off valid = 1s; set $b...
67,439,713
I have a script that runs daily to check the status of orders for different sellers. The output populates a table that looks like this, which tells me the failure status of an order: ``` | date | failure | order | seller_id | |------------|-------------------------|-------|-----------| | 2021-04-...
2021/05/07
[ "https://Stackoverflow.com/questions/67439713", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6058499/" ]
TLDR: Your Internet Provider may be caching dnses with no respect to tiny TTL values (like 1 second). I've been trying to retest locally the same thing. * Your docker might be using local resolver (127.0.0.11) * Then Dns might be cached by your OS (which you may clean - that's OS specific) * Then you might have it ca...
Was struggling on the same thing exactly for the same thing (Docker Swarm) and actually to make it work I required to let the `upstream` away from my configuration. Something that works well (tested 5' ago on NGINX 2.22) : ``` location ~* /api/parameters/(.*)$ { resolver 127.0.0.11 ipv6=off valid = 1s; set $b...
33,819,123
Let say I have this JSON request to my Laravel Route ``` { "user_id":1, "payment_type":"point", "order_boxes":[ { "for_friend_name":"Yansen", "order_box_items":[ { "product_id": 1, } ] } ] } ...
2015/11/20
[ "https://Stackoverflow.com/questions/33819123", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1786368/" ]
This feature [will be added in Laravel 5.2](https://laravel-news.com/2015/11/laravel-5-2-a-look-at-whats-coming/). Until then use solutions like @YansenTan posted.
I managed to validate the nested array by using "foreach": ``` $rules = [ 'user_id' => 'required|exists:users,id', 'payment_type' => 'required|in:point,cod,transfer,credit_card', 'order_boxes' => 'required|array', ]; foreach($request->input('order_boxes') as $key => $value){ $rules['order_boxes.'.$key...
341,782
I'm trying to deploy TFS 2010 in a sandbox environment, and I created a managed service account for TFS. However, I seem to be unable to configure it in the Advanced Configuration Wizard. ![Advanced Configuration Wizard dialog with validation errors](https://i.stack.imgur.com/i61AJ.png) The error reported when I clic...
2011/12/16
[ "https://serverfault.com/questions/341782", "https://serverfault.com", "https://serverfault.com/users/15873/" ]
Account names ending in a `$` are normally machine accounts, not user (even non-iterative user) accounts. It is quite possible that TFS, or something that TFS uses, assumes this and thus blocks the name. (Otherwise, be very sure you have correctly typed the password. I've ended up using copy and paste for both accoun...
Is this service account user in the Administrator group on the TFS server?
341,782
I'm trying to deploy TFS 2010 in a sandbox environment, and I created a managed service account for TFS. However, I seem to be unable to configure it in the Advanced Configuration Wizard. ![Advanced Configuration Wizard dialog with validation errors](https://i.stack.imgur.com/i61AJ.png) The error reported when I clic...
2011/12/16
[ "https://serverfault.com/questions/341782", "https://serverfault.com", "https://serverfault.com/users/15873/" ]
Is this service account user in the Administrator group on the TFS server?
Remove the $ from the name of the account and try again. Make sure the account has Log on as a service permissions. Don't put it in the local admin group. Good luck!
341,782
I'm trying to deploy TFS 2010 in a sandbox environment, and I created a managed service account for TFS. However, I seem to be unable to configure it in the Advanced Configuration Wizard. ![Advanced Configuration Wizard dialog with validation errors](https://i.stack.imgur.com/i61AJ.png) The error reported when I clic...
2011/12/16
[ "https://serverfault.com/questions/341782", "https://serverfault.com", "https://serverfault.com/users/15873/" ]
Account names ending in a `$` are normally machine accounts, not user (even non-iterative user) accounts. It is quite possible that TFS, or something that TFS uses, assumes this and thus blocks the name. (Otherwise, be very sure you have correctly typed the password. I've ended up using copy and paste for both accoun...
Remove the $ from the name of the account and try again. Make sure the account has Log on as a service permissions. Don't put it in the local admin group. Good luck!
91,559
The problem is as follows: In a oasis, a lumberjack sees that a group of palm trees has a $7\times 7$ formation making a square as it is shown in the diagram from below. Find the maximum quantity of trees to be cut down by the lumberjack to get five different straight lines of four palm trees each. [![Sketch of the p...
2019/11/27
[ "https://puzzling.stackexchange.com/questions/91559", "https://puzzling.stackexchange.com", "https://puzzling.stackexchange.com/users/57036/" ]
Thinking about this problem in reverse is easier, i.e. think about the trees that need to remain. Find the fewest number of trees that can be arranged in five lines with 4 trees in each line. To minimise that number, we need as many trees as possible to do double duty by being part of multiple lines. > > If you have...
Consider the mini-arrangement of trees below: > > > ``` > > xxxx > xx > xx > xxxx > > ``` > > This arrangement contains 6 straight lines of 4 trees each - 2 horizontal, 2 diagonal, and 2 vertical. Essentially, this means you only need a total of 12 trees to achieve 5 straight lines of 4 trees each, and y...
91,559
The problem is as follows: In a oasis, a lumberjack sees that a group of palm trees has a $7\times 7$ formation making a square as it is shown in the diagram from below. Find the maximum quantity of trees to be cut down by the lumberjack to get five different straight lines of four palm trees each. [![Sketch of the p...
2019/11/27
[ "https://puzzling.stackexchange.com/questions/91559", "https://puzzling.stackexchange.com", "https://puzzling.stackexchange.com/users/57036/" ]
Thinking about this problem in reverse is easier, i.e. think about the trees that need to remain. Find the fewest number of trees that can be arranged in five lines with 4 trees in each line. To minimise that number, we need as many trees as possible to do double duty by being part of multiple lines. > > If you have...
I interpreted the problem to mean that there should be 5 rows of 4 **consecutive** trees remaining; to maximize the number of cut-down trees, we should make the remaining rows overlap as much as possible. If the rows must be of consecutive trees, you can arrange the remaining trees like this: [![Palm tree puzzle](https...
91,559
The problem is as follows: In a oasis, a lumberjack sees that a group of palm trees has a $7\times 7$ formation making a square as it is shown in the diagram from below. Find the maximum quantity of trees to be cut down by the lumberjack to get five different straight lines of four palm trees each. [![Sketch of the p...
2019/11/27
[ "https://puzzling.stackexchange.com/questions/91559", "https://puzzling.stackexchange.com", "https://puzzling.stackexchange.com/users/57036/" ]
Thinking about this problem in reverse is easier, i.e. think about the trees that need to remain. Find the fewest number of trees that can be arranged in five lines with 4 trees in each line. To minimise that number, we need as many trees as possible to do double duty by being part of multiple lines. > > If you have...
I would approach it more like: > > > [![enter image description here](https://i.stack.imgur.com/0bR46.png)](https://i.stack.imgur.com/0bR46.png) > > > > (or in text:) > > > ``` > A B C D E F G > H . . . . . . > J . . . . . . > K . . . . . . > ``` > > > > Such that the lines are: > > A B C D; B C ...
20,482,338
I need to know how to simulate keyboard input for keys `W`, `S`, `A`, `D`. I've used `SendKeys` with no avail as well as the `InputSimulator` library with no fix. What I'm trying to do is make it to where applications such as games (Battlefield, Natural Selection, ect. Newer FPS games) will register these simulated...
2013/12/09
[ "https://Stackoverflow.com/questions/20482338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2536897/" ]
Adding on to the great answer from @gareth, to simulate capital letters during a sentance you can use my solution below.. ``` public static void SendWithShift(ScanCodeShort a){ HoldLShift(); Send(a); ReleaseLShift(); } public static void HoldLShift(){ var Inputs = new InputStruct[1]; var Input = ne...
You can use `SendKeys.Send("<your character/string>");` Example: `SendKeys.Send("{ENTER}");` Source: *<https://learn.microsoft.com/en-us/dotnet/framework/winforms/how-to-simulate-mouse-and-keyboard-events-in-code>*
20,482,338
I need to know how to simulate keyboard input for keys `W`, `S`, `A`, `D`. I've used `SendKeys` with no avail as well as the `InputSimulator` library with no fix. What I'm trying to do is make it to where applications such as games (Battlefield, Natural Selection, ect. Newer FPS games) will register these simulated...
2013/12/09
[ "https://Stackoverflow.com/questions/20482338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2536897/" ]
I was looking for **emulation of multimedia button presses** and found that you need to use these parameters(in *@Gareth code*): ``` Input.U.ki.wVk = VirtualKeyShort.VOLUME_MUTE; Input.U.ki.dwFlags = KEYEVENTF.UNICODE; ```
You can use `SendKeys.Send("<your character/string>");` Example: `SendKeys.Send("{ENTER}");` Source: *<https://learn.microsoft.com/en-us/dotnet/framework/winforms/how-to-simulate-mouse-and-keyboard-events-in-code>*
20,482,338
I need to know how to simulate keyboard input for keys `W`, `S`, `A`, `D`. I've used `SendKeys` with no avail as well as the `InputSimulator` library with no fix. What I'm trying to do is make it to where applications such as games (Battlefield, Natural Selection, ect. Newer FPS games) will register these simulated...
2013/12/09
[ "https://Stackoverflow.com/questions/20482338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2536897/" ]
I like @Gareth's approach at it. However, in his method, you need to hard code your key strokes into the SendInputWithAPI() method. I made a few changes to the code; you now can call Send() and pass ScanCodeShort parameter to it. This allows you to pass any keystroke to it, any time, any place. ``` public class Keybo...
I just created a library to simulate keyboard and mouse (cursor) using dotnet core with multiplatform implementation. Here is the link for github: <https://github.com/lucassklp/Desktop.Robot>
20,482,338
I need to know how to simulate keyboard input for keys `W`, `S`, `A`, `D`. I've used `SendKeys` with no avail as well as the `InputSimulator` library with no fix. What I'm trying to do is make it to where applications such as games (Battlefield, Natural Selection, ect. Newer FPS games) will register these simulated...
2013/12/09
[ "https://Stackoverflow.com/questions/20482338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2536897/" ]
I like @Gareth's approach at it. However, in his method, you need to hard code your key strokes into the SendInputWithAPI() method. I made a few changes to the code; you now can call Send() and pass ScanCodeShort parameter to it. This allows you to pass any keystroke to it, any time, any place. ``` public class Keybo...
Adding to @Gareth's solution since the keys get stuck after calling `Send()`. Here is a simplified version of @Matthew Wherry's `ReleaseLShift()` so that it works with any key. ``` public static void ReleaseKey(ScanCodeShort key) { var Inputs = new INPUT[1]; var Input = new INPUT(); Input.type = 1; Inp...
20,482,338
I need to know how to simulate keyboard input for keys `W`, `S`, `A`, `D`. I've used `SendKeys` with no avail as well as the `InputSimulator` library with no fix. What I'm trying to do is make it to where applications such as games (Battlefield, Natural Selection, ect. Newer FPS games) will register these simulated...
2013/12/09
[ "https://Stackoverflow.com/questions/20482338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2536897/" ]
I just created a library to simulate keyboard and mouse (cursor) using dotnet core with multiplatform implementation. Here is the link for github: <https://github.com/lucassklp/Desktop.Robot>
`keybd_event` should do the job: ``` // Simulate a key press keybd_event( VK_NUMLOCK, 0x45, KEYEVENTF_EXTENDEDKEY | 0, 0 ); // Simulate a key release keybd_event( VK_NUMLOCK, 0x45, KEYEVENTF_EXTENDEDKEY | KEY...
20,482,338
I need to know how to simulate keyboard input for keys `W`, `S`, `A`, `D`. I've used `SendKeys` with no avail as well as the `InputSimulator` library with no fix. What I'm trying to do is make it to where applications such as games (Battlefield, Natural Selection, ect. Newer FPS games) will register these simulated...
2013/12/09
[ "https://Stackoverflow.com/questions/20482338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2536897/" ]
I was looking for **emulation of multimedia button presses** and found that you need to use these parameters(in *@Gareth code*): ``` Input.U.ki.wVk = VirtualKeyShort.VOLUME_MUTE; Input.U.ki.dwFlags = KEYEVENTF.UNICODE; ```
Adding to @Gareth's solution since the keys get stuck after calling `Send()`. Here is a simplified version of @Matthew Wherry's `ReleaseLShift()` so that it works with any key. ``` public static void ReleaseKey(ScanCodeShort key) { var Inputs = new INPUT[1]; var Input = new INPUT(); Input.type = 1; Inp...
20,482,338
I need to know how to simulate keyboard input for keys `W`, `S`, `A`, `D`. I've used `SendKeys` with no avail as well as the `InputSimulator` library with no fix. What I'm trying to do is make it to where applications such as games (Battlefield, Natural Selection, ect. Newer FPS games) will register these simulated...
2013/12/09
[ "https://Stackoverflow.com/questions/20482338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2536897/" ]
I just created a library to simulate keyboard and mouse (cursor) using dotnet core with multiplatform implementation. Here is the link for github: <https://github.com/lucassklp/Desktop.Robot>
You can use `SendKeys.Send("<your character/string>");` Example: `SendKeys.Send("{ENTER}");` Source: *<https://learn.microsoft.com/en-us/dotnet/framework/winforms/how-to-simulate-mouse-and-keyboard-events-in-code>*
20,482,338
I need to know how to simulate keyboard input for keys `W`, `S`, `A`, `D`. I've used `SendKeys` with no avail as well as the `InputSimulator` library with no fix. What I'm trying to do is make it to where applications such as games (Battlefield, Natural Selection, ect. Newer FPS games) will register these simulated...
2013/12/09
[ "https://Stackoverflow.com/questions/20482338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2536897/" ]
`keybd_event` should do the job: ``` // Simulate a key press keybd_event( VK_NUMLOCK, 0x45, KEYEVENTF_EXTENDEDKEY | 0, 0 ); // Simulate a key release keybd_event( VK_NUMLOCK, 0x45, KEYEVENTF_EXTENDEDKEY | KEY...
Windows Input Simulator makes this super easy. The Windows Input Simulator provides a simple .NET (C#) interface to simulate Keyboard or Mouse input using the Win32 SendInput method. All of the Interop is done for you and there's a simple programming model for sending multiple keystrokes. Nuget package -> Install-Pack...
20,482,338
I need to know how to simulate keyboard input for keys `W`, `S`, `A`, `D`. I've used `SendKeys` with no avail as well as the `InputSimulator` library with no fix. What I'm trying to do is make it to where applications such as games (Battlefield, Natural Selection, ect. Newer FPS games) will register these simulated...
2013/12/09
[ "https://Stackoverflow.com/questions/20482338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2536897/" ]
I just created a library to simulate keyboard and mouse (cursor) using dotnet core with multiplatform implementation. Here is the link for github: <https://github.com/lucassklp/Desktop.Robot>
Adding to @Gareth's solution since the keys get stuck after calling `Send()`. Here is a simplified version of @Matthew Wherry's `ReleaseLShift()` so that it works with any key. ``` public static void ReleaseKey(ScanCodeShort key) { var Inputs = new INPUT[1]; var Input = new INPUT(); Input.type = 1; Inp...
20,482,338
I need to know how to simulate keyboard input for keys `W`, `S`, `A`, `D`. I've used `SendKeys` with no avail as well as the `InputSimulator` library with no fix. What I'm trying to do is make it to where applications such as games (Battlefield, Natural Selection, ect. Newer FPS games) will register these simulated...
2013/12/09
[ "https://Stackoverflow.com/questions/20482338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2536897/" ]
Have you tried using `SendInput` which supersedes `keybd_event`? To call SendInput from C#, you're going to need to create a whole bunch of structs. Fortunately, most of this information can be gleaned from [pinvoke.net](http://pinvoke.net). Looking at the pinvoke documentation for [SendInput](http://www.pinvoke.ne...
Adding to @ogggre on `keybd_event`. I managed to have a working DllImport: ``` [DllImport("user32.dll")] internal static extern void keybd_event( byte bVk, byte bScan, uint dwFlags, uint dwExtraInfo ); ```