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
31,289,037
I am getting this error on two different Macs (iMac and Mac Book pro). No idea why people can't reproduce it but I need some help. ![enter image description here](https://i.stack.imgur.com/Te3YH.png) I am running **Xcode 7 beta 2** (23 June '15) on a Mac running **OS X Yosemite 10.10.4**. Can't even compile and run...
2015/07/08
[ "https://Stackoverflow.com/questions/31289037", "https://Stackoverflow.com", "https://Stackoverflow.com/users/382788/" ]
This worked for me on El Capitan. Go to > > /Library/Developer/CoreSimulator/Profiles/Runtimes > > > and remove the profiles in there. Restart Xcode and it should work! --- For Yosemite users try the following: * Open up terminal > > cd Library > > > cd Developer > > > cd Devices > > > rm -rf \* > > ...
1. Clean Project 2. Clean derived data Wait for reindexing files
12,424,469
In the following code: ``` class A { A() {} friend class B; }; class B { public: void foo() {A* p=new A;}; }; int main() { B b; b.foo(); A* p = new A; return 0; } ``` The function `foo()` passes compilation, however the line `A* p = new A;` does not. How can this be? `new` is a global...
2012/09/14
[ "https://Stackoverflow.com/questions/12424469", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1622810/" ]
The operator new function does not call constructors. It just allocates the needed storage. The constructor is called afterwards by compiler magic and is considered to be done by `foo` and `main` respectively.
A new-expression does two things: * calls some overload of `operator new` to acquire some memory; * constructs an object in that memory. The construction happens in the context of the new-expression, not the call to `operator new`. Therefore, the constructor must be accessible in that context; so in your example, it ...
577,623
I'm currnetly trying to retrieve files from my AWS EC2 Linux server to my Windows 7 PC using `scp` I'm a bit of a Linux newbie and from the server I'm currently trying things like: ``` scp transferMe.tar Username@publicIP/lanIP/C:/ ``` But it doesn't seem to be going very well, I've also tried things like `tcp` com...
2013/04/03
[ "https://superuser.com/questions/577623", "https://superuser.com", "https://superuser.com/users/213888/" ]
You have a couple of problems here. The first, as laurent pointed out is that `scp` does not work out of the box with Windows. You need to use specific software, for example [pscp](http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html) from the putty tools. Once you have installed it, you can run this command...
As far as I know, scp doesn't work with windows. You need to use [winscp](http://winscp.net/eng/index.php) ([introduction to winscp](http://winscp.net/eng/docs/introduction)) or use [cygwin](http://www.cygwin.com/). Is your local machine accessible from internet (public IP on the machine or port forwarding on the rout...
4,622,808
I have the below message (slightly changed): > > "Enter the competition by January 30, 2011 and you could win up to > $$$$ — including amazing summer trips!" > > > I currently have: ``` <p style="font-size:14px; color:#538b01; font-weight:bold; font-style:italic;"> ``` formatting the text string, but want to ...
2011/01/07
[ "https://Stackoverflow.com/questions/4622808", "https://Stackoverflow.com", "https://Stackoverflow.com/users/566463/" ]
You could use the HTML5 Tag `<mark>`: ```html <p>Enter the competition by <mark class="red">January 30, 2011</mark> and you could win up to $$$$ — including amazing <mark class="blue">summer</mark> trips!</p> ``` And use this in the CSS: ```css p { font-size:14px; color:#538b01; font-weight:bold; ...
``` <p style="font-size:14px; color:#538b01; font-weight:bold; font-style:italic;"> Enter the competition by <span style="color:#FF0000">January 30, 2011</span> and you could win up to $$$$ — including amazing <span style="color:#0000A0">summer</span> trips! </p> ``` The span elements are inline an thus don't bre...
81,749
I downloaded the Android app for my phone and set it up to move my pictures from the phone into UbuntuOne. When I go to the UbuntuOne web site the folder shows up and I can view the pictures after I download them. But when I open the UbuntuOne folder on my laptop, the folder with the pictures from my phone isn't list...
2011/11/22
[ "https://askubuntu.com/questions/81749", "https://askubuntu.com", "https://askubuntu.com/users/34924/" ]
When you're performing a normal search with Nautilus, it will search within the current folder and all subfolder for files with the search pattern in their names. You can limit the type of files you want by clicking on the '+' button once the search is started and adding a rule on the file type. That's pretty much all...
I discovered just by chance that, unlike what is stated in another answer, and despite what is *not* documented in Help (!!!), a space character in the search string does does not act as a wildcard but as an AND condition. Example: "screen .png -4" will find filenames that contains all of the 3 "sceen", ".png" and "-4...
31,695
I have seen in some screen-shots (can't remember where on the web) that the terminal can display the `[username@machine /]$` in bold letters. I'm looking forward to getting this too because I always find myself scrolling through long outputs to find out with difficulty the first line after my command. How can I make t...
2012/02/14
[ "https://unix.stackexchange.com/questions/31695", "https://unix.stackexchange.com", "https://unix.stackexchange.com/users/7892/" ]
You should be able to do this by setting the `PS1` prompt variable in your `~/.bashrc` file like this: ``` PS1='[\u@\h \w]\$ ' ``` To make it colored (and possibly bold - this depends on whether your terminal emulator has enabled it) you need to add escape color codes: ``` PS1='\[\e[1;91m\][\u@\h \w]\$\[\e[0m\] ' ...
This is the default prompt that you get in cygwin bash shell: ``` PS1='\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n\$ ' ``` ![enter image description here](https://i.stack.imgur.com/z5g9L.png) ``` \[\e]0;\w\a\] = Set the Window title to your current working directory \n = new line \[\e[32m\] ...
35,118,148
My Cron Setup is: ``` 0 * * * * ruby /directory/to/ruby/file.rb ``` And I get this error: ``` /usr/lib64/ruby/1.9.3/rubygems/custom_require.rb:36:in `require': cannot load such file -- mechanize (LoadError) from /usr/lib64/ruby/1.9.3/rubygems/custom_require.rb:36:in `require' from /home4/ofixcom1/rails_apps/product...
2016/01/31
[ "https://Stackoverflow.com/questions/35118148", "https://Stackoverflow.com", "https://Stackoverflow.com/users/789884/" ]
The key part of the error is the duplicated path: `/Users/KerimCaglar/KerimCaglar/.ssh/id_rsa (Errno::ENOENT)` Notice how the username is mentioned twice. I have found this to be caused by: 1. Specifying too much path in the Vagrantfile, e.g. config.vm.provision "file", source: "**KerimCaglar**/.ssh/id\_rsa", desti...
If you've got Git installed, all you have to do is simply go generate your ssh key through the GUI. Help -> Show Key ![enter image description here](https://i.stack.imgur.com/w5D5e.png)
7,926,868
I got the following code to generate a DLL : ``` public class QtObject : DependencyObject { public int speedSimu { get { return (int)GetValue(speedSimuProperty); } set { SetValue(speedSimuProperty, value); } } public static readonly DependencyProperty speedSimuProperty = Depende...
2011/10/28
[ "https://Stackoverflow.com/questions/7926868", "https://Stackoverflow.com", "https://Stackoverflow.com/users/946425/" ]
The ultimate goal of thread pools and Fork/Join are alike: Both want to utilize the available CPU power the best they can for maximum throughput. Maximum throughput means that as many tasks as possible should be completed in a long period of time. What is needed to do that? (For the following we will assume that there ...
Fork/join is different from a thread pool because it implements work stealing. From [Fork/Join](http://download.oracle.com/javase/tutorial/essential/concurrency/forkjoin.html) > > As with any ExecutorService, the fork/join framework distributes tasks > to worker threads in a thread pool. The fork/join framework is >...
60,233,448
I have a schema where users have tags associated with them: ``` user_id: int4 tags: text[] ------------- ------------ 1 [ 'apple', 'carrot', 'jelly' ] 2 [ 'jelly', 'zebra' ] ``` I am looking to create query that returns the list of all tags along with their associated counts. Exam...
2020/02/14
[ "https://Stackoverflow.com/questions/60233448", "https://Stackoverflow.com", "https://Stackoverflow.com/users/962155/" ]
You have nothing called `tag` in the data; it is `tags`. So you need to `UNNEST()` and to handle both old and new tags. I'm thinking something like: ``` INSERT INTO tags (tag, count) SELECT COALESCE(ntag, otag), (ntag IS NOT NULL)::int - (otag IS NOT NULL)::int FROM UNNEST(new.tags) ntag FULL JOIN ...
I was facing a similar problem so tried it by creating some dummy tables code as follows ``` CREATE TABLE public.test_tags( tags_names text[], id integer) CREATE TABLE public.tag_counter( tag_name text, tag_count integer, CONSTRAINT tag_counter_tag_name_key UNIQUE (tag_name)) create or replace function test_count() ...
96,861
I'm currently in my early days of learning about aviation, and have just started learning how to use a VFR chart. One thing that I have noticed is that the class D airspaces generally have frequencies to contact the controller for that airspace. Outside of CAS however, there is nothing. Do you just tune the FIS frequen...
2023/01/11
[ "https://aviation.stackexchange.com/questions/96861", "https://aviation.stackexchange.com", "https://aviation.stackexchange.com/users/67148/" ]
You want [CAP 774: UK Flight Information Services](https://publicapps.caa.co.uk/docs/33/CAP774_UK%20FIS_Edition%204.pdf). That document lists the air traffic services provided to aircraft in class G in the UK. The services listed are: Basic Service: > > A Basic Service is an ATS provided for the purpose of giving a...
Class G is uncontrolled free airspace. You don’t have to talk to anyone if you don’t want to. If there is a nearby radar facility then you could call them and ask for a service if you like but it’s not mandatory. In my opinion the ability to just go flying without talking to anyone or filing anything is one of the ad...
109,185
American citizens can apply for a [passport card](https://travel.state.gov/content/travel/en/passports/apply-renew-passport/card.html) at the same time they apply for a passport book. There’s even a small discount when you do so. I’ve heard, however, it’s better to apply for them separately because if you apply at th...
2018/02/02
[ "https://travel.stackexchange.com/questions/109185", "https://travel.stackexchange.com", "https://travel.stackexchange.com/users/17153/" ]
It’s wrong. They have completely different numbers, and are unrelated; the pattern is also different. Note that the ‘overlap’ technique for usage works very limited only, as the passport card is not valid for entry into the US except on the land borders. So if you are flying, you need a passport, or a Global Entry ...
I am not from the US but from a country (the Netherlands) where the citizens can get an ID card as well as a passport. I have always applied at different dates, due to practical reasons, but would not want to apply for the two at the same time as for me the fact they have different expiry dates is very important. W...
20,321
How can I prevent someone from modifying the contents of an email they received and then forwarding it to others? Some employees cheat managers by changing the content of emails and forwarding the modified email to them. I need a policy that prevents this backdoor.
2012/09/18
[ "https://security.stackexchange.com/questions/20321", "https://security.stackexchange.com", "https://security.stackexchange.com/users/13196/" ]
Email is an insecure communication channel. The "to" and "from" headers can be set to anything. Anything can be written into the body of an email message. This includes changing the quote text. The first issue of manipulating "to" and "from" headers can be prevented in a closed environment such as company internal mai...
Besides the very valid answer of having managers sign communications, referencing sources would be the other appropriate way of handling things. If there's a debate about the content of an email, the sent messages archive is the better reference for each party. If you have an email archiving system, then the server's c...
57,969,617
I need some help I want to show my reactive tabPanel in a popup with the `shinyBS` package. Everything seems to work well except the creation of popup. I am inspired by : 1) [R Shiny - add tabPanel to tabsetPanel dynamically (with the use of renderUI)](https://stackoverflow.com/questions/19470426/r-shiny-add-tabpanel-...
2019/09/17
[ "https://Stackoverflow.com/questions/57969617", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3530895/" ]
`bsModal` is an UI element, so you need to put it into you UI. Within this modal you want to show the `tabPanels` (rendered via `uiOutput`), so all you need to do is to place your `bsModal` into the UI, and within this `bsModal` you have your `uiOutput`. All what is left is to add an `actionButton` which shows the moda...
It's not clear to me what you want to do (maybe @thothal has the right answer). What about this app ? ``` library(shiny) library(DT) # need datatables package library(shinyBS) ui <- shinyUI(fluidPage( titlePanel("Example"), sidebarLayout( sidebarPanel( selectInput("decision", label = "Choose your speci...
46,742,333
I don't think my question duplicate with [How do I return the response from an asynchronous call?](https://stackoverflow.com/questions/14220321/how-do-i-return-the-response-from-an-asynchronous-call) In orther language(C#) i see, a variable declare in a function or loop, When you out of function or loop they can't acc...
2017/10/14
[ "https://Stackoverflow.com/questions/46742333", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8063048/" ]
You are declaring them as global variables without using `var` keyword. Use the `var` keyword to scope them to their intended scope or use `"use strict"` on top of javascript file. You can also use `let` keyword to scope them to their very local scope. 1. Variables declared not using [var and let keywords](https://de...
Any variable which is not declared inside a function, is treated as a window variable: ``` for (xxi = 0; xxi < 10; xxi++) { console.log(xxi); // this variable iix = 99; // this variable } ``` If you had done this, javascript won't read the variable outside the scope: ``` for (var xxi = ...
17,464,658
I need calculate and set the height for some div (initial settings). When the height of the browser window is changed --> change the height for div. How will be better to rewrite this code (I want do initial settings once and change it when window resize): ``` $(document).ready(function () { var height = document...
2013/07/04
[ "https://Stackoverflow.com/questions/17464658", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2299110/" ]
is that what you are looking for? [api.jquery.com](http://api.jquery.com/resize/) ``` jQuery(document).ready(function () { $(window).resize(function() { var height = document.documentElement.clientHeight - 500; if (height < 135) { height = 135; } document.getElementById('left_space').style.hei...
I think jQuery(window).resize one would be good
74,832
I am trying to prove that there exists logspace deterministic Turing machine that check if exists path between first row and last row in grid graph. Grid graph is matrix of $0s$ and $1s$, the undirected edge exists between two $0s$ or $1s$ - one the left, right, up, down. Path can contains only $0s$ or only $1s$. For...
2017/05/02
[ "https://cs.stackexchange.com/questions/74832", "https://cs.stackexchange.com", "https://cs.stackexchange.com/users/-1/" ]
I can't post a comment, which would be more appropriate: Reingold's result gives a logspace algorithm, but reachability on undirected grid graphs was show to be in $L$ by Blum and Kozen about 30 years prior: M. Blum and D. Kozen. [On the power of the compass (or, why mazes are easier to search than graphs).](https://...
Your problem is an instance of [USTCON](https://en.wikipedia.org/wiki/SL_(complexity)), which is known to be solvable in log space, thanks to a result of Omer Reingold: [Undirected connectivity in log-space](https://pdfs.semanticscholar.org/4b07/94ae3788df1851bdc4c7024764b99cd27f46.pdf). Omer Reingold. Journal of the ...
1,980,012
Since boost is forbidden in a company I work for I need to implement its functionality in pure C++. I've looked into boost sources but they seem to be too complex to understand, at least for me. I know there is something called `static_assert()` in the C++0x standart, but I'd like not to use any C++0x features.
2009/12/30
[ "https://Stackoverflow.com/questions/1980012", "https://Stackoverflow.com", "https://Stackoverflow.com/users/82625/" ]
One other trick (which can be used in C) is to try to build an array with a negative size if the assert fail: ``` #define ASSERT(cond) int foo[(cond) ? 1 : -1] ``` as a bonus, you may use a typedef instead of an object, so that it is usable in more contexts and doesn't takes place when it succeed: ``` #define ASSER...
I am using the following header file, with code ripped from someone else... ``` #ifndef STATIC_ASSERT__H #define STATIC_ASSERT__H /* ripped from http://www.pixelbeat.org/programming/gcc/static_assert.html */ #define ASSERT_CONCAT_(a, b) a##b #define ASSERT_CONCAT(a, b) ASSERT_CONCAT_(a, b) /* These can't be used aft...
155,437
How to get the placeholder image URL on my template file of product listing page?
2017/01/19
[ "https://magento.stackexchange.com/questions/155437", "https://magento.stackexchange.com", "https://magento.stackexchange.com/users/6123/" ]
``` use \Magento\Store\Model\StoreManager $storeManager $this->storeManager = $storeManager; $path = catalog/placeholder/thumbnail_placeholder OR catalog/placeholder/swatch_image_placeholder OR catalog/placeholder/small_image_placeholder OR catalog/placeholder/image_placeholder OR pu...
If you're trying to get it in any template file. You'll need Magento's image helper. `\Magento\Catalog\Helper\Image::class` You can get an instance like this at the top of any .phtml file ``` $imageHelper = \Magento\Framework\App\ObjectManager::getInstance()->get(\Magento\Catalog\Helper\Image::class); ``` and get t...
1,662,600
When I type this into the Visual Studio 2008 immediate window: `? .9 - .8999999999999995` It gives me this as the answer: `0.00000000000000055511151231257827` The documentation says that a double has 15-16 digits of precision, but it's giving me a result with 32 digits of precision. Where is all that extra precisio...
2009/11/02
[ "https://Stackoverflow.com/questions/1662600", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4228/" ]
You should read: [What Every Computer Scientist Should Know About Floating-Point Arithmetic](http://www.google.com/url?sa=t&source=web&ct=res&cd=2&ved=0CBMQFjAB&url=http%3A%2F%2Fdlc.sun.com%2Fpdf%2F800-7895%2F800-7895.pdf&ei=pRjvSpucFNDKlAe5z7H_BA&usg=AFQjCNFqeDj_vhcrQrnZ_zytDsczXO85fw&sig2=LQ1EROQQV6k7cX90ufFyMg). Ba...
I think its because in the binary system, 5 is periodic as it is not dividable by 2. And then what Mark Rushakoff said applies.
7,002,137
I have tried to create a custom NumberPicker which works in most of the cases pretty well. The only problem is the layout which is created dynamically. The layout consists of * two buttons ("+" at the top and "-" at the bottom in portrait mode) * one edit In the constructor ("NumberPicker extends LinearLayout") I add...
2011/08/09
[ "https://Stackoverflow.com/questions/7002137", "https://Stackoverflow.com", "https://Stackoverflow.com/users/871517/" ]
I would think just making an extension method would be a clear way of doing it: ``` public static bool CannotBeCastAs<T>(this object actual) where T: class { return (actual as T == null); } ``` You then simply make a check like so: ``` if(myObject.CannotBeCastAs<SomeClass>()) { } ```
I would be of the opinion that braced functionality should always match whatever brace pattern is in use in your application. For instance, in the case of iteration or conditional blocks, if you use: ``` If (foo != bar) { //Do Something } ``` well then this should be how you use brace patterned functionality at ...
62,126,513
I am working on a program where the user can send me all sort of objects at runtime, and I do not know their type in advance (at compile time). When the object can be down-cast to an (F#) array, of *any* element type, I would like to perform some usual operations on the underlying array. E.g. `Array.Length`, `Array.sub...
2020/06/01
[ "https://Stackoverflow.com/questions/62126513", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2518338/" ]
Is it legal? Yes. Is it error prone? **Yes.** That's why you are getting a warning. The C/C++ standard has one token above all (processed first): `\` This token removes the line break. Consider the following code: ``` 1. // the below code is commented out \ 2. despite not having a comment at the beginning of the l...
> > which compiler is right? > > > Both. The warning is not about "legal usage of `\`" the warning is about multiline comment. In C a `\` character on the end of the line means to ignore the newline. So the two lines: ``` // blabla\ abcabc ``` and: ``` // blabalabcbc ``` Are exactly equivalent. The double b...
247,589
I will provide definitions for which I can't think of the word: * *as though not trying one's best* * *having the appearance of little effort* The word is used to describe something that you look at and think, *"They're not really trying."* I remember thinking this is a good vocab word, and darn it, I forgot it. Thi...
2015/05/20
[ "https://english.stackexchange.com/questions/247589", "https://english.stackexchange.com", "https://english.stackexchange.com/users/122348/" ]
If a metaphoric term would work, consider *[phoning it in](http://www.oxforddictionaries.com/us/definition/american_english/phone-it-in)* > > (informal) Work or perform in a perfunctory or unenthusiastic manner. > > > *Oxford Dictionaries Online*
[Lackluster](http://www.oxforddictionaries.com/definition/american_english/lackluster) > > Lacking in vitality, force, or conviction; uninspired or uninspiring: > > > *No excuses were made for the team’s lackluster performance.* > > >
17,875,179
I have following table: ``` Type1 Type2 A T1 A T2 A T1 A T1 A T2 A T3 B T3 B T2 B T3 B T3 ``` I want output as: ``` Type1 T1 T2 T3 A 3 2 1 B 0 1 3 ``` I tried using ROW\_NUMBER() OVER (ORDER BY) and CASE Statements but couldn't get desired output. Plea...
2013/07/26
[ "https://Stackoverflow.com/questions/17875179", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1610216/" ]
Try to use PIVOT - **Query 1:** ``` DECLARE @temp TABLE (Type1 CHAR(1), Type2 CHAR(2)) INSERT INTO @temp (Type1, Type2) VALUES ('A', 'T1'),('A', 'T2'), ('A', 'T1'),('A', 'T1'), ('A', 'T2'),('A', 'T3'), ('B', 'T3'),('B', 'T2'), ('B', 'T3'),('B', 'T3') SELECT * FROM @temp PIVOT ( COUNT...
``` SELECT Type1, SUM(CASE WHEN Type2='T1' THEN 1 ELSE 0 END) AS T1, SUM(CASE WHEN Type2='T2' THEN 1 ELSE 0 END) AS T2, SUM(CASE WHEN Type2='T3' THEN 1 ELSE 0 END) AS T3 FROM your_table GROUP BY Type1 ```
56,130
The answer to the riddle is two words. The Riddle: > > I grow by consuming one thing > > > The more I consume the larger I get > > > Regardless of my size you don't see more of me > > > I am lighter than what I consume > > > Hint: > > I am something real, something tangible that you can put your hands on...
2017/10/19
[ "https://puzzling.stackexchange.com/questions/56130", "https://puzzling.stackexchange.com", "https://puzzling.stackexchange.com/users/39761/" ]
Hazarding a guess you are > > an iceberg > > > I grow by consuming one thing > > Water - ocean icebergs are composed of mostly fresh water from the salty sea. > > > The more I consume the larger I get > > Yes > > > Regardless of my size you don't see more of me > > Only see 10% of you reg...
maybe you are > > A cloud ? > > > I grow by consuming one thing > > Grow in size by absorbing water > > > The more I consume the larger I get > > The more water comes in, the bigger it gets > > > Regardless of my size you don't see more of me > > ??? if "more of me" is used as "a bigger surface...
14,082,020
How do you get the path to SignTool.exe when using Visual Studio 2012? In Visual Studio 2010, you could use ``` <Exec Command="&quot;$(FrameworkSDKDir)bin\signtool.exe&quot; sign /p ... /> ``` Where `$(FrameworkSDKDir)` is ``` "c:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\" ``` But in Visual Studio 2...
2012/12/29
[ "https://Stackoverflow.com/questions/14082020", "https://Stackoverflow.com", "https://Stackoverflow.com/users/20198/" ]
I just ran into the same issue. Running the build from a Visual Studio 2012 Command Prompt worked, but it was failing in the IDE. Looking for a detailed or diagnostic log led me to [What is the default location for MSBuild logs?](https://stackoverflow.com/questions/11526552/what-is-the-default-location-for-msbuild-logs...
The following is a more generic approach that can be used to find and set the `SignToolPath` variable based upon the build machine's specific configuration; by reading the registry: ``` <PropertyGroup> <WindowsKitsRoot>$([MSBuild]::GetRegistryValueFromView('HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Kits\Instal...
13,207
Whilst I understand why stars move across our skies,(Earth rotation) I struggle to understand why they do not appear to move relative to each other. To explain: Take the best know constellation the Plough. It is a familiar site to most people. But it has been there apparently un-changed for years. If we (I mean earth,...
2016/01/14
[ "https://astronomy.stackexchange.com/questions/13207", "https://astronomy.stackexchange.com", "https://astronomy.stackexchange.com/users/10399/" ]
They do move - just far too slowly for you to detect by eye even over several human lifetimes. > > Space is big. Really big. You just won't believe how vastly, hugely, mind-bogglingly big it is. I mean, you may think it's a long way down the road to the chemist, but that's just peanuts to space > > > *Douglas Ada...
Here's a nice image of [Barnard's star](https://en.wikipedia.org/wiki/Barnard's_Star) moving against the stellar background: [![enter image description here](https://i.stack.imgur.com/z0ge0.jpg)](https://i.stack.imgur.com/z0ge0.jpg) From this interesting website: [AstroWright](http://sites.psu.edu/astrowright/2012/08/1...
4,296,469
Suppose random variables $X\_{1}$ and $X\_{2}$ have some joint probability density function (pdf) $f(x\_{1}, x\_{2})$. I wish to find probability density of $Y\_{1} = \frac{X\_{1}}{X\_{2}}$. The textbooks say I can define an additional variable $Y\_{2} = X\_{2}$ and proceed. My question, what if I define an additional...
2021/11/04
[ "https://math.stackexchange.com/questions/4296469", "https://math.stackexchange.com", "https://math.stackexchange.com/users/980184/" ]
> > Surely these 2 integrals corresponding to marginal densities will be different, > > > **Sure that it is false.** Given that you are not responding, I will show you how to do assuming a coherent support. Let's assume that your joint density is the following $$f\_{XY}(x,y)=8xy$$ where $0<x<y<1$ You have to ...
what about this example. Let $f(x\_{1}, x\_{2}) = 8x\_{1}x\_{2}$. Define $Y\_{1} = \frac{X\_{1}}{X\_{2}}$ and $Y\_{2} = X\_{2}$. Then Jacobian of transformation is simply $y\_{2}$ and we have $f\_{Y\_{1}, Y\_{2}}(y\_{1}, y\_{2}) = 8y\_{1}y\_{2}^{3},$ and marginal density $f\_{Y\_{1}}(y\_{1}) = \int 8y\_{1}y\_{2}^{3} ...
229,657
In my world there are multiple continents with many cultures. In a far away continent, there are kingdoms that exist there. I was wondering how could they be medieval style like the mainland, and if it is even possible at all. Things to consider: * The new continent is not connected and is separated by sea * The cont...
2022/05/07
[ "https://worldbuilding.stackexchange.com/questions/229657", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/95481/" ]
The question as asked is vague, and may want to be narrowed down, but here is my understanding of the question, and my best swing at answering; you appear to be asking 'What conditions would lead a medieval culture aesthetically similar to Europe's to develop independently on two entirely separate continents, and just ...
[The Kingdom of Prester John](https://en.wikipedia.org/wiki/Prester_John): ========================================================================== [Thule](https://en.wikipedia.org/wiki/Thule), lost [Norse colonies](https://en.wikipedia.org/wiki/Norse_colonization_of_North_America), etc. The Histories and mythologie...
59,146
In the King James Version of Tehillim, we read : Psalm 119:126 [KJV] > > "It is time for thee, Lord, to work: for [they] have made [void - thy law]." > **Who are "they" and What [specifically] is the voided "Law" in Psalm 119 verse 126?** * Does "Thy Law" refer to **All** of His Commandments from [verse 6]? * Psa...
2021/04/18
[ "https://hermeneutics.stackexchange.com/questions/59146", "https://hermeneutics.stackexchange.com", "https://hermeneutics.stackexchange.com/users/37964/" ]
A few verses earlier, we have: > > 119 All the **wicked of the earth** you discard like dross; > > therefore I love your statutes. > > > The "they" refers to the wicked people of the earth. From the opening of the psalm, we have: > > 1 Blessed are those whose ways are blameless, > > who walk according to...
Ps 119:126 is part of a series of similar verses that ask God to act in order to remove the lawless; for example: * Ps 94:3 - How long, LORD, shall the wicked— How long shall the wicked triumph? * Ps 4:2 - You sons of man, how long will my honor be treated as an insult? How long will you love what is worthless and str...
2,333,365
my application requires the microsoft visual c++ redisributable package (vcredist\_x86.exe). i have a custom action to run the vcredist\_x86.exe i want it to run only if it's not already installed. i created a registry search to check it. the question: how do i run this action with the check? when using the InstallEx...
2010/02/25
[ "https://Stackoverflow.com/questions/2333365", "https://Stackoverflow.com", "https://Stackoverflow.com/users/281144/" ]
Just don't do it, it's undefined behavior. It might accidentially work because you write/read some memory the program doesn't actually use. Or it can lead to heap corruption because you overwrite metadata used by the heap manager for its purposes. Or you can overwrite some other unrelated variable and then have hard t...
Generally speaking (different implementation for different platforms) when a malloc or similar heap based allocation call is made, the underlying library translates it into a system call. When the library does that, it generally allocates space in sets of **regions** - which would be equal or larger than the amount the...
70,047
The Hubble constant, which roughly gauges the extent to which space is being stretched, can be determined from astronomical measurements of galactic velocities (via redshifts) and positions (via standard candles) relative to us. Recently a value of 67.80 ± 0.77 (km/s)/Mpc was published. On the scale of 1 A.U. the value...
2013/07/04
[ "https://physics.stackexchange.com/questions/70047", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/26438/" ]
We do measure the Hubble constant locally: everything that we know about it comes from observations of light in the vicinity of our telescopes. But if you restrict the experiments to a room with opaque walls, then no, it can't be measured locally, because it merely quantifies the average motion of galaxies on large sca...
Ben Crowell's answer is right, but I am adding a point in order to emphasize it, because this issue keeps coming up. Here is the point: *The cosmological expansion is FREE FALL motion.* What this means is that the clusters of galaxies on the largest scales are just moving freely. They are in the type of motion called...
31,243,378
I use different list in one page with each list have some Option button, you can take a look at my codepen : `[http://codepen.io/harked/pen/WvMgXg][1]` If we swipe the first card, it will show the option button. If we swipe the second card, it will also show the option button. Is there any way to prevent Option-Button...
2015/07/06
[ "https://Stackoverflow.com/questions/31243378", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4789892/" ]
If anyone wants to get the MimeType from the actual URL of the file this code worked for me: ``` import MobileCoreServices func mimeTypeForPath(path: String) -> String { let url = NSURL(fileURLWithPath: path) let pathExtension = url.pathExtension if let uti = UTTypeCreatePreferredIdentifierForTag(kUTTagC...
iOS 14.0 + ---------- **Use the extensions** ``` import UniformTypeIdentifiers extension NSURL { public func mimeType() -> String { if let pathExt = self.pathExtension, let mimeType = UTType(filenameExtension: pathExt)?.preferredMIMEType { return mimeType } else { ...
175,402
In the following example, the label is in the middle of the line. But the arrow, which acts as a marker, is not in the middle. Only its head but not the center of the arrow. ``` \documentclass{article} \usepackage{tikz} \usetikzlibrary{arrows,decorations.markings} \begin{document} \begin{tikzpicture}[ middlearrow...
2014/05/05
[ "https://tex.stackexchange.com/questions/175402", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/51145/" ]
As noticed, the `markings` mechanism puts the arrow in the selected `position` taking as reference its arrowhead. The following example demonstrates it clearly: ``` \documentclass[tikz,border=10pt]{standalone} \usepackage{tikz} \usetikzlibrary{arrows,decorations.markings,plotmarks} \begin{document} \begin{tikzpicture...
Both the arrow and the plus sign were shifted `\makebox`es, and seem to work over various length spans. I'm guessing, however, that the actual size of the makeboxes will depend on the size of the arrow head. ``` \documentclass{article} \usepackage{tikz} \usetikzlibrary{arrows,decorations.markings} \begin{document...
1,605,354
I a developing a web application in c# in which i am using the below code. Am getting "Access denied" when trying to open a file in client side. ``` String strPop = "<script language='javascript'>" + Environment.NewLine + "window.open('C://myLocalFile.txt'," + "'Report','height=520,wid...
2009/10/22
[ "https://Stackoverflow.com/questions/1605354", "https://Stackoverflow.com", "https://Stackoverflow.com/users/125148/" ]
You cant access client side files with JavaScript , the only way to access files is to first upload it to the server or to a flash application.
JavaScript has strong restrictions about accessing files on the local file system, I think that you are maybe mixing up the client-side and server-side concepts. JavaScript runs on the client-side, in the client's web browser. I'm not sure about what you want to achieve, but: * If you are trying to open a file on th...
37,807,122
I have a *Helper* that receives an array of elements and returns some other array based on the first one. ``` {{#each (sorted-strings myStrings) as |string|}} {{string}} {{/each}} ``` The implementation of the *Helper* can be something like: ``` // app/helpers/sorted-strings.js import Ember from 'ember'; export ...
2016/06/14
[ "https://Stackoverflow.com/questions/37807122", "https://Stackoverflow.com", "https://Stackoverflow.com/users/316700/" ]
After a lot of struggling I just figured out that the proper solution is to declare a *Component* instead of a *Helper*. This way I can explicitly declare a *Computed Property* that observes changes in the *myStrings* Array: ``` // app/components/sorted-strings.js export default Ember.Component.extend({ myStrings: n...
Passing a computed property to the helper should work fine. Check out this [twiddle](https://ember-twiddle.com/537e37c6db0f8cab40d4c3f9a15965f0?openFiles=templates.application.hbs%2C). Maybe your computed property is not getting updated properly.
64,473,505
I can figure out iterating through an array for similar numbers, but creating a function in order to do so through 3 arrays is stumping me for some reason. For the assignment I need to limit my built in functions to indexOf and .length. For example: ``` var sample = [1,2,3,5,6], [2,3,4,5,6], [4,5,6,7,8] function sma...
2020/10/22
[ "https://Stackoverflow.com/questions/64473505", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
Assuming the arrays are *sorted with ascending* values as specified in the question. Iterate each number in one of the arrays and check if it exists in both of the other arrays using `indexOf`, if not found it will return -1, here using `~` operator to shift -1 to 0 to get a falsy value. Could just as well just check ...
Do like: ```js function inArray(value, array){ if(array.indexOf(value) === -1){ return false; } return true; } function least(){ let a = [...arguments], l = a.length, q = l-1, r = []; for(let i=0,b; i<l; i++){ b = a[i]; for(let n=0,c,h; n<l; n++){ if(i !== n){ c = a[n]; h = []; ...
29,615,274
I am trying to create a piece of code that allows me to ask the user to enter 5 numbers at once that will be stored into a list. For instance the code would would be ran and something like this would appear in the shell ``` Please enter five numbers separated by a single space only: ``` To which the user could repl...
2015/04/13
[ "https://Stackoverflow.com/questions/29615274", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4756717/" ]
Your best way of doing this, is probably going to be a list comprehension. ``` user_input = raw_input("Please enter five numbers separated by a single space only: ") input_numbers = [int(i) for i in user_input.split(' ') if i.isdigit()] ``` This will split the user's input at the spaces, and create an integer list.
You can use something like this: ``` my_list = input("Please enter five numbers separated by a single space only") my_list = my_list.split(' ') ```
40,541,537
Hi i am newbie here and also for android development , i want to add progress bar while loading the page on webview , after loading that progress need to hide automatically, i dont know how to do it , help me guys activity\_main.xml: ``` <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://...
2016/11/11
[ "https://Stackoverflow.com/questions/40541537", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7139804/" ]
To add progress dialog while loading a page on Webview,Add the following code and no need to add the Progressbar in XML. ``` //Intialize the progress dialog: WebView webview; ProgressDialog progressDialog; //Write the following code in OnCreate: webview=(WebView)findViewById(R.id.webview); progressDialog...
initialize the progress bar in main activity and make progress bar in visible your webviewclient onPageFinished method ``` mWebView.setWebViewClient(new MyAppWebViewClient(this)); ``` and ``` private class MyAppWebViewClient extends WebViewClient { private Context mContext; public MyAppWebViewClient(Context co...
552,836
I've been looking at dc to dc step up converters/voltage multipliers, and they all seem to make it ac or pulsed dc and reconvert it to dc at the end. Is there a way to step it up directly? A clock circuit is pulsing dc, for whoever got my question closed.
2021/03/13
[ "https://electronics.stackexchange.com/questions/552836", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/275065/" ]
Yes, there are switched capacitor voltage multipliers. In one type, you put a number of capacitors in parallel across the input voltage source. Then you reconnect them so they are applied to the load in series. In another approach called a charge pump, you put one capacitor in parallel across the input voltage, and the...
Short of putting a battery in series, no.
19,522,275
Here is an example OpenSearch description file: ``` http://webcat.hud.ac.uk/OpenSearch.xml ``` When I send a query as like that: ``` http://webcat.hud.ac.uk/perl/opensearch.pl?keyword=new&startpage=1&itemsperpage=20 ``` I get a response which is compatible to OpenSearch. How can I implement OpenSearch specificati...
2013/10/22
[ "https://Stackoverflow.com/questions/19522275", "https://Stackoverflow.com", "https://Stackoverflow.com/users/453596/" ]
According to the [OpenSearch website](http://www.opensearch.org/Community/OpenSearch_software)'s section on *"Reading OpenSearch"*, there is a Java library which can do this, called [Apache Abdera](http://abdera.apache.org/). I have not used it myself, so I cannot comment on its quality, but it should be worth looking ...
[ROME](http://github.com/rometools/) also supports OpenSearch with its [ROME Module A9 OpenSearch](http://rometools.github.io/rome-modules/A9OpenSearch.html). Sample usage: ``` SyndFeed feed = new SyndFeedImpl(); feed.setFeedType(feedType); // Add the opensearch module, you would get information like totalResults fr...
411,523
I have installed the Windows 8 consumer preview and all working fine, with the exception of the communication apps (mail, calendar & people). The apps were working during initial installation process, but at some point ceased to operate. The message I receive when launching is "Mail can't open", "Calendar can't open" ...
2012/04/12
[ "https://superuser.com/questions/411523", "https://superuser.com", "https://superuser.com/users/127919/" ]
I had the same problem but I resolved it, I found that the antivirus Firewall was the cause, it blocks all metro apps to connect to the network, disable it or change the Firewall rules.
Update: SOLVED! The problem occurs if you tweak your background colors using a tool or manually. Restore all the default registry entries or default colors using the tool and poof! Problem is gone.... Hope this helps, Phew! --- This's not exactly an answer but I've the very same problem. And I've been looking for a...
31,849,337
I have an application where I use background images. I don´t want my images to be stretched or deformed when I run my application on different screens with different ratios. I already have different images for different screen sizes. 1. Can someone please explain to me how Android Studio handles the image sizes. 2...
2015/08/06
[ "https://Stackoverflow.com/questions/31849337", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4968411/" ]
As of Carbon 1.29 it is possible to do: ``` $period = CarbonPeriod::create('2018-06-14', '2018-06-20'); // Iterate over the period foreach ($period as $date) { echo $date->format('Y-m-d'); } // Convert the period to an array of dates $dates = $period->toArray(); ``` See documentation for more details: <https:/...
As Carbon is an extension of PHP's built-in DateTime, you should be able to use DatePeriod and DateInterval, exactly as you would with a DateTime object ``` $interval = new DateInterval('P1D'); $to->add($interval); $daterange = new DatePeriod($from, $interval ,$to); foreach($daterange as $date){ echo $date->forma...
903,514
I looked all over the web, and I saw many solutions to this issue, but none of them worked for me, and I don't know what to do anymore. It's a win7 PC, professional edition x64. I'm using a Realtek network adapter. Things I tried: * removing the driver and re-installing * Installing the IPv4 protocol * restarting th...
2015/04/19
[ "https://superuser.com/questions/903514", "https://superuser.com", "https://superuser.com/users/310772/" ]
This can have many causes, but the most common ones are: * Incompatible mode (your wifi card is too old) * Noisy signal (Something else running on the same channel? Gain too high?) * Wrong wifi password (For some reason, it takes Win7 ages to figure this one out) * The SSID isn't actually there anymore, but windows th...
I had the exact same issue. The solution for my laptop was: Device Manager - Network Adapters - Realtek P Cle GBE Family Connector and found it had been disabled. I enabled it and restarted and it worked!
9,841,215
I would like to give points to my users who submit articles based on their articles word count. But my page has many text area fields. Lets say message1,message2,message3 When the user fill textarea(message1,message2,message3) it will show like this in the bottom. ``` You have typed x words. Points per word : 0.2. ...
2012/03/23
[ "https://Stackoverflow.com/questions/9841215", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1091558/" ]
Keep the count of every Textfield in an array that you can use to compute the overall sum. I've edited your code, see the demo here: <http://jsfiddle.net/yZb7w/38/>
Another solution would be to have something like: ``` $('#testTextarea3').textareaCount(options3, function(data){ $('#showData3').html("You have typed <b>" + data.words + "</b> words. Points per word : <b> 0.2</b>. Estimated point: <b>" + (0.2 * data.words) +"</b>"); $(this).data("po...
3,681,243
I need to time some events in the app I'm working on. In Java i used to be able to call currentTimeMillis() but there doesnt seem to be a version in Objective-c. Is there a way to check there current time without creating a NSDate and then parsing this object everytime i need this information? Thanks -Code
2010/09/09
[ "https://Stackoverflow.com/questions/3681243", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
To get very cheap very precise time, you can use [`gettimeofday()`](http://developer.apple.com/library/ios/#documentation/system/conceptual/manpages_iphoneos/man2/gettimeofday.2.html), which is a C Function of the BSD kernel. Please read the man page for full details, but here's an simple example: ``` struct timeval t...
The correct answer is [[NSDate date] timeIntervalSince1970]; this will give you current timestamp in milliseconds. The answer given by @Noah Witherspoon returns current date but the year is not the current matching year.
34,068,224
I am stuck on trying to create an alias that will cd back a directory, make a new directory with a given name and then cd into it. Here is what I have so far: alias cdmk="cd .. | mkdir '$1' | cd '$1'" I just want to be able to type cdmk and then the name of the new directory I want to create and cd into. Any help yo...
2015/12/03
[ "https://Stackoverflow.com/questions/34068224", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5635353/" ]
You can use ``` \(([^);]+) ``` The [regex demo is available here](https://regex101.com/r/dN5dC1/2). Note the capturing group I set with the help of unescaped parentheses: the value captured with this subpattern is returned by the [`re.findall` method](https://docs.python.org/2/library/re.html#re.findall), not the w...
I would suggest ``` ^[^\(]*\(([^;\)]+) ``` Splitting it into parts: ``` # ^ - start of string # [^\(]* - everything that's not an opening bracket # \( - opening bracket # ([^;\)]+) - capture everything that's not semicolon or closing bracket ``` Unless of course you wish to impose (or drop) some...
69,183,922
I am trying to automate the scraping of a site with "infinite scroll" with Python and Playwright. The issue is that Playwright doesn't include, as of yet, a scroll functionnality let alone an infinite auto-scroll functionnality. From what I found on the net and my personnal testing, I can automate an infinite or fini...
2021/09/14
[ "https://Stackoverflow.com/questions/69183922", "https://Stackoverflow.com", "https://Stackoverflow.com/users/12499866/" ]
The other solutions were a tad bit verbose and "overkill" for me and this is what worked for me. Here's a two liner that took me a few migraines to come around to :) **Note:** you are going to have to *put in your own selector*. This is just an example... ``` while page.locator("span",has_text="End of results")....
the playwright has the `page.keyboard.down('End')` command, it will scroll to the end of the page.
42,811,045
I am practising some entry-level java 8 lambda functionality. Given a list of messages, each containing a message offset, where all offsets must form a consecutive list of integers, I'm trying to find gaps to warn about. I get the feeling this all should be well doable with a nice lambda. But I can't get my head aroun...
2017/03/15
[ "https://Stackoverflow.com/questions/42811045", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4347951/" ]
*for the present problem, this approach seems to be more suitable* ``` messages.stream().sorted( Comparator.comparingLong( Message::getOffset ) ) .reduce( (m1, m2) -> { if( m1.getOffset() + 1 != m2.getOffset() ) LOG.error( "Missing offset(s) found in messages: missing from {} to {}", m1.getOffset(), m2.get...
How about: ``` final List<Long> offsets = messages.stream().map(Message::getOffset).sorted().collect(toList()); IntStream.range(0, offsets.size() - 1).forEach(i -> { long currentOffset = offsets.get(i); if (offsets.get(i + 1) != currentOffset + 1) { LOG.error("Missing offset(s) found in messages: missi...
4,122,361
I am trying to show that $$\frac{1}{a^2+x^2} \ast \frac{1}{a^2+x^2}=\int\_{-\infty}^\infty\frac{1}{(a^2+t^2)(a^2+(x-t)^2) }dt = \frac{2\pi}{a(4a^2+x^2)}$$ I wrote out the integral for the convolution and it becomes a big exercise in partial fractions and integration of rational functions. $$ \int(\frac{1}{a^2+t^2}) ...
2021/04/30
[ "https://math.stackexchange.com/questions/4122361", "https://math.stackexchange.com", "https://math.stackexchange.com/users/623019/" ]
Here using Fourier transform may simplify things considerably: Let $\phi(x)=\frac{1}{1+x^2}$, and $\phi\_a(x)=\frac{1}{a}\phi(a^{-1}x)=\frac{a}{a^2+x^2}$. Recall that $\pi e^{-2\pi|t|}=\int e^{-2\pi itx}\frac{1}{1+x^2}\,dx=\widehat{\phi\_1}(t)$. Hence $$\widehat{\phi\_a}(t)=\frac{1}{a}\int e^{-2\pi itx}\phi(xa^{-1})\...
Less elegant than @Quanto's answer, let us write $$a^2+(x-t)^2=(t-r)(t-r)$$ with $r=(x+ia)$ and $r=(x-ia)$ and use partial fraction decomposition $$\frac{1}{(a^2+t^2)(a^2+(x-t)^2) }=\frac{r s+r t+s t-a^2}{\left(a^2+r^2\right) \left(a^2+s^2\right) \left(t^2+a^2\right)}+$$ $$\frac{1}{\left(a^2+r^2\right) (r-s) (t-r)}-\fr...
17,981,834
I installed SDL 1.2 long time ago with my package manager and now I have just installed from source the new SDL version (2.0). Do you think it is safe to keep both version on the same OS? I need the old versions for other applications so I would prefer to have both.. PS I am on Linux. Cheers!
2013/07/31
[ "https://Stackoverflow.com/questions/17981834", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1977035/" ]
To become familiar with state restoration I highly recommend the [WWDC 2013 session What's New in State Restoration](https://developer.apple.com/videos/wwdc/2013/#222). While state restoration was introduced a year earlier in iOS 6, iOS 7 brought some notable changes. ### Passing it forward Using the "pass the baton"...
I have not done a ton with state restore but I would think along these lines: * Does the app delegate get woken up first? Is there an opportunity for the app delegate to walk the view controllers? * Can the view controller *pause* while it waits for the AppDelegate to give it the context? Sounds like State Restoratio...
336,854
When I first saw this meme: [![C++ template meta programming meme with Bjarne Stroustrup looking bewildered](https://i.stack.imgur.com/pntYI.png)](https://i.stack.imgur.com/pntYI.png) I thought to myself, *yeah right*, but now I am not sure any more. So **was template meta programming in C++ discovered by accident** ...
2016/11/25
[ "https://softwareengineering.stackexchange.com/questions/336854", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/173147/" ]
There is more to invention than giving a simple list of implications and with C++ Stroustrup aimed for generality: > > I'm not interested in a language that can only do what I can imagine > > > This is from [Did you really not understand what you were doing?](http://www.stroustrup.com/bs_faq.html#understand): > ...
*The following excerpt is subject to: <https://creativecommons.org/licenses/by-sa/3.0/>* > > History of TMP > > > Historically TMP is something of an accident; it was discovered during the process of standardizing the C++ language that its template system happens to be Turing-complete, i.e., capable in principle o...
48,452,060
I want to calculate the RMSE of two unequal data sets. Dataset 1 has the dimensions 1067x1 and dataset 2 has the dimensions 2227x1. How do I calculate the RMSE? Thanks
2018/01/25
[ "https://Stackoverflow.com/questions/48452060", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8362417/" ]
The `antd` support recommends using `onValuesChange` in `Form.create()` <https://github.com/ant-design/ant-design/issues/20418> I found this workaround that works for me: ``` <Radio.Group onChange={(e: RadioChangeEvent) => { form.setFieldsValue({ yourRadioFieldNameFromGetFieldDecorator: e.target.value }, () => { ...
You should really use `e.target.value` if you want the value immediately. since the value is not set yet (to the antd form yet) at the moment you click the radio.(the field needs to pass setStatus, setfeedback etc) if you really want to use getFieldValue, you can do the setTime strick ``` setTimeout(() => console.log...
2,235,365
Using Java 6 to get 8-bit characters from a String: ``` System.out.println(Arrays.toString("öä".getBytes("ISO-8859-1"))); ``` gives me, on Linux: [-10, 28] but OS X I get: [63, 63, 63, -89] I seem get the same result when using the fancy new nio CharSetEncoder class. What am I doing wrong? Or is it Apple's fault? :...
2010/02/10
[ "https://Stackoverflow.com/questions/2235365", "https://Stackoverflow.com", "https://Stackoverflow.com/users/231633/" ]
Maybe the character set for the source is not set (and thus different according to system locale)? Can you run the same compiled class on both systems (not re-compile)?
Bear in mind that there's more than one way to represent characters. Mac OS X uses unicode by default, so your string literal may actually not be represented by two bytes. You need to make sure that you load the string from the appropriate incoming character set; for example, by specifying in the source a \u escape cha...
33,817,327
Say I have some OCaml code where I need to use the `Str` module. If I run the code with the interpreter, then I have to put `#load Str.cma` to be able to use the `Str` module. But if I want to native-compile the code, then the `load` directive causes an error. How can I import the module in a way that will work in both...
2015/11/20
[ "https://Stackoverflow.com/questions/33817327", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3722213/" ]
with the benefits of a context manager: ``` with requests_html.HTMLSession() as s: try: r = s.get('http://econpy.pythonanywhere.com/ex/001.html') links = r.html.links for link in links: print(link) except: pass ```
``` from requests_html import HTMLSession session = HTMLSession() r = session.get('https://www.***.com') r.html.links ``` [Requests-HTML](https://html.python-requests.org)
28,563,621
I have this SQL query: ``` SELECT * FROM [CMS_MVC_PREPROD].[dbo].[T_MEMBER] m left outer join [CMS_MVC_PREPROD].[dbo].[T_COMPANY] c ON m.Company_Id = c.Id left outer join [CMS_MVC_PREPROD].[dbo].[T_ADRESSE] a ON m.Id = a.Member_Id OR a.Company_Id = c.Id ``` But i could not translate it to Linq I have some troub...
2015/02/17
[ "https://Stackoverflow.com/questions/28563621", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3830047/" ]
LINQ only supports equi-joins directly. You'll have to use a different query pattern: ``` from m in db.MEMBER //add join to "c" here from a in ( from a db.ADRESSE where m.Id == a.Member_Id || a.Company_Id == c.Id select a).DefaultIfEmpty() select new { m, a } ``` Just a sketch. The trick is using `Def...
You can write this way to make it work: ``` from m in db.Member join c in db.T_Company on m.Company_Id equals c.Id into a from c in a.DefaultIfEmpty() from ta in db.T_Address where m.Id == ta.Member_Id || ta.Company_Id == c.Id ```
43,658,274
I never used Jasmine before but I'm required for this little project that I'm working on. Can't quite figure it out, any help would be appreciated. I have looked at various tutorials and googeled the problem but being new to this does not help. JS source file ``` > $(document).ready(function(){ > > > $.ajax({ ty...
2017/04/27
[ "https://Stackoverflow.com/questions/43658274", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7291306/" ]
I have the same issue in my Angular 7 project. The below steps solved the issue. add below code on top of the spec.ts file ``` declare var $: any; ``` A Karma plugin - adapter for jQuery framework. ``` npm install karma-jquery --save-dev ``` Add the '**karma-jquery**' in 'plugins' array in the karma.conf...
I'm using this approach, it's simple! Into file karma.conf.ts I've put the path of jquery. ``` module.exports = function(config) { config.set({ // list of files / patterns to load in the browser files: [ './node_modules/jquery/dist/jquery.min.js', //..rest files ], //rest karma o...
38,717,543
I have a large dataTable which contains ride information. Every row has a start datetime and an end datetime of the following format(yyyy-mm-dd HH:mm:ss). How can I use a datepicker for setting a filter range in dataTables? I want to have a datepicker which only selects a day and not the time. I've searched everywhere ...
2016/08/02
[ "https://Stackoverflow.com/questions/38717543", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3397167/" ]
Using other posters code with some tweaks: ``` <table id="MainContent_tbFilterAsp" style="margin-top:-15px;"> <tbody> <tr> <td style="vertical-align:initial;"><label for="datepicker_from" id="MainContent_datepicker_from_lbl" style="margin-top:7px;">From date:</label>&nbsp; ...
Follow the link below and configure it to what you need. Daterangepicker does it for you, very easily. :) <http://www.daterangepicker.com/#ex1>
21,994,651
I want to check if there is a certain value in an array of objects. For example, if I have something like this: ``` [ { _id: 1, name: foo }, { _id: 2, name: bar }, { _id: 3, name: foox }, { _id: 4, name: fooz }, ] var search = [1,25,33,4,22,44,5555,63] ``` then I want ...
2014/02/24
[ "https://Stackoverflow.com/questions/21994651", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3093439/" ]
Use [`some`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/some) to iterate over the array of objects. If an id is found `some` short-circuits and doesn't continue with the rest of the iteration. ```js const data=[{_id:1,name:'foo'},{_id:2,name:'bar'},{_id:3,name:'foox'},{_id:4,na...
``` var list = [ { _id: 1, name: foo }, { _id: 2, name: bar }, { _id: 3, name: foox }, { _id: 4, name: fooz }, ]; var isAnyOfIdsInArrayOfObject = function(arrayOfObjects, ids){ return arrayOfObjects.some(function(el) { return ids.indexOf(el._id) !== -1; }); } ```
3,853,087
In Serre's A Course in Arithmetic, he writes the following lemma: Lemma: Let $0 \rightarrow A \rightarrow E\rightarrow B\rightarrow 0$ be an exact sequence of commutative groups with $A$ and $B$ finite with orders $a$ and $b$ prime to each other. Let $B'$ be the set of $x\in E$ such that $bx=0$. The group $E$ is the d...
2020/10/05
[ "https://math.stackexchange.com/questions/3853087", "https://math.stackexchange.com", "https://math.stackexchange.com/users/813593/" ]
Let $p:E\rightarrow B$ the projection. Remark that for every $x\in E$, whe have $p(bx)=0$ since the order of $B$ is $B$. This implies that $bx\in A$ since the sequence is exact, we deduce that a $abx =0$. We have $1=ua+vb$ implies that for every $x\in E$, $x=uax+vbx$. We have $vbx=bvx\in A$, and $b(uax)=u(abx)=0$ im p...
**HINT.** Use exactness of the sequence.
55,620
Assumptions: Technology equivalent to contemporary tech. A city with a population of millions built from scratch. There is a need for an inexpensive underground system that would transport cargo (at best everything from packages, food, garbage, construction materials, etc.) within the city and free the streets from...
2016/09/17
[ "https://worldbuilding.stackexchange.com/questions/55620", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/25459/" ]
Look into Walt Disney's plans for the City of EPCOT, which is not the park by the same name we have today. The central part of the city would route all automobile traffic to a series of roads underneath the public portion of the city, to reduce pedestrian traffic access, and allow for trucks and supplies to navigate t...
Whatever system you use will boil down to a few basic principles ---------------------------------------------------------------- 1. When delivering a load of cargo going to one place, a single larger transport vehicle is cheaper and equally fast per unit as many small transports. 2. When delivering a load of cargo to...
4,638,604
I've been trying to write a server in C++ Unix style, but I'm stuck on a Windows machine. I started with MinGW, but it didn't compile right and told me that it couldn't find the "sys/socket.h" file. Which, of course, is necessary for the server to even work. I went searching for it, and I think somewhere said to instal...
2011/01/09
[ "https://Stackoverflow.com/questions/4638604", "https://Stackoverflow.com", "https://Stackoverflow.com/users/728194/" ]
Given that Windows has no sys/socket.h, you might consider just doing something like this: ``` #ifdef __WIN32__ # include <winsock2.h> #else # include <sys/socket.h> #endif ``` I know you indicated that you won't use WinSock, but since WinSock is how TCP networking is done under Windows, I don't see that you have an...
I would like just to add that if you want to use windows socket library you have to : * at the beginning : call WSAStartup() * at the end : call WSACleanup() Regards;
39,012,038
I have the following tables: ``` CREATE TABLE source_table ( id int IDENTITY(1, 1) NOT NULL, category varchar(255) NULL, item int NULL, counter int NULL, length int NULL ); CREATE TABLE dest_table( id int IDENTITY(1, 1) NOT NULL, from_item [int] NULL, to_item [int] NULL, length [in...
2016/08/18
[ "https://Stackoverflow.com/questions/39012038", "https://Stackoverflow.com", "https://Stackoverflow.com/users/524861/" ]
You could use the `lag` window function: ``` select * from (select lag(item) over (partition by category order by item) as from_item, item as to_item, length from source_table) base where from_item is not null ``` To insert this into the destination table is standard.
``` SELECT a.item, b.item, b.length FROM source_table as a INNER JOIN source_table b ON a.id = b.id - 1 AND a.category = b.category ```
6,548,626
I have a sub that is activated from a button on a userform. The basic procedure from the click is 1) Run my sub based off of user inputs 2) Select results sheet 3) Display my results 4) Unload my userform I've run into a problem because I want to try and put bounds on an user input value and if the user inputs so...
2011/07/01
[ "https://Stackoverflow.com/questions/6548626", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
I would turn Search into a function which returns true or false if the input is within bounds or not: ``` Function Search() AS Boolean If (TextBox1 And TextBox2 <= 8) And (TextBox1 And TextBox2 > 0) Then Search = True Else Search = False EndIf End Function ``` then you just exit the sub if inp...
There are about a thousand and one ways around this - the question is what behavior do you want the form to have? Do you want it to self close after a certain amount of time? Check out this example of timer [1](https://learn.microsoft.com/en-us/office/vba/language/reference/user-interface-help/timer-function) Or look...
18,639,483
As I'm currently in the process of making a forum system which is loading new posts/edits without having to refresh the page. Now, for the older browers which don't have an implentation of EventSource/WebSocket, I'd like to offer another option: Every X seconds I'm GET'ing a PHP site which is echoing the five latest n...
2013/09/05
[ "https://Stackoverflow.com/questions/18639483", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1955931/" ]
This code should open each div, and then close the previous one: ``` var currentPos = 0; $('#yourButtonId').on('click', function () { if (currentPos > 0) $('#' + divnameids[currentPos - 1]).hide(); if (currentPos == 0) // hide the last tab when coming back to the start $('#' +...
``` $(document).ready(function(){ $(".content-box-front").click(function(){ $(".full-content-back").fadeIn("slow"); $(".full-content-front").fadeIn("slow"); $(".content-box-front").fadeOut("slow"); $(".content-box-back").fadeOut("slow"); }); }); $(document).ready(functi...
19,676,835
I'm pretty new to XML and I was wondering how would I parse, sort, and print val1 to val4 in python? With my research I found `xml.dom` or `xml.etree` was used a lot but I'm having trouble finding the correct functions to use to parse the through the XML tree and print out what I need. ``` <a> <b> <c> <d> ...
2013/10/30
[ "https://Stackoverflow.com/questions/19676835", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1815710/" ]
I recently made a small python program to display some information from some XML files. I found that using [BeautifulSoup 4](http://www.crummy.com/software/BeautifulSoup/bs4/doc/) made XML extremely easy to parse. You can either download the source from the linked website and install it yourself, or follow the document...
Use `lxml` package in python, because lxml supports to `xpath` which is very helpful for firing query on xml file. And it is fast to process large data from XML file ``` from lxml import etree tree = etree.parse(XML_FILE_PATH) root = self.tree.getroot() ``` To get `text` from node of xml : ``` nodes = tree.findall...
13,214,252
I am using the following code from castle windsor documentation. I can't figure out how to pass in my configFile on my bootstrapper container installer that installs this installer. ``` public void Install(IWindsorContainer container, IConfigurationStore store) { container.AddFacility<LoggingFacility>(f =...
2012/11/03
[ "https://Stackoverflow.com/questions/13214252", "https://Stackoverflow.com", "https://Stackoverflow.com/users/35166/" ]
The difference is for types with no trivial default constructor, which is called for you by compiler in your class `B`. Your class `B` is equivalent to: ``` class B { private: SleepyInt a, b; public: // takes at least 20s B(int a_var, int b_var) : a(), b() // ^^^^^^^^^^...
Initialization list is benefical reference types, member class objects, or const members. Otherwise it takes more time. Look at my test code: ``` #include <iostream> #include <ctime> using namespace std; class A{ int a; public: A(int a_):a(a_){} }; class B{ int b; public: B(){ } B(int b...
54,665,527
When I tried to read a pickle file that saved by a former version of pandas, it yielded an `ImportError`. > > ImportError: No module named 'pandas.core.internals.managers'; > 'pandas.core.internals' is not a package > > > There was no hit on stackoverflow so i would like to share my solution for this particular ...
2019/02/13
[ "https://Stackoverflow.com/questions/54665527", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4197348/" ]
This error comes off due to encoding of formerly saved pickle file. If you updated pandas to newly amended version, it produces this import error.
`conda update pandas` If you use conda package manager.
57,545,059
I am working on a [react-native](https://facebook.github.io/react-native/) app and I have a problem when rendering some Arabic text that returned from API most of the times the text looks like rubbish (check screenshot 1) And for a few times, it rendered correctly (check screenshot 2) screenshot 1 [![screenshot 1](ht...
2019/08/18
[ "https://Stackoverflow.com/questions/57545059", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3711273/" ]
I have same problem like this and just upgrade ckeditor with command: ``` pip install django-ckeditor --upgrade ```
I also had this problem and fixed it by including the path in the urls file with. ```py urlpatterns = [ path('admin/', admin.site.urls), path("ckeditor/", include('ckeditor_uploader.urls')), # <-- here ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) ```
101,124
Do angels make any requests of G-d besides praising and thanking Him?
2019/03/21
[ "https://judaism.stackexchange.com/questions/101124", "https://judaism.stackexchange.com", "https://judaism.stackexchange.com/users/17905/" ]
There were many questions about angels' nature on this site - are they real individualities or just G-d's messengers. To consolidate those views especially on your question, I would like to differentiate between two different aspects of angels - a. the nature of angels and b. our perception of angels. 1. **The natur...
[Rashi](https://www.sefaria.org/Genesis.32.27?lang=bi&with=Rashi&lang2=en) on Gen 32:27, when the man/[angel](https://www.sefaria.org/Genesis.32.25?lang=bi&with=Rashi&lang2=en) asks Jacob to release him, writes > > כי עלה השחר FOR THE DAY BREAKETH, and I have to sing God’s praise at day (Chullin 91b; Genesis Rabbah 7...
17,892,840
I have been trying to achieve something which should pretty trivial and is trivial in *Matlab*. I want to simply achieve something such as: ``` cv::Mat sample = [4 5 6; 4 2 5; 1 4 2]; sample = 5*sample; ``` After which sample should just be: ``` [20 24 30; 20 10 25; 5 20 10] ``` I have tried `scaleAdd`, `Mul`, `...
2013/07/27
[ "https://Stackoverflow.com/questions/17892840", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2624574/" ]
OpenCV does in fact support multiplication by a scalar value with overloaded `operator*`. You might need to initialize the matrix correctly, though. ``` float data[] = {1 ,2, 3, 4, 5, 6, 7, 8, 9}; cv::Mat m(3, 3, CV_32FC1, data); m = 3*m; // This works just fine ``` If you are mainly...
For java there is no operator overloading, but the Mat object provides the functionality with a convertTo method. ``` Mat dst= new Mat(src.rows(),src.cols(),src.type()); src.convertTo(dst,-1,scale,offset); ``` [Doc on this method is here](https://docs.opencv.org/3.1.0/d3/d63/classcv_1_1Mat.html#a3f356665bb0ca452e7d7...
68,027,599
I tried something like this `sed 's/^[ \t]*//' file.txt | grep "^[A-Z].* "` but it will show only the lines that start with words starting with an uppercase. file.txt content: Something1 something2 word1 Word2 this is lower The output will be Something1 something2 but I will like for it to also show the second...
2021/06/17
[ "https://Stackoverflow.com/questions/68027599", "https://Stackoverflow.com", "https://Stackoverflow.com/users/16256617/" ]
With GNU `grep`, you can use ```sh grep '\<[[:upper:]]' file grep '\b[[:upper:]]' file ``` **NOTE**: * `\<` - a leading word boundary (`\b` is a word boundary) * `[[:upper:]]` - any uppercase letter. See the [online demo](https://ideone.com/NjytnI): ```sh #!/bin/bash s='Something1 something2 word1 Word2 this ...
> > How do you display all the words > > > That's simple: ``` grep -wo '[A-Z]\w*' ```
43,104,814
I have a detail report with interactive sorting on the headers. After the report is refreshed, the user would like to highlight some rows of data that appear throughout the report in order to see if patterns are detectable. Say, a vendor name that appears on multiple customer rows might indicate that they all shopped...
2017/03/29
[ "https://Stackoverflow.com/questions/43104814", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2812742/" ]
I found out how to use `ADODB.Stream` to solve this problem: ``` Const adTypeBinary = 1 Dim byteValue With CreateObject("ADODB.Stream") .Type = adTypeBinary .Open .LoadFromFile fileName .Position = 4 ' could be any byte position byteValue = Right(00 & Hex(AscB(.Read(1))), 2) ' Returns 0A End With...
There are other questions/answers on SO regarding [reading binary files](https://stackoverflow.com/a/6087783/243925) in VBSCript, perhaps they will help you. What's important to remember is that a binary file (as is any file) is a continuous stream of bytes. So rather than thinking about the "5th byte" of each line re...
7,034,908
I'm new to using Propel ORM. I have generated code and am now trying to integrate the runtime with my PHP project. I am struggling with initializing the main `Propel` class. It appears that the usage should be: ``` require_once('propel/runtime/lib/Propel.php'); Propel::configure('/path/to/runtime/config.php'); Propel:...
2011/08/12
[ "https://Stackoverflow.com/questions/7034908", "https://Stackoverflow.com", "https://Stackoverflow.com/users/199397/" ]
Change your (updated) CSS to the following and it should work: ``` #main { width: 100%; text-align: center; } ```
You have the #bigimage img within the #main div. Since the main div is 1024px wide, the 100% will always be 1024. The result here is that you'll always see 1024px. If you remove the width attribute from #main or change it to 100%, you should start to see what you're looking for.
51,792
I need to work with several teams and need to be able to share requirements and design documents. Most people won't be too technical, so I want to avoid source code tools. The main requirements are: 1. Easy sharing via links. I don't want people to have to install multple tools just to see a file or learn anything abo...
2009/10/06
[ "https://superuser.com/questions/51792", "https://superuser.com", "https://superuser.com/users/-1/" ]
Use [Google Sites](http://sites.google.com) - it's easy to maintain and administer, and if done right, it can perform remarkably well as a simple intranet. You can even create multiple sites, with one site catering for one project, and restricting team members to just that.
For me this look like a job for a wiki like [DokuWiki](http://www.dokuwiki.org/dokuwiki) or [MediaWiki](http://www.mediawiki.org). * Online document editing * Various level of permission * Automatic version tracking;
54,669,047
I'm using Oracle Report Builder 9.0.4.1.0 and I have a heavy report that has defined a large number of queries. I think not all that queries are used in the report and are not linked to any layout object. Is there a easy way to detect what queries (or other objects) aren't used at all in a specific report? Instead of d...
2019/02/13
[ "https://Stackoverflow.com/questions/54669047", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4524205/" ]
If there is an easy way to do that, I don't know it. A long time ago, when Reports 1.x was used, report was saved in the database so you could write a query to fetch metadata you're interested in. I never did that, though, but - that would be an option. Now, all you have is a RDF (or a JSP) file. However, a few sugges...
You can return a report results to an XML file. Each query with data will contain something in XML-s tags. [enter image description here](https://i.stack.imgur.com/6tItz.png)
1,264,992
We have to transfer binary data using web service stack and in the process we have to sign web service requests/responses. The main question is: what is the prefered way to do this? Should we use MTOM and WS-Security? From [ISSUE CXF-1904](https://issues.apache.org/jira/browse/CXF-1904) I have concluded that there ar...
2009/08/12
[ "https://Stackoverflow.com/questions/1264992", "https://Stackoverflow.com", "https://Stackoverflow.com/users/122674/" ]
CXF can do WS-Security related things along with MTOM, but the attachments do not end up signed or encrypted. The SOAP message itself is signed/encrypted, but the attachments are not due to restrictions in WSS4J. (If SpringWS uses WSS4J, it would have the same restrictions) Be default for security reasons when using t...
From <http://ws.apache.org/wss4j/attachments.html> : WSS4J 2.0.0 introduces support for signing and encrypting SOAP message attachments, via the the SOAP with Attachments (SWA) Profile 1.1 specification. There is no support in WSS4J 1.6.x for signing or encrypting message attachments. Attachments can be signed and enc...
24,092,328
I've found very gentle way to increment limited variable, just: ``` ++i %= range; ``` Unfortunately this trick doesn't work for decrement, because `-1 % v == -1`. How can I improve this in C++?
2014/06/07
[ "https://Stackoverflow.com/questions/24092328", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1565454/" ]
To avoid the negative modulus behaviour you can just make it positive first: ``` i = (i - 1 + range) % range; ``` However this is no good if `range` is bigger than half of INT\_MAX. (or whatever type `i` is). This seems simpler: ``` i = (i ? i : range) - 1; ```
This code should work for decrementing `i` through the interval [0, range) ``` --i = (i > 0) * (i % range); ```
935
I have a view that I've created that selects blog posts based on a specific taxonomy term, creating a sort of "Featured Posts" view that I've embedded on the front page of my site. The issue I keep running into is trying to output the view so that each post is semantically marked up using some of the new HTML. I've tri...
2011/03/17
[ "https://drupal.stackexchange.com/questions/935", "https://drupal.stackexchange.com", "https://drupal.stackexchange.com/users/20/" ]
You'll notice that in your view under the "Style Settings" block there is a link for Theme: Information. It will expose all the theme files that are called for your view. You can use generic to very detailed theme files that will only be use for your views display. The first file name in Display output is views-view....
Fences looks like a great module (for Drupal 7) to control views output markup: Project page: <http://drupal.org/project/fences> From the project page: > > "Fences is a an easy-to-use tool to specify an HTML element for each > field. This element choice will propagate everywhere the field is > used, such as teas...
159,620
I'm trying to learn calculus here, but I know I have to set the $h$ equal to 0 and find the time at when it's equal to 0, but I have no idea what to do after. Here is the question. How do I find out the velocity at that time? > > If a rock is thrown upward on the planet Mars with a velocity of $10\;m/s$, its height (...
2012/06/17
[ "https://math.stackexchange.com/questions/159620", "https://math.stackexchange.com", "https://math.stackexchange.com/users/17863/" ]
First we find the time(s) when the rock is at ground level. So set $10t-1.86t^2=0$ and solve for $t$. We get $t=0$ and $t=\frac{10}{1.86}$. The velocity at time $t$ is the derivative of the displacement function $H(t)$. So the velocity at time $t$ is $10-(2)(1.86)t$. Substitute the value of $t$ we found above. **Rem...
Find the positive root of $H(t)=10t-1.86t^2$. Let $t\_1$ be that root. Then evaluate $H'(t\_1)$. Added: Plot of the height function $H(t)=10t-1.86t^2$ (in meters) vs. time $t$ (in seconds) ![enter image description here](https://i.stack.imgur.com/bUbnw.jpg) Added 2: Plot of $H(t)$ (black, in meters) and $H'(t)=10-3...
1,044,085
``` [ExternalException (0x80004005): A generic error occurred in GDI+.] IpitchitImageHandler.Data.ImageRepository.AddNewTempImage(Stream image, String extension, Guid PageId, Guid ImageId, ImageTransformCollection toDoTransforms) +1967 IpitchitImageHandler.Data.ImageRepository.AddNewTempImage(Stream image, String...
2009/06/25
[ "https://Stackoverflow.com/questions/1044085", "https://Stackoverflow.com", "https://Stackoverflow.com/users/121113/" ]
I hate that error with a passion. Generic Error is possibly the most useless error description ever written. When I've encountered it the problem as always been related to file IO. Here is the list of fixes I keep in my notes- Not sure if these apply but they usually do the trick for me. * Check File path + Make ...
Make sure **IIS\_WPG** has the correct **permissions** on your **upload folder** and also **ASPNET**. I just had the same problem and this fixed it. Don't forget to propagate the permissions through your sub folders if required too ( I may have forgotten that.. :) )
82,879
I tried to look around for an answer to this problem but don't know how to ask the proper question in a search engine. I've been working on a song and realized recently that while I had been working on the song in the key of Em (E, F#, G, A, B, C, D) I had accidentally placed D# notes in several of my melodies. The con...
2019/04/17
[ "https://music.stackexchange.com/questions/82879", "https://music.stackexchange.com", "https://music.stackexchange.com/users/59211/" ]
You'll most likely find that the chord used where D♯ fits better is either B major or B7. That has the D♯ in it. The D ♮ will fit in other places, notably when going from an Em chord to an Am. It's the reason centuries ago that the natural minor scale morphed into the harmonic minor, with a raised leading note ( here, ...
> > I tried to look around for an answer to this problem but don't know how to ask the proper question in a search engine. > > > So you are writing a piece in e-minor and obviously you know what is e-minor, you know the scale of e-minor is and you know that there are D and D#. > > I had accidentally placed D# n...
24,453,225
I am using `column chart` with `drilldown`. Here is my [JSFIDDLE](http://jsfiddle.net/phpdeveloperrahul/6juNE/). Now my problem is: * I want to remove hyperlink like formatting from the labels on x-axis and dataLabels As you would be able to notice from my fiddle that I have already tried to apply formatting on the ...
2014/06/27
[ "https://Stackoverflow.com/questions/24453225", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2833516/" ]
We can use drilldown option to control the drilldown. ``` drilldown: { //for axis label activeAxisLabelStyle: { textDecoration: 'none', fontStyle: 'italic' }, //for datalabel activeDataLabelStyle: { textDecoration: 'none', fontStyle: 'italic' ...
In case you have a chart where only a selection of columns have drilldowns, Sebastian Bochan's answer needs to be modified so that all columns have the same label: ``` (function (H) { //DATALABELS H.wrap(H.Series.prototype, 'drawDataLabels', function (proceed) { var css = this.c...
6,559,081
I am making a login in page and i am a beginner programmer i need to know what function to compare the passwords with then if they do not match tell the user that they dont match and then i need to encrypt them to be sent to the database Thank you This is what i have so far: ``` <?php $Firstname = $_POST['Firstnam...
2011/07/02
[ "https://Stackoverflow.com/questions/6559081", "https://Stackoverflow.com", "https://Stackoverflow.com/users/826336/" ]
You can use a function such as md5 (http://php.net/manual/en/function.md5.php) in order to calculate the hash of the password and compare the hashes (and store the password as a hash in the db)
Well, first of all, you generally **[hash](http://en.wikipedia.org/wiki/Hash_function)** a password, you don't encrypt it. A popular hash algorithm is **md5**, PHP provides a built in function to make a md5 hash: [md5](http://php.net/manual/en/function.md5.php) It is best practise to salt the hashes of the passwords y...
2,515,155
> > Let $n \in \mathbb{N}$ be odd. Show that: > $$\Aut(\mathbb{Z}/{n\mathbb{Z}}) \cong \Aut(\mathbb{Z}/{2n\mathbb{Z}})$$ > > > $\DeclareMathOperator{\Aut}{Aut}$ My attempt: An automorphism $f \in \Aut(\mathbb{Z}/{n\mathbb{Z}})$ is uniquely represented by $f(1)$ since $1$ generates $\mathbb{Z}/{n\mathbb{Z}}$. $f...
2017/11/11
[ "https://math.stackexchange.com/questions/2515155", "https://math.stackexchange.com", "https://math.stackexchange.com/users/144766/" ]
The length of the crease is 16 inches. [![enter image description here](https://i.stack.imgur.com/kZM9m.jpg)](https://i.stack.imgur.com/kZM9m.jpg)
Hint: [![enter image description here](https://i.stack.imgur.com/lsFon.png)](https://i.stack.imgur.com/lsFon.png) (This space intentionally left blank.)
6,666,038
I have an ASP.net WebForms page that has a lot of content on the top of the screen. It has a link button that will post back to the page and show another section of the page. When the page refreshes, I would like to set focus and scroll down to this section of the page. I tried doing ``` txtField.Focus() ``` in my...
2011/07/12
[ "https://Stackoverflow.com/questions/6666038", "https://Stackoverflow.com", "https://Stackoverflow.com/users/143919/" ]
`Page.MaintainScrollPositionOnPostBack = true;` should take you back to the same position on the screen, but you could use AJAX, or you could use `SetFocus()` to focus on a specific control after the postback: <http://msdn.microsoft.com/en-us/library/ms178232.aspx>
I have ``` <asp:MultiView ID="mvAriza" runat="server"> <asp:View ID="View14" runat="server"> ............ ....... </asp:View> </asp:MultiView> ``` on \*.aspx page. And on the \*.aspx.cs page on a button click. ``` Page.SetFocus(mvAriza.ClientID); ``` It works great.
46,373,421
I have built a Ping Pong game using JavaScript and am trying to have the scores updated on the 'scoreboard' after each match. Presently, the scores for both players on the scoreboard are on a some sort of a counter loop and will not stop. I would like to have 1 win added for the winning player's stats to the scoreboard...
2017/09/22
[ "https://Stackoverflow.com/questions/46373421", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5041196/" ]
After battling for several hours with this error and trying various solutions, my solution turned out to be different than others here so I'm adding it for others who may benefit. I tried: - ALWAYS\_EMBED\_SWIFT\_STANDARD\_LIBRARIES = YES - LD\_RUNPATH\_SEARCH\_PATHS = $(inherited) @executable\_path/Frameworks No luc...
Try restarting Xcode. I tried everything else and this is what stopped the problem.
31,695,890
**UPDATE:** I changed my script to this and it works. Way simpler and it works. ``` function myFunction(valor) { var elementos = document.getElementsByClassName("inner"); var i; for (i = 1; i < elementos.length+1; i++) { d...
2015/07/29
[ "https://Stackoverflow.com/questions/31695890", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5123792/" ]
Matlab's `reshape` function is pretty handy (and fast), but always reads and writes *complete* columns. So for your problem, some additional steps are necessary. Here is how you can do it: ``` m = 5 % columns of submatrix n = 4 % rows of submatrix k = 50 % num submatrixes in matrix column l = 50 % num submatrixes in ...
Thought I'd add another approach that uses indices and one built-in function `zeros`. Maybe this way won't have any unnecessary error checks or reshaping operations. Turns out it's more efficient (see below). ``` %submatrix size m = 5; n = 4; %repeated submatrix rows and cols rep_rows = 50; rep_cols = 50; % big matrix...
57,850,483
The new share sheet on iOS13 shows a preview/thumbnail of the item being shared on its top left corner. When sharing an UIImage using an UIActivityViewController I would expect a preview/thumbnail of the image being shared to be displayed there (like e.g. when sharing an image attached to the built in Mail app), but i...
2019/09/09
[ "https://Stackoverflow.com/questions/57850483", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10060753/" ]
Just pass the image urls to `UIActivityViewController` not the `UIImage` objects. For example: ``` let imageURLs: [URL] = self.prepareImageURLs() let activityViewController = UIActivityViewController(activityItems: imageURLs, applicationActivities: nil) self.present(activityViewController, animated: true, completion: ...
This code is only available for iOS 13 as a minimum target. I added a code example to use a share button in a SwiftUI view in case other people need it. This code also work for iPad. You can use this class `LinkMetadataManager` and add the image of your choice. The very important part, is that you **must have your ima...
50,966,011
I am using Angular 6 and I added the material components to my project following the steps in this [Guide](https://material.angular.io/guide/getting-started). But when I use the stepper component in my code I get the following exception in the console: ``` NewReqComponent.html:16 ERROR TypeError: _this._driver.validat...
2018/06/21
[ "https://Stackoverflow.com/questions/50966011", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4497657/" ]
It seems that there is a mismatch between the angular version and the material version. Please make sure to update the angular to the latest. try to set it to 6.0.6 version and I think it will works fine.
you are required to upgrade Angular.json. Run these commands and that's it. ``` $ ng update @angular/cli $ ng update @angular/core $ ng update @angular/material ```
4,014,982
I have a method which I will accept either a single object or a list of objects. I want to add whatever is passed to another list. Currently, my method looks like this: ``` def appendOrExtend(self, item): if type(item).__name__ == "list": self.list.extend(item) else: self.list.append(item) ``` It seems t...
2010/10/25
[ "https://Stackoverflow.com/questions/4014982", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
``` def append(self, item): self.list.append(item) def extend(self, item): self.list.extend(item) ``` Bottom line: Don't have a method to do both things. It confuses and makes your method less useful, instead of more useful. It's also harder to test and to maintain. Also the user of your function already know...
You can also do this while keeping the if test: ``` if not isinstance(item, list): item = [item] self.list.extend(item) ```
129,565
Apple (AAPL) recently announced that they'll undergo a 4:1 stock split. Here are the relevant dates per a [CNBC article](https://www.cnbc.com/2020/07/30/apple-stock-split-announced.html): > > The shares will be distributed to shareholders at the close of business on August 24, and trading will begin on a split-adjust...
2020/08/05
[ "https://money.stackexchange.com/questions/129565", "https://money.stackexchange.com", "https://money.stackexchange.com/users/101642/" ]
Your confusion appears to be due to a poor summary in the [CNBC article](https://www.cnbc.com/2020/07/30/apple-stock-split-announced.html). Where they had: > > The shares **will be distributed to shareholders at the close of business on August 24**, and trading will begin on a split-adjusted basis on August 31. > > ...
> > When will the new shares from the split be credited to my brokerage account? > > > > > When will the new stock price be reflected? > > > Let’s assume that as of the Record Date (August 24, 2020) an investor owns 100 shares of Apple common stock and that the market price of Apple stock is $400 per share, s...
42,725,413
I am wondering if it is possible to deploy `react.js` web app that I've built to a share hosting site that does not have `node.js` installed? I use `webpack` to build the application and it creates normal `html, js, css` file. I uploaded the static folder that includes all those `html, js(bundle.js) and css` files, bu...
2017/03/10
[ "https://Stackoverflow.com/questions/42725413", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3301668/" ]
Yes you sure can put react on a shared hosting provider. Seeing as you're getting a 404 error (not found), you are probably referencing your react file/bundle incorrectly. It might not even be named `bundle.js` if you're using a boilerplate to create your application. Can you give more information? What does your ind...
For deploying a react app on a shared hosting you need to create a production build. Production build is a pack of all your react code and its dependencies. in most shared hosting we put our site/app inside a public\_html directory so if we hit [www.yourdomain.com](http://www.yourdomain.com) it serves the code from pu...
6,711,592
I'm curious about the purpose of the methods [`getItem`](http://developer.android.com/reference/android/widget/Adapter.html#getItem%28int%29) and [`getItemId`](http://developer.android.com/reference/android/widget/Adapter.html#getItemId%28int%29) in the class Adapter in the Android SDK. From the description, it seems ...
2011/07/15
[ "https://Stackoverflow.com/questions/6711592", "https://Stackoverflow.com", "https://Stackoverflow.com/users/56944/" ]
If you implement `getItemId`correctly then it might be very useful. Example : You have a list of albums : ``` class Album{ String coverUrl; String title; } ``` And you implement `getItemId` like this : ``` @Override public long getItemId(int position){ Album album = mListOfAlbums.get(position); ...
I would like to mention that after implementing `getItem` and `getItemId` you can use [ListView.getItemAtPosition](http://developer.android.com/reference/android/widget/AdapterView.html#getItemAtPosition%28int%29) and [ListView.getItemIdAtPosition](http://developer.android.com/reference/android/widget/AdapterView.html#...
31,594,349
What's the best practice for having different environments for lambda functions, i.e. dev/prod Should I just have two lambda functions one called myFunction-prod and myFunction-dev or is there a better way to create environments. I saw that Amazon API Gateway has a notion of "Stages" which accommodates separation of ...
2015/07/23
[ "https://Stackoverflow.com/questions/31594349", "https://Stackoverflow.com", "https://Stackoverflow.com/users/611750/" ]
During re:Invent 2015 (Oct); versioning and aliases has been added to lambda; this [official doc](http://docs.aws.amazon.com/lambda/latest/dg/versioning-aliases.html) describes very well how to use this for prod and dev. p.s. In order to test on the live data (w/o affecting the prod); I use SNS fan-out pattern (subscr...
Just to add to Neil's you can also use Stage Variables to link to the respective Lambda Alias i.e. the dev stage will use the DEV alias of your lambda function while the prod stage will use the PROD alias of your lambda function. More about stage variables here [Working with Stage Variables in Amazon API Gateway](http:...
14,470,115
I have just started learning Haskell using "Learn you a Haskell for Great Good". I am currently reading "Types and Typeclasses" chapter, so my knowledge is pretty .. non-existent. I am using Sublime Text 2 with SublimeHaskell package which builds/checks file on every save. The problem: I'm trying to make function typ...
2013/01/22
[ "https://Stackoverflow.com/questions/14470115", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1435744/" ]
`String` is nothing more than a type alias for `[Char]`, so there is no practical between the two - it's simply a matter of readability.
You seem to be running HLint on your code automatically, and treating any HLint warnings as fatal errors. As [the HLint author says](http://neilmitchell.blogspot.co.uk/2009/09/how-i-use-hlint.html) "Do not blindly apply the output of HLint". `String` and `[Char]` are exactly the same, as everyone says, it's a question ...
490,861
I have loose measures of average speed in different positions (speed is in the x axis given particularities of my own problem) [![enter image description here](https://i.stack.imgur.com/VTnzI.png)](https://i.stack.imgur.com/VTnzI.png) How can I estimate a fitting curve for 'instantaneous speed at each position' vs. ...
2019/07/10
[ "https://physics.stackexchange.com/questions/490861", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/236547/" ]
The problem lies in the boundary conditions. Ignoring factors of $G$ and $\pi$, gauss's law of gravitation relates the gravitational potential $\Phi$ to the mass density $\rho$ by $$\rho=-\nabla^2 \Phi. $$ In order to have a unique, well-defined solution, we need to specify boundary conditions for $\Phi$. Usually, we *...
From a very quick skim it seems the existing answers are excellent, so I'll instead contribute some of the physics and philosophy literature. I too was concerned by this issue after reading a certain paper (Peacock 2001, incidentally), until I discovered centuries of thought preceded me! Your concern was apparently fi...
3,176,593
I'm having a hard time understanding how to find all solutions of the form $a\_n = a^{(h)}\_n+a\_n^{(p)}$ I show that $a\_n=n2^n \to a\_n=2(n-1)2^{n-1} +2^n=2^n(n-1+1)=n2^n$. I can show that $a\_n^{(h)}$ characteristic equation $r-2=0 \to a\_n^{(h)}=\alpha2^n$ But I'm stuck on $a\_n^{(p)}$ characteristic equation $C...
2019/04/06
[ "https://math.stackexchange.com/questions/3176593", "https://math.stackexchange.com", "https://math.stackexchange.com/users/584468/" ]
Your homogeneous solution has $2^n$ in it already. When this happens, for the particular solution part, we cannot just use $C2^n$ (you have seen what happens if we do). Instead, *the rule in this scenario is to modify the guess by **multiplying by $\boldsymbol{n}$**, i.e. try $a\_n^{(p)}=C\color{red}{n}\cdot 2^n$*.
Here is another take. Let $b\_n=2^n$. Then $$ a\_n=2a\_{n-1}+2b\_{n-1}, \quad b\_n=2b\_{n-1}, \quad b\_0=1 $$ and so $$ \pmatrix{ a\_n \\ b\_n } = \pmatrix{ 2 & 2 \\ 0 & 2 } \pmatrix{ a\_{n-1} \\ b\_{n-1} } = 2 \pmatrix{ 1 & 1 \\ 0 & 1 } \pmatrix{ a\_{n-1} \\ b\_{n-1} }$$ which gives $$ \pmatrix{ a\_n \\ b\_n } = 2^n ...
57,101,028
I have a large ingestion pipeline, and sometimes it takes awhile for things to progress from source to the Elasticsearch index. Currently, when we parse our messages with Logstash, we parse the `@timestamp` field based on when the message was written by the source. However, due to large volumes of messages, it takes a ...
2019/07/18
[ "https://Stackoverflow.com/questions/57101028", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4949938/" ]
You can try to add a ruby filter as your last filter to create a field with the current time. ``` ruby { code => "event.set('fieldName', Time.now())" } ```
You can do it in an [ingest pipeline](https://gist.github.com/cdahlqvist/e713b39f0c17d85e613f56408a7facd5). That means the script is executed in elasticsearch, so it has the advantage of including any delays caused by back-pressure from the output.
8,444,184
Is it possible to somehow listen to, and catch, all the touch events occurring in an app? The app I'm currently developing will be used in showrooms and information kiosks and I would therefore like to revert to the start section of the app if no touches has been received for a given couple of minutes. A sort of scree...
2011/12/09
[ "https://Stackoverflow.com/questions/8444184", "https://Stackoverflow.com", "https://Stackoverflow.com/users/543224/" ]
You can use a tap gesture recognizer for this. Subclass `UITapGestureRecognizer` and import `<UIKit/UIGestureRecognizerSubclass.h>`. This defines `touchesBegan:`, `touchesMoved:`, `touchesEnded:` and `touchesCancelled:`. Put your touch-handling code in the appropriate methods. Instantiate the gesture recognizer in `ap...
In Swift 4.2 1. Create subclass of UIApplication object and print user action: ``` import UIKit class ANUIApplication: UIApplication { override func sendAction(_ action: Selector, to target: Any?, from sender: Any?, for event: UIEvent?) -> Bool { print("FILE= \(NSStringFromSelector(action)...
7,273,424
I am extremely OCD when it comes to the layout of my code, and it's a pain to press the down arrow key and Tab a hundred times in a row. Does anyone use a text editor that has the function of indenting chunks of code at the same time? Such as, if I have this: ``` <div> <img src="blahblah" style="float:left" /> ...
2011/09/01
[ "https://Stackoverflow.com/questions/7273424", "https://Stackoverflow.com", "https://Stackoverflow.com/users/857256/" ]
Any decent text editor, including Notepad++, can do this. Select the lines and press `Tab`.
Yup go with Notepad++, its brilliant. Dont forget Shift + Tab too though, just as useful:)