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
57,554,043
In my head section of my `form.layout.blade.php` I have the following: ``` <head> <script src="/js/main.js"></script> <head> ``` This is layout file is loaded before all pages are loaded. Is there a way to *not* load `main.js` for a specific route?
2019/08/19
[ "https://Stackoverflow.com/questions/57554043", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5272159/" ]
you can use if statement like this. main.js will not load on this page ``` @if(!Request::is('subpage/url')) <script src="/js/main.js"></script> @endif ```
The workaround I used for not loading scripts on all sites, is that I put script paths in variables in controllers, something like this: ``` public function show($id){ $scripts[] = '/js/main.js'; view()->share('scripts', $scripts); return view('view', $someData); } ``` This allows me to use this script on...
57,554,043
In my head section of my `form.layout.blade.php` I have the following: ``` <head> <script src="/js/main.js"></script> <head> ``` This is layout file is loaded before all pages are loaded. Is there a way to *not* load `main.js` for a specific route?
2019/08/19
[ "https://Stackoverflow.com/questions/57554043", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5272159/" ]
you can use if statement like this. main.js will not load on this page ``` @if(!Request::is('subpage/url')) <script src="/js/main.js"></script> @endif ```
You can use if statements ``` @if(!in_array(Route::currentRouteName(), ['route.name', ...])) <script src="/js/main.js"></script> @endif ```
1,886,096
``` L->| A -> B ^ | |__> C -> D-> G->X--| | K |_> T | |_>Z |___________| ``` I hope this small drawing helps convey what I'm trying to do. I have a list of 7,000 locations, each with an undefined, but small number of doors. Each door is a bridge between bot...
2009/12/11
[ "https://Stackoverflow.com/questions/1886096", "https://Stackoverflow.com", "https://Stackoverflow.com/users/88770/" ]
Represent your locations as nodes and the doors as edges in a graph. Then apply some rather standard [shortest path algorithm(s)](http://en.wikipedia.org/wiki/Shortest_path_problem) and you're done.
Look up [Pathfinding](http://en.wikipedia.org/wiki/Pathfinding) algorithms on Wikipedia. You basically build up a series of nodes and connections between them, and the algorithm works through them finding a way from the start to a goal.
1,886,096
``` L->| A -> B ^ | |__> C -> D-> G->X--| | K |_> T | |_>Z |___________| ``` I hope this small drawing helps convey what I'm trying to do. I have a list of 7,000 locations, each with an undefined, but small number of doors. Each door is a bridge between bot...
2009/12/11
[ "https://Stackoverflow.com/questions/1886096", "https://Stackoverflow.com", "https://Stackoverflow.com/users/88770/" ]
Represent your locations as nodes and the doors as edges in a graph. Then apply some rather standard [shortest path algorithm(s)](http://en.wikipedia.org/wiki/Shortest_path_problem) and you're done.
You can suppose that each room is a node and each door is a node and the problem will become finding shortest path in graph which you can find with [Dijkstra's algorithm](http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm) for example
1,772,475
I'm running a LAMP box with PHP running as fcgid. APC is installed and working well. However, each PHP process gets its own cache. This is a problem, because it would make far more sense to have 10 PHP processes with 300MB shared APC cache than 10 PHP processes, each with a redundant 30MB unshared APC cache. There was...
2009/11/20
[ "https://Stackoverflow.com/questions/1772475", "https://Stackoverflow.com", "https://Stackoverflow.com/users/199475/" ]
As far as I know it's still not possible to use shared memory cache with any PHP cacher amongst multiple processes... anyway, unless you're under extremely heavy load you should be fine with separate caches, I suppose, since they'll be filled pretty quickly. And hey, RAM is cheap nowadays!
It turns out that this is still not possible if you are truly using different processes: <http://pecl.php.net/bugs/bug.php?id=11988> (updated 11/13/2009 by the author of the relevant portion of APC).
1,772,475
I'm running a LAMP box with PHP running as fcgid. APC is installed and working well. However, each PHP process gets its own cache. This is a problem, because it would make far more sense to have 10 PHP processes with 300MB shared APC cache than 10 PHP processes, each with a redundant 30MB unshared APC cache. There was...
2009/11/20
[ "https://Stackoverflow.com/questions/1772475", "https://Stackoverflow.com", "https://Stackoverflow.com/users/199475/" ]
As far as I know it's still not possible to use shared memory cache with any PHP cacher amongst multiple processes... anyway, unless you're under extremely heavy load you should be fine with separate caches, I suppose, since they'll be filled pretty quickly. And hey, RAM is cheap nowadays!
I was reading about it just minutes ago in the bug tracking of PHP <https://bugs.php.net/bug.php?id=57825> it's fixed but you must use spawnfcgi or php-fpm <http://php-fpm.org/> Quoted from Ramus > > It works fine if you use spawnfcgi or php-fpm. Any process manager > that launches a parent process and spawns child...
1,772,475
I'm running a LAMP box with PHP running as fcgid. APC is installed and working well. However, each PHP process gets its own cache. This is a problem, because it would make far more sense to have 10 PHP processes with 300MB shared APC cache than 10 PHP processes, each with a redundant 30MB unshared APC cache. There was...
2009/11/20
[ "https://Stackoverflow.com/questions/1772475", "https://Stackoverflow.com", "https://Stackoverflow.com/users/199475/" ]
I was reading about it just minutes ago in the bug tracking of PHP <https://bugs.php.net/bug.php?id=57825> it's fixed but you must use spawnfcgi or php-fpm <http://php-fpm.org/> Quoted from Ramus > > It works fine if you use spawnfcgi or php-fpm. Any process manager > that launches a parent process and spawns child...
It turns out that this is still not possible if you are truly using different processes: <http://pecl.php.net/bugs/bug.php?id=11988> (updated 11/13/2009 by the author of the relevant portion of APC).
2,465,656
is this a valid JQuery usage pattern to : ``` <script type="text/javascript"> $("body").prepend('<input type="hidden" id="error" value="show">'); </script> ``` That is using Jquery to manipulate / insert HTML Tags **when the Document has NOT YET been loaded** (by not using document.ready for the...
2010/03/17
[ "https://Stackoverflow.com/questions/2465656", "https://Stackoverflow.com", "https://Stackoverflow.com/users/293513/" ]
Yes, you can do that, but: * You have to place the script somewhere after the closing tag of the element that you add elements to. That means that the body element is not a good candidate to prepend anything to. * Make sure that the HTML code is valid. If you are using XHTML you should self close the input element. C...
IE may fail loading such HTML - it has problems when someone modifies not fully rendered elements. I think the right choice would be placing such code just after tag.
2,465,656
is this a valid JQuery usage pattern to : ``` <script type="text/javascript"> $("body").prepend('<input type="hidden" id="error" value="show">'); </script> ``` That is using Jquery to manipulate / insert HTML Tags **when the Document has NOT YET been loaded** (by not using document.ready for the...
2010/03/17
[ "https://Stackoverflow.com/questions/2465656", "https://Stackoverflow.com", "https://Stackoverflow.com/users/293513/" ]
You can but it won't consistently work, as Andrew Bezzub says IE will be the problem (surprise, surprise) Hard to tell the master plan but for your example could you just not just put this immediately after the `<body>` opening tag: ``` document.write('<input type="hidden" id="error" value="show">'); ```
IE may fail loading such HTML - it has problems when someone modifies not fully rendered elements. I think the right choice would be placing such code just after tag.
50,790
The following theorem has been mentioned (and partially proved) in the book Functions of Bounded Variation and Free Discontinuity Problems by Luigi Ambrosio et. al. Let $\mu,\nu$ be positive measures on $(X,\mathcal{E})$. Assume that they are equal on a collection of sets $\mathcal{G}$ which is closed under finite int...
2011/07/11
[ "https://math.stackexchange.com/questions/50790", "https://math.stackexchange.com", "https://math.stackexchange.com/users/13199/" ]
The collection of $A \in \mathcal{E}$ such that $\mu(A \cap X\_h) = \nu(A \cap X\_h)$ for all $h$ forms a $\sigma$-algebra containing $\sigma(G)$.
Note that if $\nu$ is a $\sigma$-finite non negative measure then on a $\sigma$-algebra $G$ then every finite nonnegative measurable function $f$ defines the $\sigma$-finite measure $\mu:=f.\nu$. We can take $f$ to be a characteristic function. This is because, if $f$ is integrable then it defines a set function $\mu(A...
24,630,720
Is there any equivalent of strict mocks in python? Some mechanism to report unintended call of mocked methods (action.step2() in this example), just like this in GoogleMock framework. ``` class Action: def step1(self, arg): return False def step2(self, arg): return False def algorithm(action)...
2014/07/08
[ "https://Stackoverflow.com/questions/24630720", "https://Stackoverflow.com", "https://Stackoverflow.com/users/407981/" ]
Looks like it's not supported out of the box. However there are at least two approaches on how to achieve the same result. Passing list of allowed members ------------------------------- According to mock documentation > > *spec*: This can be either a **list of strings** or an existing object (a class or instance) ...
Yes, this is possible using the `spec=` and `autospec=` arguments. See the [mock documentation on Autospeccing](http://www.voidspace.org.uk/python/mock/helpers.html#auto-speccing) for more information. In your example it would become: ``` action_mock = mock.Mock(spec=Action) ``` or: ``` action_mock = mock.Mock('Act...
24,630,720
Is there any equivalent of strict mocks in python? Some mechanism to report unintended call of mocked methods (action.step2() in this example), just like this in GoogleMock framework. ``` class Action: def step1(self, arg): return False def step2(self, arg): return False def algorithm(action)...
2014/07/08
[ "https://Stackoverflow.com/questions/24630720", "https://Stackoverflow.com", "https://Stackoverflow.com/users/407981/" ]
Looks like it's not supported out of the box. However there are at least two approaches on how to achieve the same result. Passing list of allowed members ------------------------------- According to mock documentation > > *spec*: This can be either a **list of strings** or an existing object (a class or instance) ...
Another possibility: Checking call\_count individually on restricted methods ------------------------------------------------------- Ensure that `call_count` is zero on methods that should not be called. ``` class TestAlgorithm(unittest.TestCase): def test_algorithm(self): actionMock = mock.create_autosp...
20,531,272
In my php program, I have to insert variables into one of my sql tables. Every time I go to test this out though, the values don't get posted to the table. Is there something wrong with these statements? or is the problem bigger than these 2 lines ``` $sqli = mySQLi_connect("localhost","root","root","myProject"); mys...
2013/12/11
[ "https://Stackoverflow.com/questions/20531272", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3093085/" ]
Look at [my white paper on Drools Design Patterns](http://www.google.at/url?q=http://www.redhat.com/rhecm/rest-rhecm/jcr/repository/collaboration/sites%2520content/live/redhat/web-cabinet/home/resourcelibrary/whitepapers/brms-design-patterns/rh%3apdfFile.pdf) especially the section on Data Validation. The section expl...
Look into **Drools decision tables**, which make it easier for someone to input those 1000 rules.
24,768,747
I don't quite understand how escape the character works in .awk scripts. I have this line in the file I want to read: ``` #Name Surname City Company State Probability Units Price Amount ``` If I just write: ``` awk < test.txt '/\#/ {print $1}' ``` in the command line, then everything is fine and the output is #...
2014/07/15
[ "https://Stackoverflow.com/questions/24768747", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3614293/" ]
Join your queries with a `UNION`. The way you've got it now, it'll return two results sets. ``` SELECT [col1], [col2] FROM Contact UNION ALL SELECT [col1], [col2] FROM Numar_contact ``` As DJ KRAZE pointed out in a comment, it might not be a bad idea to wrap this in a sproc or a TVF. But this will work too. **Edit:...
Thanks to [your comment](https://stackoverflow.com/questions/24768745/doesnt-work-th-sqlcommand-with-multiple-queries#comment38434382_24768774), what you are wanting to do is [JOIN](http://technet.microsoft.com/en-us/library/ms191517(v=sql.105).aspx) the tables. ```sql SELECT Contact.id_contact, nume_contact, prenume_...
24,768,747
I don't quite understand how escape the character works in .awk scripts. I have this line in the file I want to read: ``` #Name Surname City Company State Probability Units Price Amount ``` If I just write: ``` awk < test.txt '/\#/ {print $1}' ``` in the command line, then everything is fine and the output is #...
2014/07/15
[ "https://Stackoverflow.com/questions/24768747", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3614293/" ]
Join your queries with a `UNION`. The way you've got it now, it'll return two results sets. ``` SELECT [col1], [col2] FROM Contact UNION ALL SELECT [col1], [col2] FROM Numar_contact ``` As DJ KRAZE pointed out in a comment, it might not be a bad idea to wrap this in a sproc or a TVF. But this will work too. **Edit:...
Yes you can. Here is [an example from the MSDN](http://support.microsoft.com/kb/311274) I've modified to use your code - you need to move the reader to the [Next ResultSet](http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqldatareader.nextresult(v=vs.110).aspx) ``` string connString = @"database=Agenda_...
48,302,244
I can transpose a square matrix, but now I'd like to transpose a non square matrix (in my code 3\*2) with user input. Other sources recommended me to create a new matrix first, which I have done. I manage to make the matrix, but when transposing, it stops from the 4th value. I have looked at other topics but I can'...
2018/01/17
[ "https://Stackoverflow.com/questions/48302244", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9229665/" ]
So, at the beginning you load a matrix with fields : "i,j" => "row, column" On the last step, you try accessing the matrix with a "j,i" => "column, row" order. You're inverting the i,j indexes.- Let me help you by just changing the variable names : //const ``` const int ROWS = 3; const int COLS = 2; ...
Replace ``` matrix2[j, i] = matrix1[j, i]; ``` with ``` matrix2[j, i] = matrix1[i, j]; ``` This way a row number of matrix1 becomes a column number for matrix2 - i.e. the matrix gets transposed.
48,302,244
I can transpose a square matrix, but now I'd like to transpose a non square matrix (in my code 3\*2) with user input. Other sources recommended me to create a new matrix first, which I have done. I manage to make the matrix, but when transposing, it stops from the 4th value. I have looked at other topics but I can'...
2018/01/17
[ "https://Stackoverflow.com/questions/48302244", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9229665/" ]
So, at the beginning you load a matrix with fields : "i,j" => "row, column" On the last step, you try accessing the matrix with a "j,i" => "column, row" order. You're inverting the i,j indexes.- Let me help you by just changing the variable names : //const ``` const int ROWS = 3; const int COLS = 2; ...
If you combine the other two answers, you will have a complete picture: This line is wrong and will give you an `IndexOutOfRangeException`: ``` matrix2[j, i] = matrix1[j, i]; ``` In order to transpose you need to flip the indices: ``` matrix2[j, i] = matrix1[i, j]; ``` Another problem is that when you print the ...
65,235,190
I am thinking of setting up a bitnami mongodb replicaset in K8s, as explained [here](https://github.com/bitnami/charts/tree/master/bitnami/mongodb#architecture). However, as a note they mention this while upgrading: > > Note: An update takes your MongoDB replicaset offline if the Arbiter is enabled and the number of...
2020/12/10
[ "https://Stackoverflow.com/questions/65235190", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3848107/" ]
Bitnami developer here > > Is it that, while performing the upgrade, the replicaset will have > only one mongodb server working, while both, the other mongo db server > and arbiter, are offline and being upgraded? > > > That will depend on how many replicas you have. If you install the chart with 2 replicas + 1 a...
I don't know what Helm is or what it does or why it takes down two nodes at a time, but: > > I this case, it will not imply downtime, just that momentarily, there is just one server available (instead of two), so similar to a standalone setup. > > > A standalone accepts writes whenever it's up. A replica set node...
8,968,133
I have added a view to a layout which occupies a part of my screen. To this layout I want to add another layout which will be transparent. On this layout there should be only two lines which will scroll over the background layout. This I am doing so that my background layout is not invalidated and only the foreground i...
2012/01/23
[ "https://Stackoverflow.com/questions/8968133", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1463039/" ]
Use `FrameLayout` as a parent layout and stack it up with as many layouts as you want. Thats one part of the answer. To make a layer (a layout in this case) transparent, set the alpha value in its background (a color) to 0. For instance `android:background="#00777777"` sets a background which is translucent with a dull...
Use fram layout, which will allow you to add two views on each other.
229,878
This is part of a series of questions. *Context*: a friend of mine is writing a novel about a rogue planet around the mass of Mars passing by the solar system before continuing its journey in interstellar space (it must not be captured by the Sun). Given sufficient heads-ups, Earth sends a research mission to land on ...
2022/05/12
[ "https://worldbuilding.stackexchange.com/questions/229878", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/76461/" ]
"Passing through the solar system" I guess means in this case "passing through the inner solar system". If it only passes the Kuiper belt or the Oort cloud, there would be no serious perturbations (no "showering the inner solar system" or the like"). When passing through the inner solar system there will be no perturb...
Considering that the solar system is a multi-body system, we are sure it is a chaotic system in the long run. For the solar system, its [Lyapunov time](https://en.wikipedia.org/wiki/Lyapunov_time) is 5 million years. This means that the effect of any perturbation on the system cannot really be reliably predicted past ...
229,878
This is part of a series of questions. *Context*: a friend of mine is writing a novel about a rogue planet around the mass of Mars passing by the solar system before continuing its journey in interstellar space (it must not be captured by the Sun). Given sufficient heads-ups, Earth sends a research mission to land on ...
2022/05/12
[ "https://worldbuilding.stackexchange.com/questions/229878", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/76461/" ]
**Numbers** I concur with Avun Jahei's answer, but feel that it's worth quantifying the minimum non-catastrophic close approach distance. This object has a mass comparable to Mars - 6.9 x 1023 kg Earth's moon has a mass of 7.35 x 1022 kg and orbits at an average distance of 3.8 x 108 m. For the purposes of calculat...
Considering that the solar system is a multi-body system, we are sure it is a chaotic system in the long run. For the solar system, its [Lyapunov time](https://en.wikipedia.org/wiki/Lyapunov_time) is 5 million years. This means that the effect of any perturbation on the system cannot really be reliably predicted past ...
29,457,315
I have 3 tables, like so: ``` release (release_id, name, ...) medium (medium_id, release_id, name, ...) track (track_id, medium_id, title, ...) ``` Having only the release\_id, i want to be able delete both the track and the medium associated with that release\_id in one shot using one query. Is it possible? If y...
2015/04/05
[ "https://Stackoverflow.com/questions/29457315", "https://Stackoverflow.com", "https://Stackoverflow.com/users/888139/" ]
Strictly speaking, yes, you need three separate delete statements. However, if you always want the associated rows deleted from the other two tables when you delete a row from the 'release' table, you can use foreign keys and an ON DELETE CASCADE constraint on the 'release' table. See, e.g. <http://www.mysqltutorial....
In the first line you define from which tables you want to delete in the join ``` delete r, m, t from release r left join medium m on m.release_id = r.release_id left join track t on t.medium_id = m.medium_id where r.release_id = 123 ```
29,457,315
I have 3 tables, like so: ``` release (release_id, name, ...) medium (medium_id, release_id, name, ...) track (track_id, medium_id, title, ...) ``` Having only the release\_id, i want to be able delete both the track and the medium associated with that release\_id in one shot using one query. Is it possible? If y...
2015/04/05
[ "https://Stackoverflow.com/questions/29457315", "https://Stackoverflow.com", "https://Stackoverflow.com/users/888139/" ]
Yes you can do this in one statement by referencing multiple tables in the delete statement: ``` DELETE FROM `release`, medium, track USING `release`, medium, track WHERE `release`.release_id = medium.release_id AND medium.medium_id = track.medium_id AND `release`.release_id = 1; ``` [Sample SQL Fiddle](http://www....
In the first line you define from which tables you want to delete in the join ``` delete r, m, t from release r left join medium m on m.release_id = r.release_id left join track t on t.medium_id = m.medium_id where r.release_id = 123 ```
61,338,861
I'm trying to increment an index in a loop for but my program does not work. I have a simple array with 10 elements and I want to sum all elements of this array. I'm having problem, because I consider two loop, first I want to calculate the five first elements and than the five last, but my counter i\_i does not change...
2020/04/21
[ "https://Stackoverflow.com/questions/61338861", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6457422/" ]
You used the wrong variable in the second loop, it is `ii`, not `i`. Secondly the last loop must go from `i_i` to `i_j` so your range is also wrong: ``` import numpy as np from matplotlib.pylab import * x = [1, 2, 3, 4, 5, 6, 7, 8 ,9 ,10] i_i = 0 i_j = 5 sum_t = 0.0 for i in range(2): for ii in range(i_i, i_j):...
I'm not sure what you hope to achieve by summing in two halves, but this works: ``` x = [1, 2, 3, 4, 5, 6, 7, 8 ,9 ,10] i_i = 0 i_j = 5 sum_t = 0.0 for i in range(2): for ii in range(i_j): sum_t += x[ii + i_i] i_i += 5 print(sum_t) ``` `i_j` means that you want to sum 5 elements each time. `i_i` t...
61,338,861
I'm trying to increment an index in a loop for but my program does not work. I have a simple array with 10 elements and I want to sum all elements of this array. I'm having problem, because I consider two loop, first I want to calculate the five first elements and than the five last, but my counter i\_i does not change...
2020/04/21
[ "https://Stackoverflow.com/questions/61338861", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6457422/" ]
You used the wrong variable in the second loop, it is `ii`, not `i`. Secondly the last loop must go from `i_i` to `i_j` so your range is also wrong: ``` import numpy as np from matplotlib.pylab import * x = [1, 2, 3, 4, 5, 6, 7, 8 ,9 ,10] i_i = 0 i_j = 5 sum_t = 0.0 for i in range(2): for ii in range(i_i, i_j):...
You forgot to use the i\_i index and in the second for you were using i instead of ii. ```py x = [1, 2, 3, 4, 5, 6, 7, 8 ,9 ,10] i_i = 0 i_j = 5 sum_t = 0.0 for i in range(2): for ii in range(i_i, i_j): sum_t += x[ii] i_i += 5 i_j += 5 print (i_j) print(sum_t) ``` But I would just use this...
61,338,861
I'm trying to increment an index in a loop for but my program does not work. I have a simple array with 10 elements and I want to sum all elements of this array. I'm having problem, because I consider two loop, first I want to calculate the five first elements and than the five last, but my counter i\_i does not change...
2020/04/21
[ "https://Stackoverflow.com/questions/61338861", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6457422/" ]
You used the wrong variable in the second loop, it is `ii`, not `i`. Secondly the last loop must go from `i_i` to `i_j` so your range is also wrong: ``` import numpy as np from matplotlib.pylab import * x = [1, 2, 3, 4, 5, 6, 7, 8 ,9 ,10] i_i = 0 i_j = 5 sum_t = 0.0 for i in range(2): for ii in range(i_i, i_j):...
Here are the reasons why above code does not work as expected 1) Wrong index variable in the sum.Have to use x[ii] instead of x[i] 2) Range of the second for loop, first execution it has to start from index 0 and in the next execution, the starting index should be 5. ``` x = [1, 2, 3, 4, 5, 6, 7, 8 ,9 ,10] i_i = 0...
8,147,696
I can't find this information online or in the documentation, does anyone know what versions of Android and iOS the AIR 3.0 captive runtime is compatible with? I'm assuming there is some restriction there, but short of actually compiling a program and trying it on iPhone for example, which I don't have, how can I tell ...
2011/11/16
[ "https://Stackoverflow.com/questions/8147696", "https://Stackoverflow.com", "https://Stackoverflow.com/users/997477/" ]
System requirements using captive runtime are the same as without - in other words, quoting from the [reqs page](http://www.adobe.com/products/air/tech-specs.html): * Android™ 2.2, 2.3, 3.0, 3.1, and 3.2 * iPod touch (3rd generation) 32 GB and 64 GB model, iPod touch 4, iPhone 3GS, iPhone 4, iPad, iPad 2 * iOS 4 and a...
I would suppose captive runtime apps work on all the devices which originally support AIR. Captive runtime just packages the AIR packages (which would otherwise be separately installed) into your application so that a separate download is not required. As for iOS, I believe the compiler creates native iOS code (becaus...
28,762,226
i need sql query for report from table item per day(fix day1-day31 as column) of the month when i input **month and year**. This is my table (item)   ID   |   NAME  |   DATE ---------------------------------------------------    1   |   ITEM A |   2015-2-25 13:37:49    2   |   ITEM A |   2015-2-25 14:37:4...
2015/02/27
[ "https://Stackoverflow.com/questions/28762226", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4613455/" ]
You can do this using a PIVOT in your query ``` SELECT name, [1], [2], [3], [4], [5], [6], [7], [8], [9], [10], [11], [12], [13], [14], [15], [16], [17], [18], [19], [20], ...
This will do it for you. First test data: ``` CREATE TABLE data ([ID] int, [Name] varchar(30), [Date] datetime) INSERT INTO data ([ID], [Name], [Date]) SELECT 1,'ITEM A','2015-2-25 13:37:49' UNION ALL SELECT 2,'ITEM A','2015-2-25 14:37:49' UNION ALL SELECT 3,'ITEM A','2015-2-26 13:30:55' UNION ALL SELECT 4,'ITEM B','...
28,762,226
i need sql query for report from table item per day(fix day1-day31 as column) of the month when i input **month and year**. This is my table (item)   ID   |   NAME  |   DATE ---------------------------------------------------    1   |   ITEM A |   2015-2-25 13:37:49    2   |   ITEM A |   2015-2-25 14:37:4...
2015/02/27
[ "https://Stackoverflow.com/questions/28762226", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4613455/" ]
This will do it for you. First test data: ``` CREATE TABLE data ([ID] int, [Name] varchar(30), [Date] datetime) INSERT INTO data ([ID], [Name], [Date]) SELECT 1,'ITEM A','2015-2-25 13:37:49' UNION ALL SELECT 2,'ITEM A','2015-2-25 14:37:49' UNION ALL SELECT 3,'ITEM A','2015-2-26 13:30:55' UNION ALL SELECT 4,'ITEM B','...
``` select convert(varchar,PaymentDate,103) AS date, DatePart(MONTH,PaymentDate) as month, CAST(SUM(Total_Amount) as INT) as Revenue from Tbl_Name where YEAR(PaymentDate) = YEAR(CURRENT_TIMESTAMP) AND MONTH(PaymentDate) = MONTH(CURRENT_TIMESTAMP) GROUP BY convert(varchar,PaymentDate,103), Da...
28,762,226
i need sql query for report from table item per day(fix day1-day31 as column) of the month when i input **month and year**. This is my table (item)   ID   |   NAME  |   DATE ---------------------------------------------------    1   |   ITEM A |   2015-2-25 13:37:49    2   |   ITEM A |   2015-2-25 14:37:4...
2015/02/27
[ "https://Stackoverflow.com/questions/28762226", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4613455/" ]
You can do this using a PIVOT in your query ``` SELECT name, [1], [2], [3], [4], [5], [6], [7], [8], [9], [10], [11], [12], [13], [14], [15], [16], [17], [18], [19], [20], ...
``` select convert(varchar,PaymentDate,103) AS date, DatePart(MONTH,PaymentDate) as month, CAST(SUM(Total_Amount) as INT) as Revenue from Tbl_Name where YEAR(PaymentDate) = YEAR(CURRENT_TIMESTAMP) AND MONTH(PaymentDate) = MONTH(CURRENT_TIMESTAMP) GROUP BY convert(varchar,PaymentDate,103), Da...
13,695,522
I am having trouble trying to loop through a multidimensional array using PHP. When I use the `print_r()` function, here is my output: ``` Array ( [0] => Array ( [fname] => [sname] => [address] => [address2] => [city] => [state] => Select State [zip] => [county] => United States [phone] => [fax] => [email] => [use_ema...
2012/12/04
[ "https://Stackoverflow.com/questions/13695522", "https://Stackoverflow.com", "https://Stackoverflow.com/users/317740/" ]
easiest would just use a foreach statement: ``` foreach($yourarray as $array_element) { $address = $array_element['address']; $fname = $array_element['fname']; ... } ```
It looks like there is one more dimension before what you want to loop through. Try this. ``` foreach($array[0] as $key => $value) { echo $key, ': ', $value; } ```
13,695,522
I am having trouble trying to loop through a multidimensional array using PHP. When I use the `print_r()` function, here is my output: ``` Array ( [0] => Array ( [fname] => [sname] => [address] => [address2] => [city] => [state] => Select State [zip] => [county] => United States [phone] => [fax] => [email] => [use_ema...
2012/12/04
[ "https://Stackoverflow.com/questions/13695522", "https://Stackoverflow.com", "https://Stackoverflow.com/users/317740/" ]
you can do this by ``` foreach($array as $value) { foreach($value as $val) { echo $val; } } ```
It looks like there is one more dimension before what you want to loop through. Try this. ``` foreach($array[0] as $key => $value) { echo $key, ': ', $value; } ```
13,695,522
I am having trouble trying to loop through a multidimensional array using PHP. When I use the `print_r()` function, here is my output: ``` Array ( [0] => Array ( [fname] => [sname] => [address] => [address2] => [city] => [state] => Select State [zip] => [county] => United States [phone] => [fax] => [email] => [use_ema...
2012/12/04
[ "https://Stackoverflow.com/questions/13695522", "https://Stackoverflow.com", "https://Stackoverflow.com/users/317740/" ]
Your code is: ``` $set = array( 0 => array ( 'fname' => '', 'sname' => '', 'address' => '', 'address2' => '', 'city' => '', 'state' => 'Select State', ...
It looks like there is one more dimension before what you want to loop through. Try this. ``` foreach($array[0] as $key => $value) { echo $key, ': ', $value; } ```
13,695,522
I am having trouble trying to loop through a multidimensional array using PHP. When I use the `print_r()` function, here is my output: ``` Array ( [0] => Array ( [fname] => [sname] => [address] => [address2] => [city] => [state] => Select State [zip] => [county] => United States [phone] => [fax] => [email] => [use_ema...
2012/12/04
[ "https://Stackoverflow.com/questions/13695522", "https://Stackoverflow.com", "https://Stackoverflow.com/users/317740/" ]
easiest would just use a foreach statement: ``` foreach($yourarray as $array_element) { $address = $array_element['address']; $fname = $array_element['fname']; ... } ```
you can do this by ``` foreach($array as $value) { foreach($value as $val) { echo $val; } } ```
13,695,522
I am having trouble trying to loop through a multidimensional array using PHP. When I use the `print_r()` function, here is my output: ``` Array ( [0] => Array ( [fname] => [sname] => [address] => [address2] => [city] => [state] => Select State [zip] => [county] => United States [phone] => [fax] => [email] => [use_ema...
2012/12/04
[ "https://Stackoverflow.com/questions/13695522", "https://Stackoverflow.com", "https://Stackoverflow.com/users/317740/" ]
easiest would just use a foreach statement: ``` foreach($yourarray as $array_element) { $address = $array_element['address']; $fname = $array_element['fname']; ... } ```
Your code is: ``` $set = array( 0 => array ( 'fname' => '', 'sname' => '', 'address' => '', 'address2' => '', 'city' => '', 'state' => 'Select State', ...
4,274,388
``` string = "Jack and Jill went up the hill to fetch a pail of water. Jack fell down and broke his crown. And Jill came tumbling after. " d = string.match(/(jack|jill)/i) # -> MatchData "Jill" 1:"Jill" d.size # -> 1 ``` This only match the first occurrence it seems. `string.scan` does the job partially but it doe...
2010/11/25
[ "https://Stackoverflow.com/questions/4274388", "https://Stackoverflow.com", "https://Stackoverflow.com/users/499097/" ]
You can use `.scan` and `$`` global variable, which means *The string to the left of the last successful match*, but it doesn't work inside usual `.scan`, so you need this *hack* (stolen from [this answer](https://stackoverflow.com/a/2257073/322020)): ```ruby string = "Jack and Jill went up the hill to fetch a pail of...
Here's a modification of Nakilon's answer if you want to put just the locations of "Jack" into an array ``` location_array = Array.new string = "Jack and Jack went up the hill to fetch a pail of Jack..." string.to_enum(:scan,/(jack)/i).map do |m,| location_array.push [$`.size] end ```
10,458,660
I'm trying to compare these three but it seems only `array_map` works. ``` $input = array( ' hello ','whsdf ',' lve you',' '); $input2 = array( ' hello ','whsdf ',' ...
2012/05/05
[ "https://Stackoverflow.com/questions/10458660", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1099531/" ]
[`array_walk`](http://php.net/manual/en/function.array-walk.php) doesn't look at what result function gives. Instead it passes callback a reference to item value. So your code for it to work needs to be ``` function walk_trim(&$value) { $value = trim($value); } ``` `foreach` doesn't store changed values itself e...
As of **PHP 5.3** Anonymous Functions possible. ex: ``` $arr = array('1<br/>','<a href="#">2</a>','<p>3</p>','<span>4</span>','<div>5</div>'); array_walk($arr, function(&$arg){ $arg = strip_tags($arg); }); var_dump($arr); // 1,2,3,4,5 ;-) ``` Have fun.
524,086
I would appreciate if somebody could help me with the following problem Q. Finding ~~maximum~~ minimum $$\frac{x+y}{z}+\frac{x+z}{y}+\frac{y+z}{x}(\text{where} ~~x,y,z>0)$$
2013/10/13
[ "https://math.stackexchange.com/questions/524086", "https://math.stackexchange.com", "https://math.stackexchange.com/users/59343/" ]
$$\frac{x+y}{z}+\frac{x+z}{y}+\frac{y+z}{x}(\text{where} ~~x,y,z>0)$$ Consider the following : $a , \frac{1}{a}$ we know that $A.M. \geq G.M.$ $\therefore \frac{a+ \frac{1}{a}}{2} \geq \sqrt{a . \frac{1}{a}}$ $\Rightarrow \frac{a^2+1}{2a} \geq 1 $ $\Rightarrow a^2 + 1 \geq 2a $ $\Rightarrow (a-1)^2 \geq 0$ $\Rig...
Note that if $F(x,y,z) = \frac{x+y}{z}+\frac{x+z}{y} + \frac{y+z}{x}$, then $F(kx,ky,kz)=F(x,y,z),\ k>0$. So we will use Lagrange multiplier method. Let $g(x,y,z)=x+y+z$. Constraint is $x+y+z=1$. $$\nabla F = (\frac{1}{z}+\frac{1}{y} - \frac{y+z}{x^2},\frac{1}{z}+\frac{1}{x} - \frac{x+z}{y^2},\frac{1}{y}+\frac{1}{x}...
524,086
I would appreciate if somebody could help me with the following problem Q. Finding ~~maximum~~ minimum $$\frac{x+y}{z}+\frac{x+z}{y}+\frac{y+z}{x}(\text{where} ~~x,y,z>0)$$
2013/10/13
[ "https://math.stackexchange.com/questions/524086", "https://math.stackexchange.com", "https://math.stackexchange.com/users/59343/" ]
$$\frac{x+y}{z}+\frac{x+z}{y}+\frac{y+z}{x}(\text{where} ~~x,y,z>0)$$ Consider the following : $a , \frac{1}{a}$ we know that $A.M. \geq G.M.$ $\therefore \frac{a+ \frac{1}{a}}{2} \geq \sqrt{a . \frac{1}{a}}$ $\Rightarrow \frac{a^2+1}{2a} \geq 1 $ $\Rightarrow a^2 + 1 \geq 2a $ $\Rightarrow (a-1)^2 \geq 0$ $\Rig...
A more formal proof that there is no maximum follows from taking the first derivatives and comparing to zero, showing that if $(x\_0, y\_0, z\_0)$ is a maximum / minimum, it satisfies: $$x\_0 = y\_0 = z\_0$$ This means that you can calculate the Hessian by only doing two calculations to determine $f\_{xx}$ and $f\_{xy}...
524,086
I would appreciate if somebody could help me with the following problem Q. Finding ~~maximum~~ minimum $$\frac{x+y}{z}+\frac{x+z}{y}+\frac{y+z}{x}(\text{where} ~~x,y,z>0)$$
2013/10/13
[ "https://math.stackexchange.com/questions/524086", "https://math.stackexchange.com", "https://math.stackexchange.com/users/59343/" ]
By letting $u = \frac xy$ , $v = \frac yz$, and $w = \frac zx$ , our expression becomes $(u + \frac1u) + (v + \frac1v) + (w + \frac1w)$ , whose minimum is thrice that of $f(t) = t + \frac1t$ , which is to be found among the roots of its first order derivative: $f'(t) = 1 - \frac1{t^2}$ , which vanishes for $t = \pm1$ ....
$$\frac{x+y}{z}+\frac{x+z}{y}+\frac{y+z}{x}(\text{where} ~~x,y,z>0)$$ Consider the following : $a , \frac{1}{a}$ we know that $A.M. \geq G.M.$ $\therefore \frac{a+ \frac{1}{a}}{2} \geq \sqrt{a . \frac{1}{a}}$ $\Rightarrow \frac{a^2+1}{2a} \geq 1 $ $\Rightarrow a^2 + 1 \geq 2a $ $\Rightarrow (a-1)^2 \geq 0$ $\Rig...
524,086
I would appreciate if somebody could help me with the following problem Q. Finding ~~maximum~~ minimum $$\frac{x+y}{z}+\frac{x+z}{y}+\frac{y+z}{x}(\text{where} ~~x,y,z>0)$$
2013/10/13
[ "https://math.stackexchange.com/questions/524086", "https://math.stackexchange.com", "https://math.stackexchange.com/users/59343/" ]
A more formal proof that there is no maximum follows from taking the first derivatives and comparing to zero, showing that if $(x\_0, y\_0, z\_0)$ is a maximum / minimum, it satisfies: $$x\_0 = y\_0 = z\_0$$ This means that you can calculate the Hessian by only doing two calculations to determine $f\_{xx}$ and $f\_{xy}...
Note that if $F(x,y,z) = \frac{x+y}{z}+\frac{x+z}{y} + \frac{y+z}{x}$, then $F(kx,ky,kz)=F(x,y,z),\ k>0$. So we will use Lagrange multiplier method. Let $g(x,y,z)=x+y+z$. Constraint is $x+y+z=1$. $$\nabla F = (\frac{1}{z}+\frac{1}{y} - \frac{y+z}{x^2},\frac{1}{z}+\frac{1}{x} - \frac{x+z}{y^2},\frac{1}{y}+\frac{1}{x}...
524,086
I would appreciate if somebody could help me with the following problem Q. Finding ~~maximum~~ minimum $$\frac{x+y}{z}+\frac{x+z}{y}+\frac{y+z}{x}(\text{where} ~~x,y,z>0)$$
2013/10/13
[ "https://math.stackexchange.com/questions/524086", "https://math.stackexchange.com", "https://math.stackexchange.com/users/59343/" ]
By letting $u = \frac xy$ , $v = \frac yz$, and $w = \frac zx$ , our expression becomes $(u + \frac1u) + (v + \frac1v) + (w + \frac1w)$ , whose minimum is thrice that of $f(t) = t + \frac1t$ , which is to be found among the roots of its first order derivative: $f'(t) = 1 - \frac1{t^2}$ , which vanishes for $t = \pm1$ ....
Note that if $F(x,y,z) = \frac{x+y}{z}+\frac{x+z}{y} + \frac{y+z}{x}$, then $F(kx,ky,kz)=F(x,y,z),\ k>0$. So we will use Lagrange multiplier method. Let $g(x,y,z)=x+y+z$. Constraint is $x+y+z=1$. $$\nabla F = (\frac{1}{z}+\frac{1}{y} - \frac{y+z}{x^2},\frac{1}{z}+\frac{1}{x} - \frac{x+z}{y^2},\frac{1}{y}+\frac{1}{x}...
524,086
I would appreciate if somebody could help me with the following problem Q. Finding ~~maximum~~ minimum $$\frac{x+y}{z}+\frac{x+z}{y}+\frac{y+z}{x}(\text{where} ~~x,y,z>0)$$
2013/10/13
[ "https://math.stackexchange.com/questions/524086", "https://math.stackexchange.com", "https://math.stackexchange.com/users/59343/" ]
By letting $u = \frac xy$ , $v = \frac yz$, and $w = \frac zx$ , our expression becomes $(u + \frac1u) + (v + \frac1v) + (w + \frac1w)$ , whose minimum is thrice that of $f(t) = t + \frac1t$ , which is to be found among the roots of its first order derivative: $f'(t) = 1 - \frac1{t^2}$ , which vanishes for $t = \pm1$ ....
A more formal proof that there is no maximum follows from taking the first derivatives and comparing to zero, showing that if $(x\_0, y\_0, z\_0)$ is a maximum / minimum, it satisfies: $$x\_0 = y\_0 = z\_0$$ This means that you can calculate the Hessian by only doing two calculations to determine $f\_{xx}$ and $f\_{xy}...
7,231,649
Let me use an example for what I'm looking for. On my phone I have a music player widget, when active and the phone times out, the player continues working (iPod style I get that). BUT when you turn the phone back on, the player is visible and active above the unlocking slide bar. Is this easy to do in java? giving ...
2011/08/29
[ "https://Stackoverflow.com/questions/7231649", "https://Stackoverflow.com", "https://Stackoverflow.com/users/693526/" ]
This is a contentious issue: * There are apps that do this. See [How to customize Android's LockScreen?](https://stackoverflow.com/questions/5829671/how-to-customize-androids-lockscreen) e.g. [WidgetLocker](https://play.google.com/store/apps/details?id=com.teslacoilsw.widgetlocker) - so it is not entirely impossible. ...
There is [no API for drawing on lock screen](https://stackoverflow.com/questions/4065201/android-how-can-i-programmatically-draw-text-on-key-guard-screen-lock-screen), nor can you [replace lock screen](https://stackoverflow.com/questions/2758006/screen-lock-customization-for-android) with a custom one. SO you can not w...
35,479,494
I'm editing a file in vim and my function looks like this: ``` function arrForeignCharacterMapping() { return array( '<8a>'=>'S', '<9a>'=>'s', 'Ð'=>'Dj','<8e>'=>'Z', '<9e>'=>'z', 'À'=>'A', 'Á'=>'A', 'Â'=>'A', 'Ã'=>'A', 'Ä'=>'A', 'Å'=>'A', 'Æ'=>'A', 'Ç'=>'C', 'È'=>'E', 'É'=>'E', 'Ê'=>'E', 'Ë'=>'...
2016/02/18
[ "https://Stackoverflow.com/questions/35479494", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1058739/" ]
you can google "unicode character map", its pretty common so I'm sure you will find many tools and one you would like. this was one of the first results for me: <http://charmap.online-toolz.com/tools/character-map.php> look at the unicode character value, as such: [![enter image description here](https://i.stack.img...
not sure if you are looking for this. In vim ``` echo char2nr('ý',1) ``` will print `253`
54,621,210
I am trying to write a function that takes a string as input and returns a string with all vowels repeated 4 times. *eg: `apple` becomes `aaaappleeee`* It works for every vowel, except for *e*, in which it repeats *e* an egregious amount of times. Python 3. I have tried playing with the replace function, changing t...
2019/02/10
[ "https://Stackoverflow.com/questions/54621210", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10951091/" ]
You shall never modify something you're iterating over, store the modified word in a new variable. Modifing your code it would be something like ``` def exclamation(string): new = '' for i in string: if i in 'aeiou': new += i*4 else: new += i return new + '!' ```
It's not that `e` is being treated differently, but rather that you're replacing each `e` with `eeee` for as many `e`s as there are in the word. If you try other words with multiples of the same vowel, you would see the same behavior there. Instead of replacing for each vowel in the string, you should be doing each re...
54,621,210
I am trying to write a function that takes a string as input and returns a string with all vowels repeated 4 times. *eg: `apple` becomes `aaaappleeee`* It works for every vowel, except for *e*, in which it repeats *e* an egregious amount of times. Python 3. I have tried playing with the replace function, changing t...
2019/02/10
[ "https://Stackoverflow.com/questions/54621210", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10951091/" ]
For every vowel you’re iterating through, the loop checks the condition, replaces the content in the same string and then iterates by 1 which now is the same string but instead of the next new letter, it now has to deal with 3 more of the same vowel. For example: Let’s talk about the string ‘excellent’. For the first ...
It's not that `e` is being treated differently, but rather that you're replacing each `e` with `eeee` for as many `e`s as there are in the word. If you try other words with multiples of the same vowel, you would see the same behavior there. Instead of replacing for each vowel in the string, you should be doing each re...
54,621,210
I am trying to write a function that takes a string as input and returns a string with all vowels repeated 4 times. *eg: `apple` becomes `aaaappleeee`* It works for every vowel, except for *e*, in which it repeats *e* an egregious amount of times. Python 3. I have tried playing with the replace function, changing t...
2019/02/10
[ "https://Stackoverflow.com/questions/54621210", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10951091/" ]
You shall never modify something you're iterating over, store the modified word in a new variable. Modifing your code it would be something like ``` def exclamation(string): new = '' for i in string: if i in 'aeiou': new += i*4 else: new += i return new + '!' ```
def exclamation(string): ``` result = '' for i in string: if i in 'aeiou': vowel = i * 4 else: vowel = i result += vowel return result + '!' ``` **The reason why replace didnt work for excellent is because we have 3 'e' in which means for each of the 'e' in the loop, replace will multiply...
54,621,210
I am trying to write a function that takes a string as input and returns a string with all vowels repeated 4 times. *eg: `apple` becomes `aaaappleeee`* It works for every vowel, except for *e*, in which it repeats *e* an egregious amount of times. Python 3. I have tried playing with the replace function, changing t...
2019/02/10
[ "https://Stackoverflow.com/questions/54621210", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10951091/" ]
You shall never modify something you're iterating over, store the modified word in a new variable. Modifing your code it would be something like ``` def exclamation(string): new = '' for i in string: if i in 'aeiou': new += i*4 else: new += i return new + '!' ```
For every vowel you’re iterating through, the loop checks the condition, replaces the content in the same string and then iterates by 1 which now is the same string but instead of the next new letter, it now has to deal with 3 more of the same vowel. For example: Let’s talk about the string ‘excellent’. For the first ...
54,621,210
I am trying to write a function that takes a string as input and returns a string with all vowels repeated 4 times. *eg: `apple` becomes `aaaappleeee`* It works for every vowel, except for *e*, in which it repeats *e* an egregious amount of times. Python 3. I have tried playing with the replace function, changing t...
2019/02/10
[ "https://Stackoverflow.com/questions/54621210", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10951091/" ]
You shall never modify something you're iterating over, store the modified word in a new variable. Modifing your code it would be something like ``` def exclamation(string): new = '' for i in string: if i in 'aeiou': new += i*4 else: new += i return new + '!' ```
It is happening because your loop will consider the replaced 'e's as the element of the string as well. Here is what I am saying: * String is excellent * Iterate through the string and check if the letter is vowel + If the letter is vowel, write that vowel 4 times. By following the above steps, we will find this re...
54,621,210
I am trying to write a function that takes a string as input and returns a string with all vowels repeated 4 times. *eg: `apple` becomes `aaaappleeee`* It works for every vowel, except for *e*, in which it repeats *e* an egregious amount of times. Python 3. I have tried playing with the replace function, changing t...
2019/02/10
[ "https://Stackoverflow.com/questions/54621210", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10951091/" ]
For every vowel you’re iterating through, the loop checks the condition, replaces the content in the same string and then iterates by 1 which now is the same string but instead of the next new letter, it now has to deal with 3 more of the same vowel. For example: Let’s talk about the string ‘excellent’. For the first ...
def exclamation(string): ``` result = '' for i in string: if i in 'aeiou': vowel = i * 4 else: vowel = i result += vowel return result + '!' ``` **The reason why replace didnt work for excellent is because we have 3 'e' in which means for each of the 'e' in the loop, replace will multiply...
54,621,210
I am trying to write a function that takes a string as input and returns a string with all vowels repeated 4 times. *eg: `apple` becomes `aaaappleeee`* It works for every vowel, except for *e*, in which it repeats *e* an egregious amount of times. Python 3. I have tried playing with the replace function, changing t...
2019/02/10
[ "https://Stackoverflow.com/questions/54621210", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10951091/" ]
For every vowel you’re iterating through, the loop checks the condition, replaces the content in the same string and then iterates by 1 which now is the same string but instead of the next new letter, it now has to deal with 3 more of the same vowel. For example: Let’s talk about the string ‘excellent’. For the first ...
It is happening because your loop will consider the replaced 'e's as the element of the string as well. Here is what I am saying: * String is excellent * Iterate through the string and check if the letter is vowel + If the letter is vowel, write that vowel 4 times. By following the above steps, we will find this re...
65,307,874
Hello I am looking for a way to implement a hierarchical graph in JavaFX, as is the case with a company organization. Ideally, the graph should be in a scrollable pane and the individual nodes of the graph should be able to be displayed (in a different pane) in order to get more information about an employee, etc. The...
2020/12/15
[ "https://Stackoverflow.com/questions/65307874", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11895027/" ]
That depends on what you mean by "graph". If a tree view is sufficient, you can use a JavaFX Tree control to display the hierarchical graph - like a directory structure in an explorer window. If a TreeView is not sufficient, you will have to implement some control yourself. If the information for each node in the grap...
I found this: [Graph Visualisation (like yFiles) in JavaFX](https://stackoverflow.com/questions/30679025/graph-visualisation-like-yfiles-in-javafx) and changed some code and finaly endet up with this: [![enter image description here](https://i.stack.imgur.com/QdlVA.png)](https://i.stack.imgur.com/QdlVA.png) code i ch...
97,092
I am in the process of building myself a fancy schmancy Raspberry Pi "laptop", and am trying to power it with a single cord/power supply. My strategy is to put together a small project box with 120VAC inputs, and the innards from a couple wall warts to provide 5VDC and 12VDC power. Before I start wiring crap together, ...
2014/01/20
[ "https://electronics.stackexchange.com/questions/97092", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/10660/" ]
I think this is not a good idea. You should use a 120V power cord attached to a fused power entry module <http://www.digikey.com/product-search/en/connectors-interconnects/power-entry-connectors-inlets-outlets-modules/1442743>, in turn connected to the right 5V/12V AC to DC converter rated for the currents you're inter...
Using hacked together power supplies can be dangerous if you aren't sure what you are doing. Luckily there are tons of off the shelf power supplies thay already do exactly what you want - 5v and 12v in one supply. You will find them for many external hard drives with a 3 (5v, 12v and gnd) or sometimes 4 pin (seperate ...
97,092
I am in the process of building myself a fancy schmancy Raspberry Pi "laptop", and am trying to power it with a single cord/power supply. My strategy is to put together a small project box with 120VAC inputs, and the innards from a couple wall warts to provide 5VDC and 12VDC power. Before I start wiring crap together, ...
2014/01/20
[ "https://electronics.stackexchange.com/questions/97092", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/10660/" ]
Areas of concern: 1. The mains connections between the wall-wart PCBs and the mains wires going to the cord. Ideally these need to be tied together in a mechanically secure manner - soldered and taped would be fine, as would bringing them to a terminal block with ring terminals. 2. The mechanical security of the wall-...
Using hacked together power supplies can be dangerous if you aren't sure what you are doing. Luckily there are tons of off the shelf power supplies thay already do exactly what you want - 5v and 12v in one supply. You will find them for many external hard drives with a 3 (5v, 12v and gnd) or sometimes 4 pin (seperate ...
34,659,636
i'm new to meteor framework I want to fetch single from the collection ``` AccountNames = new Mongo.Collection("AccountTypeMaster"); ``` I created a collection using ``` db.createCollection("AccountTypeMaster") this.helpers({ AccountNames: () => { return AccountNames.find({}, {fields: {name: 1}}); ...
2016/01/07
[ "https://Stackoverflow.com/questions/34659636", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5220060/" ]
You need to change how you instantiate your collection. The correct Meteor syntax would be: ``` AccountNames = new Mongo.Collection("AccountTypeMaster"); ``` Helpers also need to be attached to a template. Remember, helpers only run on client-side code. ``` if (Meteor.isClient) { // This code only runs on the cli...
Create Client folder in your project and put client side code into that folder.[To create collection in mongodb](https://www.meteor.com/tutorials/blaze/collections) ``` Template.name.helpers({ fun: function() { return AccountNames.find({},{name: 1}).fetch(); }) ```
17,605,290
I have the following 3 tables. This is just a small section of the data, I left out most rows and other columns that I'm not querying against. If it would be helpful to include the full table(s) let me know and I can figure out how to post them. **infocoms** ``` id items_id itemtype value 1735 21 ...
2013/07/11
[ "https://Stackoverflow.com/questions/17605290", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2573866/" ]
Comment (because I do not have the reputation) : "value" and "name" should be encased in back-ticks (``) because they are reserved words. But looking at your code a little closer I find that you are grouping by location.name even though many of the values are duplicated when you do an `JOIN ON peripherals.locations_id...
@Eugene Scray is right about GROUP BY being the reason why you see only some values. To keep columns "ungrouped", you need to add those columns into the GROUPING clause. For example: ``` GROUP BY peripherals.id, infocom.value ```
17,605,290
I have the following 3 tables. This is just a small section of the data, I left out most rows and other columns that I'm not querying against. If it would be helpful to include the full table(s) let me know and I can figure out how to post them. **infocoms** ``` id items_id itemtype value 1735 21 ...
2013/07/11
[ "https://Stackoverflow.com/questions/17605290", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2573866/" ]
Comment (because I do not have the reputation) : "value" and "name" should be encased in back-ticks (``) because they are reserved words. But looking at your code a little closer I find that you are grouping by location.name even though many of the values are duplicated when you do an `JOIN ON peripherals.locations_id...
In the `WHERE` clause I added `AND infocoms.itemtype = 'Peripheral'` which returned the correct number of of rows along with the appropriate value(s).
414,465
Is every $ \mathbb{R}P^{2n} $ bundle over the circle trivial? Are there exactly two $ \mathbb{R}P^{2n+1} $ bundles over the circle? This is a cross-post of (part of) my MSE question <https://math.stackexchange.com/questions/4349052/diffeomorphisms-of-spheres-and-real-projective-spaces> which has been up for a coupl...
2022/01/23
[ "https://mathoverflow.net/questions/414465", "https://mathoverflow.net", "https://mathoverflow.net/users/387190/" ]
As Sam Hopkins commented, 8 vertices are enough. Let $Q$ be the pentagon from the picture and let $\pi$ be the plane containing it. Now we can define the triangle $P$ as a triangle of less diameter than the black segment and intersecting $\pi$ at two points: one point $a\_0$ in the open blue region $B$ and one point $b...
I think that 8 might be possible, by interlocking two Star Trek symbols as shown below. [![enter image description here](https://i.stack.imgur.com/RyurZ.png)](https://i.stack.imgur.com/RyurZ.png) **Adendum:** This candidate may not work, as quarague points out, but I leave it as a potential "how not to" example. Ther...
414,465
Is every $ \mathbb{R}P^{2n} $ bundle over the circle trivial? Are there exactly two $ \mathbb{R}P^{2n+1} $ bundles over the circle? This is a cross-post of (part of) my MSE question <https://math.stackexchange.com/questions/4349052/diffeomorphisms-of-spheres-and-real-projective-spaces> which has been up for a coupl...
2022/01/23
[ "https://mathoverflow.net/questions/414465", "https://mathoverflow.net", "https://mathoverflow.net/users/387190/" ]
It is not possible with 7 (i.e., with a triangle $T$ and a quadrilateral $Q$). I write a rough proof. First, any quadrilateral $Q$ lying in a plane $\pi$ can be partitioned in two triangles $Q\_1$ and $Q\_2$, whose common edge is a diagonal $d$ of $Q$. Now the intersection of the triangle $T$ with $\pi$ consists of tw...
I think that 8 might be possible, by interlocking two Star Trek symbols as shown below. [![enter image description here](https://i.stack.imgur.com/RyurZ.png)](https://i.stack.imgur.com/RyurZ.png) **Adendum:** This candidate may not work, as quarague points out, but I leave it as a potential "how not to" example. Ther...
414,465
Is every $ \mathbb{R}P^{2n} $ bundle over the circle trivial? Are there exactly two $ \mathbb{R}P^{2n+1} $ bundles over the circle? This is a cross-post of (part of) my MSE question <https://math.stackexchange.com/questions/4349052/diffeomorphisms-of-spheres-and-real-projective-spaces> which has been up for a coupl...
2022/01/23
[ "https://mathoverflow.net/questions/414465", "https://mathoverflow.net", "https://mathoverflow.net/users/387190/" ]
As Sam Hopkins commented, 8 vertices are enough. Let $Q$ be the pentagon from the picture and let $\pi$ be the plane containing it. Now we can define the triangle $P$ as a triangle of less diameter than the black segment and intersecting $\pi$ at two points: one point $a\_0$ in the open blue region $B$ and one point $b...
Here is another example with 8 vertices: a short fat Star Trek symbol and a square in orthogonal planes. [![enter image description here](https://i.stack.imgur.com/TiQQK.jpg)](https://i.stack.imgur.com/TiQQK.jpg) Since the distance between the base points of the red figure is greater than its height, one cannot rotate...
414,465
Is every $ \mathbb{R}P^{2n} $ bundle over the circle trivial? Are there exactly two $ \mathbb{R}P^{2n+1} $ bundles over the circle? This is a cross-post of (part of) my MSE question <https://math.stackexchange.com/questions/4349052/diffeomorphisms-of-spheres-and-real-projective-spaces> which has been up for a coupl...
2022/01/23
[ "https://mathoverflow.net/questions/414465", "https://mathoverflow.net", "https://mathoverflow.net/users/387190/" ]
As Sam Hopkins commented, 8 vertices are enough. Let $Q$ be the pentagon from the picture and let $\pi$ be the plane containing it. Now we can define the triangle $P$ as a triangle of less diameter than the black segment and intersecting $\pi$ at two points: one point $a\_0$ in the open blue region $B$ and one point $b...
It is not possible with 7 (i.e., with a triangle $T$ and a quadrilateral $Q$). I write a rough proof. First, any quadrilateral $Q$ lying in a plane $\pi$ can be partitioned in two triangles $Q\_1$ and $Q\_2$, whose common edge is a diagonal $d$ of $Q$. Now the intersection of the triangle $T$ with $\pi$ consists of tw...
414,465
Is every $ \mathbb{R}P^{2n} $ bundle over the circle trivial? Are there exactly two $ \mathbb{R}P^{2n+1} $ bundles over the circle? This is a cross-post of (part of) my MSE question <https://math.stackexchange.com/questions/4349052/diffeomorphisms-of-spheres-and-real-projective-spaces> which has been up for a coupl...
2022/01/23
[ "https://mathoverflow.net/questions/414465", "https://mathoverflow.net", "https://mathoverflow.net/users/387190/" ]
It is not possible with 7 (i.e., with a triangle $T$ and a quadrilateral $Q$). I write a rough proof. First, any quadrilateral $Q$ lying in a plane $\pi$ can be partitioned in two triangles $Q\_1$ and $Q\_2$, whose common edge is a diagonal $d$ of $Q$. Now the intersection of the triangle $T$ with $\pi$ consists of tw...
Here is another example with 8 vertices: a short fat Star Trek symbol and a square in orthogonal planes. [![enter image description here](https://i.stack.imgur.com/TiQQK.jpg)](https://i.stack.imgur.com/TiQQK.jpg) Since the distance between the base points of the red figure is greater than its height, one cannot rotate...
58,252
I am currently doing a 3-month paid internship program - it started 3 weeks ago and will be conclusive in 3 months. This company does not promise to provide me with a position afterwards. Now I've received a full-time job offer from another company. * If it ethical to jump ship? * What might some possible consequenc...
2015/11/24
[ "https://workplace.stackexchange.com/questions/58252", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/44326/" ]
Is it a ***nice*** thing to do? **No.** Is it a ***good*** thing to do? **Depends who you're asking.** Make no mistake, you are screwing your boss over by quitting. However, as you yourself have said, the company you're with right now is offering no guarantees whatsoever. That job offer, on the other hand, is **a cer...
Think of it this way, you're leaving a temp/contract position for a full-time position. That situation is pretty much what many people in temp positions look for, unless they only want to do temp/contract work. If they brought you on knowing that you would eventually leave, they weren't prepared to make an offer to kee...
3,672,853
The problem? ``` <UI:PanelBrowser Margin="12,27,12,32"></UI:PanelBrowser> ``` WPF is ridiculous in that not manually specifying properties (Such as Width and Height) in this case causes them to have the values `Doulbe.NaN`. The problem is that I need to know this number. I'm not going to manually set a width and hei...
2010/09/09
[ "https://Stackoverflow.com/questions/3672853", "https://Stackoverflow.com", "https://Stackoverflow.com/users/369345/" ]
Try using the [FrameworkElement.ActualWidth](http://msdn.microsoft.com/en-us/library/system.windows.frameworkelement.actualwidth.aspx) and [ActualHeight](http://msdn.microsoft.com/en-us/library/system.windows.frameworkelement.actualheight.aspx) properties, instead.
You can use elements' `ActualWidth` and `ActualHeight` properties to get the values of the width and height when they were drawn.
3,672,853
The problem? ``` <UI:PanelBrowser Margin="12,27,12,32"></UI:PanelBrowser> ``` WPF is ridiculous in that not manually specifying properties (Such as Width and Height) in this case causes them to have the values `Doulbe.NaN`. The problem is that I need to know this number. I'm not going to manually set a width and hei...
2010/09/09
[ "https://Stackoverflow.com/questions/3672853", "https://Stackoverflow.com", "https://Stackoverflow.com/users/369345/" ]
Try using the [FrameworkElement.ActualWidth](http://msdn.microsoft.com/en-us/library/system.windows.frameworkelement.actualwidth.aspx) and [ActualHeight](http://msdn.microsoft.com/en-us/library/system.windows.frameworkelement.actualheight.aspx) properties, instead.
The WPF FrameworkElement class provides two DependencyProperties for that purpose: `FrameworkElement.ActualWidth` and `FrameworkElement.ActualHeight` will get the rendered width and height at run-time.
3,672,853
The problem? ``` <UI:PanelBrowser Margin="12,27,12,32"></UI:PanelBrowser> ``` WPF is ridiculous in that not manually specifying properties (Such as Width and Height) in this case causes them to have the values `Doulbe.NaN`. The problem is that I need to know this number. I'm not going to manually set a width and hei...
2010/09/09
[ "https://Stackoverflow.com/questions/3672853", "https://Stackoverflow.com", "https://Stackoverflow.com/users/369345/" ]
Try using the [FrameworkElement.ActualWidth](http://msdn.microsoft.com/en-us/library/system.windows.frameworkelement.actualwidth.aspx) and [ActualHeight](http://msdn.microsoft.com/en-us/library/system.windows.frameworkelement.actualheight.aspx) properties, instead.
Use **VisualTreeHelper.GetDescendantBounds(Visual Reference)**, and it return Rect. Then Check the height of the Rect. Ex) ``` Rect bounds = VisualTreeHelper.GetDescendantBounds(element); double height = bounds.height; ``` **OR** Use **UIElement.Measure(Size size)**, it will assign the Size into DesiredSize...
3,672,853
The problem? ``` <UI:PanelBrowser Margin="12,27,12,32"></UI:PanelBrowser> ``` WPF is ridiculous in that not manually specifying properties (Such as Width and Height) in this case causes them to have the values `Doulbe.NaN`. The problem is that I need to know this number. I'm not going to manually set a width and hei...
2010/09/09
[ "https://Stackoverflow.com/questions/3672853", "https://Stackoverflow.com", "https://Stackoverflow.com/users/369345/" ]
The WPF FrameworkElement class provides two DependencyProperties for that purpose: `FrameworkElement.ActualWidth` and `FrameworkElement.ActualHeight` will get the rendered width and height at run-time.
You can use elements' `ActualWidth` and `ActualHeight` properties to get the values of the width and height when they were drawn.
3,672,853
The problem? ``` <UI:PanelBrowser Margin="12,27,12,32"></UI:PanelBrowser> ``` WPF is ridiculous in that not manually specifying properties (Such as Width and Height) in this case causes them to have the values `Doulbe.NaN`. The problem is that I need to know this number. I'm not going to manually set a width and hei...
2010/09/09
[ "https://Stackoverflow.com/questions/3672853", "https://Stackoverflow.com", "https://Stackoverflow.com/users/369345/" ]
You can use elements' `ActualWidth` and `ActualHeight` properties to get the values of the width and height when they were drawn.
Use **VisualTreeHelper.GetDescendantBounds(Visual Reference)**, and it return Rect. Then Check the height of the Rect. Ex) ``` Rect bounds = VisualTreeHelper.GetDescendantBounds(element); double height = bounds.height; ``` **OR** Use **UIElement.Measure(Size size)**, it will assign the Size into DesiredSize...
3,672,853
The problem? ``` <UI:PanelBrowser Margin="12,27,12,32"></UI:PanelBrowser> ``` WPF is ridiculous in that not manually specifying properties (Such as Width and Height) in this case causes them to have the values `Doulbe.NaN`. The problem is that I need to know this number. I'm not going to manually set a width and hei...
2010/09/09
[ "https://Stackoverflow.com/questions/3672853", "https://Stackoverflow.com", "https://Stackoverflow.com/users/369345/" ]
The WPF FrameworkElement class provides two DependencyProperties for that purpose: `FrameworkElement.ActualWidth` and `FrameworkElement.ActualHeight` will get the rendered width and height at run-time.
Use **VisualTreeHelper.GetDescendantBounds(Visual Reference)**, and it return Rect. Then Check the height of the Rect. Ex) ``` Rect bounds = VisualTreeHelper.GetDescendantBounds(element); double height = bounds.height; ``` **OR** Use **UIElement.Measure(Size size)**, it will assign the Size into DesiredSize...
54,442,972
I write my API documentation with Spring REST Docs. Code example: ``` @Override public void getById(String urlTemplate, PathParametersSnippet pathParametersSnippet, Object... urlVariables) throws Exception { resultActions = mockMvc.perform(get(urlTemplate, urlVariables) .principal(principal) ...
2019/01/30
[ "https://Stackoverflow.com/questions/54442972", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10499368/" ]
If you're not in a position to configure your application to produce pretty-printed responses, you can have REST Docs do it for you prior to them being documented. This is described in the [Customizing Requests and Responses](https://docs.spring.io/spring-restdocs/docs/2.0.x/reference/html5/#customizing-requests-and-re...
You can try get `ResultActions` object from mockMvc and than get `MockHttpServletResponse` object. After that you can get all the values of the fields that came in response. In this case, you will not need to parse the string. ``` resultActions = mockMvc.perform(get(urlTemplate, urlVariables) .principal(principal)...
239,478
I have the following tables: [![Part-Product Line relationship](https://i.stack.imgur.com/M6teW.png)](https://i.stack.imgur.com/M6teW.png) Each `ProductLine` will encompass many `Part`s. For this reason, it initially seemed to me that the `Part` table is a child of the `ProductLine` table. However, a part is not simp...
2019/05/30
[ "https://dba.stackexchange.com/questions/239478", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/180524/" ]
If the business requirement is > > a business rule, every part must belong to exactly one product line. > > > So if the rule is, **each part belongs to one product line** the other side of that relationship is **each product line contains zero-to-many parts** which should convince you this is a clear instance of ...
Like in `Part` Table, ``` PartID int PK PartBase varchar(20) AK PopularityCode char(20) ``` Similarly In `ProductLine` Table ,`PK` column should be of `INT` datatype. Even if `ProductLine` table is small,it may be FK in Huge Table . So if `ProductLineNumber varchar(20)` is Index then it may affect performance. So...
36,318,280
I'm trying to create a runnable JAR from <https://bitbucket.org/madsen953/ethervisu> in Eclipse. When I try to run it I get: ``` Exception in thread "Monitor" java.lang.UnsatisfiedLinkError: no jnetpcap in java.library.path at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1864) at java.lang.Runtime.loadLi...
2016/03/30
[ "https://Stackoverflow.com/questions/36318280", "https://Stackoverflow.com", "https://Stackoverflow.com/users/259288/" ]
You need to use a WHERE clause in your update statement. ``` UPDATE wp_posts SET post_content = replace(post_content, 'free', 'free3' ) WHERE post_content LIKE '%blue%' ```
Try this: ``` UPDATE wp_posts SET post_content = REPLACE(post_content, 'free', 'free3') WHERE LOCATE('blue', post_content) > 0 ```
16,469,150
We are supposed to use the code below to print out the parameters listed in it, currently however we are unable to do so and are using a round about method. This is supposed to print out things instead of what we print out in the Game class in the playturn function ``` def __str__(self): x = self.name + ":\t"...
2013/05/09
[ "https://Stackoverflow.com/questions/16469150", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2321264/" ]
The problem is that, in at least some places, you're trying to print a `list`. While printing anything, including a `list`, calls `str` on it, the `list.__str__` method calls `repr` on its elements. (If you don't know the difference between `str` and `rep`, see [Difference between `__str__` and `__repr__` in Python](h...
You are not running the functionality you want because you are referencing `player.hand`. Try changing ``` str(self.player.hand) ``` to ``` str(self.player) ```
65,753,830
I'm trying to train Mask-R CNN model from cocoapi(<https://github.com/cocodataset/cocoapi>), and this error code keep come out. ``` ModuleNotFoundError Traceback (most recent call last) <ipython-input-8-83356bb9cf95> in <module> 19 sys.path.append(os.path.join(ROOT_DIR, "samples/...
2021/01/16
[ "https://Stackoverflow.com/questions/65753830", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14258016/" ]
The answer is summarise from [these](https://github.com/cocodataset/cocoapi/issues/172) [three](https://github.com/cocodataset/cocoapi/issues/168) [GitHub issues](https://github.com/cocodataset/cocoapi/issues/141#issuecomment-386606299) 1.whether you have installed cython in the correct version. Namely, you should ins...
Try cloning official repo and run below commands ``` python setup.py install make ```
73,039,121
With great help from @pratik-wadekar I have the following working text animation. Now my problem is that when I test it on different screen sizes/mobile the animated word `plants` breaks into pieces. For example PLA and in the next line NTS. How can I avoid this? So it always keeps as one full word. First I tried to a...
2022/07/19
[ "https://Stackoverflow.com/questions/73039121", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Every single character is a separate `<span>`, so it's not parsed as a single word. One solution would be to simply make the parent a `flex` container: ``` <AnimatedTypography style={{display:"flex"}}> ``` <https://codesandbox.io/s/blissful-sea-4o7498>
What you need is `white-space: nowrap`. Please check <https://codesandbox.io/s/infallible-matan-rcnclw>
73,039,121
With great help from @pratik-wadekar I have the following working text animation. Now my problem is that when I test it on different screen sizes/mobile the animated word `plants` breaks into pieces. For example PLA and in the next line NTS. How can I avoid this? So it always keeps as one full word. First I tried to a...
2022/07/19
[ "https://Stackoverflow.com/questions/73039121", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Ok I got it. I had to make the animation as own component and add the `<AnimatedTypography>` the `component={"span"}` type and `white-space: nowrap`. Additionally to my `const AnimatedTypography = styled(Typography)` I had to cast the resulting component with `as typeof Typograph`y so Typescript does not throws errors....
What you need is `white-space: nowrap`. Please check <https://codesandbox.io/s/infallible-matan-rcnclw>
73,039,121
With great help from @pratik-wadekar I have the following working text animation. Now my problem is that when I test it on different screen sizes/mobile the animated word `plants` breaks into pieces. For example PLA and in the next line NTS. How can I avoid this? So it always keeps as one full word. First I tried to a...
2022/07/19
[ "https://Stackoverflow.com/questions/73039121", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Ok I got it. I had to make the animation as own component and add the `<AnimatedTypography>` the `component={"span"}` type and `white-space: nowrap`. Additionally to my `const AnimatedTypography = styled(Typography)` I had to cast the resulting component with `as typeof Typograph`y so Typescript does not throws errors....
Every single character is a separate `<span>`, so it's not parsed as a single word. One solution would be to simply make the parent a `flex` container: ``` <AnimatedTypography style={{display:"flex"}}> ``` <https://codesandbox.io/s/blissful-sea-4o7498>
23,423,572
As title says, why does Rails prefer to use the @params variable inside of a Controller action when you are responding to the action instead of passing the individual parameters through the function arguments when we call the function? Other frameworks use this (i.e, ASP MVC) and I was just wondering if there was a re...
2014/05/02
[ "https://Stackoverflow.com/questions/23423572", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1073868/" ]
The Maven command `mvn eclipse:eclipse` generate the eclipse project files from POM. The "-D" prefix in the argument means that it's a system property. System property are defined like `http://docs.oracle.com/javase/jndi/tutorial/beyond/env/source.html#SYS` `mvn eclipse:eclipse -Dwtpversion=2.0` command convert the w...
``` mvn eclipse:eclipse -Dwtpversion=2.0 -e clean install ``` run this instead. This builds your project by resolving dependencies
23,423,572
As title says, why does Rails prefer to use the @params variable inside of a Controller action when you are responding to the action instead of passing the individual parameters through the function arguments when we call the function? Other frameworks use this (i.e, ASP MVC) and I was just wondering if there was a re...
2014/05/02
[ "https://Stackoverflow.com/questions/23423572", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1073868/" ]
Please try installing m2eclipse plugin (if you haven't done so yet) and nextly convert project to use maven behaviour through right clicking on project and choosing "convert to maven" option.
``` mvn eclipse:eclipse -Dwtpversion=2.0 -e clean install ``` run this instead. This builds your project by resolving dependencies
23,423,572
As title says, why does Rails prefer to use the @params variable inside of a Controller action when you are responding to the action instead of passing the individual parameters through the function arguments when we call the function? Other frameworks use this (i.e, ASP MVC) and I was just wondering if there was a re...
2014/05/02
[ "https://Stackoverflow.com/questions/23423572", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1073868/" ]
The Maven command `mvn eclipse:eclipse` generate the eclipse project files from POM. The "-D" prefix in the argument means that it's a system property. System property are defined like `http://docs.oracle.com/javase/jndi/tutorial/beyond/env/source.html#SYS` `mvn eclipse:eclipse -Dwtpversion=2.0` command convert the w...
Please try installing m2eclipse plugin (if you haven't done so yet) and nextly convert project to use maven behaviour through right clicking on project and choosing "convert to maven" option.
40,925,951
In our WPF software, we used a `ControlTemplate` which defines a `ToggleButton` that causes the window to shrink/extend. The definition of `ToggleButton` is given below: ```xml <ToggleButton ToolTip="Standard/Extended" Grid.Column="0" x:Name="PART_MaximizeToggle" VerticalAlignment="Top" HorizontalAlignment="Ri...
2016/12/02
[ "https://Stackoverflow.com/questions/40925951", "https://Stackoverflow.com", "https://Stackoverflow.com/users/68304/" ]
You could assign ([and register](https://msdn.microsoft.com/en-us/library/system.windows.frameworkcontentelement.registername.aspx)) the names automatically via an [AttachedProperty](https://msdn.microsoft.com/en-us/library/ms749011(v=vs.110).aspx) that increments a counter for each prefix. (This is just a proof of con...
Manfred Radlwimmer's solution is useful but makes the controls code behind harder. Any dynamic code in the Controls' OnApplyTemplate that searches for that template part will become a pain. An alternative would be to use same trick (generation of a unique id) for the automation id instead and use the automation id i...
20,810,059
Is it good practice to declare variables to be used across a program in a Module then populate them in one form and use what you have populated to these variables in another form? I plan on closing the population form after the data has been populated to the variables so I see this as the only method that would work. ...
2013/12/28
[ "https://Stackoverflow.com/questions/20810059", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2177940/" ]
I guess it **depends** on your application and the kind of data you're talking about. Think of a `User Login form` that saves the user information after logging in. You can then keep this information in a Module shared across your entire application because it's not expected to change during the session. So you can q...
No, and yes. Define a class or perhaps more than one to hold the data, pass that about. If by module you mean one of those .bas things with a bunch of primitive types in it, then that would be considered bad practice unless there was no practical alternative. It's not expected to change was what you said, but if you u...
20,810,059
Is it good practice to declare variables to be used across a program in a Module then populate them in one form and use what you have populated to these variables in another form? I plan on closing the population form after the data has been populated to the variables so I see this as the only method that would work. ...
2013/12/28
[ "https://Stackoverflow.com/questions/20810059", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2177940/" ]
I guess it **depends** on your application and the kind of data you're talking about. Think of a `User Login form` that saves the user information after logging in. You can then keep this information in a Module shared across your entire application because it's not expected to change during the session. So you can q...
...on the other hand, there is nothing whatsoever that a module can do that cannot also be done with a class. For a UserLogin example, leaving it in a module does not make it easier to access: ``` Friend User As New UserLogin ' elsewhere: theName = User.Name thePass = User.Password ``` Meanwhile, a class can m...
20,810,059
Is it good practice to declare variables to be used across a program in a Module then populate them in one form and use what you have populated to these variables in another form? I plan on closing the population form after the data has been populated to the variables so I see this as the only method that would work. ...
2013/12/28
[ "https://Stackoverflow.com/questions/20810059", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2177940/" ]
...on the other hand, there is nothing whatsoever that a module can do that cannot also be done with a class. For a UserLogin example, leaving it in a module does not make it easier to access: ``` Friend User As New UserLogin ' elsewhere: theName = User.Name thePass = User.Password ``` Meanwhile, a class can m...
No, and yes. Define a class or perhaps more than one to hold the data, pass that about. If by module you mean one of those .bas things with a bunch of primitive types in it, then that would be considered bad practice unless there was no practical alternative. It's not expected to change was what you said, but if you u...
60,803,621
I'm having a little trouble figuring out a nested for loop here. Here's the problem: > > 3. The population of Ireland is 4.8 million and growing at a rate of 7% per year. Write a program to determine and display the population > in 10 years time. Your program should also display a count of the > number of years th...
2020/03/22
[ "https://Stackoverflow.com/questions/60803621", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13105750/" ]
Look at your inner loop. ``` for (int j = 0; pop >5; j++) { years += j; } ``` Your condition being `pop > 5`, you need `pop` to shrink if you ever want to exit the loop. But the body of the loop never alters `pop`, so if it's greater than 5, you'll loop forever. The problem definition suggests t...
First, you need to clearer variable names in my opinion. Of course, don't go to far with that, but IMO `population` will be better than just `pop`. Furhter, you could use `Dictionary` to store years alongside with preidcted population. Also, write comments to better see what's going on :) With this suggestions, I wo...
60,803,621
I'm having a little trouble figuring out a nested for loop here. Here's the problem: > > 3. The population of Ireland is 4.8 million and growing at a rate of 7% per year. Write a program to determine and display the population > in 10 years time. Your program should also display a count of the > number of years th...
2020/03/22
[ "https://Stackoverflow.com/questions/60803621", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13105750/" ]
Look at your inner loop. ``` for (int j = 0; pop >5; j++) { years += j; } ``` Your condition being `pop > 5`, you need `pop` to shrink if you ever want to exit the loop. But the body of the loop never alters `pop`, so if it's greater than 5, you'll loop forever. The problem definition suggests t...
If I well understand your question. Technically if you add 7% each year your program should look like this ``` bool passed = true; double pop = 4.8; int year = 0; for (int i=0; i<10; i++) { pop *= 1.07; if (pop > 5 && passed) { year = i; passed = false; } } ```
16,688,245
I'm trying to deploy my app on heroku. But everytime I try to push my database, I get the following error: ``` heroku db:push Sending schema Schema: 100% |==========================================| Time: 00:00:16 Sending indexes refinery_page: 100% |==========================================| Time: 00:00:02 re...
2013/05/22
[ "https://Stackoverflow.com/questions/16688245", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1458773/" ]
I too had same problem, but i solved with these lines. To my knowledge we cannot request a session for new permissions which is already opened. ``` Session session = new Session(this); Session.setActiveSession(session); session.openForRead(new Session.OpenRequest(this).setCallback(callback).setPermissions(Arra...
If the Session is neither opened nor closed, I think it is better to Session.openActiveSession() This snipped is copied-pasted from the Facebook SDK sample project SessionLoginSample, LoginUsingActivityActivity#onClickLogin() ``` private void onClickLogin() { Session session = Session.getActiveSession(); if (...
15,469,904
I need to set up a listener that can call a method every time a `show()` method is invoked to display a window. How can I do this?
2013/03/18
[ "https://Stackoverflow.com/questions/15469904", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2172496/" ]
You'd probably be interested in `WindowListener`. From [the tutorial, "How to Write Window Listeners"](http://docs.oracle.com/javase/tutorial/uiswing/events/windowlistener.html): > > The following window activities or states can precede a window event: > > > * Opening a window — Showing a window for the first time...
There is an interface called [WindowListener](http://docs.oracle.com/javase/7/docs/api/java/awt/event/WindowListener.html) and here is a event that gets fired when window is [opened](http://docs.oracle.com/javase/7/docs/api/java/awt/event/WindowListener.html#windowOpened%28java.awt.event.WindowEvent%29).You can find al...
15,469,904
I need to set up a listener that can call a method every time a `show()` method is invoked to display a window. How can I do this?
2013/03/18
[ "https://Stackoverflow.com/questions/15469904", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2172496/" ]
You'd probably be interested in `WindowListener`. From [the tutorial, "How to Write Window Listeners"](http://docs.oracle.com/javase/tutorial/uiswing/events/windowlistener.html): > > The following window activities or states can precede a window event: > > > * Opening a window — Showing a window for the first time...
Add a `ComponentListener` and check for the `componentShown` event. Note that a `WindowListener` will only fire the **first time** the window is opened while `ComponentListener` will fire ***every*** time. See [How to Write a Component Listener](http://docs.oracle.com/javase/tutorial/uiswing/events/componentlistener....
60,747,796
I have a simple table ``` **targeted_url_redirect targeted_countries msg_type non_targeted_url** http://new.botweet.com india,nepal,philippines NEW http://twisend.com http://expapers.com United States,Canada OLD http://all.twisend.com https://tweeasy.com india,england ...
2020/03/18
[ "https://Stackoverflow.com/questions/60747796", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2014130/" ]
One option uses `not exists`: ``` SELECT t.* FROM tweeasy_website_redirection t WHERE t.message_type = 'OLD' AND ( t.targeted_countries LIKE '%@country%' OR NOT EXISTS ( SELECT 1 FROM tweeasy_website_redirection t1 WHERE t1.targeted_countries LIKE '%@coun...
select \* from tweeasy\_website\_redirection where targeted\_countries not in (SELECT targeted\_countries FROM stack WHERE targeted\_countries LIKE '%@country%')
42,549,008
what is the best way to maintain global variable in `angular2`. I am unable to find a way to maintain a global variable through out the application. After user logged into the application I need `User` object which has user details and `isLoggedIn` values in all other components. Here is what I am doing ... ``` @Injec...
2017/03/02
[ "https://Stackoverflow.com/questions/42549008", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1653027/" ]
Simply, follow the instructions given in the error: Download miniconda, then run the script file by typing following command: `bash <file_name.sh>` e.g. `bash Miniconda3-latest-Linux-x86_64.sh`. Now reopen the terminal for the changes to take effect. If conda is already installed on your system, you can reinstall it...
**TL;DR**: nothing is corrupted, the message you're seeing is a hardcoded stub and could be fixed. *conda* package manager actually **can** be used with regular python installation. **Update**: I've been tinkering with the described method and found that you should use `conda install --dry-run ...` to see changes tha...
42,549,008
what is the best way to maintain global variable in `angular2`. I am unable to find a way to maintain a global variable through out the application. After user logged into the application I need `User` object which has user details and `isLoggedIn` values in all other components. Here is what I am doing ... ``` @Injec...
2017/03/02
[ "https://Stackoverflow.com/questions/42549008", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1653027/" ]
Simply, follow the instructions given in the error: Download miniconda, then run the script file by typing following command: `bash <file_name.sh>` e.g. `bash Miniconda3-latest-Linux-x86_64.sh`. Now reopen the terminal for the changes to take effect. If conda is already installed on your system, you can reinstall it...
If you are facing this problem in Virtual Machine (VM) then you have to activate the main environment by running below line of code: ``` source /anaconda_installation_folder_path/bin/activate ``` Once you are in your main environment you can work with conda.
42,549,008
what is the best way to maintain global variable in `angular2`. I am unable to find a way to maintain a global variable through out the application. After user logged into the application I need `User` object which has user details and `isLoggedIn` values in all other components. Here is what I am doing ... ``` @Injec...
2017/03/02
[ "https://Stackoverflow.com/questions/42549008", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1653027/" ]
Simply, follow the instructions given in the error: Download miniconda, then run the script file by typing following command: `bash <file_name.sh>` e.g. `bash Miniconda3-latest-Linux-x86_64.sh`. Now reopen the terminal for the changes to take effect. If conda is already installed on your system, you can reinstall it...
In my case, what worked was: ``` pip uninstall conda ``` and then installing [miniconda](https://docs.conda.io/en/latest/miniconda.html)
42,549,008
what is the best way to maintain global variable in `angular2`. I am unable to find a way to maintain a global variable through out the application. After user logged into the application I need `User` object which has user details and `isLoggedIn` values in all other components. Here is what I am doing ... ``` @Injec...
2017/03/02
[ "https://Stackoverflow.com/questions/42549008", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1653027/" ]
Simply, follow the instructions given in the error: Download miniconda, then run the script file by typing following command: `bash <file_name.sh>` e.g. `bash Miniconda3-latest-Linux-x86_64.sh`. Now reopen the terminal for the changes to take effect. If conda is already installed on your system, you can reinstall it...
Download miniconda, then run the script file by typing following command: bash <file\_name.sh> e.g. bash Miniconda3-latest-Linux-x86\_64.sh -u '-u' : update tag, used if the original conda bash paths get lost due to certain modifications in the .bashrc file
42,549,008
what is the best way to maintain global variable in `angular2`. I am unable to find a way to maintain a global variable through out the application. After user logged into the application I need `User` object which has user details and `isLoggedIn` values in all other components. Here is what I am doing ... ``` @Injec...
2017/03/02
[ "https://Stackoverflow.com/questions/42549008", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1653027/" ]
**TL;DR**: nothing is corrupted, the message you're seeing is a hardcoded stub and could be fixed. *conda* package manager actually **can** be used with regular python installation. **Update**: I've been tinkering with the described method and found that you should use `conda install --dry-run ...` to see changes tha...
In my case, what worked was: ``` pip uninstall conda ``` and then installing [miniconda](https://docs.conda.io/en/latest/miniconda.html)
42,549,008
what is the best way to maintain global variable in `angular2`. I am unable to find a way to maintain a global variable through out the application. After user logged into the application I need `User` object which has user details and `isLoggedIn` values in all other components. Here is what I am doing ... ``` @Injec...
2017/03/02
[ "https://Stackoverflow.com/questions/42549008", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1653027/" ]
**TL;DR**: nothing is corrupted, the message you're seeing is a hardcoded stub and could be fixed. *conda* package manager actually **can** be used with regular python installation. **Update**: I've been tinkering with the described method and found that you should use `conda install --dry-run ...` to see changes tha...
Download miniconda, then run the script file by typing following command: bash <file\_name.sh> e.g. bash Miniconda3-latest-Linux-x86\_64.sh -u '-u' : update tag, used if the original conda bash paths get lost due to certain modifications in the .bashrc file
42,549,008
what is the best way to maintain global variable in `angular2`. I am unable to find a way to maintain a global variable through out the application. After user logged into the application I need `User` object which has user details and `isLoggedIn` values in all other components. Here is what I am doing ... ``` @Injec...
2017/03/02
[ "https://Stackoverflow.com/questions/42549008", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1653027/" ]
If you are facing this problem in Virtual Machine (VM) then you have to activate the main environment by running below line of code: ``` source /anaconda_installation_folder_path/bin/activate ``` Once you are in your main environment you can work with conda.
In my case, what worked was: ``` pip uninstall conda ``` and then installing [miniconda](https://docs.conda.io/en/latest/miniconda.html)
42,549,008
what is the best way to maintain global variable in `angular2`. I am unable to find a way to maintain a global variable through out the application. After user logged into the application I need `User` object which has user details and `isLoggedIn` values in all other components. Here is what I am doing ... ``` @Injec...
2017/03/02
[ "https://Stackoverflow.com/questions/42549008", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1653027/" ]
If you are facing this problem in Virtual Machine (VM) then you have to activate the main environment by running below line of code: ``` source /anaconda_installation_folder_path/bin/activate ``` Once you are in your main environment you can work with conda.
Download miniconda, then run the script file by typing following command: bash <file\_name.sh> e.g. bash Miniconda3-latest-Linux-x86\_64.sh -u '-u' : update tag, used if the original conda bash paths get lost due to certain modifications in the .bashrc file
56,197,545
I have Tab navigator that handles data changing of itself and other two sibling component. **Main parent Component** that does data fetching and manipulation based on three sentiments: positive, negative and neutral as request body parameter in *http post request*. **Second parent component** that stores all positiv...
2019/05/18
[ "https://Stackoverflow.com/questions/56197545", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11349591/" ]
You need **urgently** research about SQL injection, and **STOP USING** string concatenation for building your SQL insert statement **RIGHT NOW**. You need to use the proper technique - **parametrized queries** -- always - **NO** exceptions! And also, it's a commonly accepted Best Practice to list the columns in your ...
You should specify the columns names. For example: ``` cmd.CommandText = $"Insert into Table1 ({ColumnName of firstname}, { ColumnName of lastname}, { ColumnName of city}) values({firstname.Text}, {lastname.Text}, {city.Text})"; ``` You can better use a stored procedure - something like that: `...