qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
62,464,045
I was currently working on an app and have made it so when I press the continue button it shows the image with a .toggle() but on the second time p press it I want it to change to a blank screen is there any way to do this or am I going to have to add a second button to change to a blank canvas.
2020/06/19
[ "https://Stackoverflow.com/questions/62464045", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13623855/" ]
You can use state pattern here. First create `enum` with all button states ``` enum ButtonState { case notTapped, tappedOnce } ``` Then create a property in a class that handle button tap ``` var buttonState: ButtonState = .notTapped ``` Now you can handle button tap in a way you want ``` @IBAction func but...
You can set different targets to the button according to it's state and toggle them in the action methods as shown below. ```swift override func viewDidLoad() { super.viewDidLoad() // write your code here button.addTarget(self, action: #selector(ButtonTappedDuringPrimaryMode(sender:)), for: .touchUpInside)...
95,952
I am repairing a battery charger that uses two power supplies. TH20594 (couldn't find any info on that either) controls the primary PSU, while the mysterious chip controls the bootstrap/standby supply (aux winding on the smaller transformer provides power to the TH20594). It does not work, but I cannot find any informa...
2014/01/09
[ "https://electronics.stackexchange.com/questions/95952", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/7663/" ]
For the TH20594: I can find references (in russian), [here](http://therepair.ru/topic/2887-zariadnoe-metabo-asc-30/) that states the TH20594MC1.4 is a PWM controller, which makes sense in this context. I can't read russian (I used google translate) but it seems to indicate that there are similar replacement parts with...
Chip 67A= SG6848 or LD7550 Low Cost Green-Mode PWM Controller for Flyback Converters
4,120
Whenever I open a PDF file in Ubuntu, the document viewer shows that file zoomed so that the page *width* fits to the screen *width* (and the lower part of the document is not visible). Due to the large monitor I would really prefer to have it show the full document with a smaller zoom instead (I think that might be ca...
2010/09/13
[ "https://askubuntu.com/questions/4120", "https://askubuntu.com", "https://askubuntu.com/users/277/" ]
[Evince](https://wiki.gnome.org/Apps/Evince) (default PDF viewer) should automatically remember individual display settings for different documents. However, in 10.04, there doesn't appear to be a preference for the default view mode. In Ubuntu 10.10+ (GNOME 2.30+), Evince has an option on the *Edit* menu for this: "S...
You can also run the following command in the terminal to change the default setting: ``` gsettings set org.gnome.Evince.Default sizing-mode 'fit-page' ``` If you also want to have all windows *maximized* by default, additionally run the following command, replacing `1920, 1080` with your screen size: ``` gsettings...
48,279,766
I'm using devise to create users directly from console, in consequence not using the `:registerable` module. The way to create users from the console is by providing email, password and password\_conformation this way: ``` User.create(email: 'john@hotmail.com', password: '1234', password_conformation: '1234') ``` N...
2018/01/16
[ "https://Stackoverflow.com/questions/48279766", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6227057/" ]
I added the `password` and `password_confirmation` fields to the dashboard and it worked like a charm, following I have included a sample of the dashboard with the relevant fields. ``` require "administrate/base_dashboard" class AdminUserDashboard < Administrate::BaseDashboard ATTRIBUTE_TYPES = { . . ....
You can use [devise\_invitable](https://github.com/scambra/devise_invitable) And then you have a form to invite user by `Email`, and the user enter his `password` (is not safe that you set the user password)
12,667
I've got a 1:Many relationship between a Parent object and Child object (master detail). I want to write a report that will show each parent object in its own row, with columns for each child record. Is this possible? Data: ``` ParentA | +----+----+ | | ChildA ChildB ``` Desired report out...
2013/06/10
[ "https://salesforce.stackexchange.com/questions/12667", "https://salesforce.stackexchange.com", "https://salesforce.stackexchange.com/users/2795/" ]
Excellent question. With basic reporting capabilities - no. As far as I know SF doesn't offer any way to pivot (turn rows into columns) in SOQL, Apex and in the reporting engine. If you have a field that's unique for kids of one parent (ideally some sequential number) you could try faking it by using a [bucket field]...
This may give you something which may help point you in a direction that might be fruitful. Whether it provides a solution, I can't say for certain because you want to go to "n" children, which it sounds as though is an indeterminant number. If you create a Matrix report, you can group things both by columns and by r...
15,965,757
Please checkout the demo at - <http://jsfiddle.net/cYGzC/> The idea is that on hover the cross ('×') will turn around its center which will give a nice spinning motion on hover. The problem is, for this to work nicely the center of the × and the circle's center must coincide. ``` .close_button { background-color:...
2013/04/12
[ "https://Stackoverflow.com/questions/15965757", "https://Stackoverflow.com", "https://Stackoverflow.com/users/137893/" ]
The short answer is to use an image for your cross. As Taras says, there is no guarantee that fonts will be rendered exactly the same in every browser.
It looks like the `font-family` It causing part of the issue. If you make the `font-family:Arial, Helvetica, sans-serif;` it seems to work better in firefox <http://jsfiddle.net/cYGzC/1/>
62,935,631
After changing some library references in my web app and updating others using nuget, I get errors like the following on this library if the IIS Worker Process is running from a previous debug session: ``` 1>C:\Program Files (x86)\MSBuild\14.0\bin\Microsoft.Common.CurrentVersion.targets(4136,5): error MSB3021: Unable ...
2020/07/16
[ "https://Stackoverflow.com/questions/62935631", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1188758/" ]
You could try to change the build option(Release). Build your project and go back to Debug mode. If you were in release then the other way. It will in a way restart the configuration of your project. They are different for **Release** then **Debug**. [![enter image description here](https://i.stack.imgur.com/gTfW4.pn...
What you could also do is closing Visual Studio and manually delete files in the debug folder of your project. Open your project again and then rebuild/clean solution.
57,804,073
I am being returned a response from an API method, and I simply need to get the value of "CustomerContactIdentifier". I have tried interating through, but just getting foreach errors. Any help on this would be appriciated. ```php stdClass Object ( [CreateCustomerContactResponse] => stdClass Object ( ...
2019/09/05
[ "https://Stackoverflow.com/questions/57804073", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12024829/" ]
[command](https://docs.ansible.com/ansible/latest/modules/command_module.html): executes a remote command on the target host, in the same shell of other playbook's tasks. It can be used for launch scripts (.sh) or for execute simple commands. For example: ``` - name: Cat a file command: cat somefile.txt - name: ...
Since I were I stumbling about the same question, I wanted to share my findings here too. The `command` and `shell` module, as well `gather_facts` depend on a properly installed Python interpreter on the remote host. If that requirement isn't fulfilled one may experience errors were it isn't possible to execute ``` p...
28,687,690
I've created a custom filter. However when I call this filter in my html, I get the error **Unknown provider: fixUrlFilterProvider <- fixUrlFilter** Filter Code: ``` angular.module('TestDemo') .filter('fixUrl', function () { 'use strict'; return function (relativePath) { ...
2015/02/24
[ "https://Stackoverflow.com/questions/28687690", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3793122/" ]
Usually happens to me when I have forgotten to include the js file. * Check that file containing 'TestDemo' is included in the HTML * Check the module name matches ng-app * If filter and ng-app are different module, check if the filter module is listed as dependency in the ng-app module * Sacrifice a goat to the JS go...
Make sure your app is really called "TestDemo", that your html in enclosed inside the "TestDemo" app and that you have this file included in your script tags
28,687,690
I've created a custom filter. However when I call this filter in my html, I get the error **Unknown provider: fixUrlFilterProvider <- fixUrlFilter** Filter Code: ``` angular.module('TestDemo') .filter('fixUrl', function () { 'use strict'; return function (relativePath) { ...
2015/02/24
[ "https://Stackoverflow.com/questions/28687690", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3793122/" ]
Usually happens to me when I have forgotten to include the js file. * Check that file containing 'TestDemo' is included in the HTML * Check the module name matches ng-app * If filter and ng-app are different module, check if the filter module is listed as dependency in the ng-app module * Sacrifice a goat to the JS go...
I received this error when I accidentally defined the filter in my controller function instead of after declaring my module. Please make sure that after you have created your todoApp, that directly after, you create custom filter ``` //todoApp is an AngularJS module object var todoApp = angular.module("tod...
4,082
I was reading papers on Randomized Benchmarking, such as [this](https://arxiv.org/abs/1404.6025) and [this](https://arxiv.org/abs/1701.04299). (more specifically, equation 30 in the second paper) It appears to be some kind of averaging but I would like to have a more intuitive and physical picture of what it actually ...
2018/08/24
[ "https://quantumcomputing.stackexchange.com/questions/4082", "https://quantumcomputing.stackexchange.com", "https://quantumcomputing.stackexchange.com/users/4399/" ]
I think the way that it is used in deriving bounds on quantum cloning is quite insightful, and hopefully gives you a flavour of the broader context. Where possible I'll skip some of the details in favour of description. Imagine you want to clone an unknown one-qubit quantum state $|\psi\rangle$, making two copies. We ...
An average over conjugations is known as a “twirl”. The “twirling” operation originates from invariant theory (where it is sometimes called “transfer homomorphism”). Twirling a quantum channel over $P\_1^{⊗n}$, $C\_1^{⊗n}$ or $C\_n$ takes it to one described by a polynomial number of parameters. The twirling operation...
1,852,279
By eliminating $u$ from the equations, $x=u+v$ and $y=uv^2$, we get that $F(x,y,v)=0$. Where $v$ implicitly defines $x$ as function of $y$ ($v=h(x,y)$). Prove that $\dfrac{\partial h}{\partial x}=\dfrac{h(x,y)}{3h(x,y)-2x}$. Honestly I have no idea how to start. First, how do we get $F(x,y,v)=0$? What does eliminating...
2016/07/07
[ "https://math.stackexchange.com/questions/1852279", "https://math.stackexchange.com", "https://math.stackexchange.com/users/224176/" ]
This is certainly not an exact differential equation. Moreover, I don't think it has closed-form solutions at all: Maple doesn't find any. Are you sure you don't have a typo?
Obviously $x(x^2+y^2)^{-1/2}+yy\prime(x^2+2y^2)=0$ isn't an exact differential equation. So, there is a typo. Moreover the equation is certainly simple. The simplest guess is : $$x(x^2+y^2)+yy\prime(x^2+2y^2)=0$$ $$x(x^2+y^2)dx+y(x^2+2y^2)dy=0$$ If it is the exact differential of $F(x,y)$ then : $\begin{cases} \frac{...
1,852,279
By eliminating $u$ from the equations, $x=u+v$ and $y=uv^2$, we get that $F(x,y,v)=0$. Where $v$ implicitly defines $x$ as function of $y$ ($v=h(x,y)$). Prove that $\dfrac{\partial h}{\partial x}=\dfrac{h(x,y)}{3h(x,y)-2x}$. Honestly I have no idea how to start. First, how do we get $F(x,y,v)=0$? What does eliminating...
2016/07/07
[ "https://math.stackexchange.com/questions/1852279", "https://math.stackexchange.com", "https://math.stackexchange.com/users/224176/" ]
This is certainly not an exact differential equation. Moreover, I don't think it has closed-form solutions at all: Maple doesn't find any. Are you sure you don't have a typo?
Hint: $x(x^2+y^2)^{-1/2}+yy'(x^2+2y^2)=0$ $y\dfrac{dy}{dx}(x^2+2y^2)=-\dfrac{x}{\sqrt{x^2+y^2}}$ $\dfrac{dx}{dy}=-\dfrac{y(x^2+2y^2)\sqrt{x^2+y^2}}{x}$ Let $t=y^2$ , Then $\dfrac{dx}{dy}=\dfrac{dx}{dt}\dfrac{dt}{dy}=2y\dfrac{dx}{dt}$ $\therefore2y\dfrac{dx}{dt}=-\dfrac{y(x^2+2y^2)\sqrt{x^2+y^2}}{x}$ $\dfrac{dx}{...
286,689
I noticed that when it's raining slightly, there may be puddles forming as you lap around a track. I didn't notice a splash when I was driving through it, however. It also does feel like the road getting wet affects handling, but that might be a placebo. I know that in some games like DiRT Rally, the track can change ...
2016/09/28
[ "https://gaming.stackexchange.com/questions/286689", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/97713/" ]
You can change your name here: <https://account.mojang.com/me> Once you change your name, no two people can have the same name at one time. It's yours until you change it again. If what you mean is that you want your OLD username to be secured, it is blacklisted for one month and a week, so you can change back, but aft...
On <https://account.mojang.com/me>, there is an option to change your name. If you want to know if people have a username you want, you should probably head over to NameMC.
19,338
Given: ``` $ cat lines.txt a/b 'c/d e/f' $ cat 1.sh #!/bin/sh ./2.sh `cat lines.txt` $ cat 2.sh #!/bin/sh echo p1=$1 echo p2=$2 echo p3=$3 $ ./1.sh p1=a/b p2='c/d p3=e/f' ``` How do I change `lines.txt` or `1.sh`, so that `2.sh` receives only two arguments: * **`a/b`** * **`c/d e/f`** ?
2011/08/24
[ "https://unix.stackexchange.com/questions/19338", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/10009/" ]
Set the IFS (internal field separator) to a newline: ``` $ cat 1.sh #!/bin/sh OLD_IFS=$IFS IFS=" " ./2.sh `cat lines.txt` IFS=$OLD_IFS $ ./1.sh p1=a/b p2='c/d e/f' p3= ```
If you aren't locked into the idea of using cat to send as many args as the file is long, you may find this method quite flexible. You can pipe file directly to 2.sh ``` # echo -e "a/b\n'c/d e/f'" >lines.txt fn2.sh() { set -f # disable pathname expansion while IFS= read -r line; do # -r prevents exp...
19,338
Given: ``` $ cat lines.txt a/b 'c/d e/f' $ cat 1.sh #!/bin/sh ./2.sh `cat lines.txt` $ cat 2.sh #!/bin/sh echo p1=$1 echo p2=$2 echo p3=$3 $ ./1.sh p1=a/b p2='c/d p3=e/f' ``` How do I change `lines.txt` or `1.sh`, so that `2.sh` receives only two arguments: * **`a/b`** * **`c/d e/f`** ?
2011/08/24
[ "https://unix.stackexchange.com/questions/19338", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/10009/" ]
Set the IFS (internal field separator) to a newline: ``` $ cat 1.sh #!/bin/sh OLD_IFS=$IFS IFS=" " ./2.sh `cat lines.txt` IFS=$OLD_IFS $ ./1.sh p1=a/b p2='c/d e/f' p3= ```
If your input file contains the line `'c/d e/f'` and you want to process the item `c/d e/f` (without the quotes), then you may be looking for [`xargs`](http://pubs.opengroup.org/onlinepubs/009695399/utilities/xargs.html). Its input format is a space-separated list of strings, with the characters `'` and `"` delimiting ...
44,561,186
I am trying to use `LD_PRELOAD` on linux to wrap calls to `system` function to add some preprocessing to the argument. Here's my `system.cpp`: ``` #define _GNU_SOURCE #include <dlfcn.h> #include <string> #include <iostream> typedef int (*orig_system_type)(const char *command); int system(const char *command) { s...
2017/06/15
[ "https://Stackoverflow.com/questions/44561186", "https://Stackoverflow.com", "https://Stackoverflow.com/users/717214/" ]
You need ``` extern "C" int system ... ``` because it is called by a C function. The C++ version has its name mangled so it is not recognizable.
The code should work perfectly fine. Assuming the driver program is something like this: ``` #include <cstdlib> int main() { system("find -name *.cpp"); } ``` Then `env LD_PRELOAD=$PWD/libsystem.so ./a.out` gives me this output: ``` set -f;find -name *.cpp ./system.cpp ./test.cpp ``` Which shows that not onl...
44,561,186
I am trying to use `LD_PRELOAD` on linux to wrap calls to `system` function to add some preprocessing to the argument. Here's my `system.cpp`: ``` #define _GNU_SOURCE #include <dlfcn.h> #include <string> #include <iostream> typedef int (*orig_system_type)(const char *command); int system(const char *command) { s...
2017/06/15
[ "https://Stackoverflow.com/questions/44561186", "https://Stackoverflow.com", "https://Stackoverflow.com/users/717214/" ]
You need ``` extern "C" int system ... ``` because it is called by a C function. The C++ version has its name mangled so it is not recognizable.
You might also want to consider saving the "orig\_system" pointer so that you avoid calling dlsym every time. You can do this in a [constructor/init](https://stackoverflow.com/questions/9759880/automatically-executed-functions-when-loading-shared-libraries) function, so you would have something like ``` extern "C" { ...
44,561,186
I am trying to use `LD_PRELOAD` on linux to wrap calls to `system` function to add some preprocessing to the argument. Here's my `system.cpp`: ``` #define _GNU_SOURCE #include <dlfcn.h> #include <string> #include <iostream> typedef int (*orig_system_type)(const char *command); int system(const char *command) { s...
2017/06/15
[ "https://Stackoverflow.com/questions/44561186", "https://Stackoverflow.com", "https://Stackoverflow.com/users/717214/" ]
You might also want to consider saving the "orig\_system" pointer so that you avoid calling dlsym every time. You can do this in a [constructor/init](https://stackoverflow.com/questions/9759880/automatically-executed-functions-when-loading-shared-libraries) function, so you would have something like ``` extern "C" { ...
The code should work perfectly fine. Assuming the driver program is something like this: ``` #include <cstdlib> int main() { system("find -name *.cpp"); } ``` Then `env LD_PRELOAD=$PWD/libsystem.so ./a.out` gives me this output: ``` set -f;find -name *.cpp ./system.cpp ./test.cpp ``` Which shows that not onl...
20,873,755
I have this: ``` #define ONE 1 #define TWO 2 switch { case ONE: { return ONE * ONE; } case TWO: { return TWO * TWO; } } ``` and I want to do this: ``` #define ONE 1 #define TWO 2 switch { case ONE: case TWO: { return name_of_the_case_value * name_of_the_case_v...
2014/01/01
[ "https://Stackoverflow.com/questions/20873755", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3152003/" ]
Whatever variable you put in the `switch(variable)` part you just just reuse in the case itself. e.g. ``` int var; //some code that sets the value of var switch(var){ case ONE: case TWO: return var * var; default: break; } ``` You can't just have ``` switch{ case WHATEVER1: ca...
You cannot have this: ``` #define ONE 1 #define TWO 2 switch { case ONE: { return ONE * ONE; } case TWO: { return TWO * TWO; } } ``` `switch` needs a value to switch according to... So you have: ``` switch (my_value) { case ONE: { return ONE * ONE; } case TWO: ...
20,873,755
I have this: ``` #define ONE 1 #define TWO 2 switch { case ONE: { return ONE * ONE; } case TWO: { return TWO * TWO; } } ``` and I want to do this: ``` #define ONE 1 #define TWO 2 switch { case ONE: case TWO: { return name_of_the_case_value * name_of_the_case_v...
2014/01/01
[ "https://Stackoverflow.com/questions/20873755", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3152003/" ]
Whatever variable you put in the `switch(variable)` part you just just reuse in the case itself. e.g. ``` int var; //some code that sets the value of var switch(var){ case ONE: case TWO: return var * var; default: break; } ``` You can't just have ``` switch{ case WHATEVER1: ca...
This construction ``` #define ONE 1 #define TWO 2 switch { case ONE: { return ONE * ONE; } case TWO: { return TWO * TWO; } } ``` is invalid because switch statement requires an expression. The case labels correspond to possible values of the expression. So if the control was passed ...
20,873,755
I have this: ``` #define ONE 1 #define TWO 2 switch { case ONE: { return ONE * ONE; } case TWO: { return TWO * TWO; } } ``` and I want to do this: ``` #define ONE 1 #define TWO 2 switch { case ONE: case TWO: { return name_of_the_case_value * name_of_the_case_v...
2014/01/01
[ "https://Stackoverflow.com/questions/20873755", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3152003/" ]
You cannot have this: ``` #define ONE 1 #define TWO 2 switch { case ONE: { return ONE * ONE; } case TWO: { return TWO * TWO; } } ``` `switch` needs a value to switch according to... So you have: ``` switch (my_value) { case ONE: { return ONE * ONE; } case TWO: ...
This construction ``` #define ONE 1 #define TWO 2 switch { case ONE: { return ONE * ONE; } case TWO: { return TWO * TWO; } } ``` is invalid because switch statement requires an expression. The case labels correspond to possible values of the expression. So if the control was passed ...
29,183,990
Which code snippet calculates the sum of all the elements in even positions in an array? ``` a) int sum = 0; for (int i = 1; < values.length; i+=2) { sum++; } b) int sum = 0 for (int i = 0; i < values.length; i++) { sum++; } c) int sum = 0; for (int i = 0; i < values.lengthl; i++) { sum +=values [i]; } d) int sum ...
2015/03/21
[ "https://Stackoverflow.com/questions/29183990", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3288334/" ]
None of these answers appear to answer the question. Here is a code snippet which will compute the sum of all even elements of array `values`. ``` int sum = 0; for (int i = 1; i < values.length; i = i + 2) { sum +=values [i]; } ``` You have to increment the loop variable `i` by 2 in order to sum only even elemen...
A small correction you are using array in your code. `ArrayList` is different from `Array`. `ArrayList` doesn't have a `length` property, it's the property of an `Array`. I think the answer added by **Tim Biegeieisen** is correct for an array. Similary, You can do the same thing for a array list like this - ``` int...
29,183,990
Which code snippet calculates the sum of all the elements in even positions in an array? ``` a) int sum = 0; for (int i = 1; < values.length; i+=2) { sum++; } b) int sum = 0 for (int i = 0; i < values.length; i++) { sum++; } c) int sum = 0; for (int i = 0; i < values.lengthl; i++) { sum +=values [i]; } d) int sum ...
2015/03/21
[ "https://Stackoverflow.com/questions/29183990", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3288334/" ]
None of these answers appear to answer the question. Here is a code snippet which will compute the sum of all even elements of array `values`. ``` int sum = 0; for (int i = 1; i < values.length; i = i + 2) { sum +=values [i]; } ``` You have to increment the loop variable `i` by 2 in order to sum only even elemen...
A and B don't add elements of the array to `sum`; B and C process all elements. So if any of them are correct, it must be D. But since D does not change `i`, it cannot be right, either.
9,078
I asked a question a few months ago that was answered very succinctly. I thought the answer fit perfectly; it had the exact amount of information that someone with the same problem would need to resolve it. The answer had more than 50 upvotes already, lending credence to its usefulness. Not long ago, the answer was [e...
2015/01/20
[ "https://meta.superuser.com/questions/9078", "https://meta.superuser.com", "https://meta.superuser.com/users/164688/" ]
No, not cool. Such an extensive edit should have been its own answer, not an edit. The suggested edit should have been rejected.
[Oliver](https://meta.superuser.com/users/36744/oliver-salzburg) reached out to me to let me know about the discussion here. Really appreciate that, thanks! OK, so it probably helps to tell the whole story so you see where I'm coming from. Apologize for the length… --- I work on the Chrome team so I wanted to help c...
3,661,490
I was wondering it for a long time since Apple released iTunes for Windows. What did they use to write iTunes for Windows? It seems completely with its own UI components and everything is contained inside it. It even uses QuickTime resources files. Can we assume that they've Cocoa working with windows. Anyway, my main ...
2010/09/07
[ "https://Stackoverflow.com/questions/3661490", "https://Stackoverflow.com", "https://Stackoverflow.com/users/337827/" ]
Not a direct answer, but if the reason you're asking is that you want to port a cocoa application to Windows, you might be interested in this: <http://code.google.com/p/cocotron/> bit more info here: <http://cocoawithlove.com/2010/04/design-of-multi-platform-app-using.html> <http://cocoawithlove.com/2010/04/por...
itunes for both mac and windows are written in c++ as it is easier to port between operating systems with much or the same codebase
33,488,307
I'm trying to write a main method in Java that accepts some user input and passes it to some methods. My Code so far: ``` //this method prints a menu to the console public static void menu(){ System.out.println("Select one of the following:\n"); System.out.println("Enter Observatory Data[1]"); System.ou...
2015/11/02
[ "https://Stackoverflow.com/questions/33488307", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3059024/" ]
In your while loop condition, you are setting cheese to false instead of comparing cheese with false. Change it to ``` while (cheese == false) { ``` or ``` while(!cheese) { ``` You can also wait for more user input after you last actual input. So after you last line, add this: ``` reader.next(); ``` so that ...
Your while condition is incorrect... It should be: ``` boolean cheese = true; while (cheese) { // Do stuff. } ``` or if you really want to have your cheese boolean to be false, just do this: ``` boolean cheese = false; while (!cheese) { // Do stuff. } ```
23,757,527
When I tried to draw circle on JMapViewer with the following parameters: Latitude:30.58654740901267 Longitude:31.504483034999993 radius : 100 I got the following gigantic circle ![enter image description here](https://i.stack.imgur.com/7Y3Ig.png) **What is the measurement unit used for this radius variable ?!!** **...
2014/05/20
[ "https://Stackoverflow.com/questions/23757527", "https://Stackoverflow.com", "https://Stackoverflow.com/users/586557/" ]
Not a single function, no. But you can quite easily do this: * Obtain current time using [`time()`](http://linux.die.net/man/2/time). * Subtract 90 days' worth of seconds. * Convert to local time using [`localtime()`](http://linux.die.net/man/3/ctime). * Convert to string using [`strftime()`](http://linux.die.net/man...
DateTime dt = DateTime.Now.AddDays(-90); string edate = dt.ToString("dd-MM-yyyy");
23,757,527
When I tried to draw circle on JMapViewer with the following parameters: Latitude:30.58654740901267 Longitude:31.504483034999993 radius : 100 I got the following gigantic circle ![enter image description here](https://i.stack.imgur.com/7Y3Ig.png) **What is the measurement unit used for this radius variable ?!!** **...
2014/05/20
[ "https://Stackoverflow.com/questions/23757527", "https://Stackoverflow.com", "https://Stackoverflow.com/users/586557/" ]
``` #include <stdio.h> #include <string.h> #include <time.h> int main(void) { time_t t = time(0); // NOW struct tm tm[1]; memmove(tm, localtime(&t), sizeof tm); // convert to struct tm tm->tm_mday -= 90; // subtract 90 days time_t then2 = mktime(tm); ...
Not a single function, no. But you can quite easily do this: * Obtain current time using [`time()`](http://linux.die.net/man/2/time). * Subtract 90 days' worth of seconds. * Convert to local time using [`localtime()`](http://linux.die.net/man/3/ctime). * Convert to string using [`strftime()`](http://linux.die.net/man...
23,757,527
When I tried to draw circle on JMapViewer with the following parameters: Latitude:30.58654740901267 Longitude:31.504483034999993 radius : 100 I got the following gigantic circle ![enter image description here](https://i.stack.imgur.com/7Y3Ig.png) **What is the measurement unit used for this radius variable ?!!** **...
2014/05/20
[ "https://Stackoverflow.com/questions/23757527", "https://Stackoverflow.com", "https://Stackoverflow.com/users/586557/" ]
The `COleDateTime` [(link)](http://msdn.microsoft.com/en-us/library/38wh24td.aspx) and `COleDateTimeSpan` [(link)](http://msdn.microsoft.com/en-us/library/xb7yw6f3.aspx) classes could be used. ``` #include <atlcomtime.h> COleDateTime dt = COleDateTime::GetCurrentTime(); COleDateTimeSpan span(90, 0, 0, 0); COleDateTim...
Not a single function, no. But you can quite easily do this: * Obtain current time using [`time()`](http://linux.die.net/man/2/time). * Subtract 90 days' worth of seconds. * Convert to local time using [`localtime()`](http://linux.die.net/man/3/ctime). * Convert to string using [`strftime()`](http://linux.die.net/man...
23,757,527
When I tried to draw circle on JMapViewer with the following parameters: Latitude:30.58654740901267 Longitude:31.504483034999993 radius : 100 I got the following gigantic circle ![enter image description here](https://i.stack.imgur.com/7Y3Ig.png) **What is the measurement unit used for this radius variable ?!!** **...
2014/05/20
[ "https://Stackoverflow.com/questions/23757527", "https://Stackoverflow.com", "https://Stackoverflow.com/users/586557/" ]
``` #include <stdio.h> #include <string.h> #include <time.h> int main(void) { time_t t = time(0); // NOW struct tm tm[1]; memmove(tm, localtime(&t), sizeof tm); // convert to struct tm tm->tm_mday -= 90; // subtract 90 days time_t then2 = mktime(tm); ...
DateTime dt = DateTime.Now.AddDays(-90); string edate = dt.ToString("dd-MM-yyyy");
23,757,527
When I tried to draw circle on JMapViewer with the following parameters: Latitude:30.58654740901267 Longitude:31.504483034999993 radius : 100 I got the following gigantic circle ![enter image description here](https://i.stack.imgur.com/7Y3Ig.png) **What is the measurement unit used for this radius variable ?!!** **...
2014/05/20
[ "https://Stackoverflow.com/questions/23757527", "https://Stackoverflow.com", "https://Stackoverflow.com/users/586557/" ]
The `COleDateTime` [(link)](http://msdn.microsoft.com/en-us/library/38wh24td.aspx) and `COleDateTimeSpan` [(link)](http://msdn.microsoft.com/en-us/library/xb7yw6f3.aspx) classes could be used. ``` #include <atlcomtime.h> COleDateTime dt = COleDateTime::GetCurrentTime(); COleDateTimeSpan span(90, 0, 0, 0); COleDateTim...
DateTime dt = DateTime.Now.AddDays(-90); string edate = dt.ToString("dd-MM-yyyy");
23,757,527
When I tried to draw circle on JMapViewer with the following parameters: Latitude:30.58654740901267 Longitude:31.504483034999993 radius : 100 I got the following gigantic circle ![enter image description here](https://i.stack.imgur.com/7Y3Ig.png) **What is the measurement unit used for this radius variable ?!!** **...
2014/05/20
[ "https://Stackoverflow.com/questions/23757527", "https://Stackoverflow.com", "https://Stackoverflow.com/users/586557/" ]
The `COleDateTime` [(link)](http://msdn.microsoft.com/en-us/library/38wh24td.aspx) and `COleDateTimeSpan` [(link)](http://msdn.microsoft.com/en-us/library/xb7yw6f3.aspx) classes could be used. ``` #include <atlcomtime.h> COleDateTime dt = COleDateTime::GetCurrentTime(); COleDateTimeSpan span(90, 0, 0, 0); COleDateTim...
``` #include <stdio.h> #include <string.h> #include <time.h> int main(void) { time_t t = time(0); // NOW struct tm tm[1]; memmove(tm, localtime(&t), sizeof tm); // convert to struct tm tm->tm_mday -= 90; // subtract 90 days time_t then2 = mktime(tm); ...
31,439
is there any insights on installing civicrm on mariadb with data encryption turned on? Is it workable? Thanks.
2019/07/21
[ "https://civicrm.stackexchange.com/questions/31439", "https://civicrm.stackexchange.com", "https://civicrm.stackexchange.com/users/6624/" ]
Welcome to CiviCRM SE. Eileen's answer is definitely the right place to start, but you might want to look at a related question that I asked about the built-in (reserved) de-duplicate rules, as they aren't entirely clear from the documentation. It says "NAME" in the description, but actually uses the fields "First Name...
I think this blog does a reasonable job of describing it <https://civicrm.org/blog/spidersilk/understanding-civicrm-dedupe-rules> Here are the official docs <https://docs.civicrm.org/user/en/latest/common-workflows/deduping-and-merging/> * but we could do with pulling some in from the docs Basically you need to che...
12,886,413
I have a website with a database of 2,4 million entries. Now I want to use mod\_rewrite to produce clear URLs like example.com/this-is-a-beautiful-url. To recognize which URL belongs to which page I want to build a URL-table which refers to the website's content. Like "this-url-example" belongs to the post with the ID ...
2012/10/14
[ "https://Stackoverflow.com/questions/12886413", "https://Stackoverflow.com", "https://Stackoverflow.com/users/558559/" ]
Go for a compromise, have urls as sitename.com/12345/clean-url-format You have both keywords in a readable URL and the identified which you can use to fetch the row by the primary key for speed. It would be reasonable to redirect urls without the text part to the canonical version with it.
I would not use either mysql or md5 hashing. Instead, use a key-value store such as [dbm](https://en.wikipedia.org/wiki/dbm) or [leveldb](http://leveldb.org/). If you are using Apache's `mod_rewrite`, it has a feature, [RewriteMap](http://httpd.apache.org/docs/current/rewrite/rewritemap.html) that can read the keys and...
12,886,413
I have a website with a database of 2,4 million entries. Now I want to use mod\_rewrite to produce clear URLs like example.com/this-is-a-beautiful-url. To recognize which URL belongs to which page I want to build a URL-table which refers to the website's content. Like "this-url-example" belongs to the post with the ID ...
2012/10/14
[ "https://Stackoverflow.com/questions/12886413", "https://Stackoverflow.com", "https://Stackoverflow.com/users/558559/" ]
MD5 Hash was designed for data comparison purposes. I.e. checking that a password is valid or that a file remains unchanged. If you plan on being able to change and modify the URL (for search engine optimization purposes) I would stick to Plain text. Also if you want to create Mod Rewrite Commands (in your HTACCESS) ...
I would not use either mysql or md5 hashing. Instead, use a key-value store such as [dbm](https://en.wikipedia.org/wiki/dbm) or [leveldb](http://leveldb.org/). If you are using Apache's `mod_rewrite`, it has a feature, [RewriteMap](http://httpd.apache.org/docs/current/rewrite/rewritemap.html) that can read the keys and...
70,655,035
My question is really simple. I want to call the `useState` hook conditionally. I know this is not allowed in react, and that is why I'm here. My use case is: I have an array of "comments". For each comment, I want to allow it to be liked based on whether the user is logged in or not. For this, I am using a `hasLiked`...
2022/01/10
[ "https://Stackoverflow.com/questions/70655035", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16747996/" ]
You can use getCell with the cRow variable after getRangeBetweenHeaderAndTotal() to get a specific cell range. Once you have that range, you can read its value using getValue(). And you can write a value to that range using setValue(). You can see an example of how to do that below: ``` function main(workbook: ExcelSc...
Can get the value by using the worksheet cell, but I would really like to reference the table itself to not have any issues if things are moved around and such.. ``` let col = collectionTable.getColumnByName("SomeCol").getIndex(); // if table starts at beginning of sheet, or else have to offset col and row.. let cel...
34,564,999
I am a yiibie and I am having a problem that any event that I am trying to delete is not getting deleted and it gives me an error which is ``` Error 500: <h1>CDbException</h1> <p>CDbCommand failed to execute the SQL statement: SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row:...
2016/01/02
[ "https://Stackoverflow.com/questions/34564999", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5166301/" ]
Well the problem is related to the fact you have Eevent link to User Event by the table user\_join\_event. then when you try to delete an Event the DB raise an error because in the way some row of user\_join\_event remain without reference. This implies that before deleting the Event is mandatory delete the releted ch...
you have relation with UserJoinEvent table, and the error cause from the restrictions, so delete rows from UserJoinEvent table (parent table)
2,298,920
Which is the right-click equivalent to `svn status` in [TortoiseSVN](http://tortoisesvn.tigris.org/)? TortoiseSVN is a Windows' GUI for Subversion.
2010/02/19
[ "https://Stackoverflow.com/questions/2298920", "https://Stackoverflow.com", "https://Stackoverflow.com/users/157519/" ]
You can see all local changes in "TortoiseSVN > Check for modifications". The "Check repository" button will also look for remote updates. But you can do the same by opening the commit window - it's the same as long as you don't click on the commit button accidentally.
Try the "Check for updates" command.
2,298,920
Which is the right-click equivalent to `svn status` in [TortoiseSVN](http://tortoisesvn.tigris.org/)? TortoiseSVN is a Windows' GUI for Subversion.
2010/02/19
[ "https://Stackoverflow.com/questions/2298920", "https://Stackoverflow.com", "https://Stackoverflow.com/users/157519/" ]
Try the "Check for updates" command.
If you have the icon overlays turned on, you can just look at your working copy folder and the icons will give you much of this information.
2,298,920
Which is the right-click equivalent to `svn status` in [TortoiseSVN](http://tortoisesvn.tigris.org/)? TortoiseSVN is a Windows' GUI for Subversion.
2010/02/19
[ "https://Stackoverflow.com/questions/2298920", "https://Stackoverflow.com", "https://Stackoverflow.com/users/157519/" ]
You can see all local changes in "TortoiseSVN > Check for modifications". The "Check repository" button will also look for remote updates. But you can do the same by opening the commit window - it's the same as long as you don't click on the commit button accidentally.
"Check for Updates"
2,298,920
Which is the right-click equivalent to `svn status` in [TortoiseSVN](http://tortoisesvn.tigris.org/)? TortoiseSVN is a Windows' GUI for Subversion.
2010/02/19
[ "https://Stackoverflow.com/questions/2298920", "https://Stackoverflow.com", "https://Stackoverflow.com/users/157519/" ]
"Check for Updates"
If you have the icon overlays turned on, you can just look at your working copy folder and the icons will give you much of this information.
2,298,920
Which is the right-click equivalent to `svn status` in [TortoiseSVN](http://tortoisesvn.tigris.org/)? TortoiseSVN is a Windows' GUI for Subversion.
2010/02/19
[ "https://Stackoverflow.com/questions/2298920", "https://Stackoverflow.com", "https://Stackoverflow.com/users/157519/" ]
You can see all local changes in "TortoiseSVN > Check for modifications". The "Check repository" button will also look for remote updates. But you can do the same by opening the commit window - it's the same as long as you don't click on the commit button accidentally.
If you have the icon overlays turned on, you can just look at your working copy folder and the icons will give you much of this information.
73,941
I'm trying to create a custom field that takes today's date and adds a random number of days to it and returns that new date? Any ideas?
2015/05/01
[ "https://salesforce.stackexchange.com/questions/73941", "https://salesforce.stackexchange.com", "https://salesforce.stackexchange.com/users/19160/" ]
As of yet, there is no way to generate a random number using just formula functions (that I know of without hitting the compiled character limit). An alternative is to make it a standard date field and create a new trigger on the object: ``` trigger <name> on <object> (before insert) { public integer MAX_RANDOM_VAL ...
An alternative solution, if you are not able to (or don't want to) add a trigger, is to generate a pseudo random number using an auto number formula + a last modified date value converted to a value all modded together. This is not really random, but it's random enough for generating arbitrary dates. Your formula wou...
53,342,591
I am trying to apply a function to `pandas` dataframe. My function has a `try/except` block to catch exceptions like `ZeroDivisionError` but it's failing. Data Frame have 100+ columns. And **actual** function is to be applied every row by selecting subset of columns Following is my code Function: ``` import pandas ...
2018/11/16
[ "https://Stackoverflow.com/questions/53342591", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4520274/" ]
Specify column: ``` df[0].apply(lambda x : d(x)) ``` Out: ``` 0 0.000000 1 3.142857 2 1.571429 3 1.047619 4 0.785714 Name: 0, dtype: float64 ``` For entire dataset use: df.applymap(d)
Here's an alternative which will be faster than using `apply` if your real dataset is very large: ``` import math import pandas as pd import numpy as np df = pd.DataFrame({'a': [0, 2, 3, 4], 'b': [0, 3, 4, 5]}) df = (math.pi / df).replace(np.inf, 0) ``` Results: ``` a b 0 0.000000 0.000000 1 1...
242
It slows down the browsing, the browser consumes 99% CPU for like 2 seconds after a page is loaded. And editing a page with some mathjax expressions is **hell slow**, probably because of preview. Why can't you do the same on server side, at least partially? There is a golden rule: don't do on client's side what you can...
2013/03/05
[ "https://crypto.meta.stackexchange.com/questions/242", "https://crypto.meta.stackexchange.com", "https://crypto.meta.stackexchange.com/users/5102/" ]
That clause is against people inventing their own primitives, typically classical ciphers. New classical ciphers created by beginners aren't interesting, and evaluating a new modern primitive is far too much work for a question. If you designed a proof of work system building on standard primitives that should be acce...
For the record, the FAQ doesn't say what you seem to think it says. We're not interested in questions from an amateur who has invented a new homebrew encryption algorithm and challenges us to cryptanalyze it; those questions are rarely of interest to the Crypto.SE audience. However, if you have a question that's likel...
2,359,400
I'm considering a design for a private messaging system and I need some input here, basically I have several questions regarding this. I've read most of the related questions and they've given me some thought already. All of the basic messaging systems I've thus far looked into use a single table for all of the users'...
2010/03/01
[ "https://Stackoverflow.com/questions/2359400", "https://Stackoverflow.com", "https://Stackoverflow.com/users/283950/" ]
Creating one table per user certainly won't scale well when there are a large number of users with a small number of messages. The way MySQL handles table opening/closing, very large numbers of tables (> 10k, say) become quite inefficient, especially at server startup and shutdown, as well as trying to backup non-trans...
Splitting large amounts of data into smaller sets makes sense if you're trying to avoid locking issues: for example - locking the messages table - doing big selects or updating huge amounts of data at once. In this case long running queries could block whole table and everyone needs to wait... You should ask yourself i...
2,359,400
I'm considering a design for a private messaging system and I need some input here, basically I have several questions regarding this. I've read most of the related questions and they've given me some thought already. All of the basic messaging systems I've thus far looked into use a single table for all of the users'...
2010/03/01
[ "https://Stackoverflow.com/questions/2359400", "https://Stackoverflow.com", "https://Stackoverflow.com/users/283950/" ]
Creating one table per user certainly won't scale well when there are a large number of users with a small number of messages. The way MySQL handles table opening/closing, very large numbers of tables (> 10k, say) become quite inefficient, especially at server startup and shutdown, as well as trying to backup non-trans...
It depends how your message system works. Are there cuncurrency issue? Does it need to be scalable as the application accomodate more customers? Designing one table will perfectly work on small, one message at a time single user system. However, if you are considering multiple user, concurrent messaging system, the ta...
2,359,400
I'm considering a design for a private messaging system and I need some input here, basically I have several questions regarding this. I've read most of the related questions and they've given me some thought already. All of the basic messaging systems I've thus far looked into use a single table for all of the users'...
2010/03/01
[ "https://Stackoverflow.com/questions/2359400", "https://Stackoverflow.com", "https://Stackoverflow.com/users/283950/" ]
I'm agreeing with @MarkR here - in that initially the one table for messages is definitely the way to proceed. As time progresses and should you end up with a very large table then you can consider how to partition the table to best proceed. That's counter to the way I'd normally advise design, but we're talking about ...
Creating one table per user certainly won't scale well when there are a large number of users with a small number of messages. The way MySQL handles table opening/closing, very large numbers of tables (> 10k, say) become quite inefficient, especially at server startup and shutdown, as well as trying to backup non-trans...
2,359,400
I'm considering a design for a private messaging system and I need some input here, basically I have several questions regarding this. I've read most of the related questions and they've given me some thought already. All of the basic messaging systems I've thus far looked into use a single table for all of the users'...
2010/03/01
[ "https://Stackoverflow.com/questions/2359400", "https://Stackoverflow.com", "https://Stackoverflow.com/users/283950/" ]
You'll just get headaches from moving to small numerous tables. Databases are made for handling lots of data, let it do it's thing. * You'll likely end up using dynamic table names in queries (`SELECT * FROM $username WHERE ...`), making smart features like stored procedures and possibly parameterized queries a lot tr...
Creating one table per user certainly won't scale well when there are a large number of users with a small number of messages. The way MySQL handles table opening/closing, very large numbers of tables (> 10k, say) become quite inefficient, especially at server startup and shutdown, as well as trying to backup non-trans...
2,359,400
I'm considering a design for a private messaging system and I need some input here, basically I have several questions regarding this. I've read most of the related questions and they've given me some thought already. All of the basic messaging systems I've thus far looked into use a single table for all of the users'...
2010/03/01
[ "https://Stackoverflow.com/questions/2359400", "https://Stackoverflow.com", "https://Stackoverflow.com/users/283950/" ]
I'm agreeing with @MarkR here - in that initially the one table for messages is definitely the way to proceed. As time progresses and should you end up with a very large table then you can consider how to partition the table to best proceed. That's counter to the way I'd normally advise design, but we're talking about ...
Splitting large amounts of data into smaller sets makes sense if you're trying to avoid locking issues: for example - locking the messages table - doing big selects or updating huge amounts of data at once. In this case long running queries could block whole table and everyone needs to wait... You should ask yourself i...
2,359,400
I'm considering a design for a private messaging system and I need some input here, basically I have several questions regarding this. I've read most of the related questions and they've given me some thought already. All of the basic messaging systems I've thus far looked into use a single table for all of the users'...
2010/03/01
[ "https://Stackoverflow.com/questions/2359400", "https://Stackoverflow.com", "https://Stackoverflow.com/users/283950/" ]
You'll just get headaches from moving to small numerous tables. Databases are made for handling lots of data, let it do it's thing. * You'll likely end up using dynamic table names in queries (`SELECT * FROM $username WHERE ...`), making smart features like stored procedures and possibly parameterized queries a lot tr...
Splitting large amounts of data into smaller sets makes sense if you're trying to avoid locking issues: for example - locking the messages table - doing big selects or updating huge amounts of data at once. In this case long running queries could block whole table and everyone needs to wait... You should ask yourself i...
2,359,400
I'm considering a design for a private messaging system and I need some input here, basically I have several questions regarding this. I've read most of the related questions and they've given me some thought already. All of the basic messaging systems I've thus far looked into use a single table for all of the users'...
2010/03/01
[ "https://Stackoverflow.com/questions/2359400", "https://Stackoverflow.com", "https://Stackoverflow.com/users/283950/" ]
I'm agreeing with @MarkR here - in that initially the one table for messages is definitely the way to proceed. As time progresses and should you end up with a very large table then you can consider how to partition the table to best proceed. That's counter to the way I'd normally advise design, but we're talking about ...
It depends how your message system works. Are there cuncurrency issue? Does it need to be scalable as the application accomodate more customers? Designing one table will perfectly work on small, one message at a time single user system. However, if you are considering multiple user, concurrent messaging system, the ta...
2,359,400
I'm considering a design for a private messaging system and I need some input here, basically I have several questions regarding this. I've read most of the related questions and they've given me some thought already. All of the basic messaging systems I've thus far looked into use a single table for all of the users'...
2010/03/01
[ "https://Stackoverflow.com/questions/2359400", "https://Stackoverflow.com", "https://Stackoverflow.com/users/283950/" ]
You'll just get headaches from moving to small numerous tables. Databases are made for handling lots of data, let it do it's thing. * You'll likely end up using dynamic table names in queries (`SELECT * FROM $username WHERE ...`), making smart features like stored procedures and possibly parameterized queries a lot tr...
It depends how your message system works. Are there cuncurrency issue? Does it need to be scalable as the application accomodate more customers? Designing one table will perfectly work on small, one message at a time single user system. However, if you are considering multiple user, concurrent messaging system, the ta...
2,359,400
I'm considering a design for a private messaging system and I need some input here, basically I have several questions regarding this. I've read most of the related questions and they've given me some thought already. All of the basic messaging systems I've thus far looked into use a single table for all of the users'...
2010/03/01
[ "https://Stackoverflow.com/questions/2359400", "https://Stackoverflow.com", "https://Stackoverflow.com/users/283950/" ]
You'll just get headaches from moving to small numerous tables. Databases are made for handling lots of data, let it do it's thing. * You'll likely end up using dynamic table names in queries (`SELECT * FROM $username WHERE ...`), making smart features like stored procedures and possibly parameterized queries a lot tr...
I'm agreeing with @MarkR here - in that initially the one table for messages is definitely the way to proceed. As time progresses and should you end up with a very large table then you can consider how to partition the table to best proceed. That's counter to the way I'd normally advise design, but we're talking about ...
46,784,334
[![enter image description here](https://i.stack.imgur.com/trUh3.png)](https://i.stack.imgur.com/trUh3.png)I am using `Object.keys` function for get the `length` of the array but after push the data in array it will be show array `length` is undefine [enter image description here](https://i.stack.imgur.com/HAijz.png). ...
2017/10/17
[ "https://Stackoverflow.com/questions/46784334", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6761261/" ]
Its very simple. Just do following: 1. Check whether Gecko driver driver is already installed or not in your machine using command - **"webdriver-manager status"**. This will show what has already installed like Selenium Server, IE, Chrome and Gecko drivers and version details on command prompt 2. If you do not find t...
The downloads (and source code) for Gecko driver is available here : <https://github.com/mozilla/geckodriver/releases> Instructions for installation are there also. There are compiled binaries available for Windows, Linux and MacOS.
46,784,334
[![enter image description here](https://i.stack.imgur.com/trUh3.png)](https://i.stack.imgur.com/trUh3.png)I am using `Object.keys` function for get the `length` of the array but after push the data in array it will be show array `length` is undefine [enter image description here](https://i.stack.imgur.com/HAijz.png). ...
2017/10/17
[ "https://Stackoverflow.com/questions/46784334", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6761261/" ]
Its very simple. Just do following: 1. Check whether Gecko driver driver is already installed or not in your machine using command - **"webdriver-manager status"**. This will show what has already installed like Selenium Server, IE, Chrome and Gecko drivers and version details on command prompt 2. If you do not find t...
if webdriver-manger update is not working , then download the driver manually from : <https://github.com/mozilla/geckodriver/releases> Now goto : ``` C:\Users\somepath\node_modules\protractor\node_modules\webdriver-manager\selenium and below property to update-config.json "gecko": { "last": "C:\\pathtog...
2,992,001
I have a dictionary collection as bleow: ``` mydic.addvalue(key1, val1) mydic.addvalue(key2, val1) mydic.addvalue(key3, val1) mydic.addvalue(key4, val2) mydic.addvalue(key5, val2) ``` From the above dictionary I want to delete all the entries where value == "val1", so that the result would have only following entry:...
2010/06/07
[ "https://Stackoverflow.com/questions/2992001", "https://Stackoverflow.com", "https://Stackoverflow.com/users/350233/" ]
You first need to find all keys for which the associated value is `val1`: ``` var keysToRemove = mydic.Where(kvp => kvp.Value == val1) .Select(kvp => kvp.Key) .ToArray(); ``` Then you can remove each of those keys: ``` foreach (var key in keysToRemove) { mydic.Rem...
You can also use ``` var x= (from k in mydic where k.Value != val1 select k).ToDictionary(k=>k.key); ``` x will not have any of the val1's
2,992,001
I have a dictionary collection as bleow: ``` mydic.addvalue(key1, val1) mydic.addvalue(key2, val1) mydic.addvalue(key3, val1) mydic.addvalue(key4, val2) mydic.addvalue(key5, val2) ``` From the above dictionary I want to delete all the entries where value == "val1", so that the result would have only following entry:...
2010/06/07
[ "https://Stackoverflow.com/questions/2992001", "https://Stackoverflow.com", "https://Stackoverflow.com/users/350233/" ]
A non-LINQ answer based on a comment by the user. ``` private static void RemoveByValue<TKey,TValue>(Dictionary<TKey, TValue> dictionary, TValue someValue) { List<TKey> itemsToRemove = new List<TKey>(); foreach (var pair in dictionary) { if (pair.Value.Equals(someValue)) itemsToRemove....
You first need to find all keys for which the associated value is `val1`: ``` var keysToRemove = mydic.Where(kvp => kvp.Value == val1) .Select(kvp => kvp.Key) .ToArray(); ``` Then you can remove each of those keys: ``` foreach (var key in keysToRemove) { mydic.Rem...
2,992,001
I have a dictionary collection as bleow: ``` mydic.addvalue(key1, val1) mydic.addvalue(key2, val1) mydic.addvalue(key3, val1) mydic.addvalue(key4, val2) mydic.addvalue(key5, val2) ``` From the above dictionary I want to delete all the entries where value == "val1", so that the result would have only following entry:...
2010/06/07
[ "https://Stackoverflow.com/questions/2992001", "https://Stackoverflow.com", "https://Stackoverflow.com/users/350233/" ]
You first need to find all keys for which the associated value is `val1`: ``` var keysToRemove = mydic.Where(kvp => kvp.Value == val1) .Select(kvp => kvp.Key) .ToArray(); ``` Then you can remove each of those keys: ``` foreach (var key in keysToRemove) { mydic.Rem...
``` foreach(var key in dict.AllKeys.ToArray()) { if(...) //remove key or something } ```
2,992,001
I have a dictionary collection as bleow: ``` mydic.addvalue(key1, val1) mydic.addvalue(key2, val1) mydic.addvalue(key3, val1) mydic.addvalue(key4, val2) mydic.addvalue(key5, val2) ``` From the above dictionary I want to delete all the entries where value == "val1", so that the result would have only following entry:...
2010/06/07
[ "https://Stackoverflow.com/questions/2992001", "https://Stackoverflow.com", "https://Stackoverflow.com/users/350233/" ]
You first need to find all keys for which the associated value is `val1`: ``` var keysToRemove = mydic.Where(kvp => kvp.Value == val1) .Select(kvp => kvp.Key) .ToArray(); ``` Then you can remove each of those keys: ``` foreach (var key in keysToRemove) { mydic.Rem...
The answer it's old but this is how I do the same thing without create another Dictionary. ``` foreach (KeyValuePair<TKey, TValue> x in MyDic) { if (x.Value == "val1")) { MyDic.Remove(x.Key); } } ```
2,992,001
I have a dictionary collection as bleow: ``` mydic.addvalue(key1, val1) mydic.addvalue(key2, val1) mydic.addvalue(key3, val1) mydic.addvalue(key4, val2) mydic.addvalue(key5, val2) ``` From the above dictionary I want to delete all the entries where value == "val1", so that the result would have only following entry:...
2010/06/07
[ "https://Stackoverflow.com/questions/2992001", "https://Stackoverflow.com", "https://Stackoverflow.com/users/350233/" ]
A non-LINQ answer based on a comment by the user. ``` private static void RemoveByValue<TKey,TValue>(Dictionary<TKey, TValue> dictionary, TValue someValue) { List<TKey> itemsToRemove = new List<TKey>(); foreach (var pair in dictionary) { if (pair.Value.Equals(someValue)) itemsToRemove....
You can also use ``` var x= (from k in mydic where k.Value != val1 select k).ToDictionary(k=>k.key); ``` x will not have any of the val1's
2,992,001
I have a dictionary collection as bleow: ``` mydic.addvalue(key1, val1) mydic.addvalue(key2, val1) mydic.addvalue(key3, val1) mydic.addvalue(key4, val2) mydic.addvalue(key5, val2) ``` From the above dictionary I want to delete all the entries where value == "val1", so that the result would have only following entry:...
2010/06/07
[ "https://Stackoverflow.com/questions/2992001", "https://Stackoverflow.com", "https://Stackoverflow.com/users/350233/" ]
You can also use ``` var x= (from k in mydic where k.Value != val1 select k).ToDictionary(k=>k.key); ``` x will not have any of the val1's
``` foreach(var key in dict.AllKeys.ToArray()) { if(...) //remove key or something } ```
2,992,001
I have a dictionary collection as bleow: ``` mydic.addvalue(key1, val1) mydic.addvalue(key2, val1) mydic.addvalue(key3, val1) mydic.addvalue(key4, val2) mydic.addvalue(key5, val2) ``` From the above dictionary I want to delete all the entries where value == "val1", so that the result would have only following entry:...
2010/06/07
[ "https://Stackoverflow.com/questions/2992001", "https://Stackoverflow.com", "https://Stackoverflow.com/users/350233/" ]
You can also use ``` var x= (from k in mydic where k.Value != val1 select k).ToDictionary(k=>k.key); ``` x will not have any of the val1's
The answer it's old but this is how I do the same thing without create another Dictionary. ``` foreach (KeyValuePair<TKey, TValue> x in MyDic) { if (x.Value == "val1")) { MyDic.Remove(x.Key); } } ```
2,992,001
I have a dictionary collection as bleow: ``` mydic.addvalue(key1, val1) mydic.addvalue(key2, val1) mydic.addvalue(key3, val1) mydic.addvalue(key4, val2) mydic.addvalue(key5, val2) ``` From the above dictionary I want to delete all the entries where value == "val1", so that the result would have only following entry:...
2010/06/07
[ "https://Stackoverflow.com/questions/2992001", "https://Stackoverflow.com", "https://Stackoverflow.com/users/350233/" ]
A non-LINQ answer based on a comment by the user. ``` private static void RemoveByValue<TKey,TValue>(Dictionary<TKey, TValue> dictionary, TValue someValue) { List<TKey> itemsToRemove = new List<TKey>(); foreach (var pair in dictionary) { if (pair.Value.Equals(someValue)) itemsToRemove....
``` foreach(var key in dict.AllKeys.ToArray()) { if(...) //remove key or something } ```
2,992,001
I have a dictionary collection as bleow: ``` mydic.addvalue(key1, val1) mydic.addvalue(key2, val1) mydic.addvalue(key3, val1) mydic.addvalue(key4, val2) mydic.addvalue(key5, val2) ``` From the above dictionary I want to delete all the entries where value == "val1", so that the result would have only following entry:...
2010/06/07
[ "https://Stackoverflow.com/questions/2992001", "https://Stackoverflow.com", "https://Stackoverflow.com/users/350233/" ]
A non-LINQ answer based on a comment by the user. ``` private static void RemoveByValue<TKey,TValue>(Dictionary<TKey, TValue> dictionary, TValue someValue) { List<TKey> itemsToRemove = new List<TKey>(); foreach (var pair in dictionary) { if (pair.Value.Equals(someValue)) itemsToRemove....
The answer it's old but this is how I do the same thing without create another Dictionary. ``` foreach (KeyValuePair<TKey, TValue> x in MyDic) { if (x.Value == "val1")) { MyDic.Remove(x.Key); } } ```
203,410
Visiting a node *Foobar* a breadcrumb gets created which adds the parent menu structure like so: ``` $currentPluginId = $menu_link->getPluginId(); $trailIds = $this->menuActiveTrail->getActiveTrailIds('main'); foreach (array_reverse($trailIds) as $key => $value) { if ($value && $value !== $currentPluginId) { //...
2016/06/07
[ "https://drupal.stackexchange.com/questions/203410", "https://drupal.stackexchange.com", "https://drupal.stackexchange.com/users/9449/" ]
What you want is views' right column. You need to use a contextual filter of `Content: nid`, choose to provide a default value `Content id from url`. If you want to suppress the current product (eg. for a related products display use the `Exclude` option in the `More` fieldset at the bottom.) Then add a relationship ...
I found solution by adding new filter criteria of Global:PHP(PHP) type, where you can type your own php logic, in my case: ``` $node = node_load(arg(1)); if(isset($node->field_recommended_products['und'][0])) { foreach($node->field_recommended_products['und'] as $prod) { if($prod['target_id'] == $data->nid)...
54,348,378
I found a lot of info about this topic, but none of those sites and articles could solve my problem. I'm having a pretty simple method: ``` [HttpPost, Route("Diagnosis/{lkNo}/Tree/{nodeID:int}/Answer")] public List<TreeNode> AnswerTreeNode(string lkNo, int nodeID, [FromBody] dynamic data) { // So some stuff } ``...
2019/01/24
[ "https://Stackoverflow.com/questions/54348378", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10406502/" ]
This is a very common mistake The thing here is the ``` var ws = new WebSocket({port: wsport}); ws.on('connection', function open() { console.log('ws connection has been established.'); // ws.send('something'); this line is not working! }); ``` the variable created as an new Websocket, isn't valid inside the fu...
``` var ws_server = new WebSocket({ port: wsport }); ws_server.on('connection', (ws_socket) => { ws_socket.send('something'); }); ```
68,678,735
I am trying to vertically align to flexed items. the second flexed item contains a form button with tex of a different size added before the submit button. The text before lines up perfectly with the button text. However the second flexed item will not vertically align with the second flexed item. Any pointers as to w...
2021/08/06
[ "https://Stackoverflow.com/questions/68678735", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5330521/" ]
I would approach it this way. Even though it's not centered geometrically, it should be centered optically for a better user experience. ```css #intro { display: flex; align-items: center } button { border: none; background: transparent; padding: 0 0 0 1em; display: flex; align-items: center; } #...
I think that what you want is the flex-direction: column Here is a very compressive guide for flexbox. <https://css-tricks.com/snippets/css/a-guide-to-flexbox/> ```css #intro { display: flex; flex-direction: column; } button { border: none; background: transparent; padding: ...
1,262,666
I need to find a given file, 123.txt, in all the subdirectories I have, and then add the particular sub-directory's name to that file. And even FORCE the bat file to overwrite existing file each time it's run. For example: -folder --subfolder1 ---123.txt --subfolder2 ---123.txt To sum up, a given file 123.txt is i...
2017/10/26
[ "https://superuser.com/questions/1262666", "https://superuser.com", "https://superuser.com/users/555599/" ]
I'd probably do something like this: Loop recursively over all folders, check if a file called 123.txt exists, and if so, rename it. Note that `~n` returns the name part of the directory contained in the `%%d` variable. Save the following to a file with a `.bat` extension and run it from the directory where your 123 f...
Here's a PowerShell alternative: ``` gci C:\somewhere -r -filter 123.txt | % { rni $_.FullName -NewName ( "$( split-path (split-path $_.FullName -parent) -leaf )-123.txt" ) } ``` You can change the path in `gci` to your topmost directory and it will look for 123.txt in every subfolder there is and rename it with par...
11,960,021
We have an issue with SSL and I am 99% this is not your usual certificates trust store merry-go-round. We have a Weblogic server trying to make SSL connections to Active Directory via LDAPS, underlying SSL implementation is the JSSE. Some of the time, it works. Usually for a few hours after restarting Weblogic. Afte...
2012/08/14
[ "https://Stackoverflow.com/questions/11960021", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1599073/" ]
So after a great deal of research, experimentation and soul searching. We eventually tracked this issue down to a third party library we were using to connect to an external system. Which upon initialization would add itself as a security provider ahead of the JSSE default provider. I don't know exactly why this then w...
From what I understand, you have the problems intermittent. That is you can connect to AD via SSL but occasionally you notice this error. So I guess certificate issues [Error LDAPS](http://social.technet.microsoft.com/Forums/en-US/winserversecurity/thread/9376684a-8210-45f0-86d6-589f615a6985/) are not your problem. F...
846,317
I was reading something which I found really special. It goes like this : Imagine we have a line with unity division (0,1,2,etc.) Now, we have a point on this line. The point can be on a point of division or it can be contained between two points of division. If it isn't on a point of division, then we can continue cut...
2014/06/24
[ "https://math.stackexchange.com/questions/846317", "https://math.stackexchange.com", "https://math.stackexchange.com/users/-1/" ]
The point here is that the two real numbers $$0.24999... \text{ and } 0.25000...$$ are the same. There are a couple of ways to see this. Let's just consider the number $$r=0.9999...$$ we can demonstrate that this is actually equal to 1: $$10r-r = 9$$ $$9r=9$$ $$r=1$$ If that isn't convincing, you can view this in term...
Real numbers are usually defined by a process or algorithm. This process produces a series of numbers $(a\_n)\_{n=1}^{\infty}$ (usually rational, or else the definition of real numbers is circular). This series is said to *converge* if (using Cauchy's definition) for any $c>0$ there is a $N(c)$ such that for all $n, m...
25,246,275
I know this has been asked a few times on here, but I've been through the answers and still can't figure out why I can't override a core model in Magento: I am trying to override the Eav/Attribute/Data/Text.php but it refuses to use my version of the `validateValue()` function. Here is my model class /app/code/local/...
2014/08/11
[ "https://Stackoverflow.com/questions/25246275", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1495940/" ]
Use this ``` <codePool>local</codePool> ```
There are `issue in class declaration` of `config.xml and Hailstorm_Eav.xml` in **Hailstorm\_Eav.xml** `hailstorm_eav` to `Hailstorm_Eav` **and in config.xml** ``` <hailstorm_eav> <version>0.1.0</version> </hailstorm_eav> ``` Should be ``` <Hailstorm_Eav> <version>0.1.0</version> </Hailstorm_Ea...
11,888,367
Suppose I have this HTML: ``` <div class="SomeParent" id="BlueParent"> <div> <div class="Test">test</div> <div> </div> ``` The div of class `Test` is actually deeply nested in the `SomeParent` container. What's the **fastest** way to get the id of the `SomeParent` class of which Test is a descendant. Is the...
2012/08/09
[ "https://Stackoverflow.com/questions/11888367", "https://Stackoverflow.com", "https://Stackoverflow.com/users/565968/" ]
Perhaps ``` $('.Test').closest('.SomeParent').attr('id'); ``` <http://api.jquery.com/closest/> I don't know if it would be any faster or slower than thecodeparadox's solution, however.
You can try: ``` $('div.SomeParent').has('div.Test').attr('id'); ``` **[DEMO](http://jsfiddle.net/PGqR4/)** Instead of parent you can use **[`.has()`](http://api.jquery.com/has/)**. Another choice is **[`closest()`](http://api.jquery.com/closest/)**: ``` $('.Test').closest('.SomeParent').attr('id') ``` **[DEMO]...
11,888,367
Suppose I have this HTML: ``` <div class="SomeParent" id="BlueParent"> <div> <div class="Test">test</div> <div> </div> ``` The div of class `Test` is actually deeply nested in the `SomeParent` container. What's the **fastest** way to get the id of the `SomeParent` class of which Test is a descendant. Is the...
2012/08/09
[ "https://Stackoverflow.com/questions/11888367", "https://Stackoverflow.com", "https://Stackoverflow.com/users/565968/" ]
You can try: ``` $('div.SomeParent').has('div.Test').attr('id'); ``` **[DEMO](http://jsfiddle.net/PGqR4/)** Instead of parent you can use **[`.has()`](http://api.jquery.com/has/)**. Another choice is **[`closest()`](http://api.jquery.com/closest/)**: ``` $('.Test').closest('.SomeParent').attr('id') ``` **[DEMO]...
You could use parents() rather than parent() to specify the class of the parent element that you are searching for within the DOM tree of parents. ``` $(".Test").parents(".SomeParent").attr("id") ```
11,888,367
Suppose I have this HTML: ``` <div class="SomeParent" id="BlueParent"> <div> <div class="Test">test</div> <div> </div> ``` The div of class `Test` is actually deeply nested in the `SomeParent` container. What's the **fastest** way to get the id of the `SomeParent` class of which Test is a descendant. Is the...
2012/08/09
[ "https://Stackoverflow.com/questions/11888367", "https://Stackoverflow.com", "https://Stackoverflow.com/users/565968/" ]
Perhaps ``` $('.Test').closest('.SomeParent').attr('id'); ``` <http://api.jquery.com/closest/> I don't know if it would be any faster or slower than thecodeparadox's solution, however.
If you already have the `<div.Test>` as a jQuery object then you could use `.closest()` rather than using `.parents()`. `.closest()` will stop once it hits the first occurrence of the selector you give it. `.parents()` on the other hand traverses up to the root of the dom and gives you back all found.
11,888,367
Suppose I have this HTML: ``` <div class="SomeParent" id="BlueParent"> <div> <div class="Test">test</div> <div> </div> ``` The div of class `Test` is actually deeply nested in the `SomeParent` container. What's the **fastest** way to get the id of the `SomeParent` class of which Test is a descendant. Is the...
2012/08/09
[ "https://Stackoverflow.com/questions/11888367", "https://Stackoverflow.com", "https://Stackoverflow.com/users/565968/" ]
Perhaps ``` $('.Test').closest('.SomeParent').attr('id'); ``` <http://api.jquery.com/closest/> I don't know if it would be any faster or slower than thecodeparadox's solution, however.
You could use parents() rather than parent() to specify the class of the parent element that you are searching for within the DOM tree of parents. ``` $(".Test").parents(".SomeParent").attr("id") ```
11,888,367
Suppose I have this HTML: ``` <div class="SomeParent" id="BlueParent"> <div> <div class="Test">test</div> <div> </div> ``` The div of class `Test` is actually deeply nested in the `SomeParent` container. What's the **fastest** way to get the id of the `SomeParent` class of which Test is a descendant. Is the...
2012/08/09
[ "https://Stackoverflow.com/questions/11888367", "https://Stackoverflow.com", "https://Stackoverflow.com/users/565968/" ]
If you already have the `<div.Test>` as a jQuery object then you could use `.closest()` rather than using `.parents()`. `.closest()` will stop once it hits the first occurrence of the selector you give it. `.parents()` on the other hand traverses up to the root of the dom and gives you back all found.
You could use parents() rather than parent() to specify the class of the parent element that you are searching for within the DOM tree of parents. ``` $(".Test").parents(".SomeParent").attr("id") ```
53,008,315
I am getting date value from API as "date\_display":"13/03/2018". Now how to display the date as 13 MAR 2018 and how to get the day value for this date and show it in TextView? ``` protected void onPostExecute(String result) { super.onPostExecute(result); //text.setText(result); try { ...
2018/10/26
[ "https://Stackoverflow.com/questions/53008315", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10560889/" ]
A compound literal declared inside a function has automatic storage duration associated with its enclosing block (C 2018 6.5.2.5 5), which means its lifetime ends when execution of the block ends. Inside `numbers`, `*p = (int []){1, 2, 3};` assigns the address of the compound literal to `*p`. When `numbers` returns, t...
It depends on where the compound literal is placed. C17 6.5.2.5 §5 > > The value of the compound literal is that of an unnamed object initialized by the > initializer list. If the compound literal occurs outside the body of a function, the object > has static storage duration; otherwise, it has automatic storage d...
47,339,029
Okay, so I have an image for a background that has 1px of a blur filter in the CSS. That works. *Then*, I added a CSS :hover selector to a *new* CSS rule that changes the blur filter to 0. When I hover over it on the browser, however, it doesn't change the blur at all! (I went into Google Chrome Inspect Element a...
2017/11/16
[ "https://Stackoverflow.com/questions/47339029", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8947188/" ]
You haven't already added the `:hover` pseudo-class. ```css #bgimage:hover { /* the styles you want to display on hover */ } ```
You did not add the `:hover` part of the CSS but it works for me if I just add this to the CSS: ``` #bgimage:hover { filter: none; } ```
10,185,105
I was just wondering if it was possible to do something like this in jQuery: ``` $('#MyDiv').show((MyVar==2?1:0)); // 1=show, 0=hide. ``` otherwise I'd have to write it like this everywhere. ``` if(MyVar==2?1:0){$('#MyVar').show();}else{$('#MyVar').hide();} ```
2012/04/17
[ "https://Stackoverflow.com/questions/10185105", "https://Stackoverflow.com", "https://Stackoverflow.com/users/853263/" ]
There's a built-in function [`.toggle(boolean value)`](http://api.jquery.com/toggle/#toggle-showOrHide) since jQuery 1.3: ``` $('#MyDiv').toggle(MyVar === 2); ```
Considering that the manual for .show() says it takes no arguments, I believe that you must do it the 2nd way. I would recommend instead something like `if (MyVal==2) { $('#MyVar').show(); } else { $('#MyVar').hide(); }`. The ? operator is unnecessary in an if since MyVal==2 already evaluates to a true (1) or false (0...
56,867,359
If I need to change to some directory several levels up, I usually do this in bash: ``` cd ../../../../some/other/folder ``` Since it is quite annoying to type all those periods and slashes, I was wondering if there is some shorter way to type it; like for example: ``` cd ..4/some/other/folder ``` I have not been...
2019/07/03
[ "https://Stackoverflow.com/questions/56867359", "https://Stackoverflow.com", "https://Stackoverflow.com/users/865169/" ]
There's no standard way. You can declare a function that takes a number of parent directories as the first argument, and the relative path as the second one: ``` cdu () { local n=$1 local p="" while ((n--)) ; do p+=../ done cd "$p/$2" } ``` You can then shorten `cd ../../../bin` to `cdu ...
according to cd man page, the immediate answer is "no". if it helps, you may add the following to your .bashrc: ``` export prev1=".." export prev2="../.." export prev3="../../.." export prev4="../../../.." ``` and so on. example: ``` export prev4="../../../.." mkdir -p /1/2/3/4/5 cd /1/2/3/4/5 pwd => result is /1...
35,622,753
If I try to use the Message History bean from Spring Integration "int:message-history" when developing a Spring XD module, it fails when try to export the JMX bean. I've seen that the naming strategy used is org.springframework.xd.dirt.module.jmx.ModuleObjectNamingStrategy I already open a ticket for that <https://j...
2016/02/25
[ "https://Stackoverflow.com/questions/35622753", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5542763/" ]
You shoud try: ``` <div class="hgtinpu errormessage serverside" ng-if="firstnameError && !contact.fname.$touched">{{ firstnameError }}</div> ```
You can use **ng-show** or **ng-hide** directive for that ``` <div class="hgtinpu errormessage" ng-show="contact.fname.$touched && !contact.fname.$error"> Message for Touched </div> <div class="hgtinpu errormessage" ng-show="contact.fname.$error && !contact.fname.$touched"> Message Errors </div> ```
35,622,753
If I try to use the Message History bean from Spring Integration "int:message-history" when developing a Spring XD module, it fails when try to export the JMX bean. I've seen that the naming strategy used is org.springframework.xd.dirt.module.jmx.ModuleObjectNamingStrategy I already open a ticket for that <https://j...
2016/02/25
[ "https://Stackoverflow.com/questions/35622753", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5542763/" ]
You shoud try: ``` <div class="hgtinpu errormessage serverside" ng-if="firstnameError && !contact.fname.$touched">{{ firstnameError }}</div> ```
A few things you are doing wrong there. 1. It all needs to be inside a form tag with a name of contact. 2. You can use ng-show to show and hide your errors. 3. All the errors are updated on the form model. ```js var myApp = angular.module('myApp', []); myApp.controller('MyCtrl', function($scope) { $scope.DBArra...
38,663,751
I've got some user generated html markup from a text area and I'd like to render it on another part of the screen. The markup is saved as a string in the props of the component. I don't want to use dangerouslysethtml for obvious reasons. Is there a parser such as [marked](https://github.com/chjj/marked) but for html ...
2016/07/29
[ "https://Stackoverflow.com/questions/38663751", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1646372/" ]
Sanitize the html using the [sanitize-html](https://www.npmjs.com/package/sanitize-html) module, and render the sanitized string using [dangerouslySetInnerHTML](https://facebook.github.io/react/tips/dangerously-set-inner-html.html). You can create a simple wrapper component: ``` const defaultOptions = { allowedTags...
An example based on the accepted answer: ``` import sanitizeHtml from 'sanitize-html'; const MyComponent = () => { dirty = '<a href="my-slug" target="_blank" onClick="evil()">click</a>'; const clean = sanitizeHtml(dirty, { allowedTags: ['b', 'i', 'em', 'strong', 'a'], allowedAttributes: { a: ['href...
38,663,751
I've got some user generated html markup from a text area and I'd like to render it on another part of the screen. The markup is saved as a string in the props of the component. I don't want to use dangerouslysethtml for obvious reasons. Is there a parser such as [marked](https://github.com/chjj/marked) but for html ...
2016/07/29
[ "https://Stackoverflow.com/questions/38663751", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1646372/" ]
Sanitize the html using the [sanitize-html](https://www.npmjs.com/package/sanitize-html) module, and render the sanitized string using [dangerouslySetInnerHTML](https://facebook.github.io/react/tips/dangerously-set-inner-html.html). You can create a simple wrapper component: ``` const defaultOptions = { allowedTags...
For XSS filtering, there is a good alternative to [sanitize-html](https://www.npmjs.com/package/sanitize-html) written by security people, called [dompurify](https://www.npmjs.com/package/dompurify). Here is how the wrapper from <https://stackoverflow.com/a/38663813/1762849> would look with DOMPurify: ```js const def...
38,663,751
I've got some user generated html markup from a text area and I'd like to render it on another part of the screen. The markup is saved as a string in the props of the component. I don't want to use dangerouslysethtml for obvious reasons. Is there a parser such as [marked](https://github.com/chjj/marked) but for html ...
2016/07/29
[ "https://Stackoverflow.com/questions/38663751", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1646372/" ]
An example based on the accepted answer: ``` import sanitizeHtml from 'sanitize-html'; const MyComponent = () => { dirty = '<a href="my-slug" target="_blank" onClick="evil()">click</a>'; const clean = sanitizeHtml(dirty, { allowedTags: ['b', 'i', 'em', 'strong', 'a'], allowedAttributes: { a: ['href...
For XSS filtering, there is a good alternative to [sanitize-html](https://www.npmjs.com/package/sanitize-html) written by security people, called [dompurify](https://www.npmjs.com/package/dompurify). Here is how the wrapper from <https://stackoverflow.com/a/38663813/1762849> would look with DOMPurify: ```js const def...
60,504,613
I'm using Eureka Server microservice and Eureka client microservice. I initialized the Eureka Server first, and then initialized the eureka client. I'm getting the following error! ``` com.netflix.discovery.shared.transport.TransportException: Cannot execute request on any known server at com.netflix.discovery.shared....
2020/03/03
[ "https://Stackoverflow.com/questions/60504613", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8146182/" ]
Remove `eureka.client.fetch-registry` property from client side as this property is used by eureka server to get the registry annotated with `@EnableDiscoveryClient`
why this property added on the client-side? ``` eureka.client.fetch-registry=true eureka.client.register-with-eureka=true ``` this is added on server side.
60,504,613
I'm using Eureka Server microservice and Eureka client microservice. I initialized the Eureka Server first, and then initialized the eureka client. I'm getting the following error! ``` com.netflix.discovery.shared.transport.TransportException: Cannot execute request on any known server at com.netflix.discovery.shared....
2020/03/03
[ "https://Stackoverflow.com/questions/60504613", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8146182/" ]
**FIX** Steps to fix the error: 1. Specify username and password for your Eureka Server in its properties file ``` spring.security.basic.enabled=true spring.security.user.name=theusername spring.security.user.password=thepassword ``` 2. Create Web Security Configuration for your Eureka Server ``` @EnableWebSecu...
Remove `eureka.client.fetch-registry` property from client side as this property is used by eureka server to get the registry annotated with `@EnableDiscoveryClient`
60,504,613
I'm using Eureka Server microservice and Eureka client microservice. I initialized the Eureka Server first, and then initialized the eureka client. I'm getting the following error! ``` com.netflix.discovery.shared.transport.TransportException: Cannot execute request on any known server at com.netflix.discovery.shared....
2020/03/03
[ "https://Stackoverflow.com/questions/60504613", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8146182/" ]
**FIX** Steps to fix the error: 1. Specify username and password for your Eureka Server in its properties file ``` spring.security.basic.enabled=true spring.security.user.name=theusername spring.security.user.password=thepassword ``` 2. Create Web Security Configuration for your Eureka Server ``` @EnableWebSecu...
why this property added on the client-side? ``` eureka.client.fetch-registry=true eureka.client.register-with-eureka=true ``` this is added on server side.
28,778,460
I'm trying to put together a project with AdaSDL2 but I don't know what I'm doing (not afraid to admit that). There are lots of answered questions on SO and other places that address similar problems but don't fix mine. Basically, I can't get the thing to link. This is the first time I've ever tried to link to a bindi...
2015/02/28
[ "https://Stackoverflow.com/questions/28778460", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4616944/" ]
You're creating new instance of your frame within your class that's executing the query, but it is not the frame which is displayed on the screen, so the value you are trying to use is not the one that the user entered. Instead, you want to pass the value from the frame to the class that's executing the sql... ``` ...
Your problem could possibly be solved by using a modal JDialog and not a JFrame, and I'll explain why... * When you display a JFrame it is non-modal, meaning the calling code that creates the JFrame and displays it, does not halt, but rather continues running while the JFrame is being displayed. * So if you try to ext...
10,934,285
I have a local *ASP.NET MVC 3 Windows Azure Project* where I use a local instance of *MSSQL Express* for my emulator. In my **web.config** I have the following connection string: `<add name="ExampleDb" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;Initial Catalog=ExampleDb;User Instance=true;Mul...
2012/06/07
[ "https://Stackoverflow.com/questions/10934285", "https://Stackoverflow.com", "https://Stackoverflow.com/users/286390/" ]
Your connection string contains 'User Instance=True'. This means that SQLEXPRESS uses a user instance to store your data. This is a completely different instance of SQL Server that contains a new set of databases. I assume the code in WebRole.cs is run in a different user account than the code in ExampleController. Wh...
In CodeFirst Model you should define the connection string in the web.config first as below: ``` <connectionStrings> <add name="ExampleDbConnection" connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI; database=ExampleDb; AttachDBFilename=|YouDataDirectory|y...
18,139,845
I have this extension detection function, but it relies heavily on numerous lines of if/then statements. Is there a different method I could use to get the same results? (all of the variables are defined at a higher level). I want to deal with less code, and increase performance speeds. ``` if (extT == 'app') { docTyp...
2013/08/09
[ "https://Stackoverflow.com/questions/18139845", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1267801/" ]
Use an object as a map. ``` var map = { "exe": {type:"exe",desc:"Executable File"}, "vwx": {type:"vwx",desc:"Vectorworks File"} }; var extT = "exe"; var docType = map[extT].type; var docDesc = map[extT].desc; ``` <http://jsfiddle.net/ZfbHf/1/> ### Advantages * Lists the data as actual data, and then con...
It won't look like less code, but if you use an object to create a map, it should be more efficient: ``` var types = { 'app': { 'docType': 'app', 'docDesc': 'Application' }, 'exe': { 'docType': 'exe', 'docDesc': 'Executable File' }, ... }; ``` Then use it as a lookup: ``` var curType = types['app']; ...
18,139,845
I have this extension detection function, but it relies heavily on numerous lines of if/then statements. Is there a different method I could use to get the same results? (all of the variables are defined at a higher level). I want to deal with less code, and increase performance speeds. ``` if (extT == 'app') { docTyp...
2013/08/09
[ "https://Stackoverflow.com/questions/18139845", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1267801/" ]
Use an object as a map. ``` var map = { "exe": {type:"exe",desc:"Executable File"}, "vwx": {type:"vwx",desc:"Vectorworks File"} }; var extT = "exe"; var docType = map[extT].type; var docDesc = map[extT].desc; ``` <http://jsfiddle.net/ZfbHf/1/> ### Advantages * Lists the data as actual data, and then con...
You *could* use a case/switch statement, but you're essentially going to be in the same boat, and (to my knowledge) there is really no performance difference between the two. Then again, I'm basing that last statement on my C# knowledge. Maybe preload this info into an array of some sort, pull it from a database or som...
18,139,845
I have this extension detection function, but it relies heavily on numerous lines of if/then statements. Is there a different method I could use to get the same results? (all of the variables are defined at a higher level). I want to deal with less code, and increase performance speeds. ``` if (extT == 'app') { docTyp...
2013/08/09
[ "https://Stackoverflow.com/questions/18139845", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1267801/" ]
It won't look like less code, but if you use an object to create a map, it should be more efficient: ``` var types = { 'app': { 'docType': 'app', 'docDesc': 'Application' }, 'exe': { 'docType': 'exe', 'docDesc': 'Executable File' }, ... }; ``` Then use it as a lookup: ``` var curType = types['app']; ...
You *could* use a case/switch statement, but you're essentially going to be in the same boat, and (to my knowledge) there is really no performance difference between the two. Then again, I'm basing that last statement on my C# knowledge. Maybe preload this info into an array of some sort, pull it from a database or som...
57,702,625
I have a function whose name is rendered which get two params: the container is a `<select>` in HTML and items just is my student array of an object which contains information of each student and it has 'class' property. My idea is to create an `<opgroup>` tag in string and then pass it to HTML through `.innerHTML`. T...
2019/08/29
[ "https://Stackoverflow.com/questions/57702625", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11965619/" ]
In my case the problem was the same, but resolved by putting an `id` in `defaultRenderer`, e.g.: ``` customRendererId: 'novoId' ```
simply remove the `defaultRenderer` and it will work
57,702,625
I have a function whose name is rendered which get two params: the container is a `<select>` in HTML and items just is my student array of an object which contains information of each student and it has 'class' property. My idea is to create an `<opgroup>` tag in string and then pass it to HTML through `.innerHTML`. T...
2019/08/29
[ "https://Stackoverflow.com/questions/57702625", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11965619/" ]
[Here a solution possibly](https://stackoverflow.com/questions/55221941/flutter-pie-chart-labelaccessorfn-is-not-working?rq=1) I got with (is a barchart in my case): ``` defaultRenderer: new charts.BarRendererConfig( fillPattern: charts.FillPatternType.solid, //customRendererId: "id", barRendererDecorato...
simply remove the `defaultRenderer` and it will work
57,702,625
I have a function whose name is rendered which get two params: the container is a `<select>` in HTML and items just is my student array of an object which contains information of each student and it has 'class' property. My idea is to create an `<opgroup>` tag in string and then pass it to HTML through `.innerHTML`. T...
2019/08/29
[ "https://Stackoverflow.com/questions/57702625", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11965619/" ]
You have to add the type parameter of the PieChart.
simply remove the `defaultRenderer` and it will work
33,317
If my bike wont start but does start when I use the wrench on the solenoid trick; does that mean I need to replace the solenoid? I'm having trouble working this out as I'm new to mechanics and trying to learn. If this is the case some people say its not the solenoid and its the starter relay. I cant seem to work out th...
2016/07/24
[ "https://mechanics.stackexchange.com/questions/33317", "https://mechanics.stackexchange.com", "https://mechanics.stackexchange.com/users/20036/" ]
The "solenoid trick" pretty much guarantees that the solenoid is good. When you short it with the wrench you're simulating a start signal on the small terminal. When you do that the solenoid does its job, so the solenoid is probably good. So now the question is why aren't you getting the start signal when you turn the...
There is no soleniod in a motorcycle, in general. That function is done by the sprag clutch, and they rarely malfunction, and when they do it's pretty darn obvious- either the starter motor spins and nothing happens, or the motor starts and sounds like it's going to explode (and does if you run it for more than a few s...
55,120,998
I'm trying to render a child component by mapping multiple props at the same time. What I'd like to do is: ``` const Parent = props => { const whatever = props.(***need to pass both props***).map((firstProp, secondProp) => ( <Child key={//} firstProp={firstProp} secondProp={secondProp} /> ...
2019/03/12
[ "https://Stackoverflow.com/questions/55120998", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11109408/" ]
You can use `android:textDirection="rtl"` so no matter if the text is in Hebrew or English it will start from the right side of your view and won't jump to the other direction when you change the language. **Note -** I think that `android:gravity` didn't work for you because Hebrew is written rtl and English is writte...
Use ``` android:textAlignment="viewEnd" ``` and text will be aligned regardless of its content, but still depended on the layout direction. The Documentation [here](https://developer.android.com/reference/android/view/View#attr_android:textAlignment): > > Align to the end of the view, which is ALIGN\_RIGHT if the...