qid
int64
1
74.7M
question
stringlengths
15
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
4
30.2k
response_k
stringlengths
11
36.5k
1,985,792
I have an ASP.NET MVC web app whose controllers use WCF to call into the domain model on a different server. The domain code needs to talk to a database and access to the database server isn't always possible from web servers (depends on the customer site) hence the use of WCF to get to a place where my code is allowed...
2009/12/31
[ "https://Stackoverflow.com/questions/1985792", "https://Stackoverflow.com", "https://Stackoverflow.com/users/241587/" ]
It appears that you are not actually trying to use a service-oriented architecture. In this case, you can place the domain objects into a single assembly, and share it between the WCF service and the clients. When creating the clients, use "Add Service Reference", and on the "Advanced" tab, choose "Share Types". Either...
Sound service-oriented-architecture dictates that you use message based communication regardless of whether your service is on another machine, in another process, in another appdomain, or in your appdomain. You can use different endpoints with different bindings to take advantage of the speed of the link (http, tcp, n...
1,985,792
I have an ASP.NET MVC web app whose controllers use WCF to call into the domain model on a different server. The domain code needs to talk to a database and access to the database server isn't always possible from web servers (depends on the customer site) hence the use of WCF to get to a place where my code is allowed...
2009/12/31
[ "https://Stackoverflow.com/questions/1985792", "https://Stackoverflow.com", "https://Stackoverflow.com/users/241587/" ]
It appears that you are not actually trying to use a service-oriented architecture. In this case, you can place the domain objects into a single assembly, and share it between the WCF service and the clients. When creating the clients, use "Add Service Reference", and on the "Advanced" tab, choose "Share Types". Either...
This may not be the easiest or least time-consuming answer, but one thing you can do is avoid using the "add service reference" option, and then copy your contract interfaces to your MVC application and initiate the connection to WCF manually without automatically creating a service proxy. This will allow you to use on...
1,985,792
I have an ASP.NET MVC web app whose controllers use WCF to call into the domain model on a different server. The domain code needs to talk to a database and access to the database server isn't always possible from web servers (depends on the customer site) hence the use of WCF to get to a place where my code is allowed...
2009/12/31
[ "https://Stackoverflow.com/questions/1985792", "https://Stackoverflow.com", "https://Stackoverflow.com/users/241587/" ]
It appears that you are not actually trying to use a service-oriented architecture. In this case, you can place the domain objects into a single assembly, and share it between the WCF service and the clients. When creating the clients, use "Add Service Reference", and on the "Advanced" tab, choose "Share Types". Either...
One sound option is that you always use WCF, even if client and server are in the same process, as Aviad points out. Another option is to define the service contracts on interfaces, and to put these, together with the data contracts into an assembly that is shared between client and server. In the client, don't use `s...
24,932,838
I have some android project and I am trying to read some file from the "res/drawable-xhdpi" directory so I put ``` InputStream is = null; try { is = getResources().openRawResource(R.drawable.my_btn); //my_btn is inside drawable-xhdpi directory } catch (Exception e) { e.printSta...
2014/07/24
[ "https://Stackoverflow.com/questions/24932838", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1611830/" ]
The drawable will be fetched from `"res/drawable-xhdpi"` only if you are running the app on an `xhdpi` device. Else it will try to fetch the drawable from the corresponding drawable folder according to the screen and if it is not there, you will get the same error as above. If you are not sure which screen size you are...
> > I am just trying to test and I take a picture and send it to Parse > > > Put your test image somewhere either in `res/raw/` (then, use your existing code, with `R.raw.whatever_you_call_the_image`) or in `assets/` (then, use `getAssets().open()` with a relative path within `assets/` to your image).
24,932,838
I have some android project and I am trying to read some file from the "res/drawable-xhdpi" directory so I put ``` InputStream is = null; try { is = getResources().openRawResource(R.drawable.my_btn); //my_btn is inside drawable-xhdpi directory } catch (Exception e) { e.printSta...
2014/07/24
[ "https://Stackoverflow.com/questions/24932838", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1611830/" ]
\_pm.iconStream = getResources().openRawResource(+ R.drawable.pdf\_icon);
> > I am just trying to test and I take a picture and send it to Parse > > > Put your test image somewhere either in `res/raw/` (then, use your existing code, with `R.raw.whatever_you_call_the_image`) or in `assets/` (then, use `getAssets().open()` with a relative path within `assets/` to your image).
20,622,124
Whats an easy way to combine these? I'm trying to remove integers, floats, and specific words ``` string = "5 basic sent cards by 4.55" string.delete("0-9.") string.slice! "sent" string.slice! "by" puts string #desired output: basic cards ```
2013/12/16
[ "https://Stackoverflow.com/questions/20622124", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2888262/" ]
Use a regular expression: ``` string.gsub! /[0-9.]|sent|by/, '' ``` To remove runs of continuous spaces (i.e. `basic cards` -> `basic cards`), try: ``` string = string.squeeze(' ').strip ```
Be careful using regex: Naive patterns can be very destructive with minor changes to the input: ``` "5 basic sent cards by 4.55".gsub(/[0-9.]|sent|by/, '') # => " basic cards " "5 basic present cards bye 4.55".gsub(/[0-9.]|sent|by/, '') # => " basic pre cards e " "5 basic sent cards by 4.55".gsub(/[\d.]+|\b(?:sent|...
13,952,636
I am quite inexperienced when it comes to HTML/CSS, so please help me out. I have the following layout ``` <style> #main {background-color: red; width: 30%;} #right_al{float: right;} #to_scroll{overflow: scroll;} </style> <div id='main'> <div id='right_al'> CONTENT#foo <div id='to_scroll'> ...
2012/12/19
[ "https://Stackoverflow.com/questions/13952636", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1320822/" ]
As mentioned in my above comment, the W3C specs will not allow scrolling containers when no height is given because the container's inner height will be used to define its total height. If using a bit of JS code would be an option, have a look at the following Fiddle: <http://jsfiddle.net/Moonbird_IT/kf3vD/> Here's m...
Put a wrapper around the "content" divs, and then give that a float of left. ``` <div id="content-container"> <div id='div1'>CONTENT #1</div> <div id='div2'>CONTENT #2</div> <div id='div3'>CONTENT #3</div> <div id='div4'>CONTENT #4</div> <div id='div5'>CONTENT #5</div> </div> // CSS #content-cont...
32,412,522
I have page where an instant search results are displaying using PHP & AJAX and `<a>` tag `onclick` from response item, it generate preview of track. Everything is working fine but when I update my jQuery version from `1.7.2` to `1.11.3` or `2.1.4`. It open link instead of generating preview. My code ``` <!--<script ...
2015/09/05
[ "https://Stackoverflow.com/questions/32412522", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4939819/" ]
this is how to make squares ``` <div id="square"></div> #square { width: 100px; height: 100px; background: red; } ``` hope that helps source: <https://css-tricks.com/examples/ShapesOfCSS/>
For Html squares pls try as below ``` <div id="squares"> <div id="square1"></div> <div id="square2"></div> <div id="square3"></div> </div> ``` and CSS as below ``` #squares div { /* these styles will let the divs line up next to each other while accepting dimensions */ display: block; ...
52,917,199
I have installed the latest IntelliJ Idea vertion with the Scala plugin. I have created a SBT Scala project with the IDE. Unfortunately, I am not able to compile or run even the simplest "Hello World" example. ``` object Main { def main(args: Array[String]): Unit ={ val x: Int = 5 println("Hello Sc...
2018/10/21
[ "https://Stackoverflow.com/questions/52917199", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9366998/" ]
On your [screenshot](https://i.stack.imgur.com/6EOfK.png) `Runner` is in wrong package. It's written `package main.scala`. If `Runner.scala` is in `src/main/scala/way/to/my/package` package declaration should be `package way.to.my.package` (if it's just in `src/main/scala` there should not be line `package ...`). Also...
Did you try the green arrow near "object Main"? This should start the program. [![Screensht from IntelliJ Idea ](https://i.stack.imgur.com/BPyp0.png)](https://i.stack.imgur.com/BPyp0.png)
35,703,250
I have tried `setSelectedItem` in `viewDidLoad`, also tried `selectedIndex` etc.. whatever I found on net.. But I couldn't find any answer. Each item when I am launching the app it shows tab bar in default state not in selected state. I am also getting error ``` Directly tab bar cannot be modified ```
2016/02/29
[ "https://Stackoverflow.com/questions/35703250", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5997348/" ]
**Use:** ``` $scope.randomQuestion= $scope.myQuestions[Math.floor(Math.random() * $scope.myQuestions.length)]; ``` And in view: **{{randomQuestion}}** **UPDATE:** ``` $http.get('quiz_data.json').then(function(quizData){ $scope.myQuestions = quizData.data; $scope.randomQuestion= $scope.myQuesti...
This line: ``` $scope.myQuestions = Math.floor(Math.random()*2); ``` Overwrites your array of questions and turns it into a random number. I think you want to access it as an array with that number like so: ``` $http.get('quiz_data.json').then(function(quizData){ $scope.myQuestions = quizData.data; ...
46,492,666
When I put an icon on a menu item it makes the li tall but if you inspect the elements the li is the only thing that tall in the element. Is this avoidable? if not, why? Link to example: <https://jsbin.com/kirekufoju/edit?html,output> ``` <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta ...
2017/09/29
[ "https://Stackoverflow.com/questions/46492666", "https://Stackoverflow.com", "https://Stackoverflow.com/users/844858/" ]
Removing the `list-style-image` from your `li` should do the trick : ``` .ui-menu .ui-menu-item { list-style-image: none; } ``` <https://jsbin.com/mimeqebute/1/edit?html,output>
Finaly found an open ticket for this. I've been looking but must have missed it. From: <https://bugs.jqueryui.com/ticket/15214#no2> adding the following: ``` .ui-menu li.ui-menu-item{ display:inherit; } ``` to a stylesheet should cause it to behave normally. Apparently this was only happening on webkit browsers...
8,328,041
I have a `QTableView` instance limited to a single row selection. I don't want to care about what cell the user presses, but it should always extract the data in (selectedRow,0). So far I am doing the following: ``` QModelIndexList indices = _ui->_tbl->selectionModel()->selection().indexes(); QModelIndex id = indices...
2011/11/30
[ "https://Stackoverflow.com/questions/8328041", "https://Stackoverflow.com", "https://Stackoverflow.com/users/641586/" ]
As stated in Qt doc concerning `currentIndex` : > > Unless the current selection mode is NoSelection, the item is also be > selected > > > So you can do it quicker : ``` QModelIndex index = _ui->_tbl->currentIndex() ; QModelIndex id = index.sibling(index.row(),0) ; ```
Using `QItemSelectionModel::selectedRows` takes out one step. It gives you the index at a particular column (o by default). Thus: ``` QModelIndex index = _ui->_tbl->selectionModel()->selectedRows(0).at(0); ```
8,328,041
I have a `QTableView` instance limited to a single row selection. I don't want to care about what cell the user presses, but it should always extract the data in (selectedRow,0). So far I am doing the following: ``` QModelIndexList indices = _ui->_tbl->selectionModel()->selection().indexes(); QModelIndex id = indices...
2011/11/30
[ "https://Stackoverflow.com/questions/8328041", "https://Stackoverflow.com", "https://Stackoverflow.com/users/641586/" ]
Using `QItemSelectionModel::selectedRows` takes out one step. It gives you the index at a particular column (o by default). Thus: ``` QModelIndex index = _ui->_tbl->selectionModel()->selectedRows(0).at(0); ```
You can get the data of the first cell of the selected row, if you go through the `model`. ``` QModelIndex id = _ui->_tbl->model()->index(_ui->_tbl->currentIndex().row(),0); ``` Unfortunately `Qt` does not support (and I can't figure out why) a `QModelIndex` constructor with `row` and `column` as arguments.
8,328,041
I have a `QTableView` instance limited to a single row selection. I don't want to care about what cell the user presses, but it should always extract the data in (selectedRow,0). So far I am doing the following: ``` QModelIndexList indices = _ui->_tbl->selectionModel()->selection().indexes(); QModelIndex id = indices...
2011/11/30
[ "https://Stackoverflow.com/questions/8328041", "https://Stackoverflow.com", "https://Stackoverflow.com/users/641586/" ]
As stated in Qt doc concerning `currentIndex` : > > Unless the current selection mode is NoSelection, the item is also be > selected > > > So you can do it quicker : ``` QModelIndex index = _ui->_tbl->currentIndex() ; QModelIndex id = index.sibling(index.row(),0) ; ```
You can get the data of the first cell of the selected row, if you go through the `model`. ``` QModelIndex id = _ui->_tbl->model()->index(_ui->_tbl->currentIndex().row(),0); ``` Unfortunately `Qt` does not support (and I can't figure out why) a `QModelIndex` constructor with `row` and `column` as arguments.
17,174,319
I have an application where I would like to have two releases, one releases will have everything enabled, in the other release certain menu items will be disabled. I tried creating a new solution configuration where certain menuitems are disabled. My code is the following: ``` #if (SMART == true) Download_Menu...
2013/06/18
[ "https://Stackoverflow.com/questions/17174319", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1308355/" ]
Your have got something wrong. Better write: ``` #ifdef SMART Download_Menu.IsEnabled = false; ChangeLayout_Menu.IsEnabled = false; #endif ``` Read more [here](https://stackoverflow.com/questions/975355/ifdef-in-c-sharp) And the [MSDN Preprocessor Directives](http://msdn.microsoft.com/en-us/library/...
It happens because your project configuration is wrong for the new preprocesor directive that you create. Make sure the solution configuration and platform target for the new preprocesor directive matches with your debug configuration. One practical example why you face the bad image format exception is that in your pr...
17,174,319
I have an application where I would like to have two releases, one releases will have everything enabled, in the other release certain menu items will be disabled. I tried creating a new solution configuration where certain menuitems are disabled. My code is the following: ``` #if (SMART == true) Download_Menu...
2013/06/18
[ "https://Stackoverflow.com/questions/17174319", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1308355/" ]
That is because the two configurations are **not compiling** to the **same CPU type**. Whether select "Any CPU" or 32bit ou 64bit
It happens because your project configuration is wrong for the new preprocesor directive that you create. Make sure the solution configuration and platform target for the new preprocesor directive matches with your debug configuration. One practical example why you face the bad image format exception is that in your pr...
41,797,557
I have the following HashMap. Its purpose is to be used to invoke certain methods of classes extending JPanel. The method being the value in the HashMap and the parameter passed being the key. ``` HashMap<Object, String> methodMapper = new HashMap<>(); projectMethodMapper.put("Some title", "setInfoTitle"); projectMe...
2017/01/23
[ "https://Stackoverflow.com/questions/41797557", "https://Stackoverflow.com", "https://Stackoverflow.com/users/963625/" ]
A simple answer to your question > > how do I find what interface is used for the creation of the anonymous class used for the object instantiation? > > > is in the code snippet below. But be aware, that your approach can be very problematic, and you should probably attempt to refactor it if at all possible. ``...
You don't need to use reflection for this. You can use a `List<Cosumer<InfoPanel>>`, which is bascially a list of functors that each take an `InfoPanel` as argument: ``` List<Consumer<InfoPanel>> commandList = new ArrayList<>(); commandList.add(panel -> panel.attachListener(e -> System.out.println("working")) //...
328,752
I'm about to buy a Dell Precision m6700 that I plan on dual booting Windows 7 and Ubuntu 12.04 (or 12.10, feel free to comment) and I'm wondering if I should get the touch screen monitor designed for Windows 8. I'll be working on a plane a lot so the touch screen might be a nice alternative to the track pad when I don'...
2013/08/05
[ "https://askubuntu.com/questions/328752", "https://askubuntu.com", "https://askubuntu.com/users/181408/" ]
[KVM requires VT-X/AMD-V](http://www.linux-kvm.org/page/FAQ#What_do_I_need_to_use_KVM.3F), but VirtualBox [does not pass VT-X/AMD-V to the guest](https://forums.virtualbox.org/viewtopic.php?f=1&t=20589) operating system. Therefore, KVM can't run in VirtualBox (yet). Please track [bug ticket #4032](https://www.virtualb...
Virtualbox just released (12/18/2018) version 6 in which is expected to have nested virtualization. However, at this moment it seems is still unavailable on Intel procs. <https://www.virtualbox.org/wiki/Downloads> Regarding the main question (Enable nested virtualization in Ubuntu) - KVM module is supporting nested v...
328,752
I'm about to buy a Dell Precision m6700 that I plan on dual booting Windows 7 and Ubuntu 12.04 (or 12.10, feel free to comment) and I'm wondering if I should get the touch screen monitor designed for Windows 8. I'll be working on a plane a lot so the touch screen might be a nice alternative to the track pad when I don'...
2013/08/05
[ "https://askubuntu.com/questions/328752", "https://askubuntu.com", "https://askubuntu.com/users/181408/" ]
[KVM requires VT-X/AMD-V](http://www.linux-kvm.org/page/FAQ#What_do_I_need_to_use_KVM.3F), but VirtualBox [does not pass VT-X/AMD-V to the guest](https://forums.virtualbox.org/viewtopic.php?f=1&t=20589) operating system. Therefore, KVM can't run in VirtualBox (yet). Please track [bug ticket #4032](https://www.virtualb...
**Enable nested virtualization in KVM in UBUNTU** Before enabling nested VT feature, power off all running VMs. Next, unload KVM modules. To unload KVM module on INTEL systems, run: ``` $ sudo modprobe -r kvm_intel ``` On AMD systems: ``` $ sudo modprobe -r kvm_amd ``` Reload the KVM module with the nested feat...
328,752
I'm about to buy a Dell Precision m6700 that I plan on dual booting Windows 7 and Ubuntu 12.04 (or 12.10, feel free to comment) and I'm wondering if I should get the touch screen monitor designed for Windows 8. I'll be working on a plane a lot so the touch screen might be a nice alternative to the track pad when I don'...
2013/08/05
[ "https://askubuntu.com/questions/328752", "https://askubuntu.com", "https://askubuntu.com/users/181408/" ]
Virtualbox just released (12/18/2018) version 6 in which is expected to have nested virtualization. However, at this moment it seems is still unavailable on Intel procs. <https://www.virtualbox.org/wiki/Downloads> Regarding the main question (Enable nested virtualization in Ubuntu) - KVM module is supporting nested v...
**Enable nested virtualization in KVM in UBUNTU** Before enabling nested VT feature, power off all running VMs. Next, unload KVM modules. To unload KVM module on INTEL systems, run: ``` $ sudo modprobe -r kvm_intel ``` On AMD systems: ``` $ sudo modprobe -r kvm_amd ``` Reload the KVM module with the nested feat...
167,212
As is well known, the $\mathsf{Binomial}(n,p)$ *distribution* converges to the $\mathsf{Poisson}(a)$ distribution as $n\rightarrow \infty$, $p\rightarrow 0$ with $np=a$. I'm pretty sure that the *moments* of $\mathsf{Binomial}(n,p)$ also converge to those of $\mathsf{Poisson}(a)$, but I don't know how to prove it. Con...
2015/08/14
[ "https://stats.stackexchange.com/questions/167212", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/28285/" ]
Because the characteristic function (cf) of a Bernoulli$(p)$ variate is $$\psi\_p(t) = 1 + p(e^{it}-1),$$ the [cf of a sum of $n$ independent such variates](https://en.wikipedia.org/wiki/Binomial_distribution) (which is a Binomial$(p,n)$ variable) is $$\psi\_p(t)^n = \left(1 + p(e^{it}-1)\right)^n = \left(1 + \frac{...
I think I found an answer using [factorial moments](https://en.wikipedia.org/wiki/Factorial_moment). *Still, I will accept someone else's answer if they can shed some light into the more general case, such as giving sufficient conditions that assure convergence*. The $r$-th factorial moment of the binomial distributio...
42,259,113
I have a JSON which is returned from a Web Service Developed in PHP but I need help to converting this JSON to JSONArray in Android {"Name":"John","Contact":"3331234567"}{"Name":"Doe","Contact":"3017654321"}{"Name":"Smith","Contact":"3001234765"} How can i convert this String returned from URL to JSONArray
2017/02/15
[ "https://Stackoverflow.com/questions/42259113", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5804286/" ]
It sounds like your problems might be stemming from the fact that you're using multiple versions of ruby on the same system without a version manager. When multiple versions of ruby live on the same system, their gems and dependencies can get all criss-crossed and cause terrible problems. On Windows, I've had good luc...
My apologies for late response, lost my RubyScript.exe creation enviornment. Now re-setup on Toshiba, 64-bit, Windows10 pro. Using Ruby: ruby 2.3.3p222 (2016-11-21 revision 56859) [i386-mingw32] I got this non-Tk console application to build with ocra: ``` enter code here irb ``` using command: ``` enter code here...
23,862,511
I have table with index: ``` Table: Participates (player_id integer, other...) Indexes: "index_participates_on_player_id" btree (player_id) ``` Table contains 400kk rows. I execute the same query two times: Query: `explain analyze select * from participates where player_id=149294217;` First time: ``` Index Scan...
2014/05/26
[ "https://Stackoverflow.com/questions/23862511", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2572790/" ]
The difference in execution time is probably because the second time through, the table/index data from the first run of the query is in the `shared buffers` cache, and so the subsequent run of the query takes less time, since it doesn't have to go long-path to disk for that information. **Edit:** Regarding the slown...
1.) Take a look at <http://www.postgresql.org/docs/9.3/static/runtime-config-resource.html> and check out for some tuning for using more memory. This can speed up your search but will not give you a warranty (depending on the answer before)! 2.) Transfer a part of your tables/indexes to a more powerful tablespace. For...
71,744
I know it has a lot to do with who is graduating and how many students the professor has already, but I just want to get a feel of how this process works. Do professors take in 1-2 students each year until they don't have any more room? and then wait for some to graduate before taking in more? Someone I want to work w...
2016/06/22
[ "https://academia.stackexchange.com/questions/71744", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/47154/" ]
There is no way to guess how many students an unknown professor is likely to accept, because professors vary wildly in the number of graduate students that they accept each year. Reasons for this variation include, among others: * Amount of funding varies, from professors who are totally broke to professors who need l...
My personal observations: There are many different styles based upon which professors search for doctoral candidates, how they prefer to get in touch, how picky they are when choosing doctoral candidates1, and, in general, how much effort they tend to spend to personally guide doctoral candidates in different phases o...
2,893,484
I am doing my first steps with TDD. The problem is (as probably with everyone starting with TDD), I never know very well what kind of unit tests to do when I start working in my projects. Let's assume I want to write a Stack class with the following methods(I choose it as it's an easy example): ``` Stack<T> - Push(e...
2010/05/23
[ "https://Stackoverflow.com/questions/2893484", "https://Stackoverflow.com", "https://Stackoverflow.com/users/130758/" ]
Start by testing the basic principles of your API. Test on zero elements. * Test that it's empty. * Count is zero. * Pop fails. Test on one element: * Call Push. * Test that it's not empty. * Test that count is 1. * Test that Pop returns the element. * Test that it's now empty. * Test that count is now 0. Test on ...
I would start like this: * `create()` - `IsEmpty()` == true -> OK * 2x `push()` - `count()` == 2 -> OK * `peek()` - T == expected (last pushed) -> OK (peek assumes seek is a typo) * 2x `pop()` - `count()` == 0 && isEmppty -> OK
2,893,484
I am doing my first steps with TDD. The problem is (as probably with everyone starting with TDD), I never know very well what kind of unit tests to do when I start working in my projects. Let's assume I want to write a Stack class with the following methods(I choose it as it's an easy example): ``` Stack<T> - Push(e...
2010/05/23
[ "https://Stackoverflow.com/questions/2893484", "https://Stackoverflow.com", "https://Stackoverflow.com/users/130758/" ]
If you write out the requirements for each method in a little more detail, that will give you more hints as to the unit tests you need. You can then code up these tests. If you have an autocomplete IDE, like IDEA, then doing TDD is simple, because it underlines all the bits that you haven't implemented yet. For examp...
I would start like this: * `create()` - `IsEmpty()` == true -> OK * 2x `push()` - `count()` == 2 -> OK * `peek()` - T == expected (last pushed) -> OK (peek assumes seek is a typo) * 2x `pop()` - `count()` == 0 && isEmppty -> OK
2,893,484
I am doing my first steps with TDD. The problem is (as probably with everyone starting with TDD), I never know very well what kind of unit tests to do when I start working in my projects. Let's assume I want to write a Stack class with the following methods(I choose it as it's an easy example): ``` Stack<T> - Push(e...
2010/05/23
[ "https://Stackoverflow.com/questions/2893484", "https://Stackoverflow.com", "https://Stackoverflow.com/users/130758/" ]
Start by testing the basic principles of your API. Test on zero elements. * Test that it's empty. * Count is zero. * Pop fails. Test on one element: * Call Push. * Test that it's not empty. * Test that count is 1. * Test that Pop returns the element. * Test that it's now empty. * Test that count is now 0. Test on ...
If you write out the requirements for each method in a little more detail, that will give you more hints as to the unit tests you need. You can then code up these tests. If you have an autocomplete IDE, like IDEA, then doing TDD is simple, because it underlines all the bits that you haven't implemented yet. For examp...
2,893,484
I am doing my first steps with TDD. The problem is (as probably with everyone starting with TDD), I never know very well what kind of unit tests to do when I start working in my projects. Let's assume I want to write a Stack class with the following methods(I choose it as it's an easy example): ``` Stack<T> - Push(e...
2010/05/23
[ "https://Stackoverflow.com/questions/2893484", "https://Stackoverflow.com", "https://Stackoverflow.com/users/130758/" ]
Start by testing the basic principles of your API. Test on zero elements. * Test that it's empty. * Count is zero. * Pop fails. Test on one element: * Call Push. * Test that it's not empty. * Test that count is 1. * Test that Pop returns the element. * Test that it's now empty. * Test that count is now 0. Test on ...
Ideally the tests have to cover all functionalities of the class. They should check whether each operation behaves according to its contract. Theoretically speaking, I see the contract as a mapping between <prev state , params> to <new state , returned value>. Therefore, before designing the tests you should define wel...
2,893,484
I am doing my first steps with TDD. The problem is (as probably with everyone starting with TDD), I never know very well what kind of unit tests to do when I start working in my projects. Let's assume I want to write a Stack class with the following methods(I choose it as it's an easy example): ``` Stack<T> - Push(e...
2010/05/23
[ "https://Stackoverflow.com/questions/2893484", "https://Stackoverflow.com", "https://Stackoverflow.com/users/130758/" ]
Start by testing the basic principles of your API. Test on zero elements. * Test that it's empty. * Count is zero. * Pop fails. Test on one element: * Call Push. * Test that it's not empty. * Test that count is 1. * Test that Pop returns the element. * Test that it's now empty. * Test that count is now 0. Test on ...
If you read [the book](https://rads.stackoverflow.com/amzn/click/com/0321146530) about the Test-Driven development by Kent Beck, you might have noticed an idea that sounds frequently in the book: you should write tests to what you are curently missing. As long as you do not need something, do not write tests and do not...
2,893,484
I am doing my first steps with TDD. The problem is (as probably with everyone starting with TDD), I never know very well what kind of unit tests to do when I start working in my projects. Let's assume I want to write a Stack class with the following methods(I choose it as it's an easy example): ``` Stack<T> - Push(e...
2010/05/23
[ "https://Stackoverflow.com/questions/2893484", "https://Stackoverflow.com", "https://Stackoverflow.com/users/130758/" ]
If you write out the requirements for each method in a little more detail, that will give you more hints as to the unit tests you need. You can then code up these tests. If you have an autocomplete IDE, like IDEA, then doing TDD is simple, because it underlines all the bits that you haven't implemented yet. For examp...
Ideally the tests have to cover all functionalities of the class. They should check whether each operation behaves according to its contract. Theoretically speaking, I see the contract as a mapping between <prev state , params> to <new state , returned value>. Therefore, before designing the tests you should define wel...
2,893,484
I am doing my first steps with TDD. The problem is (as probably with everyone starting with TDD), I never know very well what kind of unit tests to do when I start working in my projects. Let's assume I want to write a Stack class with the following methods(I choose it as it's an easy example): ``` Stack<T> - Push(e...
2010/05/23
[ "https://Stackoverflow.com/questions/2893484", "https://Stackoverflow.com", "https://Stackoverflow.com/users/130758/" ]
If you write out the requirements for each method in a little more detail, that will give you more hints as to the unit tests you need. You can then code up these tests. If you have an autocomplete IDE, like IDEA, then doing TDD is simple, because it underlines all the bits that you haven't implemented yet. For examp...
If you read [the book](https://rads.stackoverflow.com/amzn/click/com/0321146530) about the Test-Driven development by Kent Beck, you might have noticed an idea that sounds frequently in the book: you should write tests to what you are curently missing. As long as you do not need something, do not write tests and do not...
22,059
I was watching BBC Click today, and they showed this website where there was a picture that, when zoomed in, it does not get hazy. You actually zoom straight into another picture, and this just goes on and on. It is like a sort of infinite zooming. **Could anyone tell me the name of this and even a place on the net wh...
2013/10/20
[ "https://graphicdesign.stackexchange.com/questions/22059", "https://graphicdesign.stackexchange.com", "https://graphicdesign.stackexchange.com/users/16080/" ]
It's now been 8 months since I posed the question, and I've spent a lot of time evaluating various answers here (as well as suggestions posed in other places). I'm confident saying that there was a "best" answer here based on an 8 month project. Indeed, on the basis of a vast amount of empirical data collected, there i...
If you have an iOS device, FontBook is a fun app. From their [site](http://www.fontbook.com): > > If typography were a religion, this would be the Bible. FontBook is the world’s most comprehensive typographic reference tool, documenting the libraries of over 130 international type foundries who publish the works of m...
22,059
I was watching BBC Click today, and they showed this website where there was a picture that, when zoomed in, it does not get hazy. You actually zoom straight into another picture, and this just goes on and on. It is like a sort of infinite zooming. **Could anyone tell me the name of this and even a place on the net wh...
2013/10/20
[ "https://graphicdesign.stackexchange.com/questions/22059", "https://graphicdesign.stackexchange.com", "https://graphicdesign.stackexchange.com/users/16080/" ]
The Precision Type Font Reference Guide version 5.0 published in 1995 listed 13,000+ fonts --- even at that time, there were estimated to be over 20,000 designs. There hasn't been a single comprehensive list of all type designs since shortly after Gutenberg.
I don't think there can ever be a master list considering fonts are being released every day, but [Typedia](http://typedia.com/) is trying. I[dentifont](http://www.identifont.com/) has a pretty decent list too.
22,059
I was watching BBC Click today, and they showed this website where there was a picture that, when zoomed in, it does not get hazy. You actually zoom straight into another picture, and this just goes on and on. It is like a sort of infinite zooming. **Could anyone tell me the name of this and even a place on the net wh...
2013/10/20
[ "https://graphicdesign.stackexchange.com/questions/22059", "https://graphicdesign.stackexchange.com", "https://graphicdesign.stackexchange.com/users/16080/" ]
The Precision Type Font Reference Guide version 5.0 published in 1995 listed 13,000+ fonts --- even at that time, there were estimated to be over 20,000 designs. There hasn't been a single comprehensive list of all type designs since shortly after Gutenberg.
No, there is no master list. (la la la, a few extra characters to make answer valid...)
22,059
I was watching BBC Click today, and they showed this website where there was a picture that, when zoomed in, it does not get hazy. You actually zoom straight into another picture, and this just goes on and on. It is like a sort of infinite zooming. **Could anyone tell me the name of this and even a place on the net wh...
2013/10/20
[ "https://graphicdesign.stackexchange.com/questions/22059", "https://graphicdesign.stackexchange.com", "https://graphicdesign.stackexchange.com/users/16080/" ]
While a good idea on paper (riffing off of @WillAdams answer), there is little practicality or feasibility in compiling such a list, especially since licenses will change over time. Between Adobe and Monotype, there are *at least* 20k currently in circulation, and then there are the uncounted boutique type foundries pu...
It's now been 8 months since I posed the question, and I've spent a lot of time evaluating various answers here (as well as suggestions posed in other places). I'm confident saying that there was a "best" answer here based on an 8 month project. Indeed, on the basis of a vast amount of empirical data collected, there i...
22,059
I was watching BBC Click today, and they showed this website where there was a picture that, when zoomed in, it does not get hazy. You actually zoom straight into another picture, and this just goes on and on. It is like a sort of infinite zooming. **Could anyone tell me the name of this and even a place on the net wh...
2013/10/20
[ "https://graphicdesign.stackexchange.com/questions/22059", "https://graphicdesign.stackexchange.com", "https://graphicdesign.stackexchange.com/users/16080/" ]
The Precision Type Font Reference Guide version 5.0 published in 1995 listed 13,000+ fonts --- even at that time, there were estimated to be over 20,000 designs. There hasn't been a single comprehensive list of all type designs since shortly after Gutenberg.
If you have an iOS device, FontBook is a fun app. From their [site](http://www.fontbook.com): > > If typography were a religion, this would be the Bible. FontBook is the world’s most comprehensive typographic reference tool, documenting the libraries of over 130 international type foundries who publish the works of m...
22,059
I was watching BBC Click today, and they showed this website where there was a picture that, when zoomed in, it does not get hazy. You actually zoom straight into another picture, and this just goes on and on. It is like a sort of infinite zooming. **Could anyone tell me the name of this and even a place on the net wh...
2013/10/20
[ "https://graphicdesign.stackexchange.com/questions/22059", "https://graphicdesign.stackexchange.com", "https://graphicdesign.stackexchange.com/users/16080/" ]
I don't think there can ever be a master list considering fonts are being released every day, but [Typedia](http://typedia.com/) is trying. I[dentifont](http://www.identifont.com/) has a pretty decent list too.
If you have an iOS device, FontBook is a fun app. From their [site](http://www.fontbook.com): > > If typography were a religion, this would be the Bible. FontBook is the world’s most comprehensive typographic reference tool, documenting the libraries of over 130 international type foundries who publish the works of m...
22,059
I was watching BBC Click today, and they showed this website where there was a picture that, when zoomed in, it does not get hazy. You actually zoom straight into another picture, and this just goes on and on. It is like a sort of infinite zooming. **Could anyone tell me the name of this and even a place on the net wh...
2013/10/20
[ "https://graphicdesign.stackexchange.com/questions/22059", "https://graphicdesign.stackexchange.com", "https://graphicdesign.stackexchange.com/users/16080/" ]
No, there is no master list. (la la la, a few extra characters to make answer valid...)
If you have an iOS device, FontBook is a fun app. From their [site](http://www.fontbook.com): > > If typography were a religion, this would be the Bible. FontBook is the world’s most comprehensive typographic reference tool, documenting the libraries of over 130 international type foundries who publish the works of m...
22,059
I was watching BBC Click today, and they showed this website where there was a picture that, when zoomed in, it does not get hazy. You actually zoom straight into another picture, and this just goes on and on. It is like a sort of infinite zooming. **Could anyone tell me the name of this and even a place on the net wh...
2013/10/20
[ "https://graphicdesign.stackexchange.com/questions/22059", "https://graphicdesign.stackexchange.com", "https://graphicdesign.stackexchange.com/users/16080/" ]
While a good idea on paper (riffing off of @WillAdams answer), there is little practicality or feasibility in compiling such a list, especially since licenses will change over time. Between Adobe and Monotype, there are *at least* 20k currently in circulation, and then there are the uncounted boutique type foundries pu...
If you have an iOS device, FontBook is a fun app. From their [site](http://www.fontbook.com): > > If typography were a religion, this would be the Bible. FontBook is the world’s most comprehensive typographic reference tool, documenting the libraries of over 130 international type foundries who publish the works of m...
22,059
I was watching BBC Click today, and they showed this website where there was a picture that, when zoomed in, it does not get hazy. You actually zoom straight into another picture, and this just goes on and on. It is like a sort of infinite zooming. **Could anyone tell me the name of this and even a place on the net wh...
2013/10/20
[ "https://graphicdesign.stackexchange.com/questions/22059", "https://graphicdesign.stackexchange.com", "https://graphicdesign.stackexchange.com/users/16080/" ]
The Precision Type Font Reference Guide version 5.0 published in 1995 listed 13,000+ fonts --- even at that time, there were estimated to be over 20,000 designs. There hasn't been a single comprehensive list of all type designs since shortly after Gutenberg.
It's now been 8 months since I posed the question, and I've spent a lot of time evaluating various answers here (as well as suggestions posed in other places). I'm confident saying that there was a "best" answer here based on an 8 month project. Indeed, on the basis of a vast amount of empirical data collected, there i...
22,059
I was watching BBC Click today, and they showed this website where there was a picture that, when zoomed in, it does not get hazy. You actually zoom straight into another picture, and this just goes on and on. It is like a sort of infinite zooming. **Could anyone tell me the name of this and even a place on the net wh...
2013/10/20
[ "https://graphicdesign.stackexchange.com/questions/22059", "https://graphicdesign.stackexchange.com", "https://graphicdesign.stackexchange.com/users/16080/" ]
While a good idea on paper (riffing off of @WillAdams answer), there is little practicality or feasibility in compiling such a list, especially since licenses will change over time. Between Adobe and Monotype, there are *at least* 20k currently in circulation, and then there are the uncounted boutique type foundries pu...
No, there is no master list. (la la la, a few extra characters to make answer valid...)
17,909,620
Which is the best way to find all elements from page which match the size i need, and less browser overloading ? the most important thing is to make it so that the browser will not overload and will not crash if on page are a lot of elements. what i'm using now is: ``` elements = document.getElementsByTagName("*");...
2013/07/28
[ "https://Stackoverflow.com/questions/17909620", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
From [the documentation](http://www.playframework.com/documentation/1.2.4/ide): > > Play provides a command to simplify Eclipse configuration. To transform a Play application into a working Eclipse project, use the eclipsify command: > > > ``` # play eclipsify myApp ``` > > You then need to import the applicat...
For newer versions of play the command is `play eclipse` Then File -> Import.. -> Existing Projects into workspace Don't check any boxes (ignore 'copy projects into workspace')
17,909,620
Which is the best way to find all elements from page which match the size i need, and less browser overloading ? the most important thing is to make it so that the browser will not overload and will not crash if on page are a lot of elements. what i'm using now is: ``` elements = document.getElementsByTagName("*");...
2013/07/28
[ "https://Stackoverflow.com/questions/17909620", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
From [the documentation](http://www.playframework.com/documentation/1.2.4/ide): > > Play provides a command to simplify Eclipse configuration. To transform a Play application into a working Eclipse project, use the eclipsify command: > > > ``` # play eclipsify myApp ``` > > You then need to import the applicat...
Excellent, I agree with @JB Nizet and Connor.However this answer applies to old version of PLAY framework. My answer might be helpful for developers using Play Framework 2.3+ and come searching, the command to transform a Play application into a working Eclipse project. * CD into your project source folder * Run Activ...
3,971,035
Can anyone send a solution or hint to these problem? I tried a greedy algorithm but couldn’t make it work[![enter image description here](https://i.stack.imgur.com/rhAhx.jpg)](https://i.stack.imgur.com/rhAhx.jpg)
2021/01/03
[ "https://math.stackexchange.com/questions/3971035", "https://math.stackexchange.com", "https://math.stackexchange.com/users/846922/" ]
Of the finitely many possible pairings, choose one for which the sum of the lengths of the line segments is least. **Claim:**$\;$For such a pairing, no two line segments intersect. Suppose for such a pairing the line segments $AC$ and $BD$ intersect at $P$. Then $ABCD$ is a convex quadrilateral with diagonals inters...
Form the convex hull of the $2n$ points, and let $x$ and $y$ be adjacent extreme points. Then you can join $x$ with $y$, and pair up the remaining $2n-2$ points by induction.
44,244,955
I am making a haiku generator in kotlin but I am getting a weird 'variable firstLineArray must be initialized' on this block of code. ``` import java.util.Random fun oneSyllableWords() : String{ val oneSyllableWordArray = arrayOf("Life", "Love", "One", "On", "No", "Go") val random = Random() val randint =...
2017/05/29
[ "https://Stackoverflow.com/questions/44244955", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6568310/" ]
You have to initialize your variable with a value. Arrays are fixed size containers, if I'm right that you need an array with a length of 5 here, you can use the following to create it with 5 empty strings as a start: ``` var firstLineArray: Array<String> = Array(5) { "" } ``` Or if you're okay with having an `Array...
you forget init the array: Ways: ``` var firstLineArray = Array<String>() ``` or ``` var firstLineArray = Array (0, { i -> "" }) ``` or ``` var firstLineArray = emptyArray<String>() ```
44,244,955
I am making a haiku generator in kotlin but I am getting a weird 'variable firstLineArray must be initialized' on this block of code. ``` import java.util.Random fun oneSyllableWords() : String{ val oneSyllableWordArray = arrayOf("Life", "Love", "One", "On", "No", "Go") val random = Random() val randint =...
2017/05/29
[ "https://Stackoverflow.com/questions/44244955", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6568310/" ]
you forget init the array: Ways: ``` var firstLineArray = Array<String>() ``` or ``` var firstLineArray = Array (0, { i -> "" }) ``` or ``` var firstLineArray = emptyArray<String>() ```
``` val read = Scanner(System.'in') print("Enter length: ") val length = read.nextInt() var arry: Array<Int> = Array(length){0} for(i in 1..length-1){ arry[i] = read.nextInt() } ``` To read the int values from the input and store the Array as integers
44,244,955
I am making a haiku generator in kotlin but I am getting a weird 'variable firstLineArray must be initialized' on this block of code. ``` import java.util.Random fun oneSyllableWords() : String{ val oneSyllableWordArray = arrayOf("Life", "Love", "One", "On", "No", "Go") val random = Random() val randint =...
2017/05/29
[ "https://Stackoverflow.com/questions/44244955", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6568310/" ]
You have to initialize your variable with a value. Arrays are fixed size containers, if I'm right that you need an array with a length of 5 here, you can use the following to create it with 5 empty strings as a start: ``` var firstLineArray: Array<String> = Array(5) { "" } ``` Or if you're okay with having an `Array...
You can initialize a String array by the below code: ``` var firstLineArray = arrayOfNulls<String>(5) ``` The above code will give a String array containing null. It returns `Array<String?>` ``` var firstLineArray = Array<String>(5) { "it = $it" } // returns Array<String> var firstLineArray = arrayOf("a", "b", "c"...
44,244,955
I am making a haiku generator in kotlin but I am getting a weird 'variable firstLineArray must be initialized' on this block of code. ``` import java.util.Random fun oneSyllableWords() : String{ val oneSyllableWordArray = arrayOf("Life", "Love", "One", "On", "No", "Go") val random = Random() val randint =...
2017/05/29
[ "https://Stackoverflow.com/questions/44244955", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6568310/" ]
You have to initialize your variable with a value. Arrays are fixed size containers, if I'm right that you need an array with a length of 5 here, you can use the following to create it with 5 empty strings as a start: ``` var firstLineArray: Array<String> = Array(5) { "" } ``` Or if you're okay with having an `Array...
``` val read = Scanner(System.'in') print("Enter length: ") val length = read.nextInt() var arry: Array<Int> = Array(length){0} for(i in 1..length-1){ arry[i] = read.nextInt() } ``` To read the int values from the input and store the Array as integers
44,244,955
I am making a haiku generator in kotlin but I am getting a weird 'variable firstLineArray must be initialized' on this block of code. ``` import java.util.Random fun oneSyllableWords() : String{ val oneSyllableWordArray = arrayOf("Life", "Love", "One", "On", "No", "Go") val random = Random() val randint =...
2017/05/29
[ "https://Stackoverflow.com/questions/44244955", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6568310/" ]
You can initialize a String array by the below code: ``` var firstLineArray = arrayOfNulls<String>(5) ``` The above code will give a String array containing null. It returns `Array<String?>` ``` var firstLineArray = Array<String>(5) { "it = $it" } // returns Array<String> var firstLineArray = arrayOf("a", "b", "c"...
``` val read = Scanner(System.'in') print("Enter length: ") val length = read.nextInt() var arry: Array<Int> = Array(length){0} for(i in 1..length-1){ arry[i] = read.nextInt() } ``` To read the int values from the input and store the Array as integers
18,112,578
``` x:=1 ;All of these (silently) fail IfGreater,x, false, EnvAdd, x, 1 IfEqual,false,%x%, EnvAdd, x, 1 IfEqual,true,x, EnvAdd, x, 1 IfEqual,1,1, EnvAdd, x, 1 If x, EnvAdd, x, 1 If (x), EnvAdd, x, 1 tf:=true if true, EnvAdd, x, 1 if tf, EnvAdd, x, 1 ;If %x%, EnvAdd, x, 1 If 1, EnvAdd, x, 1 If 0, EnvAdd, x, 1 ; ;though ...
2013/08/07
[ "https://Stackoverflow.com/questions/18112578", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2557514/" ]
Have you looked into using ternary operators? Example: ``` Age := 60 Msgbox % "You " ((Age < 45) ? ("are under 45") : ("are over 45")) ``` [There is a good guide here.](http://www.autohotkey.com/board/topic/27201-vxes-guide-to-the-ternary-operator/) Though it is most useful when doing variable assignment or returni...
No, AutoHotkey doesn't really do much by way of 1-liners (except for remapping of hotkeys). But you can wrap an if statement in a function or a sub which you can then run on a single line.. ``` x = 0 EnvAdd(x) ;x stays 0 EnvAdd(1) ;x becomes 2 EnvAdd(x) ;x becomes 3 ;since x is global, EnvAdd will modify x ...
18,112,578
``` x:=1 ;All of these (silently) fail IfGreater,x, false, EnvAdd, x, 1 IfEqual,false,%x%, EnvAdd, x, 1 IfEqual,true,x, EnvAdd, x, 1 IfEqual,1,1, EnvAdd, x, 1 If x, EnvAdd, x, 1 If (x), EnvAdd, x, 1 tf:=true if true, EnvAdd, x, 1 if tf, EnvAdd, x, 1 ;If %x%, EnvAdd, x, 1 If 1, EnvAdd, x, 1 If 0, EnvAdd, x, 1 ; ;though ...
2013/08/07
[ "https://Stackoverflow.com/questions/18112578", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2557514/" ]
Ah, so one can simply say ``` x+=x?1:0 ``` i used to think AutoHotKey`s sytax was Byzantine. Now i just think it bizarre. Eg with this blatant contradiction of its documentation. But i quess that comes from trying to track Microsoft.
No, AutoHotkey doesn't really do much by way of 1-liners (except for remapping of hotkeys). But you can wrap an if statement in a function or a sub which you can then run on a single line.. ``` x = 0 EnvAdd(x) ;x stays 0 EnvAdd(1) ;x becomes 2 EnvAdd(x) ;x becomes 3 ;since x is global, EnvAdd will modify x ...
18,112,578
``` x:=1 ;All of these (silently) fail IfGreater,x, false, EnvAdd, x, 1 IfEqual,false,%x%, EnvAdd, x, 1 IfEqual,true,x, EnvAdd, x, 1 IfEqual,1,1, EnvAdd, x, 1 If x, EnvAdd, x, 1 If (x), EnvAdd, x, 1 tf:=true if true, EnvAdd, x, 1 if tf, EnvAdd, x, 1 ;If %x%, EnvAdd, x, 1 If 1, EnvAdd, x, 1 If 0, EnvAdd, x, 1 ; ;though ...
2013/08/07
[ "https://Stackoverflow.com/questions/18112578", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2557514/" ]
Even better one could write: ``` test ? x:=y+1 or test ? statement ``` And the (pseudo) IF statement approaches intelligibility!
No, AutoHotkey doesn't really do much by way of 1-liners (except for remapping of hotkeys). But you can wrap an if statement in a function or a sub which you can then run on a single line.. ``` x = 0 EnvAdd(x) ;x stays 0 EnvAdd(1) ;x becomes 2 EnvAdd(x) ;x becomes 3 ;since x is global, EnvAdd will modify x ...
18,112,578
``` x:=1 ;All of these (silently) fail IfGreater,x, false, EnvAdd, x, 1 IfEqual,false,%x%, EnvAdd, x, 1 IfEqual,true,x, EnvAdd, x, 1 IfEqual,1,1, EnvAdd, x, 1 If x, EnvAdd, x, 1 If (x), EnvAdd, x, 1 tf:=true if true, EnvAdd, x, 1 if tf, EnvAdd, x, 1 ;If %x%, EnvAdd, x, 1 If 1, EnvAdd, x, 1 If 0, EnvAdd, x, 1 ; ;though ...
2013/08/07
[ "https://Stackoverflow.com/questions/18112578", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2557514/" ]
Even better one could write: ``` test ? x:=y+1 or test ? statement ``` And the (pseudo) IF statement approaches intelligibility!
Have you looked into using ternary operators? Example: ``` Age := 60 Msgbox % "You " ((Age < 45) ? ("are under 45") : ("are over 45")) ``` [There is a good guide here.](http://www.autohotkey.com/board/topic/27201-vxes-guide-to-the-ternary-operator/) Though it is most useful when doing variable assignment or returni...
18,112,578
``` x:=1 ;All of these (silently) fail IfGreater,x, false, EnvAdd, x, 1 IfEqual,false,%x%, EnvAdd, x, 1 IfEqual,true,x, EnvAdd, x, 1 IfEqual,1,1, EnvAdd, x, 1 If x, EnvAdd, x, 1 If (x), EnvAdd, x, 1 tf:=true if true, EnvAdd, x, 1 if tf, EnvAdd, x, 1 ;If %x%, EnvAdd, x, 1 If 1, EnvAdd, x, 1 If 0, EnvAdd, x, 1 ; ;though ...
2013/08/07
[ "https://Stackoverflow.com/questions/18112578", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2557514/" ]
Even better one could write: ``` test ? x:=y+1 or test ? statement ``` And the (pseudo) IF statement approaches intelligibility!
Ah, so one can simply say ``` x+=x?1:0 ``` i used to think AutoHotKey`s sytax was Byzantine. Now i just think it bizarre. Eg with this blatant contradiction of its documentation. But i quess that comes from trying to track Microsoft.
22,979,534
``` while((str=br.readLine())!=null) { String line1=str; String line2=br.readLine(); int datedifference=Integer.parseInt(line2.substring(8,10))-Integer.parseInt(line1.substring(8,10)); int yeardifference=Integer.parseInt(line2.substring(11,15))-Integer.parseInt(lin...
2014/04/10
[ "https://Stackoverflow.com/questions/22979534", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
There is a bit to this, so I'll explain everything that I did in order. 1. Brown/Yellow bars' container ------------------------------- In order to get those two brown and yellow bars at the bottom, you need a container for them. Since there is black around them, I simply created a 100% x 40px div with a black backgr...
I made this [flexbox text overlaying on an image](https://codepen.io/MengruZhang/pen/bvxWEw) ```css .wrapper { display: flex; flex-flow: row wrap; font-weight: bold; text-align: center; } .wrapper > * { padding: 10px; flex: 1 100%; } .header { background: tomato; } .footer { backgrou...
1,579,881
I have a docker mysql 8 container that I have been using for a couple years. Suddenly out of no where it won't start with these errors: ``` [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive ... [ERROR] [MY-011087] [Server] Different lower_case_t...
2020/08/22
[ "https://superuser.com/questions/1579881", "https://superuser.com", "https://superuser.com/users/248120/" ]
My issue was caused by the latest version of Docker 2.3.5.0. This update is what caused the problem: > > Docker Desktop now uses gRPC-FUSE for file sharing by default. This > has much faster file sharing and uses much less CPU than osxfs, > especially when there are lots of file events on the host. > > > Once I d...
The variable `lower_case_table_names` should be set at the time of initialization. Try setting it while you run your docker, so that it will be picked during initialization, ``` "mysql-8.0": container_name: "mysql-8.0" image: mysql:8.0 restart: always networks: - matrix command: --lower_case_...
1,579,881
I have a docker mysql 8 container that I have been using for a couple years. Suddenly out of no where it won't start with these errors: ``` [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive ... [ERROR] [MY-011087] [Server] Different lower_case_t...
2020/08/22
[ "https://superuser.com/questions/1579881", "https://superuser.com", "https://superuser.com/users/248120/" ]
The variable `lower_case_table_names` should be set at the time of initialization. Try setting it while you run your docker, so that it will be picked during initialization, ``` "mysql-8.0": container_name: "mysql-8.0" image: mysql:8.0 restart: always networks: - matrix command: --lower_case_...
Please see this response also (no need to downgrade, just turn off the option to use gRPC-FUSE in Docker prefs): <https://stackoverflow.com/questions/64146845/mysql-not-starting-in-a-docker-container-on-macos-after-docker-update> (edit: was on Docker Mac 3.0.4 at time of this, results may vary for users depending on ve...
1,579,881
I have a docker mysql 8 container that I have been using for a couple years. Suddenly out of no where it won't start with these errors: ``` [Warning] [MY-010159] [Server] Setting lower_case_table_names=2 because file system for /var/lib/mysql/ is case insensitive ... [ERROR] [MY-011087] [Server] Different lower_case_t...
2020/08/22
[ "https://superuser.com/questions/1579881", "https://superuser.com", "https://superuser.com/users/248120/" ]
My issue was caused by the latest version of Docker 2.3.5.0. This update is what caused the problem: > > Docker Desktop now uses gRPC-FUSE for file sharing by default. This > has much faster file sharing and uses much less CPU than osxfs, > especially when there are lots of file events on the host. > > > Once I d...
Please see this response also (no need to downgrade, just turn off the option to use gRPC-FUSE in Docker prefs): <https://stackoverflow.com/questions/64146845/mysql-not-starting-in-a-docker-container-on-macos-after-docker-update> (edit: was on Docker Mac 3.0.4 at time of this, results may vary for users depending on ve...
51,540,177
Trying to bind int value from properties file using spring But everytime getting below exception : ``` Failed to instantiate [org.springframework.amqp.rabbit.connection.ConnectionFactory]: Factory method 'connectionFactory' threw exception; nested exception is java.lang.NumberFormatException: For input string: \"${r...
2018/07/26
[ "https://Stackoverflow.com/questions/51540177", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4969916/" ]
**[Working fiddle](http://jsfiddle.net/z_acharki/4dmxf8zj/1/)**. You could simply invoke the click event using : ``` radios[1].click(); ``` **Edit:** The problem happens since you're attaching the click event to all the radio button in the current document in the following line : ``` var radios = document.querySe...
EDIT: I think it is the addition of the other radio buttons are being added to the same group so second is not your second radio but 5th so this will now work ``` radioClickHandler.apply(radios[5]); ``` <http://jsfiddle.net/wy9xbhdo/>
51,540,177
Trying to bind int value from properties file using spring But everytime getting below exception : ``` Failed to instantiate [org.springframework.amqp.rabbit.connection.ConnectionFactory]: Factory method 'connectionFactory' threw exception; nested exception is java.lang.NumberFormatException: For input string: \"${r...
2018/07/26
[ "https://Stackoverflow.com/questions/51540177", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4969916/" ]
**[Working fiddle](http://jsfiddle.net/z_acharki/4dmxf8zj/1/)**. You could simply invoke the click event using : ``` radios[1].click(); ``` **Edit:** The problem happens since you're attaching the click event to all the radio button in the current document in the following line : ``` var radios = document.querySe...
The `onchange` or `onclick` event does not fire when the selected option of the select object is changed programmatically or you fill the input value programmatically. So you do require to trigger that `onchange` or `onclick` after changing it in `window.onload` or `init` function. To trigger the event use [How to tr...
2,650,370
> > Finding smallest positive root of the equation $\sqrt{\sin(1-x)}=\sqrt{\cos x}$ > > > Try: $\sin(1-x)=\cos x= \sin\bigg(\frac{\pi}{2}-x\bigg)$ $1-x=n\pi+(-1)^n\bigg(\frac{\pi}{2}-x\bigg)$ Could some help me to solve it, Thanks
2018/02/14
[ "https://math.stackexchange.com/questions/2650370", "https://math.stackexchange.com", "https://math.stackexchange.com/users/372201/" ]
If $n$ is even, then the equation becomes $$1-x=n\pi +\frac\pi2 -x$$ which simplifies to $$1=n\pi + \frac\pi2$$ which is clearly not true for any value of $n\in\mathbb N$. --- For odd values of $n$, the equation is $$1-x=n\pi -\frac\pi2 + x$$ simplifying to $$1-n\pi + \frac\pi2 = 2x$$ and is solvable for $x$. ...
If you square both sides, and apply sum of angles formula, you get $$\sin 1\cos x - \sin x \cos 1 = \cos x.$$ Divide by $\cos x \cos 1$ to get $$\tan 1 -\tan x = \sec 1$$ so that $x = \arctan(\tan 1 - \sec 1).$ This is not as satisfying as @5xum 's answer, but I thought it was interesting.
51,847,940
I have to prepare a form.blade.php for date changing, my problem is with loading styles or something near connected. Here are my files: ``` _form.blade.php <div class='form-group'> <div class="input-group datepicker"> <input type="text" class="form-control"> <div...
2018/08/14
[ "https://Stackoverflow.com/questions/51847940", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9542556/" ]
This has nothing to do with Laravel, it seems that styles from your datepicker and datetimepicker plugins (since they are two different plugins) are having conflict, you should have used just one javascript plugin to handle both, or use libraries that don't collapse with others. **EDIT:** Actually, your datetimepicke...
**You are trying to attach datetimepicker to a div which is wrong** You must attach datetimepicker to an input so that it can be sent to server: Make an input field and give any class and attach datetimepicker using it ``` <input type="text" name="time" class="form-control mydatetime"> $(document).ready(function()...
13,298,029
I am trying to get a rolling 12 month total from a set of data that provides the minutes for a given month and year. In many cases, I will not have a a record for a month. Is there a way to display the missing months with a zero (0) for the value and then roll it up or not display them but have the query acknowledge th...
2012/11/08
[ "https://Stackoverflow.com/questions/13298029", "https://Stackoverflow.com", "https://Stackoverflow.com/users/936633/" ]
Use `theme()`: ``` d <- data.frame(x=gl(10, 1, 10, labels=paste("long text label ", letters[1:10])), y=rnorm(10)) ggplot(d, aes(x=x, y=y)) + geom_point() + theme(text = element_text(size=20), axis.text.x = element_text(angle=90, hjust=1)) #vjust adjust the vertical justification of the labels, which is of...
Use theme(): ``` d <- data.frame(x=gl(10, 1, 10, labels=paste("long text label ", letters[1:10])), y=rnorm(10)) ggplot(d, aes(x=x, y=y)) + geom_point() + theme(text = element_text(size=20)) ```
13,298,029
I am trying to get a rolling 12 month total from a set of data that provides the minutes for a given month and year. In many cases, I will not have a a record for a month. Is there a way to display the missing months with a zero (0) for the value and then roll it up or not display them but have the query acknowledge th...
2012/11/08
[ "https://Stackoverflow.com/questions/13298029", "https://Stackoverflow.com", "https://Stackoverflow.com/users/936633/" ]
Adding to previous solutions, you can also specify the font size *relative* to the `base_size` included in themes such as `theme_bw()` (where `base_size` is 11) using the `rel()` function. For example: ``` ggplot(mtcars, aes(disp, mpg)) + geom_point() + theme_bw() + theme(axis.text.x=element_text(size=rel(0.5),...
Another way to deal with overlapping labels is using `guide = guide_axis(n.dodge = 2)`. ``` library(dplyr) library(tibble) library(ggplot2) dt <- mtcars %>% rownames_to_column("name") %>% dplyr::filter(cyl == 4) # Overlapping labels ggplot(dt, aes(x = name, y = mpg)) + geom_point() ``` [![enter image descripti...
13,298,029
I am trying to get a rolling 12 month total from a set of data that provides the minutes for a given month and year. In many cases, I will not have a a record for a month. Is there a way to display the missing months with a zero (0) for the value and then roll it up or not display them but have the query acknowledge th...
2012/11/08
[ "https://Stackoverflow.com/questions/13298029", "https://Stackoverflow.com", "https://Stackoverflow.com/users/936633/" ]
Use `theme()`: ``` d <- data.frame(x=gl(10, 1, 10, labels=paste("long text label ", letters[1:10])), y=rnorm(10)) ggplot(d, aes(x=x, y=y)) + geom_point() + theme(text = element_text(size=20), axis.text.x = element_text(angle=90, hjust=1)) #vjust adjust the vertical justification of the labels, which is of...
Using "fill" attribute helps in cases like this. You can remove the text from axis using `element_blank()`and show multi color bar chart with a legend. I am plotting a part removal frequency in a repair shop as below ``` ggplot(data=df_subset,aes(x=Part,y=Removal_Frequency,fill=Part))+geom_bar(stat="identity")+theme(a...
13,298,029
I am trying to get a rolling 12 month total from a set of data that provides the minutes for a given month and year. In many cases, I will not have a a record for a month. Is there a way to display the missing months with a zero (0) for the value and then roll it up or not display them but have the query acknowledge th...
2012/11/08
[ "https://Stackoverflow.com/questions/13298029", "https://Stackoverflow.com", "https://Stackoverflow.com/users/936633/" ]
Use `theme()`: ``` d <- data.frame(x=gl(10, 1, 10, labels=paste("long text label ", letters[1:10])), y=rnorm(10)) ggplot(d, aes(x=x, y=y)) + geom_point() + theme(text = element_text(size=20), axis.text.x = element_text(angle=90, hjust=1)) #vjust adjust the vertical justification of the labels, which is of...
When making many plots, it makes sense to set it globally (relevant part is the second line, three lines together are a working example): ``` library('ggplot2') theme_update(text = element_text(size=20)) ggplot(mpg, aes(displ, hwy, colour = class)) + geom_point() ```
13,298,029
I am trying to get a rolling 12 month total from a set of data that provides the minutes for a given month and year. In many cases, I will not have a a record for a month. Is there a way to display the missing months with a zero (0) for the value and then roll it up or not display them but have the query acknowledge th...
2012/11/08
[ "https://Stackoverflow.com/questions/13298029", "https://Stackoverflow.com", "https://Stackoverflow.com/users/936633/" ]
Use `theme()`: ``` d <- data.frame(x=gl(10, 1, 10, labels=paste("long text label ", letters[1:10])), y=rnorm(10)) ggplot(d, aes(x=x, y=y)) + geom_point() + theme(text = element_text(size=20), axis.text.x = element_text(angle=90, hjust=1)) #vjust adjust the vertical justification of the labels, which is of...
Another way to deal with overlapping labels is using `guide = guide_axis(n.dodge = 2)`. ``` library(dplyr) library(tibble) library(ggplot2) dt <- mtcars %>% rownames_to_column("name") %>% dplyr::filter(cyl == 4) # Overlapping labels ggplot(dt, aes(x = name, y = mpg)) + geom_point() ``` [![enter image descripti...
13,298,029
I am trying to get a rolling 12 month total from a set of data that provides the minutes for a given month and year. In many cases, I will not have a a record for a month. Is there a way to display the missing months with a zero (0) for the value and then roll it up or not display them but have the query acknowledge th...
2012/11/08
[ "https://Stackoverflow.com/questions/13298029", "https://Stackoverflow.com", "https://Stackoverflow.com/users/936633/" ]
Adding to previous solutions, you can also specify the font size *relative* to the `base_size` included in themes such as `theme_bw()` (where `base_size` is 11) using the `rel()` function. For example: ``` ggplot(mtcars, aes(disp, mpg)) + geom_point() + theme_bw() + theme(axis.text.x=element_text(size=rel(0.5),...
When making many plots, it makes sense to set it globally (relevant part is the second line, three lines together are a working example): ``` library('ggplot2') theme_update(text = element_text(size=20)) ggplot(mpg, aes(displ, hwy, colour = class)) + geom_point() ```
13,298,029
I am trying to get a rolling 12 month total from a set of data that provides the minutes for a given month and year. In many cases, I will not have a a record for a month. Is there a way to display the missing months with a zero (0) for the value and then roll it up or not display them but have the query acknowledge th...
2012/11/08
[ "https://Stackoverflow.com/questions/13298029", "https://Stackoverflow.com", "https://Stackoverflow.com/users/936633/" ]
Ditto @Drew Steen on the use of `theme()`. Here are common theme attributes for axis text and titles. ``` ggplot(mtcars, aes(x = factor(cyl), y = mpg))+ geom_point()+ theme(axis.text.x = element_text(color = "grey20", size = 20, angle = 90, hjust = .5, vjust = .5, face = "plain"), axis.text.y = element_tex...
Using "fill" attribute helps in cases like this. You can remove the text from axis using `element_blank()`and show multi color bar chart with a legend. I am plotting a part removal frequency in a repair shop as below ``` ggplot(data=df_subset,aes(x=Part,y=Removal_Frequency,fill=Part))+geom_bar(stat="identity")+theme(a...
13,298,029
I am trying to get a rolling 12 month total from a set of data that provides the minutes for a given month and year. In many cases, I will not have a a record for a month. Is there a way to display the missing months with a zero (0) for the value and then roll it up or not display them but have the query acknowledge th...
2012/11/08
[ "https://Stackoverflow.com/questions/13298029", "https://Stackoverflow.com", "https://Stackoverflow.com/users/936633/" ]
Use `theme()`: ``` d <- data.frame(x=gl(10, 1, 10, labels=paste("long text label ", letters[1:10])), y=rnorm(10)) ggplot(d, aes(x=x, y=y)) + geom_point() + theme(text = element_text(size=20), axis.text.x = element_text(angle=90, hjust=1)) #vjust adjust the vertical justification of the labels, which is of...
Ditto @Drew Steen on the use of `theme()`. Here are common theme attributes for axis text and titles. ``` ggplot(mtcars, aes(x = factor(cyl), y = mpg))+ geom_point()+ theme(axis.text.x = element_text(color = "grey20", size = 20, angle = 90, hjust = .5, vjust = .5, face = "plain"), axis.text.y = element_tex...
13,298,029
I am trying to get a rolling 12 month total from a set of data that provides the minutes for a given month and year. In many cases, I will not have a a record for a month. Is there a way to display the missing months with a zero (0) for the value and then roll it up or not display them but have the query acknowledge th...
2012/11/08
[ "https://Stackoverflow.com/questions/13298029", "https://Stackoverflow.com", "https://Stackoverflow.com/users/936633/" ]
Ditto @Drew Steen on the use of `theme()`. Here are common theme attributes for axis text and titles. ``` ggplot(mtcars, aes(x = factor(cyl), y = mpg))+ geom_point()+ theme(axis.text.x = element_text(color = "grey20", size = 20, angle = 90, hjust = .5, vjust = .5, face = "plain"), axis.text.y = element_tex...
When making many plots, it makes sense to set it globally (relevant part is the second line, three lines together are a working example): ``` library('ggplot2') theme_update(text = element_text(size=20)) ggplot(mpg, aes(displ, hwy, colour = class)) + geom_point() ```
13,298,029
I am trying to get a rolling 12 month total from a set of data that provides the minutes for a given month and year. In many cases, I will not have a a record for a month. Is there a way to display the missing months with a zero (0) for the value and then roll it up or not display them but have the query acknowledge th...
2012/11/08
[ "https://Stackoverflow.com/questions/13298029", "https://Stackoverflow.com", "https://Stackoverflow.com/users/936633/" ]
Ditto @Drew Steen on the use of `theme()`. Here are common theme attributes for axis text and titles. ``` ggplot(mtcars, aes(x = factor(cyl), y = mpg))+ geom_point()+ theme(axis.text.x = element_text(color = "grey20", size = 20, angle = 90, hjust = .5, vjust = .5, face = "plain"), axis.text.y = element_tex...
Adding to previous solutions, you can also specify the font size *relative* to the `base_size` included in themes such as `theme_bw()` (where `base_size` is 11) using the `rel()` function. For example: ``` ggplot(mtcars, aes(disp, mpg)) + geom_point() + theme_bw() + theme(axis.text.x=element_text(size=rel(0.5),...
3,944,103
What’s the best way to add a custom masterpage to a subsite that is being created programmatically in a feature event receiver? Each of these 50 subsites gets its own “\_catalogs/masterpage”, so I have a feeling that Elements.xml for the root-site’s Module/Elements.xml is out. More feature receiver code? PowerShell pos...
2010/10/15
[ "https://Stackoverflow.com/questions/3944103", "https://Stackoverflow.com", "https://Stackoverflow.com/users/98167/" ]
Is this going to be 50 copies of the same Master Page? If not, I can't really picture how the Master Page will be specially made using code, but also a Feature Module element is certainly out. But if it is 50 copies of the same file, you could deploy the Master Page to the Gallery one time using a Feature Module ele...
You might want to think about creating [custom site definition](http://www.toddbaginski.com/blog/archive/2009/11/02/how-to-create-a-custom-site-definition-in-sharepoint-2010.aspx.aspx).
3,944,103
What’s the best way to add a custom masterpage to a subsite that is being created programmatically in a feature event receiver? Each of these 50 subsites gets its own “\_catalogs/masterpage”, so I have a feeling that Elements.xml for the root-site’s Module/Elements.xml is out. More feature receiver code? PowerShell pos...
2010/10/15
[ "https://Stackoverflow.com/questions/3944103", "https://Stackoverflow.com", "https://Stackoverflow.com/users/98167/" ]
Is this going to be 50 copies of the same Master Page? If not, I can't really picture how the Master Page will be specially made using code, but also a Feature Module element is certainly out. But if it is 50 copies of the same file, you could deploy the Master Page to the Gallery one time using a Feature Module ele...
You have following choices to set master page for the site: 1) Using Sharepoint Browser UI (from Site Settings page) 2) Using Custom site definitions 3) Programmatically 4) Using SharePoint Designer Looking at your scenario, no 3 is an option. You may want to do it in the Feature Receiver itself.
67,888,068
I have a for loop which gives me that kind of standard output : ``` 5 4473 4 4394 3 4386 2 4750 1 5963 6 4605 5 4270 4 4053 3 3909 2 4267 1 5362 3 3150 2 3457 1 4795 ``` There is 3 loop tours here. I would like to create a new column for each tour rather than adding row by row. I mean, my first loop tour gives me : ...
2021/06/08
[ "https://Stackoverflow.com/questions/67888068", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11504468/" ]
``` $ cat tst.awk { key = $1 val = $2 if ( NR==1 ) { minKey = maxKey = key } else { maxKey = ( key >= maxKey ? key : maxKey ) minKey = ( key <= minKey ? key : minKey ) } if ( key >= prev ) { numCols++ } vals[key,numCols] = val prev = key } END ...
`awk` to the rescue! ``` $ awk '{c+=p<$1; a[$1,c]=$2; p=$1} $1>max {max=$1} END {for(i=max;i;i--) for(j=1;j<=c;j++) printf "%d %d%s",i,a[i,j]+0,(j==c?ORS:OFS)}' file | column -t 6 0 6 4605 6 0 5 4473 5 4270 5 0 4 4394 4 4053 4 0 3 4386 ...
21,800,084
Use a sub-query that returns the monetary values of all orders that have discounts -- greater than 15% -- List the `orderid` and the order value this last with the highest value at the top. I keep getting an error message. ``` USE Northwind GO SELECT SUM(od.orderid) As OrderID, AS [Order Values] FROM ...
2014/02/15
[ "https://Stackoverflow.com/questions/21800084", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3313555/" ]
The variables are declared explicitly in your code, so the numbers of variables you could use is definite, there is no way to unpack a tuple(or list) with unknown length to definite numbers of vars. But you can use `*` to make [extended iterable unpacking](http://www.python.org/dev/peps/pep-3132/) in python3: ``` >>> ...
If the length of `listobj` is indeterminate, use it directly as a list instead of unpacking it into variables. Unpacking a list of different sizes doesn't make any sense. Assume you could dynamically unpack `listobj` into as many variables as possible (like var1, var2, var3... as long as needed). How would you write c...
21,254,399
I have this timepicker plugin from <https://github.com/jonthornton/jquery-timepicker> and I want to get the calculated time and put it in a input field. Any help? See <http://postimg.org/image/4m78gqdmx/> for image reference. How to get the calculated time?
2014/01/21
[ "https://Stackoverflow.com/questions/21254399", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3093453/" ]
My hostname which is localhost did not contain any underscores.The only underscore was in my computer name.My old name was `computer_1` but i changed it to `computer1` and now i am able to use `localhost:8161` activemq web console. To know how to change the computer name when on windows,do google it or refer to window...
Check your "activemq.log" in your "data" folder, in my case I obtain this error because I was using a "redeliveryPlugin" and it requires a schedulerSupport="true" in broker definition.
21,254,399
I have this timepicker plugin from <https://github.com/jonthornton/jquery-timepicker> and I want to get the calculated time and put it in a input field. Any help? See <http://postimg.org/image/4m78gqdmx/> for image reference. How to get the calculated time?
2014/01/21
[ "https://Stackoverflow.com/questions/21254399", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3093453/" ]
I had similar problem. The problem gone after reboot. Try to reboot PC and start activemq first. Probably it related that some ports were already taken.
Check your "activemq.log" in your "data" folder, in my case I obtain this error because I was using a "redeliveryPlugin" and it requires a schedulerSupport="true" in broker definition.
53,284,996
Good Evening from sweden!! I need some help with my countdown code. In the last part of the code I have added a part that will add a 0 before the last number if it is between 0 and 9 to always keep it six digits long, why isnt it working? Hope to be hearing from you guys soon since this have to be done before the day...
2018/11/13
[ "https://Stackoverflow.com/questions/53284996", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6049804/" ]
I agree with the comments about this being a strange way to 'columnize'. However, here is a function that does what you described: ``` def columnize(A, interval=2): ans = [] for i in range(0,len(A), interval*2): for j in range(min(interval, len(A)-i)): ans.append(A[i+j] + (A[i+j+interval] i...
Are you looking for something like this? Columnizing squared matrix? ``` start = [ [1, 'one'], [2, 'two'], [3, 'three'], [4, 'four'], [5, 'five'], [6, 'six'], [7, 'seven'], [8, 'eight'], [9, 'nine'], ] expected = [ [1, 'one', 3, 'three'], [2, 'two', 4, 'four'], # page br...
1,097,864
I am puzzled. I looked at the trace of a pagecall that was "slow" to load according to my boss, causing the page to partially load, and then "jump" to the memorized scroll-place on a postback. I found out eventually, using my trace, that my whole loading, from Begin PreInit to End Render, took 1.94 seconds, 1.5 of whi...
2009/07/08
[ "https://Stackoverflow.com/questions/1097864", "https://Stackoverflow.com", "https://Stackoverflow.com/users/87669/" ]
In my experience (same problem as you), it's 90% a SQL issue. Put some Stopwatch(es) around the query you are calling to find out which query is running slow. Rendering asp.net control can't take so long....
In order to identify the cause of a bottleneck you really ought to profile your code with a tool like [ANTS Profiler](http://www.red-gate.com/products/ants_performance_profiler/index2.htm) or something similar. A profiler will allow you to pinpoint the problem area by showing you which lines of code are slower than ot...
1,097,864
I am puzzled. I looked at the trace of a pagecall that was "slow" to load according to my boss, causing the page to partially load, and then "jump" to the memorized scroll-place on a postback. I found out eventually, using my trace, that my whole loading, from Begin PreInit to End Render, took 1.94 seconds, 1.5 of whi...
2009/07/08
[ "https://Stackoverflow.com/questions/1097864", "https://Stackoverflow.com", "https://Stackoverflow.com/users/87669/" ]
In order to identify the cause of a bottleneck you really ought to profile your code with a tool like [ANTS Profiler](http://www.red-gate.com/products/ants_performance_profiler/index2.htm) or something similar. A profiler will allow you to pinpoint the problem area by showing you which lines of code are slower than ot...
Your best bet is to use the [Perfomance Wizard in Visual Studio](http://blog.maartenballiauw.be/post/2008/02/Code-performance-analysis-in-Visual-Studio-2008.aspx) and look at the Call Tree for your page. It will give you more details into the exact performance bottleneck. I have seen this type of performance when the...
1,097,864
I am puzzled. I looked at the trace of a pagecall that was "slow" to load according to my boss, causing the page to partially load, and then "jump" to the memorized scroll-place on a postback. I found out eventually, using my trace, that my whole loading, from Begin PreInit to End Render, took 1.94 seconds, 1.5 of whi...
2009/07/08
[ "https://Stackoverflow.com/questions/1097864", "https://Stackoverflow.com", "https://Stackoverflow.com/users/87669/" ]
In order to identify the cause of a bottleneck you really ought to profile your code with a tool like [ANTS Profiler](http://www.red-gate.com/products/ants_performance_profiler/index2.htm) or something similar. A profiler will allow you to pinpoint the problem area by showing you which lines of code are slower than ot...
Of course, if it is sql-related, as many people have noted, "sql server profiler" is the tool to use (given that you're running mssql). mysql has "jetprofiler" (.com) which i haven't tried. once you've found the slow query, it's not rarely an indexing issue.
1,097,864
I am puzzled. I looked at the trace of a pagecall that was "slow" to load according to my boss, causing the page to partially load, and then "jump" to the memorized scroll-place on a postback. I found out eventually, using my trace, that my whole loading, from Begin PreInit to End Render, took 1.94 seconds, 1.5 of whi...
2009/07/08
[ "https://Stackoverflow.com/questions/1097864", "https://Stackoverflow.com", "https://Stackoverflow.com/users/87669/" ]
In my experience (same problem as you), it's 90% a SQL issue. Put some Stopwatch(es) around the query you are calling to find out which query is running slow. Rendering asp.net control can't take so long....
I would use [YSlow](http://developer.yahoo.com/yslow/) to determine if its from something on the client side or server side. We sometimes add timers to some queries then output the time to execute in an html comment... of course removing them when the testing is complete. Does the page call anything hosted on an exter...
1,097,864
I am puzzled. I looked at the trace of a pagecall that was "slow" to load according to my boss, causing the page to partially load, and then "jump" to the memorized scroll-place on a postback. I found out eventually, using my trace, that my whole loading, from Begin PreInit to End Render, took 1.94 seconds, 1.5 of whi...
2009/07/08
[ "https://Stackoverflow.com/questions/1097864", "https://Stackoverflow.com", "https://Stackoverflow.com/users/87669/" ]
In my experience (same problem as you), it's 90% a SQL issue. Put some Stopwatch(es) around the query you are calling to find out which query is running slow. Rendering asp.net control can't take so long....
Your best bet is to use the [Perfomance Wizard in Visual Studio](http://blog.maartenballiauw.be/post/2008/02/Code-performance-analysis-in-Visual-Studio-2008.aspx) and look at the Call Tree for your page. It will give you more details into the exact performance bottleneck. I have seen this type of performance when the...
1,097,864
I am puzzled. I looked at the trace of a pagecall that was "slow" to load according to my boss, causing the page to partially load, and then "jump" to the memorized scroll-place on a postback. I found out eventually, using my trace, that my whole loading, from Begin PreInit to End Render, took 1.94 seconds, 1.5 of whi...
2009/07/08
[ "https://Stackoverflow.com/questions/1097864", "https://Stackoverflow.com", "https://Stackoverflow.com/users/87669/" ]
In my experience (same problem as you), it's 90% a SQL issue. Put some Stopwatch(es) around the query you are calling to find out which query is running slow. Rendering asp.net control can't take so long....
Of course, if it is sql-related, as many people have noted, "sql server profiler" is the tool to use (given that you're running mssql). mysql has "jetprofiler" (.com) which i haven't tried. once you've found the slow query, it's not rarely an indexing issue.
1,097,864
I am puzzled. I looked at the trace of a pagecall that was "slow" to load according to my boss, causing the page to partially load, and then "jump" to the memorized scroll-place on a postback. I found out eventually, using my trace, that my whole loading, from Begin PreInit to End Render, took 1.94 seconds, 1.5 of whi...
2009/07/08
[ "https://Stackoverflow.com/questions/1097864", "https://Stackoverflow.com", "https://Stackoverflow.com/users/87669/" ]
I would use [YSlow](http://developer.yahoo.com/yslow/) to determine if its from something on the client side or server side. We sometimes add timers to some queries then output the time to execute in an html comment... of course removing them when the testing is complete. Does the page call anything hosted on an exter...
Your best bet is to use the [Perfomance Wizard in Visual Studio](http://blog.maartenballiauw.be/post/2008/02/Code-performance-analysis-in-Visual-Studio-2008.aspx) and look at the Call Tree for your page. It will give you more details into the exact performance bottleneck. I have seen this type of performance when the...
1,097,864
I am puzzled. I looked at the trace of a pagecall that was "slow" to load according to my boss, causing the page to partially load, and then "jump" to the memorized scroll-place on a postback. I found out eventually, using my trace, that my whole loading, from Begin PreInit to End Render, took 1.94 seconds, 1.5 of whi...
2009/07/08
[ "https://Stackoverflow.com/questions/1097864", "https://Stackoverflow.com", "https://Stackoverflow.com/users/87669/" ]
I would use [YSlow](http://developer.yahoo.com/yslow/) to determine if its from something on the client side or server side. We sometimes add timers to some queries then output the time to execute in an html comment... of course removing them when the testing is complete. Does the page call anything hosted on an exter...
Of course, if it is sql-related, as many people have noted, "sql server profiler" is the tool to use (given that you're running mssql). mysql has "jetprofiler" (.com) which i haven't tried. once you've found the slow query, it's not rarely an indexing issue.
101,826
How can a user see **Accepted Answers percentage** By Accepted answers percentage I do not refer to the percentage of answers to his/her questions the user accepted but I refer to the precentage of the Users answers that were accepted by other question posters. I know the former gets displayed on the user's profile...
2011/08/11
[ "https://meta.stackexchange.com/questions/101826", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/153124/" ]
I found [a similar query in the data explorer](https://data.stackexchange.com/stackoverflow/s/100/users-with-highest-accept-rate-of-their-answers), and modified it to show this. [Here it is for your account](https://data.stackexchange.com/stackoverflow/s/1717/user-answer-accepted-rate?UserId=452307). The data in the d...
> > "It would definitely indicate the repute of an user." > > > No, *at best* it would indicate a combination of: * How good the user's answers were. * How much traffic those questions got and how many competing answers. * What kind of users the answerer typically helped. * Personal factors: Is the answerer colle...
101,826
How can a user see **Accepted Answers percentage** By Accepted answers percentage I do not refer to the percentage of answers to his/her questions the user accepted but I refer to the precentage of the Users answers that were accepted by other question posters. I know the former gets displayed on the user's profile...
2011/08/11
[ "https://meta.stackexchange.com/questions/101826", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/153124/" ]
I found [a similar query in the data explorer](https://data.stackexchange.com/stackoverflow/s/100/users-with-highest-accept-rate-of-their-answers), and modified it to show this. [Here it is for your account](https://data.stackexchange.com/stackoverflow/s/1717/user-answer-accepted-rate?UserId=452307). The data in the d...
Maybe it's not displayed so that the user's decision is not biased. Acceptance is already adding to one's reputation, which shows the degree of trust the community has in a person, which is measured by accepted answers + upvotes. The acceptance rate alone can't do proper justice in all cases.
101,826
How can a user see **Accepted Answers percentage** By Accepted answers percentage I do not refer to the percentage of answers to his/her questions the user accepted but I refer to the precentage of the Users answers that were accepted by other question posters. I know the former gets displayed on the user's profile...
2011/08/11
[ "https://meta.stackexchange.com/questions/101826", "https://meta.stackexchange.com", "https://meta.stackexchange.com/users/153124/" ]
> > "It would definitely indicate the repute of an user." > > > No, *at best* it would indicate a combination of: * How good the user's answers were. * How much traffic those questions got and how many competing answers. * What kind of users the answerer typically helped. * Personal factors: Is the answerer colle...
Maybe it's not displayed so that the user's decision is not biased. Acceptance is already adding to one's reputation, which shows the degree of trust the community has in a person, which is measured by accepted answers + upvotes. The acceptance rate alone can't do proper justice in all cases.
12,690,480
I'm trying to learn Haskell, thinking that it would be the perfect language to implement [Combinatorial Game Theory](http://en.wikipedia.org/wiki/Combinatorial_game_theory). I've done this to some extent in Python to teach myself OOP principles and operator overloading, but Haskell attracts me because it seems more mat...
2012/10/02
[ "https://Stackoverflow.com/questions/12690480", "https://Stackoverflow.com", "https://Stackoverflow.com/users/931129/" ]
You can't use the `fst` and `snd` functions on something of type `Game`. Since you haven't declared names for your fields in your data constructors `Zero` and `Position`, the only way to actually access them is via pattern matching. (Note that I also removed the unnecessary tuple in the `Position` constructor) ``` dat...
dflemstr's answer is correct. I am going to explain the error message you got. * `a : fst b` must have type `[Game]` --- agreed, yes? * therefore `a` must have type `Game`... (and it does, hooray) * ...and `fst b` must have type `[Game]` * [`fst`](http://www.haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html...
132,712
What are some of the fastest ways to farm platinum in Rift? I'm currently a level 53 cleric with 810p and need to get to about 1200p in order to purchase my first rex from other players and unlock the auction house in game. Aside from getting lucky with having deeps lock boxes dropping, what could I do to speed up rea...
2013/09/30
[ "https://gaming.stackexchange.com/questions/132712", "https://gaming.stackexchange.com", "https://gaming.stackexchange.com/users/55903/" ]
Besides the mentioned treasure chests (which are pretty frequent), there are also the faux-multiplayer battles in the temple. When you manage to win one, you get multiple cards, many of which are resources. Another option is purchasing the individual resources for gems in the book.
I am also blocked after having played all the temple "multiplayer" games. It seems that you can only get more cards by playing real multiplayer after this.
263,986
When trying to add relativistic corrections to the standard Schrödinger equation, the kinetic energy correction is given as $H'=-\frac{p^4}{8m^3c^2}$ (e.g. page 14 <https://www.tcd.ie/Physics/people/Peter.Gallagher/lectures/js_atomic/hydrogen-essay.pdf>). It is usually stated that this can be found by expanding the re...
2016/06/22
[ "https://physics.stackexchange.com/questions/263986", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/117677/" ]
The difference arises because you are confusing the three spatial components of the 4-momentum, which are in fact $p^j = \gamma\,m\,v^j$ with the three components of the Newtonian momentum $m\,v^j$. If you write: $$\frac{p^2}{m^2\,\gamma^2} = v^2$$ and solve for $v$ in terms of $p$, then substitute back into the Watk...
The expansion is not that hard. We have $$ K~=~(\gamma~-~1)mc^2~=~\left(\frac{1}{\sqrt{1~-~v^2/c^2}}~-~1\right)mc^2 $$ where we do the binomial expansion on the Lorentz factor $$ K~\simeq~\left(1~+~\frac{1}{2}\frac{v^2}{c^2}~+~\frac{3}{8}\frac{v^4}{c^4}~-~1\right)mc^2 $$ $$ =~\frac{1}{2}mv^2~+~\frac{3}{8}m\frac{v^4}{c^...
156,103
I'm trying to figure out how to derive the transformation matrix for the Lorentz boost. Consider two inertial frames A and B, and let B move at a constant velocity V with respect to A. All the derivations I've seen assume that this implies that A moves at a velocity -V with respect to B. This does not seem obvious to m...
2015/01/01
[ "https://physics.stackexchange.com/questions/156103", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/68840/" ]
Intuitively, you are comparing the velocities of two frames. If there were unit masses moving in those frames, then there would be a center of mass frame. That center of mass frame of the fictitious masses exists regardless of whether there are masses there. And this frame sees each of the other frames moving in equal ...
A snappy but unsatisfying answer is that relative velocity just means the difference in velocity, and difference denotes subtraction. And x - y is the opposite of y - x; in other words if z = x - y, then y - x = -z. A picture that might help is this: You are on train A, moving north at 40 m/s. On a parallel track is t...
64,656,055
I updated my project to create react app 4.0, and I'm slowing moving over my files to TypeScript. I know with this new version you don't have to repetitively import React from 'react'. However, within all of my TS files where I'm not importing React I receive this error: > > 'React' refers to a UMD global, but the cu...
2020/11/03
[ "https://Stackoverflow.com/questions/64656055", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4021213/" ]
My issue here was TypeScript-related and similar, but not exactly the same, as those solutions already published herein. What was wrong -------------- I added nested directories with source code which were not **include**d in my `tsconfig.json`. ### The solution Here's how I fixed it, simply adding additional `.ts`...
I had this happen when the file was in the root of the project instead of the src folder using Create React App.
64,656,055
I updated my project to create react app 4.0, and I'm slowing moving over my files to TypeScript. I know with this new version you don't have to repetitively import React from 'react'. However, within all of my TS files where I'm not importing React I receive this error: > > 'React' refers to a UMD global, but the cu...
2020/11/03
[ "https://Stackoverflow.com/questions/64656055", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4021213/" ]
What Dan wrote is correct you can change TS `config.json`: ``` // tsconfig.json { "compilerOptions": { ... "jsx": "react-jsx" ... }, } ``` Or just import React inside the file Component that's giving you the error: ``` import React from 'react' ```
My issue here was TypeScript-related and similar, but not exactly the same, as those solutions already published herein. What was wrong -------------- I added nested directories with source code which were not **include**d in my `tsconfig.json`. ### The solution Here's how I fixed it, simply adding additional `.ts`...
64,656,055
I updated my project to create react app 4.0, and I'm slowing moving over my files to TypeScript. I know with this new version you don't have to repetitively import React from 'react'. However, within all of my TS files where I'm not importing React I receive this error: > > 'React' refers to a UMD global, but the cu...
2020/11/03
[ "https://Stackoverflow.com/questions/64656055", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4021213/" ]
I ran into this issue and finally realized that changing tsconfig.json doesn't work if you have ts-jest set up. Make sure if you have ts-jest set to: ```js module.exports = { ... globals: { ... "ts-jest": { ... tsconfig: { ... jsx: "react-jsx", // *** HERE *** ... ...
Depending on the versions used in the project, this might be the required format: ``` import * as React from "react" ```
64,656,055
I updated my project to create react app 4.0, and I'm slowing moving over my files to TypeScript. I know with this new version you don't have to repetitively import React from 'react'. However, within all of my TS files where I'm not importing React I receive this error: > > 'React' refers to a UMD global, but the cu...
2020/11/03
[ "https://Stackoverflow.com/questions/64656055", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4021213/" ]
This error message comes from TypeScript compiler. The React 17 new jsx transform is not currently supported in Typescript 4.0, and will be supported in 4.1. [TypeScript v4.1 Beta - React 17 JSX Factories](https://devblogs.microsoft.com/typescript/announcing-typescript-4-1-beta/#jsx-factories)
In my case, it was unrelated to any of this. I was using Visual Studio Code, and I opened the folder not at the root which had tsconfig.json file, but at one level inside at src folder. I was getting the error: `Parsing error: Cannot read file :C\MyProject\tsconfig.json.eslint` Which indirectly caused `'React' refer...
64,656,055
I updated my project to create react app 4.0, and I'm slowing moving over my files to TypeScript. I know with this new version you don't have to repetitively import React from 'react'. However, within all of my TS files where I'm not importing React I receive this error: > > 'React' refers to a UMD global, but the cu...
2020/11/03
[ "https://Stackoverflow.com/questions/64656055", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4021213/" ]
This error message comes from TypeScript compiler. The React 17 new jsx transform is not currently supported in Typescript 4.0, and will be supported in 4.1. [TypeScript v4.1 Beta - React 17 JSX Factories](https://devblogs.microsoft.com/typescript/announcing-typescript-4-1-beta/#jsx-factories)
What Dan wrote is correct you can change TS `config.json`: ``` // tsconfig.json { "compilerOptions": { ... "jsx": "react-jsx" ... }, } ``` Or just import React inside the file Component that's giving you the error: ``` import React from 'react' ```
64,656,055
I updated my project to create react app 4.0, and I'm slowing moving over my files to TypeScript. I know with this new version you don't have to repetitively import React from 'react'. However, within all of my TS files where I'm not importing React I receive this error: > > 'React' refers to a UMD global, but the cu...
2020/11/03
[ "https://Stackoverflow.com/questions/64656055", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4021213/" ]
Create React App supports the new JSX transformation out of the box in version 4 but if you are using a custom setup, the following is needed to remove the TypeScript error when writing `jsx` without `import React from 'react'`: * `typescript` of at least version 4.1 * `react` and `react-dom` of at least version 17 * ...
This error message comes from TypeScript compiler. The React 17 new jsx transform is not currently supported in Typescript 4.0, and will be supported in 4.1. [TypeScript v4.1 Beta - React 17 JSX Factories](https://devblogs.microsoft.com/typescript/announcing-typescript-4-1-beta/#jsx-factories)