qid
int64
1
74.7M
question
stringlengths
0
70k
date
stringlengths
10
10
metadata
list
response
stringlengths
0
115k
17,006,512
I have a simple table layout, in the one of the row, I have time for sun rise in a text view and I am trying to have sun with purple colour for the row as background. How can I achieve this? I tried creating an image 1000px x 500px with sun and purple background, However, it does not look good on different screen sizes...
2013/06/09
[ "https://Stackoverflow.com/questions/17006512", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2122179/" ]
You can set it programmatically by ``` [textField setSecureTextEntry:YES]; ``` or in IB (secured checkbox at the bottom) ![enter image description here](https://i.stack.imgur.com/G8u20.png)
59,938,330
I'm using a jsonb field in my Rails application and have installed the [gem attr\_json](https://github.com/jrochkind/attr_json). Is there a way to receive the defined json\_attributes programmatically? With a "normal" rails attribute, I would just do @instance.attribute\_names. But with attr\_json is there any way how ...
2020/01/27
[ "https://Stackoverflow.com/questions/59938330", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3748376/" ]
I think you should clear your previous model inside loop so you could use this function which is keras.backend.clear\_session().From <https://keras.io/backend/>: This will be solved your problem.
5,578,250
As I am writing my first grails webflow I am asking myself if there is anyy tool or script what can visualize the flow? Result can be a state diagram or some data to render in a graph tool like graphviz.
2011/04/07
[ "https://Stackoverflow.com/questions/5578250", "https://Stackoverflow.com", "https://Stackoverflow.com/users/172590/" ]
There's no tool around currently that will do this for you I'm afraid. I've implemented something myself before, but this was very simple and was not automated in any way. It was a simple template where the model was a step number: ``` <g:render template="flowVisualiser" model="[step: 2]" /> ``` You would have to pu...
26,377,384
I want adding background image with css but it did not work.Browser show me a blank page. my application.css ``` home-body { background-image: url('/home.jpg') no-repeat center center fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: ...
2014/10/15
[ "https://Stackoverflow.com/questions/26377384", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4059461/" ]
Please use this code. Use background instead of background-image and make sure that you have inserted the correct image path in url(). ``` html, body { margin: 0; padding: 0; height: 100%; width: 100%; } .home-body { background: url('/home.jpg') no-repeat center center fixed; -webkit-background-size: ...
1,817,508
I have a vector class that has addition, multiplication, subtraction, division, etc operators. I'm trying to optimize my program (which does a lot of vector operations) and I'm realizing that about 50% of the time spent is in constructing and destructing vectors. I understand that this is because every time I call a no...
2009/11/30
[ "https://Stackoverflow.com/questions/1817508", "https://Stackoverflow.com", "https://Stackoverflow.com/users/217546/" ]
> > I understand that this is because > every time I call a non-compound > mathematical operator for a vector, a > new vector is constructed. Is there a > way to prevent this without using > compound operators or expanding vector > operations? > > > Well, the nature of adding two things together to produce a...
234,979
I maintain a set of command line bioinformatics tools which we distribute as source and binaries for Linux, Windows, and OS X. Currently the binary distribution for OS X is just a zip file containing directories for the binaries and the documentation. Our install guide directs the user to unzip the archive, copy the bi...
2016/04/14
[ "https://apple.stackexchange.com/questions/234979", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/7226/" ]
The standard package format is the "pkg" format. It's not often used for applications, but it's fine for a terminal-only utility. * My go-to tool for creating packages is called [Packages](http://s.sudre.free.fr/Software/Packages/about.html). * I haven't used it myself, but it looks like CMake [supports PackageMaker](...
13,358,503
a gem intends to support gems `a` or `b` as alternatives for a functionality. In code I check with `defined?(A)` if I fall back to `b` that's fine. But as a gem developer how to specify these dependencies? 1) what do I put in the Gemfile. ``` group :development, :test do gem 'a', :require => false gem 'b', :req...
2012/11/13
[ "https://Stackoverflow.com/questions/13358503", "https://Stackoverflow.com", "https://Stackoverflow.com/users/641672/" ]
Don't include the `a` gem in your dependencies, but `require` it anyway. If that fails, it will raise `LoadError`, from which you can rescue. ``` begin require 'a' rescue LoadError # The 'a' gem is not installed require 'b' end ``` --- I believe this is the best way to use and test this setup: 1. Define an i...
18,939,332
Does anyone know what Facebook uses for their blurred toolbar? ![enter image description here](https://i.stack.imgur.com/RTmVf.png) Now, I **KNOW** there are already countless threads about iOS 7 blur. They all come to these same solutions: 1. Use a UIToolbar with translucent set to YES, and then set its barTintColo...
2013/09/22
[ "https://Stackoverflow.com/questions/18939332", "https://Stackoverflow.com", "https://Stackoverflow.com/users/87158/" ]
Apparently the trick here is to insert the translucent layer as a sublayer of the navigation bar. I take no credit for finding this, and the following snippet has been taken [**from this gist**](https://gist.github.com/alanzeino/6619253). ``` UIColor *barColour = [UIColor colorWithRed:0.13f green:0.14f blue:0.15f alph...
54,558,029
Here is my original df: ``` my_df_1 <- data.frame(col_1 = c(rep('a',5), rep('b',5), rep('c', 5)), col_2 = c(rep('x',3), rep('y', 9), rep('x', 3))) ``` I would like to group by `col_1` and return 1 if `col_2` for given group contains `x`, and 0 if not. Here is how final result is supposed to lo...
2019/02/06
[ "https://Stackoverflow.com/questions/54558029", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1700890/" ]
What about this? ``` do <- as.data.frame(do.call(rbind, lapply(my.stuff, as.vector))) do <- cbind(my.var=rownames(do), do) do[do == "NULL"] <- NA ``` ***Result*** ``` > do my.var my.col1 my.col2 my.col3 my.col4 AA AA 1 4 NA NA BB BB NA NA NA NA CC CC 13 ...
161,836
I'm using Oracle 11g database in which I have more than 12 schema's consisting of many tables. I've created sequences for primary keys to these tables. I've also created synonyms to refer my application from the main schema. My issue is, while i try to export(using expdp) the schema's from DB in 1 server and import(...
2017/01/21
[ "https://dba.stackexchange.com/questions/161836", "https://dba.stackexchange.com", "https://dba.stackexchange.com/users/104331/" ]
If you run export command against live database without parameters like `flashback_scn` or `flashback_time` which ensures consistency during the export, then this can be an expected behavior because these objects are exported in different time and one can become inconsistent with another. For example, if the sequence...
43,053,550
I want to change the default login validation error message like: ``` Username & Password doesn't match ``` instead of ``` these credentials do not match our records ``` How to do this ?
2017/03/27
[ "https://Stackoverflow.com/questions/43053550", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7394739/" ]
You can change this message to another one in this file: ``` resources/lang/en/auth.php ``` This is the line: ``` 'failed' => 'These credentials do not match our records.', ```
4,378,067
I need to find the GUID for an existing USB device attached to my Windows XP system. How can this be done using WMI or the registry? Or, is there another avenue that I should explore? Thanks. **Additional Information:** I need to find the GUID for a specific known device; it is not expected to change. If I need to wr...
2010/12/07
[ "https://Stackoverflow.com/questions/4378067", "https://Stackoverflow.com", "https://Stackoverflow.com/users/214296/" ]
For a specific known device, the easiest way I've found is to open the .inf file for that device's driver (if you have the driver); it should be clearly indicated there. You can probably also poke around under HKEY\_LOCAL\_MACHINE\SYSTEM\CurrentControlSet\Enum\USB.
12,104,391
I am trying to instantiate the [StdRandom](http://algs4.cs.princeton.edu/stdlib/StdRandom.java.html) class (see below) in my own Java program so that I can generate random integers by calling it's *uniform* method. However, I kept getting this error during compilation: > > MyProgram.java:43: StdRandom() has private a...
2012/08/24
[ "https://Stackoverflow.com/questions/12104391", "https://Stackoverflow.com", "https://Stackoverflow.com/users/225998/" ]
All methods are static, you don't need to create an instance of that class to use it. To use e.g. the `random()` method, use `StdRandom.random()`
13,121,850
I have used will\_paginate in my rails application but i come across a situation where i need to use to will\_paginate inside a block where the page should not reload when i click the pagination number, could anyone help me saying how to integrate will\_paginate with ajax to avoid page reloading......?
2012/10/29
[ "https://Stackoverflow.com/questions/13121850", "https://Stackoverflow.com", "https://Stackoverflow.com/users/917833/" ]
I have a pagination javascript file So in my index.html.erb file I addded ``` <%=javascript_include_tag "pagination.js"%> ``` In pagination.js file ``` $(function(){ $(".pagination a").live("click", function() { $.get(this.href, null, null, "script"); return false; }); }); ``` I fetched ...
8,322,550
I've installed XAMPP on my Windows XP. I started the XAMPP control panel and it shows apache and mysql are running. When I check the status by going to `localhost/xampp` it shows: ``` mysql : deactivated ``` When I run php files that access the mysql database, it shows the following errors: ``` Warning: mysql_conn...
2011/11/30
[ "https://Stackoverflow.com/questions/8322550", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1029133/" ]
OK I got this issue resolved in my case, hopefully will help you too. Problem was system itself. If you run Vista, Win7, win8 you probably have permission issue. Simple go to XAMPP root and find mysql\_start.bat and run it. Immediately after clicking your firewall will appear with message asking for permission. All you...
22,690,091
I need to create simple icon in css like this - about 32x32 px. ![Icon](https://i.stack.imgur.com/8I2qy.png) I'd like to make it as simple as it could be (html - no unnecessary divs). The text should be vertically and horizontally aligned to the center of each half. The text displayed will be short (about 9 chars m...
2014/03/27
[ "https://Stackoverflow.com/questions/22690091", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3151531/" ]
What's Going On --------------- I use the `i` element to create icons. Normally with an image, or more recently an icon font, but we can adapt for your needs. (Originally the `i` element wasn't used for icon, and it is debatable whether it's semantically correct. However, it's used in many icon fonts, and in some majo...
3,439,265
I have installed oracle 10g express edition and I did not find the option to create schema.. Is there a option to create schema in oracle 10g express edition or else I have to install other oracle 10g..? To create schema which oracle 10g I have to install... what?
2010/08/09
[ "https://Stackoverflow.com/questions/3439265", "https://Stackoverflow.com", "https://Stackoverflow.com/users/396486/" ]
You don't need to explicitly create schema, Oracle automatically creates a schema when you create a user (see **[`CREATE USER`](http://download.oracle.com/docs/cd/B13789_01/server.101/b10759/statements_8003.htm#i2065278)** documentation). If you really want, you can use [**`CREATE SCHEMA`**](http://download.oracle.co...
46,328,375
I have been following Gorail's tutorial to deploy on DigitalOcean. [See Here](https://gorails.com/deploy/ubuntu/16.04#capistrano) and [Here also](https://www.youtube.com/watch?time_continue=467&v=WBPV4vjzcjQ). I've reached the part where I am using the cap production deploy in the command line, but I am getting the fo...
2017/09/20
[ "https://Stackoverflow.com/questions/46328375", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7438959/" ]
You need to install [that dependency](https://github.com/capistrano/rbenv) by adding it to your `Gemfile`: ``` gem 'capistrano-rbenv' ``` Then `bundle install`. Capistrano has started to shunt some of the lesser used features to optional modules lately.
4,313,867
What does `performSelector` do? What is the difference between creating a new `NSThread` and the `performSelector` method? How it works and where should we use it?
2010/11/30
[ "https://Stackoverflow.com/questions/4313867", "https://Stackoverflow.com", "https://Stackoverflow.com/users/202735/" ]
All of these perform the same task, that is make the `doStuff` method on `anObject` execute synchronously on the **current** thread: ``` // 1 [anObject doStuff]; // 2 [anObject performSelector:@selector(doStuff)]; // 3 objc_msgSend(anObject, @selector(doStuff)); // 4 IMP imp = [anObject methodForSelector:@selector(...
173,361
With regards to Thermal Radiation, given a stable body initially at 300 Kelvin placed in isolation, after continuous Thermal Radiation will it's temperature gradually reduce to 0 kelvin asymptotically? If so, does this mean that the body is now devoid of any Thermal Energy? And does it imply that the only energy it can...
2015/03/31
[ "https://physics.stackexchange.com/questions/173361", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/76641/" ]
In practice, no. In theory, also no. The Universe is filled with photons with an energy distribution corresponding to $2.73\,\mathrm{K}$, called the [cosmic microwave background (CMB)](http://en.wikipedia.org/wiki/Cosmic_microwave_background). Every $\mathrm{cm}^3$ of space holds [around 400](https://physics.stackexch...
6,363,710
I am new to Objective C. On one of the developers documentation, I found the following statemenet. **The following statement invokes the lockFocusIfCanDraw method and assigns the return value to flag. It does not generate a compiler warning unless there is a mismatch between the type for flag and the method’s return t...
2011/06/15
[ "https://Stackoverflow.com/questions/6363710", "https://Stackoverflow.com", "https://Stackoverflow.com/users/402814/" ]
The dot syntax for calling methods should only be used for properties (i.e. when calling accessors). Since `lockFocusIfCanDraw` is not an accessor method, you should use the regular square brackets syntax, i.e. `flag = [aView lockFocusIfCanDraw];` instead.
9,855,673
It's an interesting problem, really, for all you Devise masters you there. We have Devise setup with OmniAuth, but the issue happens regardless if you are logged in via Facebook, or logged in via a normal username. What happens is we have a Flash game embedded on our website. When you finish playing the game, the game...
2012/03/24
[ "https://Stackoverflow.com/questions/9855673", "https://Stackoverflow.com", "https://Stackoverflow.com/users/200567/" ]
Does the form you are submitting have a valid CSRF token? I think Devise calls reset\_session if the csrf token is invalid or doesn't exist.
40,581,405
I'm working on this procedure which is supposed to return a list of pairs from 2 given lists. So for example (pairs '(1 2 3) '(a b c)) should return **'((1.a) (2.b) (3.c))**. This is my logic so far. I would take the first element of each list and recursively call the procedure again with cdr as the new arguments. My...
2016/11/14
[ "https://Stackoverflow.com/questions/40581405", "https://Stackoverflow.com", "https://Stackoverflow.com/users/505278/" ]
Notice that you produce a value that prints as `(1 . 3)` by evaluating `(cons 1 3)`. However in your program you are doing `(cons 1 (cons 3 ...))` which will prepend 1 and 3 to the following list. In other words: Instead of `(cons (car x) (cons (car y) (pairs ...))` use `(cons (cons (car x) (car y) (pairs ...))`.
21,494,338
I have some images in my Photo Album. I have already retrieved the asset urls of all of them.. I want to get a particular image using the asset url... below code gave me asset url.. ``` ALAssetRepresentation *defaultRepresentation = [asset defaultRepresentation]; NSString *uti = [defaultRepr...
2014/02/01
[ "https://Stackoverflow.com/questions/21494338", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1394304/" ]
Get Url by this, ``` NSURL *url= (NSURL*) [[asset valueForProperty:ALAssetPropertyURLs] valueForKey:[[[asset valueForProperty:ALAssetPropertyURLs] allKeys] objectAtIndex:0]]; ``` And get image from url like below. ``` ALAssetsLibraryAssetForURLResultBlock resultblock = ^(ALAsset *myasset) { ALAssetRepresentati...
51,482,091
I couldn't find any working examples to test for whether an event was emitted and whether the emitted value is as expected. Here is the class that emits messages and its parent: ``` const EventEmitter = require('events').EventEmitter; class FileHandler extends EventEmitter { constructor() { ...
2018/07/23
[ "https://Stackoverflow.com/questions/51482091", "https://Stackoverflow.com", "https://Stackoverflow.com/users/595638/" ]
You can assert the spy was called once and called with expected arguments as below ``` sinon.assert.calledOnce(fhParseSpy); sinon.assert.calledWith(fhParseSpy, 'success'); ```
994,426
I know it's not *exactly* what SU is about, but I didn't know where else to turn at this point. I'm trying to hook up a Samsung LA32S81B television to my/a computer using HDMI. This is a moderately old TV, 2007 era, non-smart. Originally, I tried to hook it up to my laptop, to no avail. I'll save you the long story of...
2015/10/31
[ "https://superuser.com/questions/994426", "https://superuser.com", "https://superuser.com/users/246510/" ]
In looking at the specs for that TV, it does not support 1080p. Likely, your PC is outputting a 1080p signal and the TV can't sync to it. Try these things: * Lower your display resolution to 1280x720 (that's the HDTV 720p spec). * On the TV, make sure the HDMI input says PC as the source type (Samsungs in particular ...
24,668,826
Im new to ASP. can any body give the sample code for select all the checkbox while selecting one checkbox from the check box list. Select All A B C once checking the select all check from the checkbox list all other items also should get selected.
2014/07/10
[ "https://Stackoverflow.com/questions/24668826", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3823967/" ]
From you image it seems like you presented the ViewController using push The `dismissViewControllerAnimated` is used to close ViewControllers that presented using modal **Swift 2** ``` navigationController.popViewControllerAnimated(true) ``` **Swift 4** ``` navigationController?.popViewController(animated: true) ...
57,012,262
i want to use the optional arguments without `-` or `--`, want to achive something like this: ``` scriptname install <other options> scriptname uninstall <other options> ``` my code: ``` parser = argparse.ArgumentParser() parser.add_argument("install","INSTALL",action='store_true',help="INSTALL SOMETHING",default=...
2019/07/12
[ "https://Stackoverflow.com/questions/57012262", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8369163/" ]
You don't have to use Selenium when you can just extract the match stats right off the HTML: ```py import re from ast import literal_eval url = 'https://www.whoscored.com/Matches/1294545/LiveStatistics/Germany-Bundesliga-2018-2019-Bayern-Munich-Hoffenheim' res = requests.get( url, headers={ 'user-agen...
2,773,644
I'd like to host a WCF web service in IIS. The service should keep a certain set of data all the time, it must never be lost. My colleague told me this is impossible because IIS closes down the service after a certain time (I assume without any activity). Is that true? How do I prevent that behavior? In case it matte...
2010/05/05
[ "https://Stackoverflow.com/questions/2773644", "https://Stackoverflow.com", "https://Stackoverflow.com/users/39590/" ]
By default, IIS recycles the worker process after a certain period of inactivity (20 mins if I recall correct). This causes your data to be lost. You can turn off this behavior in the Properties page of the ApplicationPool under which your app is running. EDIT: having said that, if it is *really* important that thi...
74,360,884
I deleted a category which is an f-key of the items table. Now the view has an error saying 'Attempt to read property "category\_name" on null'. How do I render a null foreign key? I tried if-else: ``` @if({{$item->category->category_name}} === 'null') <h2>no category</h2> @else {{ $item->category->category_name...
2022/11/08
[ "https://Stackoverflow.com/questions/74360884", "https://Stackoverflow.com", "https://Stackoverflow.com/users/17040377/" ]
Try this: ``` @if ($item->category) {{ $item->category->category_name }} @else <h2>no category</h2> @endif ``` Or simply ``` <h2>{{ $item->category?->category_name ?? 'no category' }}</h2> ```
53,301,678
I am using post navigation for my blog. For this portion i wrote some css. It's working fine. But the problem is for the very latest post , it's showing blank space for next post link. Same thing is happened with oldest post, it's showing again bank space for previous post link. [![enter image description here](https:/...
2018/11/14
[ "https://Stackoverflow.com/questions/53301678", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10043462/" ]
First, output the divs only if they'll have content: ``` <div class="sewl-more-posts"> <?php if (previous_post_link()){?> <div class="previous-post"> <span class="post-control-link">Previous Article</span> <span class="post-name"><?php previous_post_l...
8,177,473
``` int array[10] = {1,2,3,4,5,6,7,8}; int *ptr = array; std::cout<<*(ptr+ 2); => O/P = 3 int (*arr_ptr)[10] = &array; std::cout<<*(*arr_ptr+2); => O/P = 3 ``` Whats the difference between these 2. I know what they mean, but if they give same result why do we have 2 different notations?
2011/11/18
[ "https://Stackoverflow.com/questions/8177473", "https://Stackoverflow.com", "https://Stackoverflow.com/users/996330/" ]
The first case is the normal case: `ptr` is a pointer to the first element of the array `array`, and it is indexed (using `*(ptr+2)`, which is a synonym for `ptr[2]`) to access the third element of that array. The second case is contrived: `arr_ptr` is a pointer to the (enitre) array `array`. It is first dereferenced ...
3,763,347
I am trying to figure out the Taylor coefficient of $\exp\left\{\frac{z+1}{z-1}\right\}$. My idea is as follows: $$f(z)=\exp\left\{\frac{z+1}{z-1}\right\}=\exp\left\{1+\frac{2}{z-1}\right\}=e\exp\left\{\frac{2}{z-1}\right\}.$$ Then we have $f(z)=e\sum\_{n=0}^{+\infty}\frac{w^n}{n!}$, where $w=\frac{2}{z-1}$. Clearly, w...
2020/07/20
[ "https://math.stackexchange.com/questions/3763347", "https://math.stackexchange.com", "https://math.stackexchange.com/users/83239/" ]
Write $$ f(z):=\exp{\big(\frac{z+1}{z-1}\big)} =\frac{1}{e}\exp{\big(\frac{2z}{z-1}\big)} $$ Use the generating function for the Laguerre polynomials to show $$ f(z)=\frac{1}{e} \sum\_{n=0}^\infty L\_n^{(-1)}(2)z^n $$ Thus, using the 'coefficient of' operator $$ [z^n] f(z) = \frac{1}{e} L\_n^{(-1)}(2) .$$ It is perhaps...
1,202,075
I would like to update a table in mySql with data from another table. I have two tables "people" and "business". The people table is linked to the business table by a column called "business\_id". The necessary table structure, primary key is starred (Table: columns): People: \*business\_id, \*sort\_order, email Bu...
2009/07/29
[ "https://Stackoverflow.com/questions/1202075", "https://Stackoverflow.com", "https://Stackoverflow.com/users/54259/" ]
``` UPDATE business b, people p SET b.email = p.email WHERE b.business_id = p.business_id AND p.sort_order = '1' AND b.email = '' ```
40,407,955
I have component that renders jsx like this ``` <section> <div> <input type="text" class="hide" /> <button id={item.uniqueID}>show input</button> </div> <div> <input type="text" class="hide" /> <button id={item.uniqueID}>show input</button> </div> <div> <i...
2016/11/03
[ "https://Stackoverflow.com/questions/40407955", "https://Stackoverflow.com", "https://Stackoverflow.com/users/455340/" ]
If it were me I would make a new component out of: show input Lets call it `<InputToggler/>` and then it would have a state of inputHidden for its own input and use classes to determine if it should show or not and the button would have an onclick handler to toggle the state of hidden or shown. Here is a pen showing...
55,268,495
In some discussions it's claimed that void\* is "pointer to void object" but in C standard 6.5.3.4, point 2 it is written: "The sizeof operator yields the size (in bytes)....The size is determined from the type of the operand." So it is stated that function sizeof() receives a type as arguments. So the compiler consid...
2019/03/20
[ "https://Stackoverflow.com/questions/55268495", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10847083/" ]
A `void *` is a valid type that has a known size. What it points to is either some object whose type is not known or valid untyped memory (i.e. memory returned from `malloc`). As such `sizeof(void *)` is a valid expression. Paragraph 1 of 6.5.3.4 states: > > **The `sizeof` operator shall not be applied to an express...
35,917,100
I am developing an Android app. In my app I need to work with tabs. But when I add tabs to TabLayout in code, it is throwing error. What is wrong with my code? This is my tablayout XML in custom action bar: ``` <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/andr...
2016/03/10
[ "https://Stackoverflow.com/questions/35917100", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4675736/" ]
Your id of TabLayout in your xml is `@+id/tab_layout"` but you're finding the view with id `main_tab_layout` in your Activity. Line `tabLayout = (TabLayout)findViewById(R.id.main_tab_layout);` It should be `tabLayout = (TabLayout)findViewById(R.id.tab_layout);`
26,455,839
I just came across this code: ``` array_filter(array_map('intval', $array)); ``` It seems to return all entries of $array converted to int where the number is > 0. However, I can't see on the manual page that this is defined. It is supposed to return the array value if the callback function evaluates to true. But t...
2014/10/19
[ "https://Stackoverflow.com/questions/26455839", "https://Stackoverflow.com", "https://Stackoverflow.com/users/123594/" ]
Removes empty or equivalent values from array: ``` $entry = array( 0 => 'foo', 1 => false, 2 => -1, 3 => null, 4 => '', 5 => 0 ); print_r(array_filter($entry)); ``` **Result** ``` Array ( [0] => foo [2] => -1 ) ``` See the [original documentation](http://php.net/manual/en/function...
329,336
In my quest to better my experience in my windows 7 environment, I have installed cygwin and have started using mintty as my command line interface tool. This has been nice and takes me back to my more productive days in working in a unix environment. There is one annoying thing however, that I can't seem to get worki...
2011/08/29
[ "https://superuser.com/questions/329336", "https://superuser.com", "https://superuser.com/users/27663/" ]
I'm not sure of the answer to your question, but here are a few things that might help: * Check that the `PATHEXT` environment variable includes `.BAT`. * Read about the `noacl` option [here](http://www.cygwin.com/cygwin-ug-net/using.html). It seems that you might do better to remove `noacl`, and spend some time getti...
63,595,089
I'm trying to set chrome as default browser for launching jupyter notebook. For this i'm following the usual steps- 1. In anaconda prompt, i fired- `jupyter notebook --generate-config` ,a config file 'jupyter\_notebook\_config.py' is created. 2. Opened the file in notepad & change the line `# c.NotebookApp.browser = '...
2020/08/26
[ "https://Stackoverflow.com/questions/63595089", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13994287/" ]
In windows 10 - Goto file explorer - browse to C:\Users\your user name\AppData\Roaming\jupyter\runtime. Locate the nbserver-####-open.html files. Right click anyone of them. Select Properties (at bottom). With popup window, choose OPEN WITH: change button (at top) and select browser of your choice.
52,220,105
I want to format pagination in laravel like this: ``` api/posts?from=1&to=10 ``` I tried: ``` $posts = new LengthAwarePaginator(Post::all(), 100, 10); return $posts->toArray(); ``` Which didn’t work at all :( Please help
2018/09/07
[ "https://Stackoverflow.com/questions/52220105", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9764412/" ]
Try this ``` $x = array_search ('english', $request->all()); ```
69,254,790
I have a small issue with my application that I spotted when testing it. I have a `println` statement that should run to inform the user they have entered an invalid **product code**. I have a **for-loop** that will run through an Array List of objects where an if statement will match each item in said Array List to a...
2021/09/20
[ "https://Stackoverflow.com/questions/69254790", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16740107/" ]
Separate out the printing from the looping: Loop through the list until you find the item: ``` Report r = null; for (int i = 0; i < report.size(); ++i) { if (report.get(i).code.equals(searchTerm)) { r = report.get(i); break; } } // or for (Report rep : report) { if (rep.code.equals(searchTerm)) { ...
47,061,829
I'm trying to get image format plugins working on Android. My plan is to build this [APNG](https://github.com/Skycoder42/qapng) image format plugin, which closely follows the style of the official Qt extra [image format plugins](http://doc.qt.io/qt-5/qtimageformats-index.html). The answer to my problem will be the sam...
2017/11/01
[ "https://Stackoverflow.com/questions/47061829", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1964167/" ]
Following @Felix answer, `ANDROID_EXTRA_PLUGINS` is correct, but how it works is a bit strange. Following a discussion on the lack of doc for this feature [here](https://bugreports.qt.io/browse/QTBUG-60022), and some trial and error, i found that; `ANDROID_EXTRA_PLUGINS` must specify a *directory*, not a file. So you...
421,335
So here's the question: ***We want to design a circuit that determines if a four-bit number is less than 10 and is also even.*** ***a. (10 points) Write an expression of M such that M=1 if the four-bit number X (x3 x2 x1 x0) is less than 10 and is also even.*** Is this asking for the answer in POS form since it is u...
2019/02/09
[ "https://electronics.stackexchange.com/questions/421335", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/212333/" ]
They probably want the simplest form.
48,333,458
I want to repeat data using div and in this div , I have one more repeatation using id value from first repeatation. So I want to pass this value using function in ng-init but got me error. ``` <div ng-controller="ProductsCtrl" ng-init="getData()"> <div class="col-sm-12" ng-repeat="data in fo...
2018/01/19
[ "https://Stackoverflow.com/questions/48333458", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7942721/" ]
> > `I was hoping someone could use the context of this question to help me understand pointers better....` > > > In context of your program: ``` int main(int argc, char *argv[]) ``` First, understand what is `argc` and `argv` here. **`argc`(argument count):** is the number of arguments passed into the program...
3,574
I am getting the error - `'System.QueryException: sObject type 'CollaborationGroup' is not supported.'` When running the following code as part of a managed package by scheduled apex: > > List groups = [select id, name, description from > collaborationGroup]; > > > What's strange is that the code works if I r...
2012/10/22
[ "https://salesforce.stackexchange.com/questions/3574", "https://salesforce.stackexchange.com", "https://salesforce.stackexchange.com/users/783/" ]
Your code must be run in a `without sharing` context in order for it to have access to the `CollaborationGroup` SObject. I'm guessing that your Utility class which contains the query is *not* explicitly declared as `without sharing`, so you can do one of two things: 1. Move all of your code into your actual PostInstal...
5,018,340
I have this little piece of code, and I'm trying to convert a JSON string to a map. ``` String json = "[{'code':':)','img':'<img src=/faccine/sorriso.gif>'}]"; ObjectMapper mapper = new ObjectMapper(); Map<String,String> userData = mapper.readValue(json,new TypeReference<HashMap<String,String>>() { }); ``` But it re...
2011/02/16
[ "https://Stackoverflow.com/questions/5018340", "https://Stackoverflow.com", "https://Stackoverflow.com/users/613631/" ]
From what I remember Jackson is used to convert json to java classes - it is probably expecting the first object is reads to be a map, like ``` String json = "{'code':':)','img':'<img src=/faccine/sorriso.gif>'}"; ```
57,698,746
I am trying to do a migration in django 2.2.4 in python 3.7. First I try to make do makemigations: ``` python3 manage.py makemigrations ``` I get: ``` Migrations for 'main': main/migrations/0001_initial.py - Create model TutorialCategory - Create model TutorialSeries - Create model Tutorial ``` But ...
2019/08/28
[ "https://Stackoverflow.com/questions/57698746", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8802333/" ]
Somehow your migrations are virtually or faked applied in the database, Truncating **django\_migrations** table should work. 1. Delete all the migrations files: find . -path "*/migrations/*.py" -not -name "**init**.py" -delete find . -path "*/migrations/*.pyc" -delete 2. Truncate table: truncate django\_migrations 3...
24,197,830
let's say that I have a form ``` <form > <div class="control-group"> <label class="control-label" for="numeinculpat">Nume inculpat</label> <div class="controls"> <input type="text" id="numeinculpat" placeholder="Nume inculpat" name="nume" /> </div> </div> <div class="control-group"> <label cla...
2014/06/13
[ "https://Stackoverflow.com/questions/24197830", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3677455/" ]
There are several ways to do this, one way is to create a directive with an isolate scope that accepts an array of `label`s to be displayed aligned with the `input[radio]` elements and second is the model for all the `input[radio]` elements. Create a template that handles the iteration of each label together with the `...
46,377,827
Let us assume In PHP ``` $i = 016; echo $i / 2; ``` The output is returning `7`.! why..?
2017/09/23
[ "https://Stackoverflow.com/questions/46377827", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6382509/" ]
Appending 0 to the front of a number in PHP is making it octal. 16 in octal is equivalent to 14 in decimal. So , 14/2 = 7 is the answer.
2,825,220
I currently have a JS function that allows me to load partial content from another page into the current page using jQuery.load() However I noticed when using this that I get a duplicate ID in the DOM (when inspecting with FireBug) This function is used in conjuction with a Flash Building viewe so it does not contain...
2010/05/13
[ "https://Stackoverflow.com/questions/2825220", "https://Stackoverflow.com", "https://Stackoverflow.com/users/69795/" ]
If it's just that ID that is causing you an annoyance, you could either change that id, or remove the duplicate when the document is loaded: ``` function displayApartment(apartmentID) { $("#apartmentInfo").load(siteURL + apartmentID + ".aspx #apartmentInfo", function () { $(this).attr('id', 'somethingElse'...
114,864
I am trying to get Emacs (24.3.1), Org-mode (8.0.3, from ELPA) and BibTeX (from TeX Live 2012) to work together. I have followed the instructions under the **Bibliography** section in <http://orgmode.org/worg/org-tutorials/org-latex-export.html> but after exporting the document to LaTeX, compiling to PDF, and opening t...
2013/05/18
[ "https://tex.stackexchange.com/questions/114864", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/11886/" ]
@G.JayKerns has a perfectly good solution in the comments, but since this question has been a while without an answer, I'll fill it in. The important elisp variable is `org-latex-pdf-process`, which can work with a number of settings. I have mine set up as something like: ```lisp (setq org-latex-pdf-process (list "...
4,082
I think that [this question](https://math.stackexchange.com/questions/3704/integral-representation-of-infinite-series) deserves to be reopened. Hopefully now that we have more meta members, enough others will agree. Please vote to reopen if you agree. **Edit** $\ $ The question is now reopened. Thanks to everyone who ...
2012/05/01
[ "https://math.meta.stackexchange.com/questions/4082", "https://math.meta.stackexchange.com", "https://math.meta.stackexchange.com/users/242/" ]
I cast the final reopen vote. While at face value I think it made a close-worthy question according to the word of the FAQ and rules and such, I personally have a higher bar for my close votes: * If the question has proven amenable to a valuable and original contribution from some member of the community as an answer,...
339,291
After opening the emoji keyboard with `Ctrl + Cmd + Space`, selecting an emoji and finally hitting enter, the emoji keyboard closes but nothing is inserted at my cursor. [![enter image description here](https://i.stack.imgur.com/S8hL5.png)](https://i.stack.imgur.com/S8hL5.png) A restart seems to fix this, but after s...
2018/10/11
[ "https://apple.stackexchange.com/questions/339291", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/43263/" ]
Lets assume you are not confusing Google and Chrome. Google application passwords are stored in your KeyChain, for things like Gmail, Calendar, Google drive ect.. Chrome passwords are stored on your HD at `~/Library/Application Support/Google/Chrome/Default/databases` in special format. (SQL) However Chrome is a b...
33,099,133
When I am run my application in android studio error. I am new in android developing. My Logtag is here: ``` Information:Gradle tasks [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:assembleDebug] Error:A problem occurred configuring project ':app'. > Could not resolve all depen...
2015/10/13
[ "https://Stackoverflow.com/questions/33099133", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5064636/" ]
**Error:** > > Error:A problem occurred configuring project ':app'. Could not > resolve all dependencies for configuration ':app:\_debugCompile'. > > Could not find com.android.support:recyclerview-v7:. > > > From error i can say you'll have to add the following gradle dependency : ``` compile 'com.android....
68,682,825
I am using last version of ActiveMQ Artemis. My use case is pretty simple. The broker sends a lot of messages to consumer - a single queue. I have 2 consumers per queue. Consumers are set to use default prefetch size of messages (1000). Is there a way to monitor how many messages are pre-fetch and processed from each...
2021/08/06
[ "https://Stackoverflow.com/questions/68682825", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4173038/" ]
There are several ways you can go about "shuffling" an array. I chose the Fisher-Yates method in an experimental "war" card game. <https://github.com/scottm85/war/blob/master/src/Game/Deck.js#L80> ``` shuffle() { /* Use a Fisher-Yates shuffle...If provides a much more reliable shuffle than using variations of a so...
25,906,182
I am using Eclipse Indigo (version 3.7) for my Plug in development. I have created a plug-in and added Jersey archive jars in my Build Path . When i try to debug or run the application I am getting...... ``` org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.NoClassDefFoundError: com/sun/jersey/api/c...
2014/09/18
[ "https://Stackoverflow.com/questions/25906182", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3926459/" ]
**EDIT** I've just noticed (after adding my answer) an error in your constructor - it's name is `_construct` with single underscore. It should be with double underscore `__construct` so correct the name and make sure if error is still present and if it is, read the rest of the answer. **Rest of the answer** The firs...
77,767
In a cavity, the standing wave will constructively interfere with itself, so its energy gets higher while the oscillator is still vibrating. Since the vibration time is not a constant value, and sometimes the wall of the cavity absorbs some of the wave energy, the energy of a standing EM wave is probabilistic and follo...
2013/09/18
[ "https://physics.stackexchange.com/questions/77767", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/24610/" ]
Conservation of energy follows directly from Maxwell's equations, so if you convince yourself that energy isn't conserved when EM waves interfere, you've made a mistake, and you need to go back and figure out what your mistake was. > > In a cavity, the standing wave will constructively interfere with itself, [...] > ...
7,660
I've started Wing Chun few days before. Everything seems to be nice, but I've seen some videos on internet, they say that Wing Chun can't handle Boxers or Wrestlers. What are the comparisons between Wing Chun and boxing/wrestling that would lead someone to make this claim? Are there weaknesses that can be exploited?
2017/07/16
[ "https://martialarts.stackexchange.com/questions/7660", "https://martialarts.stackexchange.com", "https://martialarts.stackexchange.com/users/-1/" ]
As always, you can't compare style A with style B and say either one is better. It's not because you're a boxer, you immediately win agains a wing chun practitioner. It all depends on how good both fighters are, how much experience they got fighting opponents of different styles, the competition's rules (eg. if you pit...
12,011,559
I have the following html that is bound to an object containing id and status. I want to translate status values into a specific color (hence the converter function convertStatus). I can see the converter work on the first binding, but if I change status in the binding list I do not see any UI update nor do I see conve...
2012/08/17
[ "https://Stackoverflow.com/questions/12011559", "https://Stackoverflow.com", "https://Stackoverflow.com/users/665106/" ]
To answer your two questions: 1) Why can't I set id through binding? This is deliberately prevented. The WinJS binding system uses the ID to track the element that it's binding to (to avoid leaking DOM elements through dangling bindings). As such, it has to be able to control the id for bound templates. 2) Why isn't...
46,586,267
Context ------- For quite a lot of our CentOS servers I would like to install some monitoring software, the software is based on the CentOS version, I want to check the release version and install software based on that. Issue ----- It seems that the if statements are run successfully without errors while the result...
2017/10/05
[ "https://Stackoverflow.com/questions/46586267", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8726241/" ]
You need whitespace around the `=` sign; without it, the shell treats the "expression" as a single word, not a comparison of two words for equality. ``` [[ "$version" = "CentOS release 6.9 (Final)" ]] ``` `[[ a=b ]]` is equivalent to `[[ -n a=b ]]`, i.e., you are simply testing if the single word is a non-empty stri...
539,083
I am trying to build a small circuit using an ESP8288-12E, 4 5V relays and a 74HC595 shift register as the main components. To power the whole circuit I am using a Hi Link HLK 5M05 5V/5W switch power supply module. Here is how I planned the whole circuit: [![enter image description here](https://i.stack.imgur.com/iTD...
2020/12/25
[ "https://electronics.stackexchange.com/questions/539083", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/212459/" ]
If there is no load at all on the 3V3 regulator, it has no minimum required load so it won't output 3V3. When there is no ESP connected, there is nothing connected on HC595 input pins, so they are floating. The input impedance is so high that taking multimeter probes nearby will cause the HC595 to see activity on inpu...
66,223,067
Is it possible to expose all the Spring metrics in an rest endpoint? In our environment Micrometer cannot forward directly the metrics to our monitoring system, then my idea was to have all the metrics exposed in a rest endpoint (or on a file, json format but the endpoint is preferable) and then having a script to fet...
2021/02/16
[ "https://Stackoverflow.com/questions/66223067", "https://Stackoverflow.com", "https://Stackoverflow.com/users/980515/" ]
You may use this redirect rule in your site root .htaccess: ```sh RewriteEngine On RewriteCond %{HTTP_HOST} ^(?:www\.)?website\.com$ [NC] RewriteRule ^reservation/?$ https://test.com/test/page [L,NC,R=301] ``` Query string and fragment i.e. part after `#` will automatically be forwarded to the new URL.
42,347,969
how to block a jsp page (i want is ,when I click the links to redirect each pages I want to block some specific pages for specific users) I create an java script function to retrieve the jsp pages of each users(pages that user can access).But I have no idea to block other pages for the same user)
2017/02/20
[ "https://Stackoverflow.com/questions/42347969", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5983136/" ]
use js `document.getElementById("id name of link").style.display = 'none';` to remove the link from page and use **'block'** instead of **'none'** for showing the link.
44,124,940
How would I go about dividing arrays into quarters? For example, I want to ask the user to enter say 12 values. Then, divide them into 4 quarters and add the values in each quarter. I figured how to add all of them up, but I'm stuck on how to add them separately in groups. Thank You. ``` import java.util.Scanner; impo...
2017/05/23
[ "https://Stackoverflow.com/questions/44124940", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8051072/" ]
``` String[] quarters = {"first", "second", "third", "fourth"}; for (int i = 0; i < 12; i += 3) System.out.printf("The %s quarter total is %d%n", quarters[i / 3], Arrays.stream(salesData, i, i + 3).sum()); ```
28,277,685
I have webpages with URL <http://siteurl/directory/onemore/>$fileID.php I am trying to extract just the $fileID and after that use ``` $query = $mysqli->query("SELECT * FROM tablename WHERE ID = $fileID"); $rows = mysqli_fetch_array($query); $hits = $rows['HITS']; $hits = $hits + 1; $query = $mysqli->query("UPDATE t...
2015/02/02
[ "https://Stackoverflow.com/questions/28277685", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4516574/" ]
You can determine the $fileId like this: ``` /* $_SERVER['PHP_SELF'] results to e.g. '/directory/onemore/5.php' */ /* basename(...) results to e.g. '5.php' */ $fileName = basename($_SERVER['PHP_SELF']); /* take the text before the last occurrence of '.' */ $fileID = substr($fileName, 0, strrpos($fileName, '.')); $que...
22,345,614
How can this be possible: ``` var string1 = "", string2 = ""; //comparing the charCode console.log(string1.charCodeAt(0) === string2.charCodeAt(0)); //true //comparing the character console.log(string1 === string2.substring(0,1)); //false //This is giving me a headache. ``` <http://jsfiddle.net/Derek...
2014/03/12
[ "https://Stackoverflow.com/questions/22345614", "https://Stackoverflow.com", "https://Stackoverflow.com/users/283863/" ]
In JavaScript, strings are treated by characters instead of bytes, but only if they can be expressed in 16-bit code points. A majority of the characters will cause no issues, but in this case they don't "fit" and so they occupy 2 characters as far as JavaScript is concerned. In this case you need to do: ``` string2....
9,743,846
I have to do some processing on a file loaded by the user. This process can take a long time based on the number of pages within the file. I am planning on using jQuery UIs progressbar and telling the user how many pages have been processed. However, my progress check does not return until the first ajax call is comple...
2012/03/16
[ "https://Stackoverflow.com/questions/9743846", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2486/" ]
You can do it in a single thread. Suppose you have a script that prints lines at random times: ``` #!/usr/bin/env python #file: child.py import os import random import sys import time for i in range(10): print("%2d %s %s" % (int(sys.argv[1]), os.getpid(), i)) sys.stdout.flush() time.sleep(random.random()...
22,312,325
I have a set of 8 buttons in a horizontal row. How can i make them like the buttons in [www.dotacinema.com](http://www.dotacinema.com) where when you smaller the window the buttons go together too (or zoom in, the buttons are still visible) Thanks EDIT: ``` height: 38px; float: left; min-width: 60px; max-width: ...
2014/03/10
[ "https://Stackoverflow.com/questions/22312325", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2881151/" ]
Make the width of the buttons a percentage of the page, and then set a minimum button width using `min-width: ;` to stop them getting any smaller than readable. <http://jsfiddle.net/s2VvX/3/>
65,229,771
After working with the tensorflow's example tutorial on colab: Basic regression: Predict fuel efficiency, which can be found here: <https://www.tensorflow.org/tutorials/keras/regression>. I've been trying to run this example on jupyter notebook via anaconda in order to be able to run it offline too. The code that...
2020/12/10
[ "https://Stackoverflow.com/questions/65229771", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14799022/" ]
I see you are using different models in them. In **Colab** you have used model having only **5** parameters whereas in **Notebook** you are using a dense model having **944** parameters. **Try running the model with less parameter on notebook first** or Try running the same model on both.(Maybe the complex model was n...
38,408,974
I'm new in swift-ios. I'm studying [this](https://www.ralfebert.de/tutorials/ios-swift-uitableviewcontroller/) when I'm trying to create cocoa file, > > import cocoa > > > is giving error. I've searched in google and found cocoa class not work in ios-swift. it works in osx. So I'm not getting what'll I do no...
2016/07/16
[ "https://Stackoverflow.com/questions/38408974", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2007490/" ]
Cocoa is a framework for macOS. However, CocoaTouch is an umbrella module for iOS. To import the main module dependency for an iOS app, you use ``` import Foundation ``` And to import the main UI module for an iOS app, you use ``` import UIKit ```
50,621,187
I need to click a button whose xpath is "**//input[contains(@value,'Export to Excel')]**" through **Execute Javascript** keyword. I don't know how to use it. Can anyone help me out!!!
2018/05/31
[ "https://Stackoverflow.com/questions/50621187", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9667509/" ]
You can write it as below ``` Execute JavaScript document.evaluate("ur xpath",document.body,null,9,null).singleNodeValue.click(); ```
1,038,189
which one of the 2 have the best performance? In javascript I was heard douglas crockford say that you shouldn't use str += if you are concatenating a large string but use array.push instead. I've seen lots of code where developers use $str .= to concatenate a large string in PHP as well, but since "everything" in PH...
2009/06/24
[ "https://Stackoverflow.com/questions/1038189", "https://Stackoverflow.com", "https://Stackoverflow.com/users/117278/" ]
Strings are mutable in PHP so using .= does not have the same affect in php as using += in javascript. That is, you will not not end up with two different strings every time you use the operator. See: [php String Concatenation, Performance](https://stackoverflow.com/questions/124067/php-string-concatenation-performa...
61,339,388
I have two tables t1 & t2. In t1, there are 1641787 records. In t2, there are 33176007 records. I want to take two columns from t2 and keep everything of t1 using a left join. When I use left join with t1 to t2, I got more records than t1. I would like to get a similar number of records as t1 after joining. Please give...
2020/04/21
[ "https://Stackoverflow.com/questions/61339388", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5846329/" ]
You need to aggregate `t2` *before* joining: ``` SELECT t1.*, t2.City FROM t1 LEFT JOIN (SELECT t2.ID, ANY_VALUE(t2.City) as City FROM t2 GROUP BY t2.ID) ) t2 ON t1.ID = t2.ID; ```
4,012,120
I am trying to build a simple graphics application in WPF C#. The purpose is to draw 10000\*10000 rectangles of size 4 pixels each. I have modified the OnRender method of the canvas to draw the rectangles. Drawings are performed for smaller number of rectangles (say 50\*50 or 100\*100 rectangles of 4 pixel each) but i...
2010/10/25
[ "https://Stackoverflow.com/questions/4012120", "https://Stackoverflow.com", "https://Stackoverflow.com/users/461537/" ]
> > The purpose is to draw 10000\*10000 > rectangles of size 4 pixels each. > > > Do NOT draw them. That simple. This would be 40k to 40k pixels. Most will not be visible. So they must not bee drawn. Basically only draw those that are visible in the canvas. When resizing or scrolling you repaint anyway, then do ...
2,332,712
Let $M$ , $N$, and $P$ be smooth manifolds with or without boundary. Every constant map $c: M\rightarrow N$ is smooth. **Proof:** Let $c: M \rightarrow N$ be a constant map. Let $p \in M$. Smoothness of $c$ means there are charts $(U,\phi)$ of $p$ and $(V,\psi)$ of $c(p)$ such that $c(U) \subseteq V$ and $\psi \circ...
2017/06/22
[ "https://math.stackexchange.com/questions/2332712", "https://math.stackexchange.com", "https://math.stackexchange.com/users/203845/" ]
We have chosen some chart $\phi \colon U \rightarrow \phi(U) \subseteq \mathbb{R}^n$ on $M$ and a chart $\psi \colon V \rightarrow \psi(V) \subseteq \mathbb{R}^m$ on $N$. We want to show that $\psi \circ c \circ \phi^{-1}$ is smooth given $c$ is constant. Hints: 1. What is the domain and codomain of the map $\psi \ci...
446,618
![enter image description here](https://i.stack.imgur.com/0CH4T.jpg) This was my grandfather’s and have no idea what it is only that it is some piece of physics equipment! The main black cylinder doesn’t seem like it wants to rotate but not sure if it should?
2018/12/11
[ "https://physics.stackexchange.com/questions/446618", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/37250/" ]
It looks like an [induction coil](https://en.wikipedia.org/wiki/Induction_coil) with the make and break device at the bottom and a switch right at the bottom. If you connect it up to an accumulator, be very, very careful as the output between the two balls, when separate, could be lethal. Also the electrical insulation...
35,287
hello. I am looking for tensor manipulation software that would allow me: * declare indices * declare results of contraction (or simplification rules) * allow algebraic simplifications and expansion * index renaming So far I have found Maxima to satisfy my requirement more or less, <http://maxima.sourceforge.net/doc...
2010/08/11
[ "https://mathoverflow.net/questions/35287", "https://mathoverflow.net", "https://mathoverflow.net/users/5925/" ]
I think that everything in your list (except the Python interface) can be found in Kasper Peeters' [Cadabra](http://cadabra.phi-sci.com/). As for a Python interface, there are two directions: 1. [It is planned](http://cadabra.phi-sci.com/ideas.html) to add an interface layer to Cadabra to either Maxima or SymPy - in...
46,934,653
we are facing an issue in production that the 'Content-Length' header is not being sent, even if we hard-code it in the headers properties, so we are receiving back from the server the 411 Length Required error. We are using: * Axios 0.16.2 * NodeJS 6.10 * Application deployed inside AWS Lambda environment The code ...
2017/10/25
[ "https://Stackoverflow.com/questions/46934653", "https://Stackoverflow.com", "https://Stackoverflow.com/users/513808/" ]
You can specify the .py file form which you wish to import in the code itself by adding a statement `sc.addPyFile(Path)`. The path passed can be either a local file, a file in HDFS (or other Hadoop-supported filesystems), or an HTTP, HTTPS or FTP URI. Then use `from add_num import add_two_nos`
30,957,706
I am trying to modify Javascripts Array type with a method which will push a value to an array only if its is not already present. Here is my code: ``` // add a method conditionally Array.prototype.method = function (name, func){ if(!this.prototype[name]){ this.prototype[name] = func; return this;...
2015/06/20
[ "https://Stackoverflow.com/questions/30957706", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1652010/" ]
When you're putting a method on `Array.prototype` the method will be available on the instances of Array. ``` // Add the custom method Array.prototype.method = function() { console.log('XXX'); } var foo = []; // prints XXX foo.method(); ```
18,380,463
Recently I'm working on a new project and `UTF-8` is a must. I don't know why I'm facing this, but it is really strange to me. I really tried everything I knew, but the problem remains. I'm sending a JSON string to my servlet and here is the servlet part: ``` protected void doGet(HttpServletRequest request, HttpServl...
2013/08/22
[ "https://Stackoverflow.com/questions/18380463", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1773265/" ]
`String data = request.getParameter("mainData");` request.getParameter() already decodes mainData parameter. No further decoding is necessary: `URLDecoder.decode(data, "UTF-8")` If you still want to get raw mainData parameter value use [request.getQueryString()](http://docs.oracle.com/javaee/6/api/javax/servlet/http/...
42,623
Every once in a while, my eighth-inch audio jack will slip loose and I'll seemingly lose only the voice part of a track -- leaving somewhat of a "karaoke" version. What I would guess about how audio plugs work suggests that I'd be making this up; however, I've asked and others tell me they've experienced this as well. ...
2012/10/02
[ "https://electronics.stackexchange.com/questions/42623", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/13714/" ]
When the plug starts to slip out of the jack, very often it's the ground contact (sleeve) that breaks its connection first, leaving the two "hot" leads (left and right, tip and ring) still connected. With the ground open like this, both earpieces still get a signal, but now it's the "difference" signal between the lef...
37,590,244
I am using laravel 5 and having following array: ``` array:3 [▼ 0 => 3, 1 => 4, 2 => 5 ] ``` Now i wanted to get all values/rows from table say 'X' having id's 3,4,5
2016/06/02
[ "https://Stackoverflow.com/questions/37590244", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2305113/" ]
Try this query ``` $array = [ 0 => 3,1 => 4, 2 => 5]; $results = DB::table('x') ->whereIn('id',$array) ->get(); ```
114,936
Say every container and the host itself has its own dedicated, external IP. Is it possible to do this without any problems? And is this really a good plan? Instead of hosting a database per container, hosting a database per host, for all containers to share? This question is sort of related to this one: <https://unix...
2014/02/12
[ "https://unix.stackexchange.com/questions/114936", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/56196/" ]
I do this exact same thing, I have ~10+ OpenVZ guests and a single instance of MySQL running in one of the 10. This is a good approach if the following things are true: * All the VM's using this DB won't overload it * Running multiple individual MySQL instances in their own VMs would be more resource intensive * All t...
6,533,242
I want to add the ability to see the server exception on the client side. If the server got some exception => i want to show some MessageBox on the client side that will show the exception message .. How can i do it ?
2011/06/30
[ "https://Stackoverflow.com/questions/6533242", "https://Stackoverflow.com", "https://Stackoverflow.com/users/465558/" ]
First of all, you need to enable your WCF service to return detailed error information. This is OFF by default, for security reasons (you don't want to tell your attackers all the details of your system in your error messages...) For that, you need to create a new or amend an existing service behavior with the `<Servi...
13,159,303
I'm creating dates from strings with the format 'yyyy-MM-dd' but they're always created on the previous day for some reason. If I set the date as '2012-10-31' the Date object with actually be 30 of October and not 31. For example, this: ``` var d1=new Date('2012-10-31'); ``` Will output this: ``` Tue Oct 30 2012 1...
2012/10/31
[ "https://Stackoverflow.com/questions/13159303", "https://Stackoverflow.com", "https://Stackoverflow.com/users/478108/" ]
Both are valid approaches. I tend to favour the first option, because it allows better modularity and quite clear boundaries for high level BC. The second option is the 'standard' way of doing this, it favours let's say a more technical layering, while the first option literally favours a more domain driven layering. ...
23,406,727
I'm trying to simulate (very basic & simple) OS process manager subsystem, I have three "processes" (workers) writing something to console (this is an example): ``` public class Message { public Message() { } public void Show() { while (true) { Co...
2014/05/01
[ "https://Stackoverflow.com/questions/23406727", "https://Stackoverflow.com", "https://Stackoverflow.com/users/492726/" ]
`Thread.Suspend` is evil. It is about as evil as `Thread.Abort`. Almost no code is safe in the presence of being paused at arbitrary, unpredictable locations. It might hold a lock that causes other threads to pause as well. You quickly run into deadlocks or unpredictable stalls in other parts of the system. Imagine yo...
58,181,553
I have three columns in a pandas dataframe that I want to convert into a single date column. The problem is that one of the columns is day column. I am not able to convert into exact date of that month and year. Can anyone please help me to solve this issue. It looks something like this: ``` BirthMonth BirthYear Da...
2019/10/01
[ "https://Stackoverflow.com/questions/58181553", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12061738/" ]
Based on your reply to my first comment I updated my answer as follows. I think this is what you are looking for: ``` import re import time import calendar import numpy as np days = ['1st Monday', '3rd Tuesday', '4th wednesday'] months = [2, 3, 5] years = [1990, 2000, 2019] def extract_numeric(text: str): return...
152,286
I have a genuine question, I am a noob at stocks. from what I have been reading value investors get higher returns than growth investors but then how come the growth etf IVW gets much higher returns than the value index fund VTV. I've looked at other value ETF's but they sucked even more. Is value investing worth the h...
2022/08/23
[ "https://money.stackexchange.com/questions/152286", "https://money.stackexchange.com", "https://money.stackexchange.com/users/118279/" ]
"Value investing" is essentially looking for stocks that are cheaper than they "should be" by some measure. That ETF tracks an index of *large cap* value stocks, which may skew the results somewhat, since there may be more smaller "value" stocks that perform better than larger ones. Also note that the two were largely...
9,130
Is it scientifically possible to briefly walk on the moon bare footed? What possible side effects could there be? Are these side effects mild enough to make it worth it?
2015/05/16
[ "https://space.stackexchange.com/questions/9130", "https://space.stackexchange.com", "https://space.stackexchange.com/users/10160/" ]
There are 3 main threats you'd have to account for: 1. Vacuum. This is discussed in the questions @Forgemonkey linked to. Conclusion: brief exposure of the feet only is survivable. 2. Temperature. Surface temperatures on the Moon swing between + 120 and - 150 °C, so you'd have to pick your spot carefully to have a su...
237,609
Consider the following: ``` if(a == b or c) ``` In most languages, this would need to be written as: ``` if(a == b or a == c) ``` which is slightly cumbersome and repeats information. I know my above sample syntax is slightly clunky, but I am sure there are better ways to convey the idea. Why don't more langua...
2014/05/01
[ "https://softwareengineering.stackexchange.com/questions/237609", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/97416/" ]
The syntax issue is – that it requires syntax. Whatever syntax your language has, people using the language have to learn it. Otherwise they run the risk of seeing code and not knowing what it does. Thus it's generally considered a good thing if a language has a simple syntax that cleanly handles a lot of cases. In...
21,045,630
Regarding to this [tutorial by AppCoda about how to implement a app with UIPageViewController](http://www.appcoda.com/uipageviewcontroller-storyboard-tutorial/) I'd like to use a custom page control element on top of the pages instead of at the bottom. When I just put a page control element on top of the single views...
2014/01/10
[ "https://Stackoverflow.com/questions/21045630", "https://Stackoverflow.com", "https://Stackoverflow.com/users/66414/" ]
After further investigation and searching [I found a solution](https://stackoverflow.com/a/19140401/66414), also on stackoverflow. The key is the following message to send to a custom `UIPageControl` element: ``` [self.view bringSubviewToFront:self.pageControl]; ``` [The AppCoda tutorial is the foundation for this ...
69,089,637
I'm using React Native, and I have a functional component that has a function in it. This child component is located inside another component, on that another component I have a button. So, When the user clicks the button, I want to execute the function in the child component. I read about forwardRef (as I saw few que...
2021/09/07
[ "https://Stackoverflow.com/questions/69089637", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7868565/" ]
Using a forward ref to give access to a child function can be a solution, but it's not the React way to do it (See [useImperativeHandle hook](https://reactjs.org/docs/hooks-reference.html#useimperativehandle)) Instead, I would change a props of the Popup component to trigger the animation you want to use: ``` import ...
31,030,780
I have an xaml page with 40 rectangles, (4x10 grid), all named in the format r1-1 through to r10-4. I would like to iterate through these in code: ``` for (int row = 1; row < 10; row++) { for (int col = 1; col < 4; col++) { ...// what do I need here ...
2015/06/24
[ "https://Stackoverflow.com/questions/31030780", "https://Stackoverflow.com", "https://Stackoverflow.com/users/954884/" ]
Although I wouldn't recommend doing this, you can simply iterate through all of the items in the `Grid Panel` if you have a reference to it. Try something like this: ``` foreach (UIElement element in YourGrid.Children) { // do something with each element here } ```
37,810,011
So at the moment I am doing some iPhone and iPad testing and noticed a very annoying bug in relation to scrolling. So at the moment I have my basic page like so: ``` <body> <div> Content of my website... <button>This button uses jQuery to add a class to the fixed-form div</button> </div> <div class="fixed-form"> <f...
2016/06/14
[ "https://Stackoverflow.com/questions/37810011", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5929529/" ]
Is your image too large? Try uploading smaller images (a few 100 KBs in size). If that works, try compressing, or reducing the resolution of the image before encoding it. Here is an example: <https://stackoverflow.com/a/20382559/1237117> Another option is to increase the json size limit at your Web API. ``` <configu...
801,993
After reading "[Java concurrent in practice](http://jcip.net/)" and "[OSGI in practice](http://neilbartlett.name/blog/osgibook/)" I found a specific subject very interesting; Safe Publication. The following is from JCIP: > > To publish an object safely, both the reference to the object and the object's state must be ...
2009/04/29
[ "https://Stackoverflow.com/questions/801993", "https://Stackoverflow.com", "https://Stackoverflow.com/users/148909/" ]
Proportionally, it's probably fair to say that very few programmers sufficiently understand synchronization and concurrency. Who knows how many server applications there are out there right now managing financial transactions, medical records, police records, telephony etc etc that are full of synchronization bugs and ...
22,445,382
I have this exath path saved somewhere: ``` Array ( [0] => library [1] => 1 [2] => book [3] => 0 [4] => title [5] => 1 ) ``` I have some array and I want to change the value on this index: ``` $values[library][1][book][0][title][1] = "new value"; ``` I have no idea, how to do this, because...
2014/03/17
[ "https://Stackoverflow.com/questions/22445382", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2757937/" ]
It makes sense to create a function that does this, so: ``` function array_path_set(array & $array, array $path, $newValue) { $aux =& $array; foreach ($path as $key) { if (isset($aux[$key])) { $aux =& $aux[$key]; } else { return false; } } $aux = $newValu...
897,342
I am searching for an example of a semigroup, with unique idempotent element, that is not a monoid. Please help.
2014/08/14
[ "https://math.stackexchange.com/questions/897342", "https://math.stackexchange.com", "https://math.stackexchange.com/users/42041/" ]
How about a 2-element null semigroup? If the elements are $x$ and $y$, then the multiplication can be $xy=y=yx=y^2=x^2$.
32,207
I have been taking 2-3gm of creatine per day mixed extremely well with 16-17oz lukewarm water, that too on workout days (i.e. I avoid the non-workout days) for at least 2.5 months now. However, I feel that the paunch/belly fat I had, as mentioned in [this post of mine](https://fitness.stackexchange.com/questions/32030/...
2016/09/19
[ "https://fitness.stackexchange.com/questions/32207", "https://fitness.stackexchange.com", "https://fitness.stackexchange.com/users/22139/" ]
To answer the valid question here: ### Does Creatine cause bloating? Yes, the water retention usually seen with higher (>10g) loading doses can exceed five pounds (more than two kilograms). Lower doses may cause less water retention. While water mass is not muscle mass (though both count as lean mass), prolonged crea...
57,172,077
This spreadsheet I am working on tracks trainings. I'm having issues with this because one training counts for itself and fills the requirement for the other. I am trying to apply conditional formatting on column G that turns the cell red if the dates in; * Column F and G are not within 3 years * Column G are blank * ...
2019/07/23
[ "https://Stackoverflow.com/questions/57172077", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11826815/" ]
The domain `toastmasterstimer.tk` seems to be missing the Digital Asset Links file, necessary to validate ownership and enable fullscreen. The file needs to be available at `https://toastmasterstimer.tk/.well-known/assetlinks.json`. You can use the [Statement List Generator and Tester](https://developers.google.com/...