qid
int64
10
74.7M
question
stringlengths
15
26.2k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
27
28.1k
response_k
stringlengths
23
26.8k
28,296,708
I am replacing my `ListView` with `RecyclerView`, list showing ok, but I would like to know how to get clicked item and its position, similar to the method [`OnItemClickListener.onItemClick(AdapterView parent, View v, int position, long id)`](http://developer.android.com/reference/android/widget/AdapterView.OnItemClick...
2015/02/03
[ "https://Stackoverflow.com/questions/28296708", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3540593/" ]
> > Here is the simplest and the easiest way to find the position of the clicked item: > > > I've also faced the same problem. I wanted to find of the position of the clicked/selected item of the RecyclerView() and perform some specific operations on that particular item. getAdapterPosition() method works like ...
Try in this way Adapter class : ``` public class ContentAdapter extends RecyclerView.Adapter<ContentAdapter.ViewHolder> { public interface OnItemClickListener { void onItemClick(ContentItem item); } private final List<ContentItem> items; private final OnItemClickListener listener; public ContentAdapter(List<C...
41,457,721
I want to implement a **html table**. This is the screen shot. [![enter image description here](https://i.stack.imgur.com/yS3g5.png)](https://i.stack.imgur.com/yS3g5.png) The first line Categories is **static**. In the second line, the first column is static (date and images), but the second column of times and chann...
2017/01/04
[ "https://Stackoverflow.com/questions/41457721", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5160493/" ]
In C all strings should be null (i.e. `\0`) terminated, so your second variable should look like the following: ``` char b[] = {'d', 'e', 'f', '\0'}; ``` You might be curious why `"defabc"` is printed with your code. The answer is, all local variables are stored in a [stack-based memory layout](http://www.geeksforge...
You need a null terminator at the end of both strings. your second string does not have it as its defined as an array of characters.
7,741,033
Which one of these blocks of code performs better, and which one of them is more readable? I'd guess the gain would be negligible, particularly in the second block. I am just curious. **Block #1** ``` string height; string width; if (myFlag == 1) { height = "60%"; width = "60%"; } else { height = "80%"; ...
2011/10/12
[ "https://Stackoverflow.com/questions/7741033", "https://Stackoverflow.com", "https://Stackoverflow.com/users/507184/" ]
The performance gain here is negligible to the tune I'd call this micro-micro-micro-optimization. Go for readability here unless you plan to do this a couple of million times. **Edit:** (re: question in comments) In my opinion the first one is the more readable. It explicitly shows in a ready format what the strings ...
**Warning:** It's been a while since I worked with specific CPU optimizations. That said, if I were to code this in assembly language, Block 1 would have fewer instructions per loop than block 2. At the assembly/machine code level, if/else is essentially free when compared to if, because either case expands to essenti...
11,535
[Gatherer](http://gatherer.wizards.com/Pages/Default.aspx) is great (sort of) for building decks, but I'd like the additional filter of specifying the search specifically to the cards I own. Is this a feature I'm just not seeing or is there an app of some sort that does this? I'd also like if it were always as up to da...
2013/03/18
[ "https://boardgames.stackexchange.com/questions/11535", "https://boardgames.stackexchange.com", "https://boardgames.stackexchange.com/users/4974/" ]
**Mtgdb.Gui**, a free program I wrote can do this. The screenshot below demonstrates searching by text (left arrow) while limiting the search to the cards from collection you own (right arrow) [![a button to narrow down search to owned cards only](https://github.com/NikolayXHD/Mtgdb/raw/master/out/help/l/chart-filter...
iMtG for iOS has full blown inventory management system linked with Deck Builder. It is completely free for people with collections which would fit in 3 binders. iMtG is made by myself (as someone who cares), it has had regular database updates since 2011. It is important as many other MTG collection manager apps fai...
42,535,270
The title pretty much explains what I'm facing. I'm trying to test a `React` component that has some state, and I attempt to provide my store to the component in order to get what it needs. When I run the test of the component using Jest, I get the following error: `ReferenceError: regeneratorRuntime is not defined` ...
2017/03/01
[ "https://Stackoverflow.com/questions/42535270", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2593887/" ]
I am using Vuejs, Vue Jest in Laravel mix and this works for me ``` import 'regenerator-runtime/runtime' import { mount } from '@vue/test-utils' import App from '../App'; // eslint-disable-next-line no-undef test('it works', () => { // eslint-disable-next-line no-undef expect(1 + 1).toBe(2); }); // eslint-disabl...
Why --- According to the official Jest docs [`regenerator-runtime` is not longer injected](https://jestjs.io/blog/2019/01/25/jest-24-refreshing-polished-typescript-friendly#breaking-changes) automagically. > > Jest no longer automatically injects regenerator-runtime - if you get errors concerning it, make sure to co...
31,642,449
If I draw a shape with polygon on Google Maps v2, is there a way to find out if my current location is inside the shape? please write me a clear code thanks
2015/07/26
[ "https://Stackoverflow.com/questions/31642449", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4867171/" ]
I split the PolyUtil from the [Google Maps Android API Utility Library](https://github.com/googlemaps/android-maps-utils) to one class. Than just call like follow. ``` ArrayList<LatLng> polygon = new ArrayList<LatLng>(); LatLng myLocation = new LatLng(currentLocation.getLatitude(), currentLocation.getLongitude()); ...
Follow these - <https://developer.android.com/training/location/geofencing.html> <https://developers.google.com/android/reference/com/google/android/gms/location/Geofence> These links may be what you are looking for.
9,669,458
I just created my first Symfony2 project. But the "/web/app\_dev.php" part in the URL annoys me. It should be possible to do this *without* Virtual hosts... But when I try this through .htaccess I always get routing errors and the "web/" is always added to the url... EDIT: The whole project is also in a subdirectory...
2012/03/12
[ "https://Stackoverflow.com/questions/9669458", "https://Stackoverflow.com", "https://Stackoverflow.com/users/866447/" ]
Symfony2 comes with a built in debug mode, which is what you are using when you access url's with the app\_dev.php addition. The debug mode caches significantly less than the production mode which can be accessed by directing your browser to the url, but leaving out the app\_dev.php. If accessing this url doesn't work ...
If you use an apache virtual host, you can get it working the way you desire. Here is an example virtual host from my xampp: ``` <VirtualHost *:80> ServerName myurl.local # Basic stuff DocumentRoot "C:/path/to/symfony/web" DirectoryIndex app.php <Directory "C:/path/to/symfony/web"> AllowOv...
1,101,896
Is there a way to update the PDB file with the new source location ? I have a project which links to some libraries which are built on another machine and are debug build with the PDB file. I cannot put a breakpoint in the files which are compiled in the libs. These libs take more than 4 hours to build so I dont want t...
2009/07/09
[ "https://Stackoverflow.com/questions/1101896", "https://Stackoverflow.com", "https://Stackoverflow.com/users/90540/" ]
If you are doing this to avoid getting multiple links to the same content, you can simply don't use "register.php" anywhere on your page. I think no search engine will "guess" for a certain file type and if there are no security concerns you are on the safe side, because in my opinion no user will link to this file eit...
It is true that you cannot use location directive, but you can actually paste .htaccess file into any directory. Just if you put this into it, say: ``` Options -Indexes order allow,deny deny from all ``` you can copy paste this file into any (root) directory you want to protect from external execution.
17,257,041
I have a very simple JS Arrays question, my simple canvas game has been behaving differently when I replaced one block of code with another. Could you look them over and see why they are functionally different from one another, and maybe provide a suggestion? I may need these arrays to have 20+ items so I'm looking for...
2013/06/23
[ "https://Stackoverflow.com/questions/17257041", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Arrays are zero-indexed in JavaScript. The first element is `0`, not `1`: ``` var srd = new Array(); srd[0] = 1; srd[1] = 1; srd[2] = 1; ``` Also, you may want to use the more common array constructor: ``` var srd = [1, 1, 1]; ``` I have a feeling that you may be assuming that the first element is `1` instead ...
It depends on your implementation, but it's likely because of arrays being 0-indexed. In your first block of code, each number is offset by one index spot from the second block. The first one is equivalent to: ``` var srd = new Array(); srd[0] = 1; srd[1] = 1; srd[2] = 1; ``` in the way you wrote it for the secon...
514,312
It seems that changing secnumdepth does not change anything in my document for me. I want secnumdepth to be 2, so that I can label and reference subsections. However, subsection stay unnumbered for some reason, which has the consequence that when referencing these subsections, I get the section number instead. So if I...
2019/10/31
[ "https://tex.stackexchange.com/questions/514312", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/200471/" ]
The preferred method with `memoir` is to say ``` \settocdepth{section} \setsecnumdepth{subsection} ``` instead of setting the counters `tocdepth` and `secnumdepth`. If I do it and try with a skeleton document ```latex \begin{document} \frontmatter \tableofcontents \mainmatter \chapter{a} \section{b} \subsection{c}...
The following MWE works on my system. The packages commented out, I do not have available. It is obviously that you do something another place on your system. [![enter image description here](https://i.stack.imgur.com/b9gL7.png)](https://i.stack.imgur.com/b9gL7.png) ``` \documentclass[a4paper,10pt,oneside,openright]{...
47,038,677
I am writing a SQL query using the AdventureWorks 2014 database. I want to show Which orders contain more than two products? Show order number, order value, and number of products that the order contains. I tried to write statement by itself (see below), but I'd like to be able to solve the relation : ``` select Sa...
2017/10/31
[ "https://Stackoverflow.com/questions/47038677", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8858893/" ]
``` SELECT SalesOrderID, COUNT(ProductID) as total_products, SUM(LineTotal) as total_invoice FROM SalesOrderDetail s GROUP BY SalesOrderID HAVING COUNT(ProductID) > 2 ORDER BY s.SalesOrderID ```
This code would give your expected answer ``` SELECT SalesOrderID ,ProductID ,LineTotal ,'Sales Order ' +CAST(SalesOrderID AS VARCHAR(100))+' Contains Productid of'+CAST(ProductID AS VARCHAR(100)) AS [ProductsCountPerOrder] ,Productscount FROM ( SELECT salesorderid , ...
43,576,211
I have a listview and created it with an arrayadpter but when i try to add data it shows empty rows for everytime ive tried to empty data, ive checked the database and the information is getting entered just never showing on the rows. Code Below: ``` public class Column_Adapter extends ArrayAdapter<Income>{ publi...
2017/04/23
[ "https://Stackoverflow.com/questions/43576211", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7875040/" ]
You can only encode Unicode strings. If you call encode on a bytestring, Python tries to *decode* it first, using the default encoding - hence the error. (Note that this confusing behaviour only occurs in Python 2, it has been removed in Python 3).
Let me tear down your confusion to pieces. Let's start first by the the distinction between `str` and `unicode`. In Python 2.X: 1. `str` is a string of 8-bit characters (1-byte) that prints as ASCII whenever possible. `str` is really a sequence of bytes and is the equivalent of `bytes` in Python 3.X. \*There's no enco...
44,403,165
I have a React component which contains some other components that depend on access to a Redux store etc., which cause issues when doing a full Enzyme mount. Let's say a structure like this: ```js import ComponentToMock from './ComponentToMock'; <ComponentToTest> ...some stuff <ComponentToMock testProp="This thro...
2017/06/07
[ "https://Stackoverflow.com/questions/44403165", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3422667/" ]
There's a note at the bottom of the [docs for `jest.mock()`](https://jestjs.io/docs/en/jest-object#jestmockmodulename-factory-options) for preventing the hoisting behavior: > > Note: When using `babel-jest`, calls to `mock` will automatically be > hoisted to the top of the code block. Use `doMock` if you want to > ...
``` const mockComponent = ComponentName => ({ children, ...props }) => ( <ComponentName {...{ '[mockComponent]': true }} {...props}> {children} </ComponentName> ); export default mockComponent; ``` ``` jest.mock('../ComponentToMock', () => { const mockComponent = require('./mockComponent').default; retu...
113,898
Whether or not to reply inline in emails, is something to disagree on. When I write an email, I aim at producing a text with a beginning and an end, complete with greetings and other politeness forms. After all, if I meet a colleague at the coffee machine, I also greet politely before starting to discuss, and when lea...
2018/06/12
[ "https://workplace.stackexchange.com/questions/113898", "https://workplace.stackexchange.com", "https://workplace.stackexchange.com/users/88000/" ]
I can only speak about my own experience. You be the judge whether this applies to your colleagues. Personally, I don't usually reply inline, but when I do reply inline, it's because the email I am replying to is very long to begin with and I want to make sure I don't forget anything. So to encourage me not to reply...
This depends on the intent of the email. What are you looking for in return? I respond in-line when presented with a bulleted or numbered list in the email. In this case this it helps to keep each response with the particular line item in the list. I will do the same with paragraphs that each need a response. In these...
52,696
We are making a simple [Likert scale](http://en.wikipedia.org/wiki/Likert_scale) radio group for feedback and will group it as follows: > > Please rate the service you received: > > > * Very poor > * Poor > * Average > * Good > * Very good > > > According to usability guru Jakob Neilsen, [radio choices should h...
2014/02/21
[ "https://ux.stackexchange.com/questions/52696", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/43895/" ]
It is perfectly acceptable for a radio group not to have a default selection if you don't want to influence the user's response (such as in a survey). Microsoft provides this advice in its [design guidelines for radio buttons](http://msdn.microsoft.com/en-us/library/windows/desktop/aa511488.aspx): > > Don't have a de...
> > Select a single radio button by default in most cases. **Reasons to** > **deviate or not: expedite tasks, the power of suggestion, user** > **expectations, safety nets.** > > > Same source: <https://www.nngroup.com/articles/radio-buttons-default-selection/>
12,218,678
I need to sort a point array (a point is a struct with two `float` types - one for `x` and one for `y`) in a special fashion. The points have to be sorted so when they are traversed, they form a zig-zag pattern starting at the **top leftmost point**, moving to the **top rightmost point**, then down to the **second lef...
2012/08/31
[ "https://Stackoverflow.com/questions/12218678", "https://Stackoverflow.com", "https://Stackoverflow.com/users/160868/" ]
I'd use qsort() with a custom compare() function that as @stefan noted, sorts descending by y then alternates (max/min) for x.
It seems you are trying to reinvent some kind of monotone polygonal chain. Some polygon triangulation methods are in short described in [wiki](http://en.wikipedia.org/wiki/Polygon_triangulation) and [here](http://vterrain.org/Implementation/Libs/triangulate.html) with links to code
6,367,379
``` int main() { int i=3; (i << 1); cout << i; //Prints 3 } ``` I expected to get 6 because of shifting left one bit. Why does it not work?
2011/06/16
[ "https://Stackoverflow.com/questions/6367379", "https://Stackoverflow.com", "https://Stackoverflow.com/users/796608/" ]
Because the bit shift operators return a value. You want this: ``` #include <iostream> int main() { int i = 3; i = i << 1; std::cout << i; } ``` The shift operators don't shift "in place". You might be thinking of the other version. If they did, like a lot of other C++ binary operators, then we'd ha...
You need to reassign the value back to `i` with `i<<=1` (using "left shift and assign operator")
42,300,463
I'm trying to use the Flink 5.x Elasticsearch sink connector to insert data to ES 5.2.1 instance hosted on a tiny VM. As this is a tiny VM in development mode, I cant get it to start up to accept TransportClient remote client connections on 9300 without failing the bootstrap checks. ``` [2017-02-17T09:02:48,581][INFO...
2017/02/17
[ "https://Stackoverflow.com/questions/42300463", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7581243/" ]
> > max file descriptors [4096] for elasticsearch process is too low, > increase to at least [65536] > > > ``` ulimit -n 65536 ``` or set `nofile` to `65536` in `/etc/security/limits.conf` > > max number of threads [1024] for user [xxx] is too low, increase to at > least [2048] > > > ``` ulimit -u 2048 ...
Following steps helped us get started with ES 5.5.2. On Azure with 3 master, 3 client and 8 data nodes using Ubuntu servers 1. Ensure following configurations in "/etc/security/limits.conf" > > \*soft memlock unlimited > > > \*hard memlock unlimited > > > 2. ulimit -l unlimited 3. ulimit -n 65536 4. sudo sysct...
60,216,204
When I tried to run my code on Eclipse IDE, this error keeps on poping up: ``` Error occurred during initialization of boot layer java.nio.file.InvalidPathException: Illegal char <?> at index 24: (path to project). ``` I don't know what this error meant. First, I thought it was some problem caused by some of my ...
2020/02/13
[ "https://Stackoverflow.com/questions/60216204", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12494226/" ]
Not sure to understand your question. Why couldn't you use `aes_string()` and define a function like below ? ```r make.histogram <- function(variable) { p <- ggplot(my.data, aes_string(x = variable, fill = "type")) + (...) + xlab(variable) print(p) } ```
Since ggplot is part of the *tidyverse*, I think *tidyeval* will come in handy: ``` make.histogram <- function(var = "foo", bindwith = 0.01) { varName <- as.name(var) enquo_varName <- enquo(varName) ggplot(my.data, aes(x = !!enquo_varName, fill = type)) + ... labs(x = var) } ``...
70,919,047
I created a .Net 6 class library and now I am trying to create a test project. a .net 6 test project is not available. Online I found the information to use .Net Framework or .Net core in order to test. I created a .Net Framework 4.8 test project an referenced my class library. I receive the Compiler error: > > ...
2022/01/30
[ "https://Stackoverflow.com/questions/70919047", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8695110/" ]
I created a NET 6.0 class library and received the same message. I went into properties, just to double check that my project and my test project were set the same and noticed that the Target OS was not set in my library. It was in my project, but not in my class library. Once I changed my class library "Target OS" ...
This is A solution, not likely THE only solution: I also have a .NET 6.0 project that I would like to test. With the project template picker, I picked the C# NUnit Test for .NET Core. When advancing to next screen, there was a dropdown that allowed me to pick a Target framework. .NET 6.0 was the default option.
50,026,939
I am using php `mysqli_connect` for login to a MySQL database (all on localhost) ``` <?php //DEFINE ('DB_USER', 'user2'); //DEFINE ('DB_PASSWORD', 'pass2'); DEFINE ('DB_USER', 'user1'); DEFINE ('DB_PASSWORD', 'pass1'); DEFINE ('DB_HOST', '127.0.0.1'); DEFINE ('DB_NAME', 'dbname'); $dbc = mysqli_connect(DB_HOST, DB_US...
2018/04/25
[ "https://Stackoverflow.com/questions/50026939", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3806340/" ]
If you're on Windows and it's not possible to use `caching_sha2_password` at all, you can do the following: 1. rerun the MySQL Installer 2. select "Reconfigure" next to MySQL Server (the top item) 3. click "Next" until you get to "Authentication Method" 4. change "Use Strong Password Encryption for Authentication (REC...
I ran the following command `ALTER USER 'root' @ 'localhost' identified with mysql_native_password BY 'root123';` in the command line and finally restart MySQL in local services.
19,115,617
Within a Java EE 5 environment I have the problem to ensure the existence of some data written by another part before continue processing my own data. Historically (J2EE time), it was done by putting the data object to be processed into an internal JMS queue after waiting for e.g. 500ms via Thread.sleep. But this doe...
2013/10/01
[ "https://Stackoverflow.com/questions/19115617", "https://Stackoverflow.com", "https://Stackoverflow.com/users/817543/" ]
I agree with @dkaustubh about timers and avoiding threads manipulation in JavaEE. Another possibility is to use JMS queue with delayed delivery. Although it is not a part of JavaEE API, most of messaging systems vendors supports it. [check here](http://java.dzone.com/articles/sending-delayed-jms-messages).
Use notifications and `Object#wait()` / `Object#notifyAll()` i.e. Multithreaded, the producer notifies the consumer.
27,677,793
Below worksheet code defines two functions. fun accepts a function parameter of type `Int => Int` and invokes the function with parameter value 2 `funParam` accepts an Int parameter and returns this parameter + 3. This is a contrived example so as gain an intuition of how functions are passed around when writing func...
2014/12/28
[ "https://Stackoverflow.com/questions/27677793", "https://Stackoverflow.com", "https://Stackoverflow.com/users/470184/" ]
I had similar error and calling: npm cache clean Helped me solve it.
`npm` is telling you that you lack the permissions to modify permissions on the affected file. This is probably a race condition, several of which were fixed in the `npm@1.4` codebase. I will guess that the reason you see it on one disk and not the other is that the disks have different latency and read access times, c...
184,734
Usually, in Ubuntu 10.04 Netbook, if I want to open a program, it usually goes from this: ![An arbitrary open program](https://i.stack.imgur.com/7zbtD.png) (An open program) to this: [Using a program launcher to launch another program http://a.yfrog.com/img251/3201/workspace2002thumb.png](http://a.yfrog.com/img2...
2010/09/04
[ "https://superuser.com/questions/184734", "https://superuser.com", "https://superuser.com/users/23420/" ]
From the Ubuntu Software Center, install "Advanced Desktop Effects Settings (ccsm)". After the installation, a new menu item called "CompizConfig Settings Manager" will appear in the System->Preferences menu. Click on that and navigate to General->General Options->Focus and Raise Behaviour. Set the "Focus Prevention ...
hi! Try this: ``` #!/bin/bash delay=0.5 while true; do windowId=`xdotool getwindowfocus` xdotool getwindowname $windowId xdotool windowactivate $windowId; sleep $delay; done ``` This script depends on you setting the "Focus prevention level" high enough so that new opened windows w...
42,882,170
Hi I have a code that shows date + 5 days in DD.MM format Please help me to add current year to this code. DD.MM.YYYY Year also should be like day and month and not this way `+ "2017"` ``` <script> function get(dday) { var newdate = new Date(); newdate.setDate(newdate.getDate()+dday); return newdate.getDat...
2017/03/19
[ "https://Stackoverflow.com/questions/42882170", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6215911/" ]
SIGSEGV are not always thrown due to a root cause of memory access problems... Perl throws a 139 on Unix usually because of file I/O. You might have accidentally deleted your input files.
On Perl programmation RC 139 caused by "Out of memory" for me. Because there have been too much data in a variable (millions). I have done a segmentation manualy by release (undef) this variable regularly. This solved this.
37,513,660
This is my first time using Scala and ApacheSpark for a project. I'm trying to print the contents of an matrix when I run my code in the terminal, but nothing I try is working so far. Instead I only get this printed: ``` org.apache.spark.mllib.linalg.distributed.MatrixEntry;@71870da7 org.apache.spark.mllib.linalg.dis...
2016/05/29
[ "https://Stackoverflow.com/questions/37513660", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5560818/" ]
Building on @zero323 's comment ( aside would you like to put an answer out there?): given an RDD[SomeType] you can call ``` rdd.collect() ``` or ``` rdd.take(k) ``` Then you can print out the results using normal toString() methods that depend on the type of the rdd contents. So if `SomeType` were a `List[Doub...
Iterate over the `rdd` like this, ``` rdd.foreach(println) ```
1,257,725
group box, flow layout panel, panel, split container,and tab control do not drag. I believe uninstalling resharper is when it started to happen. I've done a repair on visual studio. I've uninstalled and reinstalled. Any idea where I would look or what is wrong? When I click on the drag icon. the mouse snaps left t...
2009/08/10
[ "https://Stackoverflow.com/questions/1257725", "https://Stackoverflow.com", "https://Stackoverflow.com/users/57883/" ]
I had the same issue and happened to stumble upon this solution ... If you have your table view controller (eg. `UISearchDisplayController`) nested in a Tab Bar or Navigation controller using Interface Builder, you need to set the "Nib Name" in the "Attributes Inspector" window. The Nib name will be the one that hold...
Ok, I have found how to solve it. In my case, the problem was due to the fact that I was using a controller embedded within the UITabBarController as one of its managed tabs (i.e. as a child). Removing the controller from the UITabBarController, then adding an UINavigationController to the UITabBarController instead, ...
1,764,647
Hiya i'm creating a web form and i want a user to be able to make certain selections and then add the selections to a text box or listbox. Basically i want them to be able to type someone name in a text box ... check some check boxes and for it up date either a text for or a list box with the result on button click......
2009/11/19
[ "https://Stackoverflow.com/questions/1764647", "https://Stackoverflow.com", "https://Stackoverflow.com/users/214753/" ]
Ensure that the security settings of the "C:/Program Files (x86)/Aspell" folder for the current user allow for modifying and writing. I had the same issue, and this cleared it right up.
> > "Ensure that the security settings of the "C:/Program Files (x86)/Aspell" folder for the current user allow for modifying and writing" > > > > > > > "I took the read only off of "C:/Program Files/Aspell" folder. [The error message remains]" > > > > > > > > > It's not a read-only problem, but permissions...
29,898
From my understanding, when the money supply curve shifts to the right, interest rates go down, it follows that the price level decreases and the prices should go down? Thanks in advance.
2019/06/21
[ "https://economics.stackexchange.com/questions/29898", "https://economics.stackexchange.com", "https://economics.stackexchange.com/users/23493/" ]
Price levels are not necessarily linked to interest rates, especially real rates. Speaking strictly from an IS-LM standpoint, an expansionary monetary policy will increase the real money supply and depress interest rates, holding output constant. This will cause a rightward shift in the LM curve; holding money demand ...
More money chasing the same amount of goods causes prices to rise until all demand is satisfied at the higher price.
53,319,441
I have put together this section of code which does what it's supposed to do. The only problem is when I deselect the first checkbox the shopping cart box remains. I want the top box to be the master, so if that's not selected the program will display nothing. Here's what I have so far: ```js function shoppingcartFunc...
2018/11/15
[ "https://Stackoverflow.com/questions/53319441", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5743264/" ]
You can effectively simulate what you want in your `shoppingcartFunction()` by unchecking `#shopping_cart` and calling `shoppingcart1Function()` directly. ```js function shoppingcartFunction() { // Get the checkbox var checkBox = document.getElementById("myCheck"); // Get the output text var text = docume...
If I undestand you, you want to hide all what is inside the p with id="text1". So just get it with var text1 = document.getElementById("text1"); and set its display to "none" if the first checkbox is not checked, otherwise do nothing. ``` function shoppingcartFunction() { // Get the checkbox alert("The first"); ...
3,050,984
I understand the fundamentals of algrebra, but have very limited knowledge of geometry and trigonometry. I wish to learn calculus at this point. Is it reasonable to begin learning calculus, and learn these other concepts as I encounter them rather than learning the prerequisites in the standard fixed progression (i.e....
2018/12/24
[ "https://math.stackexchange.com/questions/3050984", "https://math.stackexchange.com", "https://math.stackexchange.com/users/556557/" ]
> > How difficult will it be to learn these concepts without the prescribed linear progression? > > > It's not really a linear progression, not at all. All of these subjects actually deal with the same thing. Mathematics is all connected. Algebra (as it's defined by educators), geometry and trigonometry are taugh...
Having a personal goal in mind very motivating, and backtracking to learn what you need for specific goals as they come up is *fantastic* way to learn... as long as you have the time for it. If you're in a hurry to get something done, though, it can be incredibly frustrating to interrupt your progress for long periods...
6,796,492
Is it possible to temporarily redirect stdout/stderr in Python (i.e. for the duration of a method)? ### Edit: The problem with the current solutions (which I at first remembered but then forgot) is that they don't *redirect*; rather, they just replace the streams in their entirety. Hence, if a method has a ***local* ...
2011/07/22
[ "https://Stackoverflow.com/questions/6796492", "https://Stackoverflow.com", "https://Stackoverflow.com/users/541686/" ]
You can also put the redirection logic in a contextmanager. ``` import os import sys class RedirectStdStreams(object): def __init__(self, stdout=None, stderr=None): self._stdout = stdout or sys.stdout self._stderr = stderr or sys.stderr def __enter__(self): self.old_stdout, self.old_s...
We'll use the `PHP` syntax of [ob\_start](http://php.net/manual/en/function.ob-start.php) and [ob\_get\_contents](http://php.net/manual/en/function.ob-get-contents.php) functions in python3, and redirect the input into a file. The outputs are being stored in a file, any type of stream could be used as well. ``` from ...
1,406,632
Consider the following three points in $R^3$ : $P(−1, 1, 0), Q(1, 5, 6), R(3, −1, 4)$ Find the values of $x ∈ R$ for which $PR + x QR$ is perpendicular to $PR$. I was thinking that equating the dot product of those 2 vectors to $0$ might give the values. But this only gives one x value ($x=-3$) and I presume that the...
2015/08/23
[ "https://math.stackexchange.com/questions/1406632", "https://math.stackexchange.com", "https://math.stackexchange.com/users/260784/" ]
Translation is not a linear map, but can still be represented by a matrix by adding one new coordinate and setting it equal to$~1$. In your example you are dealing with a plane, so you have two coordinates $x,y$ say; you add a third coordinate $z$ and force it to be equal to$~1$. In other words you identify your (affin...
I think the difficulty here is that translation by a fixed vector isn't a linear transformation. One way to see this is that a sum of translates isn't the translate of the sum. Thus not going to be able to cook up a matrix to get the job done.
25,280,064
I try to make simple dll project in Visual Studio 2013 like in <http://www.itcsolutions.eu/2009/12/10/how-to-create-a-dll-dynamic-link-library-in-c-as-visual-studio-2008-project/> But when i try to build solution it falls with an error: ``` error LNK1104: can not open file "D:\prj\dlltest1\Debug\dlltest1.lib" D:\pr...
2014/08/13
[ "https://Stackoverflow.com/questions/25280064", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1312837/" ]
Updating for current state of things: **basarat**'s answer didn't work for me and it broke IAngularStatic typing in my app, but adding this to my global.d.ts fixed the custom angular extending function problem: ``` declare namespace angular { interface IAngularStatic { copyData:Function; } } ``` I d...
Since angular is a singleton instance, you can just do: ``` angular.executeAfterDigest = function(fn) { setTimeout(fn,0); } ``` When you call it, it is not guaranteed to execute after a digest. You would have to make sure that it is only called when `$scope.$$phase` is `$digest` or `$apply`. Basically, it will o...
32,205,590
After installing laravel we get an error: > > Parse error: syntax error, unexpected T\_CLASS, expecting T\_STRING or T\_VARIABLE or '$' in C:\xampp\htdocs\laravel\public\index.php on line 50 > > >
2015/08/25
[ "https://Stackoverflow.com/questions/32205590", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5264524/" ]
Laravel 5.1 uses the [`::class` property](http://php.net/manual/en/language.oop5.basic.php#language.oop5.basic.class.class) to get string representations of a fully qualified classname. The error you're seeing is caused by [this line](https://github.com/laravel/laravel/blob/8914be5fc864ebc6877be38ff3502997e0c62761/publ...
I was facing the same error but error was in app/User.php line 10. Actually, line 10 was ok but before line 10 I was missing some php syntax. After correct the php syntax error It was fixed. So you have to check C:\xampp\htdocs\laravel\public\index.php on line 49 carefully I am sure there is something wrong. Just try...
55,592,442
I have two arrays that I am trying to combine in GAS, arr2 is multidimensional. ``` arr1 = ["Diesel", "Solar", "Biomass"] arr2 = [ ["ABC", "Nigeria", "Diesel,Solar", 35], ["DEF", "Egypt", "Solar,Diesel", 50], ["GHI", "Ghana", "Biomass,Diesel", 70] ] ``` What I want to do is push the e...
2019/04/09
[ "https://Stackoverflow.com/questions/55592442", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10289339/" ]
Using [`array.splice()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice) and [`array.map()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map) **Syntax** > > `array.splice(start[, deleteCount[, item1[, item2[, ...]]]])` > > > ...
Try using the following code ``` arr1 = ["Diesel", "Solar", "Biomass"] arr2 = [ ["ABC", "Nigeria", "Diesel,Solar", 35], ["DEF", "Egypt", "Solar,Diesel", 50], ["GHI", "Ghana", "Biomass,Diesel", 70] ] arr2.forEach((subArr, index) => {console.log(subArr.splice(3, 0, arr1[index]));}); conso...
394,316
I want to write a script in Ruby to clean up some messed up keys in several copies of the same MySQL schema. I'd like to do something like SHOW CREATE TABLE, then look at what comes back and delete keys if they exist. I know in the Rails environment you can do this... ``` ActiveRecord::Base.connection.execute( some s...
2008/12/26
[ "https://Stackoverflow.com/questions/394316", "https://Stackoverflow.com", "https://Stackoverflow.com/users/42595/" ]
If you don't want to use ActiveRecord an ORM may be a bit complicated for your usage right now), you can still use the ruby-mysql library or even better IMHO is to use the Ruby DBI/DBD library ([here](http://rubyforge.org/projects/ruby-dbi/)) which has DBD drivers for mysql & postgresql out-of-the-box. That way, you c...
There is probably a better way to do that programmatically, however if you really want to drive the interactive commands and parse the results, then [expect](http://expect.nist.gov/) may be more suitable. You could still kick off expect from your ruby script.
29,312,001
Background: I am in the process of integrating TypeScript into a Play Framework (2.2.6) and I am trying to use mumoshu's plugin to do so. Problem is, the plugin has problems when running "play dist" on a windows machine. I've forked the code from GitHub in order to make some modifications to the source so I can continu...
2015/03/27
[ "https://Stackoverflow.com/questions/29312001", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1612524/" ]
I used css for this, try if this help you. HTML: `<div id="chartist" class="chartist" data-x-axis="X axis label" data-y-axis="Y axis label"></div>` CSS: ``` [data-x-axis]::before { content: attr(data-x-axis); position: absolute; width: 100%; text-align: center; left: 0; bottom: 0; font-s...
Titles are currently (June 2015) not supported. The [issue for this](https://github.com/gionkunz/chartist-js/issues/27) suggests that the Chartist authors want you to label the graph outside of Chartist but does include a way to do this in your HTML though with some notable caveats.
17,932,734
If I have tests for simple functions, `fun1` and `fun2`, which need some arguments: ``` class TestOne(unittest.TestCase): def test_func1(self): a = 0 b = 1 c = 2 self.assertEquals(c, fun1(a,b)) def test_fun2(self): d = 0 e = 1 f = 2 self.assertEq...
2013/07/29
[ "https://Stackoverflow.com/questions/17932734", "https://Stackoverflow.com", "https://Stackoverflow.com/users/348081/" ]
You have a few of options: 1. I'm adding this one at the top as every other answer seems to want to use inheritance. If this is the case and you only want to set up the values before each test section (versus each test with `setUp`), use `setUpClass`: ``` from unittest import TestCase class BaseTest(TestCase): def ...
I believe you can also create another class. I've seen this done, but I haven't actually done it before. If people know that this works, please leave a comment :) while I test it out myself: ``` class Tests(unittest.TestCase): def __init__(self): self.a = 0 self.b = 1 self.c = 2 class Test...
37,877,643
I have a `ViewPager` inside a `FragmentActivity`. For each page I have a `Fragment` with an `EditText`. I want to prevent the user leaving the screen if the `EditText` value has changed, showing a warning `Dialog` asking if he/she really wants to leave the screen. For that I need to check the `EditText` value when th...
2016/06/17
[ "https://Stackoverflow.com/questions/37877643", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2274847/" ]
Try this in your `parent Activity`: ``` @Override public void onBackPressed() { super.onBackPressed(); YourFragment fragment = (YourFragment) getSupportFragmentManager().getFragments().get(viewPager.getCurrentItem()); } ``` Then you have access to your `Fragment` so you can add a parameter in your fragme...
You could create a Boolean value in the FragmentActivity and keep it updated with the EditText updated. In this way you can check the String value instead the EditText (In fact the fragment could not be loaded in the Pager). For example: 1) create an interface in order to declare the input protocol ``` public interf...
19,456,404
``` (define (myminus x y) (cond ((zero? y) x) (else (sub1 (myminus x (sub1 y)))))) (define (myminus_v2 x y) (cond ((zero? y) x) (else (myminus_v2 (sub1 x) (sub1 y))))) ``` Please comment on the differences between these functions in terms of how much memory is required on the stack for each recur...
2013/10/18
[ "https://Stackoverflow.com/questions/19456404", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2253489/" ]
They should both have a number of steps proportional to y. The second one is a tail call meaning the interpreter can do a tail elimination meaning it takes up a constant space on the stack whereas in the first the size of the stack is proportional to Y.
`myminus` creates `y` continuations to `sub1` what the recursion evaluates to. This means you can exhaust rackets memory limit making the program fail. In my trials even as little as 10 million will not succeed with the standard 128MB limit in *DrRacket*. `myminus_v2` is `tail recursive` and since `racket` have same p...
27,245
**Mark 15:25, 18 KJV** > > And it was the **third hour**, and they crucified him. > > > and > > And began to salute him, Hail, King of the Jews! > > > **John 19:14-16 KJV** > > And it was the preparation of the passover, and about the **sixth hour**: and he saith unto the Jews, Behold your King! > But th...
2014/04/09
[ "https://christianity.stackexchange.com/questions/27245", "https://christianity.stackexchange.com", "https://christianity.stackexchange.com/users/4277/" ]
Saint Augustine gives an explication of this in his *De consensu evangelistarum* (3, 13). > > If Jesus was given up to the Jews to be crucified, when Pilate sat down at his tribunal about the sixth hour, as John relates, how could He be crucified at the third hour, as many persons have thought from not understanding ...
Mark (15:25) said that Jesus was crucified in the third hour. John (19:14), on the other hand, said that it was in the sixth hour it happened. We have here what looks like a contradiction. However, it is more a paradox than a contradiction, because there seems to be a logical explanation to this dilemma. According to ...
39,979,183
Relatively new to Sitecore. I've searched this one out pretty thoroughly here and on dev.sitecore.net, and haven't seen where these subjects overlap... We've got a web forms for marketers form in production. We use content delivery servers, so the file uploaded via this form saves the image file that is uploaded to "w...
2016/10/11
[ "https://Stackoverflow.com/questions/39979183", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2880381/" ]
The issue is not user generated content, but the configuration of the WFFM module. When installing WFFM on the CD servers you need to configure the `remoteWfmService` connection string to point to the WFFM Remote Service on the CM server. This ensures that any actions are run on the CM server, and therefore any files w...
There is no one good answer to your question. What in fact your question is about is how to store `User generated content`. There are plenty of articles and discussions about it available online already. Check e.g. <https://www.google.com/search?q=user+generated+content+sitecore> You may see from the articles that ...
6,046,350
I have the following code: ``` lblMetaTag.Text = "<meta property='" + ctrl.property_name + "' content='" + ctrl.property_value + "' />"; ``` When it renders to the page - it renders the meta tag and not the string representation. How do I display it as the string?
2011/05/18
[ "https://Stackoverflow.com/questions/6046350", "https://Stackoverflow.com", "https://Stackoverflow.com/users/185961/" ]
Change it to the following: ``` lblMetaTag.Text = "&lt ;meta property='" + ctrl.property_name + "' content='" + ctrl.property_value + "' /&gt ;"; ```
Use HTML encoding before sending putting it on your page.
7,796,010
Here is written how to set the name of a form with a class: <http://symfony.com/doc/2.0/book/forms.html#creating-form-classes> but how to set the name of this form? ``` $form = $this->createFormBuilder($defaultData) ->add('name', 'text') ->add('email', 'email') ->getForm(); ``` Well, I'm trying to get ...
2011/10/17
[ "https://Stackoverflow.com/questions/7796010", "https://Stackoverflow.com", "https://Stackoverflow.com/users/248959/" ]
There is no shortcut method for this purpose. Instead you have to access the method `createNamedBuilder` in the form factory: ``` $this->get('form.factory')->createNamedBuilder('form', 'form_name', $defaultData) ->add('name', 'text') ->add('email', 'email') ->getForm(); ```
In version 2.4.1 of Symfony, the solution is: ``` $form = $this->createFormBuilder ( NULL, array ( 'attr' => array ( 'name' => 'myFormName', 'id' => 'myFormId' ) ) ) ->add (.. ``` You can also set other form attributes this way, but I've not tried. Replace NULL with your data if you want.
56,034,177
I am trying to test my Tour of Heroes Angular application using ***mocha***, ***chai*** & ***webpack***. I have followed [this post](https://hichambi.github.io/2016/12/27/testing-angular2-with-webpack-mocha-on-browser-and-node.html) & also with the help of [this guide](https://www.radzen.com/blog/testing-angular-webpac...
2019/05/08
[ "https://Stackoverflow.com/questions/56034177", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8947616/" ]
2021 Adding the line below as first import to the spec file fixed this problem for me: ``` import 'zone.js/dist/zone-testing'; ```
I see a few issues here. You have 2 beforeEach. You should only have 1. If you have async on your block of test code, then you need to call await on a function, and/or use flush or tick to progress time. I usually use fakeAsync for observables, and async/await for real async methods. For this specific example, you sh...
32,655,076
I need to parse some markup similar to this one, from an html page: ``` <div id="list"> <div class="item-level-a"> <div class="item-level-b"> <a href="http://www.example.com/1"></a> </div> </div> <div class="item-level-a"> <div class="item-level-b"> <a href="http://www.example.com/2"></...
2015/09/18
[ "https://Stackoverflow.com/questions/32655076", "https://Stackoverflow.com", "https://Stackoverflow.com/users/709439/" ]
In `cheerio` and `jquery`, you get attributes with `attr()`, not `attrib()`. There are a few other problems with your code. Here is a working version using `cheerio`. It probably works in `jquery` this way as well.: ``` var list = []; $('div[id="list"]').find('div > div > a').each(function (index, element) { list.p...
For those who prefer a functional style: ```js const list = $('div[id="list"]') .find('div > div > a') .toArray() .map(element => $(element).attr('href'))); ```
4,655,968
We are trying to load a flash file in a browser from local machine its loading only in Internet Explorer (IE) but not in other browsers. Please suggest me some solution.
2011/01/11
[ "https://Stackoverflow.com/questions/4655968", "https://Stackoverflow.com", "https://Stackoverflow.com/users/571029/" ]
It is rare in C++ certainly. In C it may well show up where: * You use "objects" which are structs, and you always pass them around or create them on the heap as pointers. * You have collections of such pointers as dynamically allocated arrays thus T\*\* where T is the type. * You want to get an array so you pass in ...
You could refer to a 3 dimensional array of ints as `int *** intArray;`
24,878
I have an array of $n$ real values, which has mean $\mu\_{old}$ and standard deviation $\sigma\_{old}$. If an element of the array $x\_i$ is replaced by another element $x\_j$, then new mean will be > > $\mu\_{new}=\mu\_{old}+\frac{x\_j-x\_i}{n}$ > > > Advantage of this approach is it requires constant computatio...
2012/03/19
[ "https://stats.stackexchange.com/questions/24878", "https://stats.stackexchange.com", "https://stats.stackexchange.com/users/4319/" ]
Based on what i think i'm reading on the [linked Wikipedia article](http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Compute_running_.28continuous.29_variance) you can maintain a "running" standard deviation: ``` real sum = 0; int count = 0; real S = 0; real variance = 0; real GetRunningStandardDeviat...
Given original $\bar x$, $s$, and $n$, as well as the change of a given element $x\_n$ to $x\_n'$, I believe your new standard deviation $s'$ will be the square root of $$s^2 + \frac{1}{n-1}\left(2n\Delta \bar x(x\_n-\bar x) +n(n-1)(\Delta \bar x)^2\right),$$ where $\Delta \bar x = \bar x' - \bar x$, with $\bar x'$ den...
3,006,413
I have a class with a few numeric fields such as: ``` class Class1 { int a; int b; int c; public: // constructor and so on... bool operator<(const Class1& other) const; }; ``` I need to use objects of this class as a key in an `std::map`. I therefore implement `operator<`. What is the simplest im...
2010/06/09
[ "https://Stackoverflow.com/questions/3006413", "https://Stackoverflow.com", "https://Stackoverflow.com/users/45603/" ]
I think there is a misunderstanding on what `map` requires. `map` does not require your class to have `operator<` defined. It requires a suitable comparison predicate to be passed, which conveniently defaults to `std::less<Key>` which uses `operator<` on the `Key`. You should not implement `operator<` to fit your key...
A version which avoids multiple indentation is ``` bool operator<(const Class1& other) const { if(a != other.a) { return a < other.a; } if(b != other.b) { return b < other.b; } return c < other.c; } ``` The "Edit 2" version of the author has on average more comparisons t...
12,869,423
I'm learning C# and am trying to get my head around when to use classes and when not to. If I was writing an app for a bank, I know I would use classes for customers which would include their name, account number, balance, etc. Would I use a static class for the methods that would deposit into their account, withdraw...
2012/10/13
[ "https://Stackoverflow.com/questions/12869423", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1742690/" ]
Static classes are used when you aren't going to instantiate objects. You get one "instance" of that class - you can't do things like: ``` MyStaticClass m = new MyStaticClass(); m.SomeFunc(); ``` when you've got a static class. Instead you'd use it by using the class name itself. Something like: ``` MyStaticClass.S...
This is meant to be in addition to the other answers. This is example of polymorphism with interfaces. ``` public interface IDeposit { void Deposit(decimal amount); } public interface IWithdraw { void Withdraw(decimal amount); } public class Customer : IDeposit, IWithdraw { public void Deposit(decimal am...
32,183,948
I'm trying to write a function which loops x times (3 in this example) through x steps (Step 1, Step 2 in this example) for x seconds (in this example, Step 1 takes 2 seconds, Step 2 takes 1 second). So I'd like it to loop as below: Step 1 (2 seconds) Step 2 (1 second) Step 1 (2 seconds) Step 2 (1 second) Step 1 (2...
2015/08/24
[ "https://Stackoverflow.com/questions/32183948", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2282086/" ]
I have not tried the code, but I think this should work ``` jQuery('input').click(function () { loopAction (3, 1, 2); // x is number of loops - s1, s2 in seconds }); function loopAction(x, s1, s2){ If (x>0){ // as long as x>0 start the iteration jQuery('div').html('Step 1'); setTim...
Recursive Method answer: ``` function recursiveSteps(config) { var _step = config.step; config.step++; jQuery('div').html('Step 1'); setTimeout(function() { jQuery('div').html('Step 2'); },2000); setTimeout(function() { jQuery('div').empty(); },3000); if(config.st...
589
There are growing number of crypto currencies currently translated into public access via BigQuery by means of Google Cloud. For example, see [here](https://cloud.google.com/blog/products/gcp/bitcoin-in-bigquery-blockchain-analytics-on-public-data), [here](https://cloud.google.com/blog/products/data-analytics/ethereum-...
2019/02/24
[ "https://tezos.stackexchange.com/questions/589", "https://tezos.stackexchange.com", "https://tezos.stackexchange.com/users/438/" ]
It seems to me this is a very good question and afaik such an effort is actively taken by [Cryptonomic](https://cryptonomic.tech/) in that direction. They are in the process of releasing a quite flexible query system called [Arronax](https://medium.com/the-cryptonomic-aperiodical/arronax-an-analysis-oriented-block-expl...
Tezos BigQuery dataset is available now :) <https://medium.com/tezoscommons/tezos-public-finance-dataset-integrated-into-google-bigquery-6050726d2b96>
22,378,806
I am trying out a customized Incoming and outgoing call screen for my app. Both about the same screen and change the buttons according to state received from the broadcast. I am able to receive incoming calls properly but for making calls when I open my contacts and then click on number my customized screen opens but ...
2014/03/13
[ "https://Stackoverflow.com/questions/22378806", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1443051/" ]
You may try adding this to your manifest: ``` <uses-permission android:name="android.permission.CALL_PHONE" /> ``` More info here: <http://developer.android.com/reference/android/Manifest.permission.html#CALL_PHONE>
You have not defined the [CALL\_PHONE](http://developer.android.com/reference/android/Manifest.permission.html#CALL_PHONE) permission in AndroidManifest.xml file Your manifest should look like this ``` <uses-permission android:name="android.permission.CALL_PHONE" /> <!-- permission added!--> <application android:...
4,932,029
Can I have an enum which acts as a key value pair. ``` public enum infringementCategory { Infringement, OFN } ``` If I select `Infringement` I should get "INF0001" and if I select `OFN` I should get "INF0002" Is it possible?
2011/02/08
[ "https://Stackoverflow.com/questions/4932029", "https://Stackoverflow.com", "https://Stackoverflow.com/users/197878/" ]
How about these extensions: ``` public static class EnumExtension { /// <summary> /// Gets the string of an DescriptionAttribute of an Enum. /// </summary> /// <param name="value">The Enum value for which the description is needed.</param> /// <returns>If a DescriptionAttribute is set it return the...
You could store the titles (INF0001)... in a `Dictionary<infringementCategory, string>`
88,890
We're studying Heuristic in my Theoretical CS class, more specifically Greedy-Algorithms for the Traveling Salesperson Problem. The first one is the "next neighbor heuristic", where you start at any given point and connect it with the nearest point and then connect that to the next nearest one until all points are cove...
2018/03/04
[ "https://cs.stackexchange.com/questions/88890", "https://cs.stackexchange.com", "https://cs.stackexchange.com/users/84399/" ]
First let's name your points $P\_A$, $P\_B$, $P$, $P\_C$, and $P\_D$ (from left to right). With the first heuristic you start at one point ($P$) and move to the closest point. From that new point, you move to the next closest point, and so on and so forth. With the second heuristic you again start at one point ($P$) ...
The example shows the Travelling salesman problem for the case that all points are on a straight line. That’s rarely the case. And you cant just move the points to solve the problem, they are where they are. The closest pair heuristics seems to be that you find the closest connection and add it, then again the closes...
43,244,096
I'm building a virtual environment and need to simulate a real switch with devices attached. I prefer to stay away from a single vendor solution & Mininet/OVS look promising. However, I don't find snmp support in the docs. I need to obtain the switch arp & mac tables (at a minimum) via either SNMP or a cli command via...
2017/04/06
[ "https://Stackoverflow.com/questions/43244096", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1248438/" ]
Consider using a different layout manager which gives you more control over how components are laid out, for example, a `GridBagLayout` [![Example](https://i.stack.imgur.com/pOfxt.png)](https://i.stack.imgur.com/pOfxt.png) *nb: The padding around the text fields is courtesy of MacOS, in this case, I'd consider using ...
Set the preferred size of the result field as below ``` result_Label.setPreferredSize(length1.getPreferredSize()); ```
57,101,064
Using double float data calculate the count, average and standard deviation of any given input. Every time I run the program it gives me my count and average however my standard deviation shows up as NaN. ``` import java.util.Scanner; public class Final { public static void main (String[]args) { Sca...
2019/07/18
[ "https://Stackoverflow.com/questions/57101064", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11804800/" ]
Your `sumsquared`variable is always `0`since you calculate it from `0*0` right after the initialization of `double sum=0;`. This part should be moved below the summation. Also to calculate the standard deviation without arrays using loops, you need to know the following 3 values: * How many numbers were entered. * ...
Your `sumsquared` is zero. So, you’re using a value of `0` in your standard deviation. Here’s the fix to relocate your `sumsquared`. EDIT: I think your `std` is incorrect. You must find the mean first. Inside the square root, find the sum of `( x - mean)`, where x are your data, then divide that result by `count - 1`...
219,813
I want to add my custom template on product page just like `$this->getChildHtml('custom_product_info')`. As in magento1.9 to use `$this->getChildHtml('custom_product_info')` we add layout xml like below : ``` <catalog_product_view> <reference name="product.info"> <block type="core/template" name="cust...
2018/03/26
[ "https://magento.stackexchange.com/questions/219813", "https://magento.stackexchange.com", "https://magento.stackexchange.com/users/14039/" ]
Use this ``` <?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="product.info"> <block class="Magento\Framework\View\Element\Template" name="block...
``` <referenceContainer name="content"> <block class="Xcommerce\Category\Block\Overview" name="overview" template="X2commerce_Category::custom.phtml"> </block> </referenceContainer> ```
674,169
I have been looking at a few of our VB.NET dll's using FxCop and all of the errors relate to DLL setup (i.e. Strong Names, Culture Info) and the case of Variables methods. Looking at a few examples of FxCop examining a C# Dll, it appears to offer a lot more potential errors. Does this mean that FxCop is more valuab...
2009/03/23
[ "https://Stackoverflow.com/questions/674169", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11802/" ]
As far as I am aware, FxCop is language agnostic. It is more likely that C# has more freedom than VB.NET in various areas allowing for more mistakes to occur (as FxCop interprets it) rather than FxCop being biased somehow. If this is the case, then I can see it being more valuable to a C# developer than a VB.NET develo...
FxCop is supposed to work on compiled code, so the language you write in shouldn't matter. I've used the tool on projects with either C# or VB, so it does indeed work. It has been rather helpful, actually.
1,214,153
All the time I have the problem that I cannot delete - move - rename folders in Windows 7 (also applies to windows 10) on network drives because of the thumbs.db file. It complains: "The action can't be completed because the file is open in Windows Explorer." I found something in a long thread that works for me.
2017/05/29
[ "https://superuser.com/questions/1214153", "https://superuser.com", "https://superuser.com/users/390837/" ]
**short answer:** windows 7: In explorer: Change file display settings from "details" to "Content" windows 10: In explorer: View->Layout->List Now the thumbs.db file can be removed. **Long answer:** <https://social.technet.microsoft.com/Forums/windows/en-US/ca2cbc1a-362f-4f01-a8f8-6f05112f1915/windows-7-bug-explor...
I had this issue in Windows 11 on a network share, and none of the above solutions worked (changed view / layout, cut/paste on local machine). However I was able to rename it to \_.db, and then I was able to delete the file.
1,005,805
I'm trying to come up with a regex that helps me validate a **Blood Group** field - which should accept only A[+-], B[+-], AB[+-] and O[+-]. Here's the regex I came up with (and tested using **[Regex Tester](http://regexpal.com/)**): ``` [A|B|AB|O][\+|\-] ``` Now this pattern successfully matches A,B,O[+-] but fai...
2009/06/17
[ "https://Stackoverflow.com/questions/1005805", "https://Stackoverflow.com", "https://Stackoverflow.com/users/112364/" ]
Try: ``` (A|B|AB|O)[+-] ``` Using square brackets defines a [character class](http://www.regular-expressions.info/charclass.html), which can only be a single character. The parentheses [create a grouping](http://www.regular-expressions.info/brackets.html) which allows it to do what you want. You also don't need to e...
^(A|B|AB|O)[+-]?$ This will produce the correct out put.
4,497,538
This question comes from a qualifying exam. > > Let $C$ be an $n × n$ real matrix with $n ≥ 3$. > (a) For which real polynomials $q$ of degree 2 is the null space of $q(C)$ not the zero subspace? > (b) For which real polynomials $f$ of degree $k ≥ 3$ is $f(C)$ invertible? > > > I've never faced a similar question...
2022/07/21
[ "https://math.stackexchange.com/questions/4497538", "https://math.stackexchange.com", "https://math.stackexchange.com/users/314957/" ]
Suppose $\lambda\_i$, $(i=1,2,...)$ is the eigenvalue of matrix $C$. a) Construct a polynomial $q(x)=(x-\lambda\_i)g(x)$, where $g(x)=ax+b; a(\ne 0)\in\mathbb R, b\in\mathbb R$ is linear function. In case, $\lambda\_i$ is complex then choose $g(x)=(x-\overline\lambda\_i)$. Matrix $q(C)$ has determinant zero so it will...
For **(a)** let $m(x)$ be the minimal polynomial of $C$ and write it as a product of irreducibles (which are at most degree 2 by Fundamental Theorem of Algebra). If $q$ is not in a principle ideal generated by one these irreducibles (i.e. $q$ is not divisible by each irreducible or more succinctly: $m$ and $q$ have non...
3,595,043
So, here's the theorem that I'm trying to prove: Let $f$ be a function. Then, if $f(x) \to L$ as $x \to x\_0$, where $L,x\_0 \in \mathbb{R}$, then $f(x)$ is bounded in some deleted neighbourhood of $x\_0$. --- Proof Attempt: Since $f(x)$ has a limit at $x = x\_0$, we have: $$\forall \epsilon > 0 : \exists \delta ...
2020/03/25
[ "https://math.stackexchange.com/questions/3595043", "https://math.stackexchange.com", "https://math.stackexchange.com/users/426261/" ]
The set $\textbf{Q}$ is linearly ordered. This means that the relation ''$\leq$'' is reflexive, anti-symmetric and transitive. More precisely, (a) if $x\in\textbf{Q}$, then $x\leq x$ (reflexive) (b) if $x,y\in\textbf{Q}$ and $x\leq y$ and $y\leq x$, then $x = y$ (anti-symmetric) (c) if $x,y,z\in\textbf{Q}$, $x\leq y...
Anti symmetric means that the only time $x < y$ and $y < x$ can ever happen is if $x = y$. And as $x < y$ and $y < x$ *never* happens, that is vacuously true. The only time $x < y$ and $y < x$ happens is .... never. So it is anti-symmetric. If you want to argue that $x < y$ and $y< x\not \implies x=y$. I will remin...
45,290,192
I am developing django website and I want to use ldap authontation with my application. I am using Django 1.11 to authenticate with the django-python3-ldap. I tested the connection to my ldap using ldapsearch and it was succeeded and I got the following result: ``` ally@websrv:/web/demo_project_ally$ ldapsearch -x -W...
2017/07/24
[ "https://Stackoverflow.com/questions/45290192", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2152275/" ]
I have encountered the same issue. Below change fix my issue ``` LDAP_AUTH_CONNECTION_USERNAME = "cn=admin,dc=myldap,dc=com" LDAP_AUTH_FORMAT_USERNAME = "django_python3_ldap.utils.format_username_active_directory" ```
ldap3 always authorizes using the "displayName" field. If the values of your LDAP\_AUTH\_USER\_FIELDS["username"] fields are not equal to the values of the "displayName" fields, you will have errors.
1,037
We get a lot of [equipment recommendation](https://photo.stackexchange.com/questions/tagged/equipment-recommendation) questions on this site; it's currently the 2nd-most popular tag, behind the lens tag. Many of these questions seem to start out as something vague and hard to answer, like "What SLR should I get?". Com...
2011/04/27
[ "https://photo.meta.stackexchange.com/questions/1037", "https://photo.meta.stackexchange.com", "https://photo.meta.stackexchange.com/users/378/" ]
We should not only allow them, but embrace them as part of how we encourage new users. Denying questions like these will keep us from becoming the place on the web for getting answers for photography. Online photography forums **DO** allow for personalized gear recommendations, and as such generate more new members, ...
One aspect I'd like to stretch particularly is this: Even if the question is fluid and specific to one person, **I can still benefit from it.** In fact, **I spent the last three days reading various taylored 'what should I buy' questions only to get a feel for what is even relevant, which questions I have to ask myse...
1,291,408
I searched SO, finding little thing about negative testing, which is also a very important thing developers should keep in mind during work. What about making a list of top 10 test case for the negative testing developer should keep in mind collaboratively? Thanks! The definition of Negative Testing: In software tes...
2009/08/18
[ "https://Stackoverflow.com/questions/1291408", "https://Stackoverflow.com", "https://Stackoverflow.com/users/144356/" ]
Tools like [Pex](http://research.microsoft.com/en-us/projects/Pex/) may be useful here; it is designed to try to find values / scenarios that crash the code (by exercising every code branch and likely error-case like div-by-zero/overflow/etc), based on static analysis of what it does. It has successfully found some edg...
Yes, he's talking about writing tests such that you ensure code not only does what it means to do, but doesn't do more. So imagine a test to check if a file is deleted; you could delete the entire folder and it would return true. This form of testing is arguably interesting, but potentially of dubious value. For exa...
4,101,746
I am trying to understand the metric we defined in class for $C(\mathbb{R})$ i.e. on the set of continuous functions $f: \mathbb{R} \to \mathbb{R}$. A little background: We developed some strong theory on the convergence of random variables for continuous functions defined on compacta and we define this metric in an ef...
2021/04/14
[ "https://math.stackexchange.com/questions/4101746", "https://math.stackexchange.com", "https://math.stackexchange.com/users/869111/" ]
My favourite metric in this setting is $$d(f,g)=\sup\{ d\_j(f,g) \wedge 1/j: j\in\mathbb N\}$$ where $a\wedge b$ is the minimum of two real numbers. It is immediate that $d(f,g)<1/k$ if and only if $d\_k(f,g)< 1/k$, and this is exactly what you want, e.g., to show that a sequence $f\_n$ converges to $f$ if and only if ...
$$d(f,g):= \sum\_{j = 1}^{\infty}2^{-j} d\_j(f,g)$$ is not convergent. We can take $\sum\_j 2^{-j}\min \{{1, d\_j(f,g)}\}$ and this is also frequently used.
308,070
Imagin this, a triangular prism with one way mirrors on each face of it and with a light source on the inside and out, it seems normal, right? But, now the light turns off, will the light keep bouncing on the inside? And will it basically give if a source of energy that lasts so long? Remember this is a true one way mi...
2017/01/28
[ "https://physics.stackexchange.com/questions/308070", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/143528/" ]
Suppose we have a light bulb with nothing around it. It gives of energy as long as it stays lit. If it stayed lit an infinite time, it would give off an infinite amount of energy. This energy has to come from somewhere. A battery, a power cord, or some such. The point is you would have to put infinite energy in to ge...
If both the sources are switched off and we assume that there is no external source anywhere, the prism will be able to store the energy supplied till the sources are switched (google why diamonds sparkle!). That is it, it will store that energy. It will will not act as source of energy, it just traps the light.
67,348,679
I am trying to format a number to have commas and two decimal points at the end of it like: 100,000.00 This is what I have tried, but it won't work because I can't use these number formats on each other because they require a number to be inputted into the format. ``` "{:,}".format("{:.2f}".format(grossPay[i])) ``` ...
2021/05/01
[ "https://Stackoverflow.com/questions/67348679", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11254527/" ]
Terraform currently has a limitation with the provider using `Email` protocol. It is unsupported because the endpoint needs to be authorized and does not generate an ARN until the target email address has been validated. This breaks the Terraform model and as a result are not currently supported.
CloudFormation supports this. However, as others and the docs are point out, terraform doesn't quite support it. There's a guide that suggests creating a CloudFormation stack within terraform. This stack creates the SNS topic and could also add the subscription. <http://aws-cloud.guru/terraform-sns-topic-email-list/...
17,824,440
I'm having a hard time understanding the transition from @ try to @ catch I understand that if a statement from the @try block throws an exception, the @catch block gets executed. I don't understand how an NSException object containing information about the exception gets passed as the argument. A lot of stuff I'm rea...
2013/07/24
[ "https://Stackoverflow.com/questions/17824440", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1925859/" ]
Had similar issue, which was a result of update. Please make sure that names of libraries mentioned in eclipse.ini and the actual names of these files on your disk match exactly. ``` -startup plugins\org.eclipse.equinox.launcher_1.0.100.v20080509-1800.jar --launcher.library plugins/org.eclipse.equinox.launcher.win32...
This worked for me On the Zipped folder of the ADT you initially downloaded unzip and navigate to: > > adt-bundle-windows-x86\_64-20140702\eclipse\plugins > > > Copy all the executable jar files and paste them on the > > C:\adt-bundle-windows-x86\_64-20140702\adt-bundle-windows-x86\_64-20140702\eclipse\plug...
5,957
Does anyone know of a simple photo viewer that will let you quickly flip through a bunch of photos, and delete the ones you don't want, that will also (optionally) delete an associated RAW and/or sidecar file? I'm thinking of an app that had a buttons for Delete JPG, Delete RAW, Delete Both, or that would mark them fo...
2010/12/22
[ "https://photo.stackexchange.com/questions/5957", "https://photo.stackexchange.com", "https://photo.stackexchange.com/users/227/" ]
[Geeqie](http://geeqie.sourceforge.net/) can do this -- turn on the "Enable Image Grouping" option, and files with the same base name will be grouped. (It doesn't do anything magic to link files by actual contents that I'm aware of, though.) You should be able to install it with `yum install geeqie` or `apt-get instal...
[FastPictureViewer](http://www.fastpictureviewer.com/) groups JPG and RAW files similar to Lightroom and, I suppose, deletes both simultaneously. Of course, it does not do everything Lightroom does, but it comes at a much lower price.
47,585,107
I'm a scripting newbie and am looking for help in building a BASH script to compare different columns in different CSV documents and then print the non-matches. I've included an example below. File 1 Employee ID Number,Last Name,First Name,Preferred Name,Email Address File 2 Employee Name,Email Address I am wanting ...
2017/12/01
[ "https://Stackoverflow.com/questions/47585107", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9036634/" ]
What browser do you use? Chrome 62 and Firefox 57 fail at inline editing lambdas and both throw DOMExceptions, but Safari 11 seems to work. Try Safari(or some other browser) for editing while waiting for Amazon to fix this.
This is happening in chrome as chrome is disabling the use of cookies from cloudfront domain. 1. Go to address bar and there you would see a icon that says there are some cookies blocked on this website. 2. Click on it. 3. Click on manage. 4. Click on Blocked. 5. Click on allow to couldfront domain. 6. Reload page. I...
10,952,413
I've written an ASP.net web application. In the interest of following the advice in "The Pragmatic Programmer" to put application logic in configuration, I wrote a large XML file that describes various business rules. When I test the application on my local development workstation, I copy the file to `c:\xxxxx\myfile....
2012/06/08
[ "https://Stackoverflow.com/questions/10952413", "https://Stackoverflow.com", "https://Stackoverflow.com/users/238260/" ]
I don't know if this is what you want - Click on the XML file, then open the Property Window and find the "Build Action" property. Set the value to "Embedded Resources"
If you want to make available your XML file from http requests to your server, you should place it in your web publication folder. This ASP instruction should help you to find your publication path: Request.ServerVariables("APPL\_PHYSICAL\_PATH")
94,246
There are developers out there that not only write code and solve problems, but aspire to one day be an entrepreneur and run their own company. They may participate in open source projects, go to various networking events/meetups, or even write code to help shape/start their own business outside of work. And, for exam...
2011/07/19
[ "https://softwareengineering.stackexchange.com/questions/94246", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/14/" ]
Be honest. If you are interested in a future in business then this may even benefit the employer in case they are looking for an employee who can handle both "areas." Some companies, especially banks, even fund their employees if they want to do an MBA!
If you have entrepreneurial aspirations, i would love to hire you. **Because,** 1. It tell me you are self driven. Probably you wont to solve the problem on your own. 2. It tell me you are enterprising. Probably you will not come back saying *it-cann't-be-done* without trying enough. 3. Most likely you won't come up...
20,183
Don't get me wrong, I like Lion, though I do miss many things from Snow Leopard and wish to express this to the OSX team via some sort of suggestion forum. I'm visually impaired and the OS is seemingly becoming more and more visual. One thing that seems to be missing which I can barely live without is the CTRL+WHEEL ...
2011/08/05
[ "https://apple.stackexchange.com/questions/20183", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/4176/" ]
Here's the official Feedback form for OS X. <http://www.apple.com/feedback/macosx.html> The general feedback pages do get to the marketing and engineering people as well as measuring user satisfaction, but you also can sign up for a free developer account and file bugs more directly with the engineering team. It's be...
Me too I use a lot the screen zooming and I'm quite annoyed by this small bug. In addition to the solutions already provided, I've found out that playing a bit with "System preferences" -> "Universal Access" solves the problem (until it appears next time). From this screen, after playing a bit with the options about ...
57,714,549
Just wanted to ask generic question about Namespaces. If class A inherits class B and doesn't explicitly reference (`using`) B's namespace, do I have to explicitly `using B` namespace in my calling code to call B's methods from an instance of A? Is this language dependent (C#, C++)? Ex in C#: ``` // Namespace X class...
2019/08/29
[ "https://Stackoverflow.com/questions/57714549", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2898852/" ]
No namespaces are not inherited by classes in C++ (and in C#). However due to the ADL (Argument Dependent Lookup) you can "inherit" some names from the namespace of a base class. Here is a demonstrative program ``` #include <iostream> namespace N1 { struct A {}; void f( const A & ) { std::cout <...
No, there is no such thing as a inherited namespace. Namespace does not have anything that can be derived/inherited. If you want to inherit a class A that is in different namespace, you need to add "using namespace ..."
6,918,185
I would like to test if the right phone number was enterred in the text field. The phone number should be ddd-ddddddd which means 3digits then must have "-" and then 7 digits. How do I set the regular expression for that ? Thanks :)
2011/08/02
[ "https://Stackoverflow.com/questions/6918185", "https://Stackoverflow.com", "https://Stackoverflow.com/users/585639/" ]
``` var phoneNumber = '123-1234567'; if(phoneNumber.match(/^\d{3}-\d{7}$/)) { alert('blah'); } ```
That's my take: ``` /^[0-9]{3}\-[0-9]{7}$/ ```
7,745,457
I've been going through the Android development tutorials and I see a lot of calls like this: ```java String date = new StringBuilder().append(mMonth + 1).append("-").append(mDay).append("-").append(mYear).append(" ")); ``` Seems like a nice shorthand way of doing things, but is this really a good practice? Will thi...
2011/10/12
[ "https://Stackoverflow.com/questions/7745457", "https://Stackoverflow.com", "https://Stackoverflow.com/users/45507/" ]
Yes, that's fine - but it's not clear what you're concerned about. If you think that that's calling the `append` method during the `StringBuilder` constructor, it's not. This code is equivalent to: ``` StringBuilder tmp = new StringBuilder(); tmp = tmp.append(mMonth + 1); tmp = tmp.append("-"); tmp = tmp.append(mDay);...
No negative side affects, just makes it harder to read. A lot of developers go by the practice of the 'less code the better'.
59,456
I like the new Menlo font on Snow Leopard a lot. I tried copying it over to my Windows machine, but Windows does not like the format. Does anyone know if there's any legitimate way of getting Menlo on Windows?
2009/10/23
[ "https://superuser.com/questions/59456", "https://superuser.com", "https://superuser.com/users/15116/" ]
This may be a bit of a workaround - but the font is very similar to Bitstream Vera Sans Mono. ~~[Here is a comparison](http://www.davidkaneda.com/post/123940811/menlo-font-macosx)~~ [(**updated link**)](http://9-bits.com/post/123940811/menlo-font-macosx) of Menlo and ~~Bitstream Vera Sans Mono~~ DejaVu Sans Mono (also...
I used [OnlineFontConverter](http://onlinefontconverter.com/) to convert the .ttc file to multiple .ttf files. There are of course copyright issues if you distribute the converted files, so please don't do it.
11,758,616
How to determine if a checkbox is check or not through xpath Currently I am trying : ``` //input[@type='checkbox' and @checked='true')] ``` I have multiple checkboxes with same ids so I have to select the next checkbox which is not selected/checked. Specifically I need this for Selenium IDE **Edit** what I act...
2012/08/01
[ "https://Stackoverflow.com/questions/11758616", "https://Stackoverflow.com", "https://Stackoverflow.com/users/416100/" ]
However, there are solution without using css classes and selectors. Use ``` //input[@type='checkbox' and @checked] ``` or ``` //input[@type='checkbox' and not(@checked)] ``` instead of ``` //input[@type='checkbox' and @checked='xyz'] ```
something like this may works: ```xml //input[@checked='checked']/following-sibling::*[1][not(@checked='checked')] ```
151,917
I've been hired to teach two courses as an adjunct professor in the US (my first time teaching). I would like to review syllabi previously used for these courses, simply to inform my thinking on these courses. Is this an inappropriate request? It is likely I would ask the department head's administrative assistant for ...
2020/07/19
[ "https://academia.stackexchange.com/questions/151917", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/125706/" ]
The first thing I did when asked to teach already existing courses was to ask the previous lecturers for copies of syllabi, teaching materials, exams, tutorials.... Probably depends a little on office politics, but I was just handed everything in a nice manner and took over from there.
In the one department I have taught in, it was stated that you have to run the course along similar lines to previous/other instructors (some courses run w/ multiple sections so they need consistency). So absolutely, ask for the existing syllabi. And good luck with your first teaches!
91,116
> > **Possible Duplicate:** > > [How to configure a shortcut for an SSH connection through a SSH tunnel](https://serverfault.com/questions/48808/how-to-configure-a-shortcut-for-an-ssh-connection-through-a-ssh-tunnel) > > > I have a situation where I would like to have SSH/SFTP access from my workstation to a s...
2009/12/04
[ "https://serverfault.com/questions/91116", "https://serverfault.com", "https://serverfault.com/users/28212/" ]
Use the ProxyCommand [ssh config](http://www.openbsd.org/cgi-bin/man.cgi?query=ssh_config&sektion=5) variable. ``` Host inaccessible ProxyCommand ssh accessible nc -w1 %h %p ``` [This post](http://glandium.org/blog/?p=303) even explains a way to use a generic config so `ssh host1/host2` automatically jumps hosts for...
WinSCP directly supports connection through an ssh tunnel. Perhaps one of the MacOS clients also provide such functionality?
9,384,227
I have the following enum ``` enum Animal implements Mammal { CAT, DOG; public static Mammal findMammal(final String type) { for (Animal a : Animal.values()) { if (a.name().equals(type)) { return a; } } } } ``` I had originally used the `Enum.valueOf(Animal.class, ...
2012/02/21
[ "https://Stackoverflow.com/questions/9384227", "https://Stackoverflow.com", "https://Stackoverflow.com/users/543220/" ]
How about creating a `HashMap<String, Mammal>`? You only need to do it once... ``` public class Foo { private static final Map<String, Mammal> NAME_TO_MAMMAL_MAP; static { NAME_TO_MAMMAL_MAP = new HashMap<String, Mammal>(); for (Human human : EnumSet.allOf(Human.class)) { NAME_TO_MAMMAL_MAP.put(hum...
You have an error in your code. If you need your function to return null when it doesn't find something, simply return it: ``` enum Animal implements Mammal { CAT, DOG; public static Mammal findMammal(final String type) { for (Animal a : Animal.values()) { if (a.name().equals(type)) { ...
30,656,752
Struggling with some regex here. I'll be looping through several urls but I cannot get the regex to how to recognize revenue or cost and grab the them both. Essentially the output would look something like this: ``` import re url = ['GET /ca.gif?rb=1631&ca=20564929&ra=%n&pid=&revenue=224.00&cost=', 'GET /ca.gi...
2015/06/05
[ "https://Stackoverflow.com/questions/30656752", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3089468/" ]
Here's how I'd go about it - using sets ``` all_words = re.findall(r'\w+', open('test.txt').read().lower()) f = open('test2.txt', 'rb') stop_words = [line.strip() for line in f] set_all = set(all_words) set_stop = set(stop_words) all_only = set_all - set_stop print Counter(filter(lambda w:w in all_only, all_words...
``` import re from collections import Counter with open('test.txt') as testfile, open('test2.txt') as stopfile: stopwords = set(line.strip() for line in stopfile) words = Counter(re.findall(r'\w+', open('test.txt').read().lower())) for word in stopwords: if word in words: words.pop(word...
3,727,718
Compute which element $[0],[1],\ldots,[2014]$ in $\Bbb{Z}/2015\Bbb{Z}$ under the map of the Chinese remainder theorem is mapped to $([12],[5])\in\Bbb{Z}/31\Bbb{Z} \times \Bbb{Z}/65\Bbb{Z}$. $$ x=12 \pmod{31} \\ x=5 \pmod{65} $$ I used the Euclidean algorithm to find $\gcd(31,65)= 31n+65m=1$ for $n= 21$ and $m= -10$. ...
2020/06/20
[ "https://math.stackexchange.com/questions/3727718", "https://math.stackexchange.com", "https://math.stackexchange.com/users/800159/" ]
$-4545=((-3)\times2015)+1500$ $ \Rightarrow -4545\equiv 1500 ($mod $2015)$
To find the equivalence class of $-4545$ in $\mathbb{Z}/2015\mathbb{Z}$, we must find $x \in \left\{0, 1, ..., 2014\right\}$ for which $k \cdot 2015 = x - 4545$ holds for some $k \in \mathbb{Z}$. By this definition, we have $-4545 \in [x]$. Clearly, this holds for $k = -3$ and $x = 1500$, so we have $-4545 \in [1500]$...
893,724
I cannot get the system to use the wireless card. As far as I can tell, it acknowledges that the thing is plugged in, and even what it is. [![](https://cdn.discordapp.com/attachments/291740981508964353/291973322537697281/IMG_20170316_123711586.jpg)](https://cdn.discordapp.com/attachments/291740981508964353/29197332253...
2017/03/16
[ "https://askubuntu.com/questions/893724", "https://askubuntu.com", "https://askubuntu.com/users/666209/" ]
The core issue is that without an `index.html` file to serve (or a corresponding `try_files` and `index` directive) that NGINX will try and do a directory listing, which is forbidden in your config (`autoindex off;`). To override this, you should be doing at least one of ***two things***: 1. Use a `try_files $uri /in...
I figured it out, I made the mistake of not putting an index.html file in the directory, once I did that everything was working.
60,191
If my iPhone gets stolen and I try to use Find my iPhone while it's off, I am given the option to be notified by email when my iPhone is found. I believe this sends an email to my iCloud account. I see 2 problems with this: 1. Since my iCloud address was automatically set up to receive email on my iPhone, the person...
2012/08/09
[ "https://apple.stackexchange.com/questions/60191", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/218/" ]
You can setup your gmail account as default iCloud account. To do this : 1. Go to settings 2. Mail Contacts, Calenders option 3. Add new Email Account 4. Choose iCloud Account 5. Choose Get a Free Apple ID 6. When it asks for Email provide your Gmail Address 7. It will then pair your email with iCloud account so tha...
You can go to your email's settings and forward all your emails to a different email address. --- Elaborating on this further, you can set up your existing email to forward your emails to another email address which is **not** synced to your phone. You can set up the forwarding from any browser & the thief will not...
626,105
I installed Play On Linux, because I want to install World of Tanks game. But when this game installation process starts appears this error which is in print screen. ![](https://photos-1.dropbox.com/t/2/AABZMNJh7HFXlLShaur8t7tVH6EvQVxu53Qwq8gdHrzlFw/12/269710243/png/1024x768/3/1432137600/0/2/Ekr%C4%81natt%C4%93ls%202...
2015/05/20
[ "https://askubuntu.com/questions/626105", "https://askubuntu.com", "https://askubuntu.com/users/411993/" ]
Open `wotlauncher.cfg` with gedit and change number 3 in this line with number 2 ``` <launcher_transport>3</launcher_transport> ``` and then it downloads via HTTP. Check wineHQ for other problems.
I have try playonlinux too, but it fails. There are another solution: PortWoT - <http://portwine-linux.ru/world-of-tanks-linux/> WoT have gold status in wine db, but I had unable to install it, launcher crashes. Port WoT is a solution. It keep updated for years and work fine. > > PortWoT - is the port for the clien...
1,422,812
For a few different reasons one of my projects is hosted on a shared hosting server and developed in asp.Net/C# with **access** databases (Not a choice so don't laugh at this limitation, it's not from me). Most of my queries are on the last few records of the databases they are querying. My question is in 2 parts: 1...
2009/09/14
[ "https://Stackoverflow.com/questions/1422812", "https://Stackoverflow.com", "https://Stackoverflow.com/users/116708/" ]
As far as I know... 1 - That change would just be visual. There'd be no impact. 2 - Make sure your fields are indexed. If the fields you are querying on are unique, then make sure you make the fields a unique key.
To understand the answers here it is useful to consider how access works, in an un-indexed table there is unlikely to be any value in organising the data so that recently accessed records are at the end. Indeed by the virtue of the fact that Access / the JET engine is an ISAM database it's the other way around. (<http:...
13,647,481
I want to use case statement in where clause but getting error in the query below. ``` where (r.WeekId=@WeekId or @WeekId is null) and (ShiftId=@ShiftId or @ShiftId is null) and (placeid=@PlaceId or @PlaceId is null) and (r.StatusId=3) AND CASE WHEN @day = 1 THEN ((firstday=@time and (allocateddays is null ...
2012/11/30
[ "https://Stackoverflow.com/questions/13647481", "https://Stackoverflow.com", "https://Stackoverflow.com/users/857475/" ]
In a `WHERE` clause, the `CASE` statement can be used only to specify alternative values for a comparison like this: ``` where @day = case @SomeCondition when 1 then @Sunday when 2 then @Monday ... end ```
The line: ELSE AND (1 = 1) looks mighty suspicious. Take that out and try.
3,219
When a Non Jew does something it would work according to Halacha, however when a Jew does the same thing it is useless.
2010/10/05
[ "https://judaism.stackexchange.com/questions/3219", "https://judaism.stackexchange.com", "https://judaism.stackexchange.com/users/200/" ]
Negating an *avoda zara*. If a non-Jew takes an idol and says "I reject this!" and damages it, the idol is no longer prohibited from benefit. A Jew can't do that.
A non-Jew can run a kosher establishment without the certifiers worrying (as much) about him owning chametz over pesach, toveling all the kelim, etc..
5,192,785
How to get touch on a particular view. I am using ``` CGPoint Location = [[touches anyObject] locationInView:self.view ]; ``` but want to trigger the action only if an particular subView is clicked. How to do this.
2011/03/04
[ "https://Stackoverflow.com/questions/5192785", "https://Stackoverflow.com", "https://Stackoverflow.com/users/554865/" ]
Try this ``` //here enable the touch - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { // get touch event UITouch *touch = [[event allTouches] anyObject]; CGPoint touchLocation = [touch locationInView:self.view]; if (CGRectContainsPoint(yoursubview_Name.frame, touchLocation)) { ...
Did u try ``` CGPoint Location = [[touches anyObject] locationInView:necessarySubView ]; ```
17,740
Could you please tell me that what is the maximum length for meta keywords?
2011/08/03
[ "https://webmasters.stackexchange.com/questions/17740", "https://webmasters.stackexchange.com", "https://webmasters.stackexchange.com/users/9365/" ]
The question asked no longer makes any sense in the current environment. Google and all other major search engines like Yahoo, Bing have disqualified the Meta keyword tag long before. So even if you're adding the meta keyword tag in your webpages, Google and all other search engines are never going to take a look at ...
7 to 8 general keywords with comma separated is good to put on all pages of your site. Some peoples put huge list which is over optimization. Keywords must be related to your content or meta description.
1,145,880
Mobile safari supports an attribute on input elements called [`autocapitalize`](https://developer.apple.com/documentation/webkitjs/htmlelement/2871133-autocapitalize) [[documented here](https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/DesigningForms/DesigningForms.h...
2009/07/17
[ "https://Stackoverflow.com/questions/1145880", "https://Stackoverflow.com", "https://Stackoverflow.com/users/120434/" ]
This should be fixed in iPhone OS 3.0. What version of iPhone OS are you trying this on? ``` Email: <input id="email" type="text"><br> URL: <input id="url" type="text"><br> <script> //document.getElementById("email").autocapitalize = 'off'; //document.getElementById("url").autocapitalize = 'on'; document.getElementByI...
It's just as invalid if you add it via script or if you add it in the markup. It's just that the validator isn't able to notice it if you add it via script. Just put it in the markup and put a comment next to it, like `<!-- the "autocapitalize" attribute is an Apple proprietary extension for the iPhone to change its I...
9,952,273
After downloading Eclipse Indigo on a clean pc, when I try to download from <http://dl.google.com/eclipse/plugin/3.7> and download SDKs and Google Plugin , at about 35% of the way through I start getting errors. ``` Install download1 An internal error occurred during: "Install download1". Comparison method violates it...
2012/03/31
[ "https://Stackoverflow.com/questions/9952273", "https://Stackoverflow.com", "https://Stackoverflow.com/users/963070/" ]
Try to run eclipse with older java version. Start Eclipse from command line with: > > D:\Eclipse\eclipse j2ee indigo>eclipse -vm C:\Java\jdk1.6.0\_31\bin\javaw.exe > > > It worked for me. (-vm is pointing to your jre instalation. Remember: Eclipse does not use JAVA\_HOME variable. it uses its own Java.)
I had a similar issue. Could not install Android Native Development Tools. Was getting this error - "An internal error occurred during: "Install download3".Comparison method violates its general contract! " I ended up installing CDT (C/C++ Development Tools) from the Helios update site. Then I could install Android Na...
23,670,607
``` MS = 'M-SEARCH * HTTP/1.1\r\nHOST: %s:%d\r\nMAN: "ssdp:discover"\r\nMX: 2\r\nST: ssdp:all\r\n\r\n' % (SSDP_ADDR, SSDP_PORT) ``` On checking this line with [PEP8](http://pep8online.com/), it says "line too long" So I break it like this: ``` MS = 'M-SEARCH * HTTP/1.1\r\n HOST: %s:%d\r\n MAN: "s...
2014/05/15
[ "https://Stackoverflow.com/questions/23670607", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3291873/" ]
Use python's implicit string concatenation and implicit line concatenation inside unterminated brackets/parenthesis...: ``` MS = ('M-SEARCH * ' 'HTTP/1.1\r\n' 'HOST: %s:%d\r\n' 'MAN: "ssdp:discover"\r\n' 'MX: 2\r\n' 'ST: ssdp:all\r\n\r\n') % (SSDP_ADDR, SSDP_PORT) ``` Note that some ([i...
This is the solution I think would work for now. Splitting the lines into strings. ``` MS = 'M-SEARCH *' + \ 'HTTP/1.1\r\n' + \ 'HOST: %s:%d\r\n' + \ 'MAN: "ssdp:discover"\r\n' + \ 'MX: 2\r\n' + \ 'ST: ssdp:all\r\n\r\n' % (SSDP_ADDR, SSDP_PORT) ```
22,106,766
I've googled it for hours but I can't find a solution. I use raspian, on a raspberry pi and I want to have colorscheems work on it. Default terminal in raspian seems to be set at 8 colors as when I enter ``` tput colors ``` I get 8. I'm sure there must be a way to have the term work with 256 colors but I don't know ...
2014/02/28
[ "https://Stackoverflow.com/questions/22106766", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3366709/" ]
did you add `set t_Co=256` *after* the line `colorscheme <yourColourScheme>`? That was a problem I had early on. Let me know if you're still having trouble, because I managed to solve a similar problem (only I'm using MobaXterm and GNU screen), and wouldn't mind the excuse to dig into this a bit more.
I was having a similar problem and have solved it with the following setup. .zshrc on my OSX laptop contains: `TERM=xterm-256color` after I ssh into raspbian, `tput colors` returns 256. On raspbian, I don't have TERM explicitly set (which means it pulls it from ssh), and have the following in .tmux.conf: `set -g def...
370,793
In [the most recent welcoming blog](https://stackoverflow.blog/2018/07/10/welcome-wagon-classifying-comments-on-stack-overflow/) about comment evaluation, something caught my eye. In the sample unwelcoming comments, 3 out of 5 comments are seemingly posted by users who (almost surely, judging by the content) have alre...
2018/07/10
[ "https://meta.stackoverflow.com/questions/370793", "https://meta.stackoverflow.com", "https://meta.stackoverflow.com/users/7296893/" ]
> > What should we do if users don't listen to our comments pointing out severe flaws? > > > Nothing. If your comment is correct and holds true in the context of the OP your job is done. The OP will find out sooner or later that there was merit in your comment. There is no need to put users through virtual med...
So the scenario is: * OP posted a question which is unclear, incomplete, or otherwise not up to standard * I commented saying "X" (hopefully in a constructive and engaging way) * OP replies either ignoring "X" or saying it's not relevant or impossible or similar (At this point, FWIW, in many cases I won't have downvo...
11,755,112
Its a very silly problem but somehow it is not working I have a function to create a file, if it goes through with it i want it to redirect the user to X page.. in this case 1.php.... but somehow is not working :S why? ``` //Creates File, populates it and redirects the user. if (createfile($dbFile)) { header(...
2012/08/01
[ "https://Stackoverflow.com/questions/11755112", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1535747/" ]
You need to [`exit()`](http://php.net/exit) after sending a redirect header: ``` if (createfile($dbFile)) { header('Location: http://yoursite.com/path/to/1.php', true, 302); exit(); } ``` Otherwise, PHP continues to execute. If you `exit()`, the client receives the header right after you make the call to...
I had a similar sounding problem where code was still being executed after the header location. That's why I always do exit(); afterwards