qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
1,181,457
The lifetimes of batteries are independent exponential random variables , each having parameter $\lambda$. A flashlight needs two batteries to work. If one has a flashlight and a stockpile of n batteries, What is the distribution of time that the flashlight can operate? What I have so far: Let $Y$ be the lifetime of ...
2015/03/08
[ "https://math.stackexchange.com/questions/1181457", "https://math.stackexchange.com", "https://math.stackexchange.com/users/128422/" ]
We are given $n$ batteries, and we put them two at a time in the flashlight. When one of the batteries fails, we swap it out and replace it with an unused one, if possible. The key here is that the battery that we did *not* swap out now behaves as a **completely new** battery. That's because the exponential distributio...
This is not an answer, but will not fit in a comment. Given $n$ batteries with run times $x\_1,...,x\_n$ (unknown to the user), just computing the operating time is moderately complex. For example, suppose we have 3 batteries. One starts with batteries $1,2$, then replaces $1$ by $3$ if $x\_1<x\_2$ in which case the...
1,181,457
The lifetimes of batteries are independent exponential random variables , each having parameter $\lambda$. A flashlight needs two batteries to work. If one has a flashlight and a stockpile of n batteries, What is the distribution of time that the flashlight can operate? What I have so far: Let $Y$ be the lifetime of ...
2015/03/08
[ "https://math.stackexchange.com/questions/1181457", "https://math.stackexchange.com", "https://math.stackexchange.com/users/128422/" ]
**Second answer,** for a different interpretation: Batteries cannot die before they go into the flashlight. Because this interpretation involves both the minimum of two exponentials and the sum of several exponentials, it makes a more interesting problem than did the assumptions in my first answer. It is the interpreta...
We are given $n$ batteries, and we put them two at a time in the flashlight. When one of the batteries fails, we swap it out and replace it with an unused one, if possible. The key here is that the battery that we did *not* swap out now behaves as a **completely new** battery. That's because the exponential distributio...
223
Magento offers support for different database back-end. I wonder which one of the OpenSource DB Backend (like MySQL or MariaDB ...) has better performance with Magento architecture. I know that Magento workload is more cpu/cache oriented however it still has 250+ tables and an EAV model.
2013/01/25
[ "https://magento.stackexchange.com/questions/223", "https://magento.stackexchange.com", "https://magento.stackexchange.com/users/70/" ]
As said Benmarks, it depends on your hardware environment. But, if you are looking alternate open source solution instead of MySQL, you should look definitely "Percona DB". It's MySQL based but has many performance counters available in the package. Also, they have a blog where they regularly sharing their experince ab...
An apples-to-apples comparison using identical hardware for each backend may be unlikely and likely inapplicable. I believe the answer will be "it depends": it depends on the rest of the business' operating environment and the available hardware and infrastructure. On the one hand there is the efficiency of non-Magent...
223
Magento offers support for different database back-end. I wonder which one of the OpenSource DB Backend (like MySQL or MariaDB ...) has better performance with Magento architecture. I know that Magento workload is more cpu/cache oriented however it still has 250+ tables and an EAV model.
2013/01/25
[ "https://magento.stackexchange.com/questions/223", "https://magento.stackexchange.com", "https://magento.stackexchange.com/users/70/" ]
As said Benmarks, it depends on your hardware environment. But, if you are looking alternate open source solution instead of MySQL, you should look definitely "Percona DB". It's MySQL based but has many performance counters available in the package. Also, they have a blog where they regularly sharing their experince ab...
I've not been able to find enough data on the performance difference between MySQL and MariaDB, however I've seen people opting for Percona MySQL, mainly for its hot backup feature, and also Percona's InnoDB is supposed to be better than the one in MySQL. Here is a post on Percona's performance improvements <http://www...
13,346,620
In order to create a font picker I need to get the list of fonts available to Firemonkey. As Screen.Fonts doesn't exist in FireMonkey I thought I'd need to use FMX.Platform ? eg: ``` if TPlatformServices.Current.SupportsPlatformService(IFMXSystemFontService, IInterface(FontSvc)) then begin edit1.Text:= FontSvc.G...
2012/11/12
[ "https://Stackoverflow.com/questions/13346620", "https://Stackoverflow.com", "https://Stackoverflow.com/users/575511/" ]
The cross platform solution should use the MacApi.AppKit and Windows.Winapi together in conditional defines. First Add these code to your uses clause: ``` {$IFDEF MACOS} MacApi.Appkit,Macapi.CoreFoundation, Macapi.Foundation, {$ENDIF} {$IFDEF MSWINDOWS} Winapi.Messages, Winapi.Windows, {$ENDIF} ``` Then add this c...
I've used the following solution: ``` Printer.ActivePrinter; memo1.lines.AddStrings(Printer.Fonts); ``` declaring FMX.Printer in the uses.
13,346,620
In order to create a font picker I need to get the list of fonts available to Firemonkey. As Screen.Fonts doesn't exist in FireMonkey I thought I'd need to use FMX.Platform ? eg: ``` if TPlatformServices.Current.SupportsPlatformService(IFMXSystemFontService, IInterface(FontSvc)) then begin edit1.Text:= FontSvc.G...
2012/11/12
[ "https://Stackoverflow.com/questions/13346620", "https://Stackoverflow.com", "https://Stackoverflow.com/users/575511/" ]
The cross platform solution should use the MacApi.AppKit and Windows.Winapi together in conditional defines. First Add these code to your uses clause: ``` {$IFDEF MACOS} MacApi.Appkit,Macapi.CoreFoundation, Macapi.Foundation, {$ENDIF} {$IFDEF MSWINDOWS} Winapi.Messages, Winapi.Windows, {$ENDIF} ``` Then add this c...
``` unit Unit1; interface uses Windows, SysUtils, Classes, Forms, Controls, StdCtrls; type TForm1 = class(TForm) ComboBox1: TComboBox; procedure FormShow(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.DFM} ...
13,346,620
In order to create a font picker I need to get the list of fonts available to Firemonkey. As Screen.Fonts doesn't exist in FireMonkey I thought I'd need to use FMX.Platform ? eg: ``` if TPlatformServices.Current.SupportsPlatformService(IFMXSystemFontService, IInterface(FontSvc)) then begin edit1.Text:= FontSvc.G...
2012/11/12
[ "https://Stackoverflow.com/questions/13346620", "https://Stackoverflow.com", "https://Stackoverflow.com/users/575511/" ]
I've used the following solution: ``` Printer.ActivePrinter; memo1.lines.AddStrings(Printer.Fonts); ``` declaring FMX.Printer in the uses.
``` unit Unit1; interface uses Windows, SysUtils, Classes, Forms, Controls, StdCtrls; type TForm1 = class(TForm) ComboBox1: TComboBox; procedure FormShow(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.DFM} ...
63,068,079
I want to initialize a array of 1 million objects on stack, I need to write one million &i in the following code. Is there any other good way. ```cpp #include <iostream> class A{ public: A(int* p) : p_(p){ std::cout << "A" << std::endl; } private: int *p_; }; int main(){ int i; ...
2020/07/24
[ "https://Stackoverflow.com/questions/63068079", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10825418/" ]
C++ new operator can be used to call constructor on a preallocated memory: ``` #include <iostream> #include <cstddef> #include <cstdint> class A{ public: A(int* p) : p_(p){ std::cout << "A" << std::endl; } private: int *p_; }; int main(){ int i; uint8_t buf[1000000 * sizeof(A)]...
You could use `std::vector` and initialize is with a million elements ``` std::vector<A> a(1000000, &i); ```
63,068,079
I want to initialize a array of 1 million objects on stack, I need to write one million &i in the following code. Is there any other good way. ```cpp #include <iostream> class A{ public: A(int* p) : p_(p){ std::cout << "A" << std::endl; } private: int *p_; }; int main(){ int i; ...
2020/07/24
[ "https://Stackoverflow.com/questions/63068079", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10825418/" ]
``` #include <iostream> #include <type_traits> class A{ public: A(int* p) : p_(p){ std::cout << "A" << std::endl; } private: int *p_; }; int main(){ using elemType = std::aligned_storage<sizeof(A), alignof(A)>::type; const size_t count = 1000000; int i; elemType a[coun...
You could use `std::vector` and initialize is with a million elements ``` std::vector<A> a(1000000, &i); ```
63,068,079
I want to initialize a array of 1 million objects on stack, I need to write one million &i in the following code. Is there any other good way. ```cpp #include <iostream> class A{ public: A(int* p) : p_(p){ std::cout << "A" << std::endl; } private: int *p_; }; int main(){ int i; ...
2020/07/24
[ "https://Stackoverflow.com/questions/63068079", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10825418/" ]
``` #include <iostream> #include <type_traits> class A{ public: A(int* p) : p_(p){ std::cout << "A" << std::endl; } private: int *p_; }; int main(){ using elemType = std::aligned_storage<sizeof(A), alignof(A)>::type; const size_t count = 1000000; int i; elemType a[coun...
C++ new operator can be used to call constructor on a preallocated memory: ``` #include <iostream> #include <cstddef> #include <cstdint> class A{ public: A(int* p) : p_(p){ std::cout << "A" << std::endl; } private: int *p_; }; int main(){ int i; uint8_t buf[1000000 * sizeof(A)]...
74,423,308
I take it from the database and send it via ajax (wordpress). Everything works fine, except that I don't get the **first row** from the database. As I read on the Internet, a similar problem is in the array, maybe. Can someone explain and help me fix it so that all rows are displayed? Code: ``` $sql = $wpdb->prepare(...
2022/11/13
[ "https://Stackoverflow.com/questions/74423308", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11593555/" ]
You don't need to loop your results at all, your code can be simplified further. * There are no placeholders to bind variables to, so there is no need to use `prepare()`. * There is no need to loop and manually set the indexes on the first level or the associative keys on the second level because `get_results()` with ...
WordPress database tables always use prefix so you have to include prefix using `$wpdb->prefix.'users'` Or if you are trying to get WordPress core users then you can use `$wpdb->users` to get the table name with prefix. Reference: <https://developer.wordpress.org/reference/classes/wpdb/>. You can use `ARRAY_A` for se...
33,158,331
I have a query in Oracle SQL that displays results as follows: **SQL:** ``` select uuid, name, to_char(from_tz(startdate, 'UTC') at time zone 'America/New_York', 'yyyy-mm-dd hh24:mi:ss') as startdate_et, to_char(from_tz(enddate, 'UTC') at time zone 'America/New_York', 'yyyy-mm-dd hh24:mi:ss') as enddate_et, ...
2015/10/15
[ "https://Stackoverflow.com/questions/33158331", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2325154/" ]
No, the `file` input can't be prepopulated by Laravel or by any software. Your website (and any website) doesn't and shouldn't know the local path to the file. Imagine the security risks if they did! You could trick a user into uploading their SSH private key or something. What you need to do is process the uploaded f...
There seems to be a lot of questions around for the same issue ([Form::file: How to repopulate with Input::old After Validation Errors and/or on Update?](https://stackoverflow.com/questions/22659345/formfile-how-to-repopulate-with-inputold-after-validation-errors-and-or-on)) and everyone with apparent knowledge says th...
33,158,331
I have a query in Oracle SQL that displays results as follows: **SQL:** ``` select uuid, name, to_char(from_tz(startdate, 'UTC') at time zone 'America/New_York', 'yyyy-mm-dd hh24:mi:ss') as startdate_et, to_char(from_tz(enddate, 'UTC') at time zone 'America/New_York', 'yyyy-mm-dd hh24:mi:ss') as enddate_et, ...
2015/10/15
[ "https://Stackoverflow.com/questions/33158331", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2325154/" ]
No, the `file` input can't be prepopulated by Laravel or by any software. Your website (and any website) doesn't and shouldn't know the local path to the file. Imagine the security risks if they did! You could trick a user into uploading their SSH private key or something. What you need to do is process the uploaded f...
If your file is an image, you can create a hidden input and write there **base64** string there when the user uploads the image ``` {!! Form::open(array('url' => 'foo/bar')) !!} {!! Form::text('image_name') !!} {!! Form::hidden('base64_image') !!} {!! Form::file('image') !!} {!! Form::submit('Submit!') !!} {!! Form::c...
33,158,331
I have a query in Oracle SQL that displays results as follows: **SQL:** ``` select uuid, name, to_char(from_tz(startdate, 'UTC') at time zone 'America/New_York', 'yyyy-mm-dd hh24:mi:ss') as startdate_et, to_char(from_tz(enddate, 'UTC') at time zone 'America/New_York', 'yyyy-mm-dd hh24:mi:ss') as enddate_et, ...
2015/10/15
[ "https://Stackoverflow.com/questions/33158331", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2325154/" ]
There seems to be a lot of questions around for the same issue ([Form::file: How to repopulate with Input::old After Validation Errors and/or on Update?](https://stackoverflow.com/questions/22659345/formfile-how-to-repopulate-with-inputold-after-validation-errors-and-or-on)) and everyone with apparent knowledge says th...
If your file is an image, you can create a hidden input and write there **base64** string there when the user uploads the image ``` {!! Form::open(array('url' => 'foo/bar')) !!} {!! Form::text('image_name') !!} {!! Form::hidden('base64_image') !!} {!! Form::file('image') !!} {!! Form::submit('Submit!') !!} {!! Form::c...
41,740,126
Okay, the title might be kind of misleading, but I couldn't really come up with a better explanation for my problem. I'm trying to create a program that takes an array of first names and an array of last names, and puts these together in an array of full names. Problem here is that I'm trying to make sure that the same...
2017/01/19
[ "https://Stackoverflow.com/questions/41740126", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7230001/" ]
It looks like you just want to make all combinations of full names, so why not do that? ``` for (int i = 0; i < firstnames.Length; i++) { for (int j = 0; j < lastnames.Length; j++) { fullnames[i*lastnames.Length + j] = firstnames[i] + " " + lastnames[j]; } } ``` Then if you want your names in a r...
Your best bet is to generate a prototype version of `fullname` which represents every possible combination, then shuffle that if you want randomised output: ``` Random rnd = new Random(); string[] random_full_name = fullname.OrderBy(x => rnd.Next()).ToArray(); ``` You then read this new array out consecutively to ...
41,740,126
Okay, the title might be kind of misleading, but I couldn't really come up with a better explanation for my problem. I'm trying to create a program that takes an array of first names and an array of last names, and puts these together in an array of full names. Problem here is that I'm trying to make sure that the same...
2017/01/19
[ "https://Stackoverflow.com/questions/41740126", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7230001/" ]
You could use a simple HashSet to make sure that values are unique: ``` public void fillFullNames() { HashSet<string> newFullNames = new HashSet<string>(); while (newFullNames.Count != fullnames.Length) { newFullNames.Add(firstnames[getRandomIndex(0, 10)] + " " + lastnames[getRandom...
Your best bet is to generate a prototype version of `fullname` which represents every possible combination, then shuffle that if you want randomised output: ``` Random rnd = new Random(); string[] random_full_name = fullname.OrderBy(x => rnd.Next()).ToArray(); ``` You then read this new array out consecutively to ...
41,740,126
Okay, the title might be kind of misleading, but I couldn't really come up with a better explanation for my problem. I'm trying to create a program that takes an array of first names and an array of last names, and puts these together in an array of full names. Problem here is that I'm trying to make sure that the same...
2017/01/19
[ "https://Stackoverflow.com/questions/41740126", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7230001/" ]
It looks like you just want to make all combinations of full names, so why not do that? ``` for (int i = 0; i < firstnames.Length; i++) { for (int j = 0; j < lastnames.Length; j++) { fullnames[i*lastnames.Length + j] = firstnames[i] + " " + lastnames[j]; } } ``` Then if you want your names in a r...
You could use a simple HashSet to make sure that values are unique: ``` public void fillFullNames() { HashSet<string> newFullNames = new HashSet<string>(); while (newFullNames.Count != fullnames.Length) { newFullNames.Add(firstnames[getRandomIndex(0, 10)] + " " + lastnames[getRandom...
53,805,631
I don't know what can I tell more. I have this method: ``` public async Task<HttpResponseMessage> SendAsyncRequest(string uri, string content, HttpMethod method, bool tryReauthorizeOn401 = true) { HttpRequestMessage rm = new HttpRequestMessage(method, uri); if (!string.IsNullOrWhiteSpace(content)) rm.C...
2018/12/16
[ "https://Stackoverflow.com/questions/53805631", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5330895/" ]
Based on the provided example project code you provided ``` protected override async void OnStart() { Controller c = new Controller(); TodoItem item = await c.GetTodoItem(1); TodoItem item2 = await c.GetTodoItem(2); } ``` You are calling `async void` fire and forget on startup. You wont be able to catc...
try to update your compileSdkVersion to a higher version and check. also try following > > > ``` > > Go to: File > Invalidate Caches/Restart and select Invalidate and Restart > > ``` > >
56,066,777
I'm using plotly to display some shapes and add some annotations (text) over them. However I don't know how to control layer ordering to plot objects in plotly and the text is always behind the shapes (I didn't found any example in plotly R API docs). Here follows a reproducible example: ``` library("plotly") shapes...
2019/05/09
[ "https://Stackoverflow.com/questions/56066777", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4862402/" ]
A `HashMap<T, T>` is not a Map but a done something very weird to your equals() and hashCode() methods. As commented, creating a temporary short lived instance is cheap because the garbage collector uses generations. But what you must check for existence is the key not the object itself.
I don't know what you're doing to use up a lot of heap memory but why not look at weak and strong references. * Weak references to a single object are kept around as long as there is a single hard reference. When the hard reference is garbage collected, so are the weak references. * Strong references will only go away...
582,452
I would like to call multiple .msi files in silent mode, and halt the entire installation if any fail. Is it possible to get the return codes of msiexec.exe being called from the [run] section? Currently I can only see error messages in the windows event viewer.
2009/02/24
[ "https://Stackoverflow.com/questions/582452", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1145/" ]
There is currently no way to check the successful execution of *[Run]* entries. The code just logs the process exit code and continues with the next entry (it can be examined in the Inno Setup source file *Main.pas*, the function is *ProcessRunEntry()*, starting at line 3404 in the current version 5.2.3). If you need ...
You can use [my answer](https://stackoverflow.com/a/24323119/2164198) to similar question to run commands safely in [Run] section with proper notification and rollback on error. The link above provides complete solution, but idea is folowing: 1) Write error message to temporary file {tmp}\install.error using InnoSetu...
6,275,693
I'm using the following unmanaged C++ code to instantiate the CLR from an Excel 2003 add-in (a COM shim for a .NET add-in): ``` hr = CorBindToRuntimeEx( 0, // version, use default 0, // flavor, use default 0, // domain-neutral"ness" and gc settings CLSID_CorRuntimeHost, II...
2011/06/08
[ "https://Stackoverflow.com/questions/6275693", "https://Stackoverflow.com", "https://Stackoverflow.com/users/323105/" ]
I would compress them into one file in order to reduce the http requests. Look at the [HTML5Boilerplate's Build Script](http://html5boilerplate.com). It allows you to code in separate files and deploy in one minified file. This is always best practice.
Using method 1 would result in requests for the `css1.css` and `css2.css` files so you would make 3 requests as opposed to 2 if you requested the files seperately. Combining the files into a single file such as method 2 would conform to the Yahoo rules.
6,275,693
I'm using the following unmanaged C++ code to instantiate the CLR from an Excel 2003 add-in (a COM shim for a .NET add-in): ``` hr = CorBindToRuntimeEx( 0, // version, use default 0, // flavor, use default 0, // domain-neutral"ness" and gc settings CLSID_CorRuntimeHost, II...
2011/06/08
[ "https://Stackoverflow.com/questions/6275693", "https://Stackoverflow.com", "https://Stackoverflow.com/users/323105/" ]
I would compress them into one file in order to reduce the http requests. Look at the [HTML5Boilerplate's Build Script](http://html5boilerplate.com). It allows you to code in separate files and deploy in one minified file. This is always best practice.
The best way to do this is with some sort of build process which combines all our source css into one file (similar to your method 2) but retains the original CSS for development and debugging in multiple files. There are many tool which help with this and depending on your platform and any framewroks you are using dif...
6,275,693
I'm using the following unmanaged C++ code to instantiate the CLR from an Excel 2003 add-in (a COM shim for a .NET add-in): ``` hr = CorBindToRuntimeEx( 0, // version, use default 0, // flavor, use default 0, // domain-neutral"ness" and gc settings CLSID_CorRuntimeHost, II...
2011/06/08
[ "https://Stackoverflow.com/questions/6275693", "https://Stackoverflow.com", "https://Stackoverflow.com/users/323105/" ]
I would compress them into one file in order to reduce the http requests. Look at the [HTML5Boilerplate's Build Script](http://html5boilerplate.com). It allows you to code in separate files and deploy in one minified file. This is always best practice.
best way is to combine all the files, compress them with YUI compressor. you can find detailed help at this [link](http://beardscratchers.com/journal/compressing-css-and-javascript-with-yui-compressor)
6,275,693
I'm using the following unmanaged C++ code to instantiate the CLR from an Excel 2003 add-in (a COM shim for a .NET add-in): ``` hr = CorBindToRuntimeEx( 0, // version, use default 0, // flavor, use default 0, // domain-neutral"ness" and gc settings CLSID_CorRuntimeHost, II...
2011/06/08
[ "https://Stackoverflow.com/questions/6275693", "https://Stackoverflow.com", "https://Stackoverflow.com/users/323105/" ]
I would compress them into one file in order to reduce the http requests. Look at the [HTML5Boilerplate's Build Script](http://html5boilerplate.com). It allows you to code in separate files and deploy in one minified file. This is always best practice.
There are some problems using @import 1. Different browsers treat import differently (Was a problem in older browsers which may not be used now) 2. I guess IE6 and IE7 do not support @media. In link tag you can specify media as screen, print, etc. But IE6 and IE7 do not support @media in CSS. So specifying media types...
6,275,693
I'm using the following unmanaged C++ code to instantiate the CLR from an Excel 2003 add-in (a COM shim for a .NET add-in): ``` hr = CorBindToRuntimeEx( 0, // version, use default 0, // flavor, use default 0, // domain-neutral"ness" and gc settings CLSID_CorRuntimeHost, II...
2011/06/08
[ "https://Stackoverflow.com/questions/6275693", "https://Stackoverflow.com", "https://Stackoverflow.com/users/323105/" ]
The best way to do this is with some sort of build process which combines all our source css into one file (similar to your method 2) but retains the original CSS for development and debugging in multiple files. There are many tool which help with this and depending on your platform and any framewroks you are using dif...
Using method 1 would result in requests for the `css1.css` and `css2.css` files so you would make 3 requests as opposed to 2 if you requested the files seperately. Combining the files into a single file such as method 2 would conform to the Yahoo rules.
6,275,693
I'm using the following unmanaged C++ code to instantiate the CLR from an Excel 2003 add-in (a COM shim for a .NET add-in): ``` hr = CorBindToRuntimeEx( 0, // version, use default 0, // flavor, use default 0, // domain-neutral"ness" and gc settings CLSID_CorRuntimeHost, II...
2011/06/08
[ "https://Stackoverflow.com/questions/6275693", "https://Stackoverflow.com", "https://Stackoverflow.com/users/323105/" ]
There are some problems using @import 1. Different browsers treat import differently (Was a problem in older browsers which may not be used now) 2. I guess IE6 and IE7 do not support @media. In link tag you can specify media as screen, print, etc. But IE6 and IE7 do not support @media in CSS. So specifying media types...
Using method 1 would result in requests for the `css1.css` and `css2.css` files so you would make 3 requests as opposed to 2 if you requested the files seperately. Combining the files into a single file such as method 2 would conform to the Yahoo rules.
6,275,693
I'm using the following unmanaged C++ code to instantiate the CLR from an Excel 2003 add-in (a COM shim for a .NET add-in): ``` hr = CorBindToRuntimeEx( 0, // version, use default 0, // flavor, use default 0, // domain-neutral"ness" and gc settings CLSID_CorRuntimeHost, II...
2011/06/08
[ "https://Stackoverflow.com/questions/6275693", "https://Stackoverflow.com", "https://Stackoverflow.com/users/323105/" ]
The best way to do this is with some sort of build process which combines all our source css into one file (similar to your method 2) but retains the original CSS for development and debugging in multiple files. There are many tool which help with this and depending on your platform and any framewroks you are using dif...
best way is to combine all the files, compress them with YUI compressor. you can find detailed help at this [link](http://beardscratchers.com/journal/compressing-css-and-javascript-with-yui-compressor)
6,275,693
I'm using the following unmanaged C++ code to instantiate the CLR from an Excel 2003 add-in (a COM shim for a .NET add-in): ``` hr = CorBindToRuntimeEx( 0, // version, use default 0, // flavor, use default 0, // domain-neutral"ness" and gc settings CLSID_CorRuntimeHost, II...
2011/06/08
[ "https://Stackoverflow.com/questions/6275693", "https://Stackoverflow.com", "https://Stackoverflow.com/users/323105/" ]
There are some problems using @import 1. Different browsers treat import differently (Was a problem in older browsers which may not be used now) 2. I guess IE6 and IE7 do not support @media. In link tag you can specify media as screen, print, etc. But IE6 and IE7 do not support @media in CSS. So specifying media types...
best way is to combine all the files, compress them with YUI compressor. you can find detailed help at this [link](http://beardscratchers.com/journal/compressing-css-and-javascript-with-yui-compressor)
13,132,144
for raw PCM data with sampling rate - say Fs - what bit rate or sample rate to use? Can I set WaveFormat sample rate parameter to same as Fs?
2012/10/30
[ "https://Stackoverflow.com/questions/13132144", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1784426/" ]
NAudio will calculate the bit rate for you, if you provide sample rate and channels in the WaveFormat constructor with two parameters. (you can also specify bit depth, but this will normally be 16). You can specify any sample rate you like, but if you want to play it easily in Windows, go for a standard value (e.g. 44...
96 khz and 44.1 kHz are standard audio sampling rates, bit rate will span from 4 to 32 depending on your needs
1,214,132
I was running Ubuntu 18.04 and just converted to Xubuntu. Is there a way to add icons to the desktop? I would like a few to launch programs.
2020/03/01
[ "https://askubuntu.com/questions/1214132", "https://askubuntu.com", "https://askubuntu.com/users/653494/" ]
Right-click on the desktop and choose `Create Launcher` from the context-menu to create custom launchers. You can also choose any program from the application-menu with a right-click and select `Add to Desktop` from the context-menu.
**Creating Desktop shortcut using terminal** You could do it in the next way: ``` ln -s /usr/share/applications/google-chrome.desktop /home/user/Desktop/ ``` But it shows an alert: `Untrusted application launcher` Also, you could create it by creating app.desktop file on your desktop with the next content: ``` vi...
49,050,425
I'm working on a project which has more than one user type (SuperUser - SchoolAdmin - Teacher) And each role has privilige to see some elements. How do i hide elements depending on the logged user role using \*ngIf? This is the project [link](https://stackblitz.com/edit/angular-vduzzk) on Stack-blitz, i uploaded som...
2018/03/01
[ "https://Stackoverflow.com/questions/49050425", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9122537/" ]
In your project, when a user is registering you are asking if he is a 'Teacher', 'Parent' or a 'Student'. So here you have your condition. When you sign-in or register you should save your user data somewhere (in a service for exemple which you can use with [@injection](https://angular.io/guide/dependency-injection). ...
boolean value true or false is used for hiding. In HTML file `<div *ngIf = !test>_contents to be printed_</div>` In .ts file initialize `test = false;` so whenever `this.test = true;` div will show otherwise will be in hide . Check your condition and make the `test = true;`
49,050,425
I'm working on a project which has more than one user type (SuperUser - SchoolAdmin - Teacher) And each role has privilige to see some elements. How do i hide elements depending on the logged user role using \*ngIf? This is the project [link](https://stackblitz.com/edit/angular-vduzzk) on Stack-blitz, i uploaded som...
2018/03/01
[ "https://Stackoverflow.com/questions/49050425", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9122537/" ]
In your project, when a user is registering you are asking if he is a 'Teacher', 'Parent' or a 'Student'. So here you have your condition. When you sign-in or register you should save your user data somewhere (in a service for exemple which you can use with [@injection](https://angular.io/guide/dependency-injection). ...
You should do: ``` <div *ngIf="superUserLogged"> // your SuperUser display ... </div> <div *ngIf="schoolAdminLogged"> // your SuperUser display ... </div> <div *ngIf="teacherLogged"> // your SuperUser display ... </div> ``` and in \*.ts file when ever someone logs to system you do: ``` onLogin(use...
44,685,473
There are tons of questions on passing strings to a javascript function - that's not what I'm asking here. My problem is that I have to pass an integer (a customer ID) as a string to a javascript function from PHP. The reason I have to do this is sometimes a customer ID can have leading zeros, and I do not know how man...
2017/06/21
[ "https://Stackoverflow.com/questions/44685473", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3470694/" ]
try to pass/escape the quotes so it gets parsed as string by the js ``` (\"" . $row["userAccountId"] . \"" ```
Great spot by john Smith, also another useful function for leading zeroes (though in this instance, not more efficient than john's) is the [sprintf](http://php.net/manual/en/function.sprintf.php) function. ``` $id = 321; function disableAccount($userAccountId, customerId) { //Result is 000321 $userAccIdWi...
44,685,473
There are tons of questions on passing strings to a javascript function - that's not what I'm asking here. My problem is that I have to pass an integer (a customer ID) as a string to a javascript function from PHP. The reason I have to do this is sometimes a customer ID can have leading zeros, and I do not know how man...
2017/06/21
[ "https://Stackoverflow.com/questions/44685473", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3470694/" ]
try to pass/escape the quotes so it gets parsed as string by the js ``` (\"" . $row["userAccountId"] . \"" ```
Use the [heredoc](http://php.net/manual/en/language.types.string.php#language.types.string.syntax.heredoc) syntax whenever you produce HTML in PHP, it's more readable: ``` echo <<< _ <td> <input type="checkbox" id="{$output['customerId']}" onclick="disableAccount('{$row['userAccountId']}', ...
26,822,038
I have a problem in my code. I've been trying to design a form that could update data in a database and showing it without refreshing the page. I could do this, but I wanted that the form would work if the user pressed the Enter key. Here is my code: ``` <form name="chat" id="chat"> <textarea name="messag...
2014/11/08
[ "https://Stackoverflow.com/questions/26822038", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1085949/" ]
If it works *onclick* I think that *onsubmit* in `<form>` should work too: > > > ``` > <form name="chat" id="chat" onsubmit="send();"> > <textarea name="message" type="text" id="message" size="63" ></textarea> > <input type="button" value="Send" onClick="send();"/> > </form> > > ``` > > Have you tried th...
What about this approach. Determines if carriage return has been pressed. (Ascii 13) ``` $(document).ready(function(){ $("form").keydown(function(event){ if(event.which == 13) { event.preventdefault(); // submit } }); }); ```
26,822,038
I have a problem in my code. I've been trying to design a form that could update data in a database and showing it without refreshing the page. I could do this, but I wanted that the form would work if the user pressed the Enter key. Here is my code: ``` <form name="chat" id="chat"> <textarea name="messag...
2014/11/08
[ "https://Stackoverflow.com/questions/26822038", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1085949/" ]
--- You will need to add an event listener on that input field. See <http://api.jquery.com/keypress/> and my example below. ```js $( "#message" ).keypress(function( event ) { if ( event.which == 13 ) { event.preventDefault(); send(); } }); ```
What about this approach. Determines if carriage return has been pressed. (Ascii 13) ``` $(document).ready(function(){ $("form").keydown(function(event){ if(event.which == 13) { event.preventdefault(); // submit } }); }); ```
38,498,175
I have to write a regex with matches following: * String should start with alphabets - [a-zA-Z] * String can contain alphabets, spaces, numbers, `_` and `-` (underscore and hyphen) * String should not end with `_` or `-` (underscore and hyphen) * Underscore character should not have space before and after. I came up ...
2016/07/21
[ "https://Stackoverflow.com/questions/38498175", "https://Stackoverflow.com", "https://Stackoverflow.com/users/664047/" ]
What about this? ``` ^[a-zA-Z](\B_\B|[a-zA-Z0-9 -])*[a-zA-Z0-9 ]$ ``` Broken down: ``` ^ [a-zA-Z] allowed characters at beginning ( \B_\B underscore with no word-boundary | or [a-zA-Z0-9 -] other allowed characters )* [a-zA-Z0-9 ] allowed characters at end $ ```
Oh! I love me some regex! Would this work? `/^[a-z]$|^[a-z](?:_(?=[^ ]))?(?:[a-z\d -][^ ]_[^ ])*[a-z\d -]*[^_-]$/i` I was a tad unsure of rule 4--do you mean underscores can have a space before *or* after *or* neither, but not before *and* after?
38,498,175
I have to write a regex with matches following: * String should start with alphabets - [a-zA-Z] * String can contain alphabets, spaces, numbers, `_` and `-` (underscore and hyphen) * String should not end with `_` or `-` (underscore and hyphen) * Underscore character should not have space before and after. I came up ...
2016/07/21
[ "https://Stackoverflow.com/questions/38498175", "https://Stackoverflow.com", "https://Stackoverflow.com/users/664047/" ]
You may use ``` ^(?!.*(?:[_-]$|_ | _))[a-zA-Z][\w -]*$ ``` See the [regex demo](https://regex101.com/r/eD1uV6/2) *Explanation*: * `^` - start of string * `(?!.*(?:[_-]$|_ | _))` - after some chars (`.*`) there must not appear (`(?!...)`) a `_` or `-` at the end of string (`[_-]$`), nor space+`_` or `_`+space * `[a...
Oh! I love me some regex! Would this work? `/^[a-z]$|^[a-z](?:_(?=[^ ]))?(?:[a-z\d -][^ ]_[^ ])*[a-z\d -]*[^_-]$/i` I was a tad unsure of rule 4--do you mean underscores can have a space before *or* after *or* neither, but not before *and* after?
38,498,175
I have to write a regex with matches following: * String should start with alphabets - [a-zA-Z] * String can contain alphabets, spaces, numbers, `_` and `-` (underscore and hyphen) * String should not end with `_` or `-` (underscore and hyphen) * Underscore character should not have space before and after. I came up ...
2016/07/21
[ "https://Stackoverflow.com/questions/38498175", "https://Stackoverflow.com", "https://Stackoverflow.com/users/664047/" ]
You could use this one: ``` ^(?!^[ _-]|.*[ _-]$|.* _|.*_ )[\w -]*$ ``` [regex tester](https://regex101.com/r/rE0tS8/1) For the test cases I used modifier `gm` to match each line individually. If emtpy string should not be considered as acceptable, then change the final `*` to a `+`: ``` ^(?!^[ _-]|.*[ _-]$|.* _|....
Oh! I love me some regex! Would this work? `/^[a-z]$|^[a-z](?:_(?=[^ ]))?(?:[a-z\d -][^ ]_[^ ])*[a-z\d -]*[^_-]$/i` I was a tad unsure of rule 4--do you mean underscores can have a space before *or* after *or* neither, but not before *and* after?
38,498,175
I have to write a regex with matches following: * String should start with alphabets - [a-zA-Z] * String can contain alphabets, spaces, numbers, `_` and `-` (underscore and hyphen) * String should not end with `_` or `-` (underscore and hyphen) * Underscore character should not have space before and after. I came up ...
2016/07/21
[ "https://Stackoverflow.com/questions/38498175", "https://Stackoverflow.com", "https://Stackoverflow.com/users/664047/" ]
You may use ``` ^(?!.*(?:[_-]$|_ | _))[a-zA-Z][\w -]*$ ``` See the [regex demo](https://regex101.com/r/eD1uV6/2) *Explanation*: * `^` - start of string * `(?!.*(?:[_-]$|_ | _))` - after some chars (`.*`) there must not appear (`(?!...)`) a `_` or `-` at the end of string (`[_-]$`), nor space+`_` or `_`+space * `[a...
What about this? ``` ^[a-zA-Z](\B_\B|[a-zA-Z0-9 -])*[a-zA-Z0-9 ]$ ``` Broken down: ``` ^ [a-zA-Z] allowed characters at beginning ( \B_\B underscore with no word-boundary | or [a-zA-Z0-9 -] other allowed characters )* [a-zA-Z0-9 ] allowed characters at end $ ```
38,498,175
I have to write a regex with matches following: * String should start with alphabets - [a-zA-Z] * String can contain alphabets, spaces, numbers, `_` and `-` (underscore and hyphen) * String should not end with `_` or `-` (underscore and hyphen) * Underscore character should not have space before and after. I came up ...
2016/07/21
[ "https://Stackoverflow.com/questions/38498175", "https://Stackoverflow.com", "https://Stackoverflow.com/users/664047/" ]
You could use this one: ``` ^(?!^[ _-]|.*[ _-]$|.* _|.*_ )[\w -]*$ ``` [regex tester](https://regex101.com/r/rE0tS8/1) For the test cases I used modifier `gm` to match each line individually. If emtpy string should not be considered as acceptable, then change the final `*` to a `+`: ``` ^(?!^[ _-]|.*[ _-]$|.* _|....
What about this? ``` ^[a-zA-Z](\B_\B|[a-zA-Z0-9 -])*[a-zA-Z0-9 ]$ ``` Broken down: ``` ^ [a-zA-Z] allowed characters at beginning ( \B_\B underscore with no word-boundary | or [a-zA-Z0-9 -] other allowed characters )* [a-zA-Z0-9 ] allowed characters at end $ ```
38,498,175
I have to write a regex with matches following: * String should start with alphabets - [a-zA-Z] * String can contain alphabets, spaces, numbers, `_` and `-` (underscore and hyphen) * String should not end with `_` or `-` (underscore and hyphen) * Underscore character should not have space before and after. I came up ...
2016/07/21
[ "https://Stackoverflow.com/questions/38498175", "https://Stackoverflow.com", "https://Stackoverflow.com/users/664047/" ]
You may use ``` ^(?!.*(?:[_-]$|_ | _))[a-zA-Z][\w -]*$ ``` See the [regex demo](https://regex101.com/r/eD1uV6/2) *Explanation*: * `^` - start of string * `(?!.*(?:[_-]$|_ | _))` - after some chars (`.*`) there must not appear (`(?!...)`) a `_` or `-` at the end of string (`[_-]$`), nor space+`_` or `_`+space * `[a...
You could use this one: ``` ^(?!^[ _-]|.*[ _-]$|.* _|.*_ )[\w -]*$ ``` [regex tester](https://regex101.com/r/rE0tS8/1) For the test cases I used modifier `gm` to match each line individually. If emtpy string should not be considered as acceptable, then change the final `*` to a `+`: ``` ^(?!^[ _-]|.*[ _-]$|.* _|....
1,946,817
The question is to show > > $(∑\_{i=1}^n |x\_i | )^p≥∑\_{i=1}^n |x\_i |^p $ for $p\ge1$ , or in plain words, the sum's power is no less than the sum of powers if the power is no less than 1. > > > It is best that it can be proved using Holder's inequality or any other commonly used inequalities like Minkowski’s ...
2016/09/29
[ "https://math.stackexchange.com/questions/1946817", "https://math.stackexchange.com", "https://math.stackexchange.com/users/181974/" ]
The essential fact needed here is that a recursive definition like that of $F\_n$ can be replaced by an equivalent explicit definition. Specifically, the Fibonacci sequence $W=\{\langle k,F\_k\rangle:k\in\mathbb N\}$ can be defined as the set of all those ordered pairs $\langle k,x\rangle$ such that there exists a func...
It does make sense. Define $S\_n = \{ F\_0, F\_1, F\_2, \dots, F\_n \}$. (I think you'll agree that this set exists for every $n$.) Then let $$S = \bigcup\_{n \in \mathbb{N}} S\_n$$ Since each $S\_n$ exists, and $\mathbb{N}$ certainly exists, the union does as well (we have an axiom, the Axiom of Unions, to tell us ...
42,181,045
I have something like this: ``` A //branch 1 \ B - C //branch 2 \ D //branch 3 ``` And I would like to get something like this: ``` A - E //branch_1 \ B' - C' //branch_2 \ D' //branch_3 ``` I would like to perform a command and rebase all branches at once...
2017/02/11
[ "https://Stackoverflow.com/questions/42181045", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1675615/" ]
Short answer: no, it's not possible ... but you *can* minimize the amount of work you have to do. Long answer on minimizing work follows. The key to understanding this is that Git's branch *names*—the names `branch_1`, `branch_2`, and `branch_3` in your example—are merely identifiers that "point to" one specific commi...
In order to at least find out *which branches* you will have to update after the initial rebase, you can run ``` $ git branch --contains <commit A> ```
42,181,045
I have something like this: ``` A //branch 1 \ B - C //branch 2 \ D //branch 3 ``` And I would like to get something like this: ``` A - E //branch_1 \ B' - C' //branch_2 \ D' //branch_3 ``` I would like to perform a command and rebase all branches at once...
2017/02/11
[ "https://Stackoverflow.com/questions/42181045", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1675615/" ]
Short answer: no, it's not possible ... but you *can* minimize the amount of work you have to do. Long answer on minimizing work follows. The key to understanding this is that Git's branch *names*—the names `branch_1`, `branch_2`, and `branch_3` in your example—are merely identifiers that "point to" one specific commi...
This question is a superset of [How do I rebase a chain of local git branches?](https://stackoverflow.com/questions/20834648/how-do-i-rebase-a-chain-of-local-git-branches/58864534#58864534) The solution I am using today is a tool called [git-chain](https://github.com/Shopify/git-chain) which aims to solve this problem...
42,181,045
I have something like this: ``` A //branch 1 \ B - C //branch 2 \ D //branch 3 ``` And I would like to get something like this: ``` A - E //branch_1 \ B' - C' //branch_2 \ D' //branch_3 ``` I would like to perform a command and rebase all branches at once...
2017/02/11
[ "https://Stackoverflow.com/questions/42181045", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1675615/" ]
Short answer: no, it's not possible ... but you *can* minimize the amount of work you have to do. Long answer on minimizing work follows. The key to understanding this is that Git's branch *names*—the names `branch_1`, `branch_2`, and `branch_3` in your example—are merely identifiers that "point to" one specific commi...
The git-branchless suite of tools can neatly solve this problem: ``` $ git checkout branch1 $ git commit -m 'E' $ git move -s B -d branch1 # the above is the same as the following, # because `branch1` is already checked out: $ git move -s B # or, if you want to address branches instead of commits # (this will also ...
42,181,045
I have something like this: ``` A //branch 1 \ B - C //branch 2 \ D //branch 3 ``` And I would like to get something like this: ``` A - E //branch_1 \ B' - C' //branch_2 \ D' //branch_3 ``` I would like to perform a command and rebase all branches at once...
2017/02/11
[ "https://Stackoverflow.com/questions/42181045", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1675615/" ]
This question is a superset of [How do I rebase a chain of local git branches?](https://stackoverflow.com/questions/20834648/how-do-i-rebase-a-chain-of-local-git-branches/58864534#58864534) The solution I am using today is a tool called [git-chain](https://github.com/Shopify/git-chain) which aims to solve this problem...
In order to at least find out *which branches* you will have to update after the initial rebase, you can run ``` $ git branch --contains <commit A> ```
42,181,045
I have something like this: ``` A //branch 1 \ B - C //branch 2 \ D //branch 3 ``` And I would like to get something like this: ``` A - E //branch_1 \ B' - C' //branch_2 \ D' //branch_3 ``` I would like to perform a command and rebase all branches at once...
2017/02/11
[ "https://Stackoverflow.com/questions/42181045", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1675615/" ]
This question is a superset of [How do I rebase a chain of local git branches?](https://stackoverflow.com/questions/20834648/how-do-i-rebase-a-chain-of-local-git-branches/58864534#58864534) The solution I am using today is a tool called [git-chain](https://github.com/Shopify/git-chain) which aims to solve this problem...
The git-branchless suite of tools can neatly solve this problem: ``` $ git checkout branch1 $ git commit -m 'E' $ git move -s B -d branch1 # the above is the same as the following, # because `branch1` is already checked out: $ git move -s B # or, if you want to address branches instead of commits # (this will also ...
33,352,386
i have this following code: ``` for ( int i = 0 ; i < 100 ; i++) for (int j = 0 ; j < 80 ; j ++) { ... } ``` i splitted it to 8 threads. ``` pthread_t thread1, thread2,thread3,thread4,thread5,thread6,thread7,thread8; int rc1,rc2,rc3,rc4,rc5,rc6,rc7,rc8; struct threads { ... } void *Prin...
2015/10/26
[ "https://Stackoverflow.com/questions/33352386", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2921443/" ]
`pthread_join(thread1,NULL);` is going to halt execution of the main thread until `thread1` finishes. You need to move all of the `pthread_join`s to after you construct all of the threads so they can all run concurrently. You are also using `thread1` for every `pthread_create(&thread1, NULL,PrintHello,threads);`. You ...
Besides of what @NathanOliver said, keep in mind that spawning a thread comes at a significant cost, so whatever work you intend the threads to do, it has to be more costly than the penalty you get for actually spawning all these threads. So if your `PrintHello` method actually does exactly that, you will probably stil...
33,352,386
i have this following code: ``` for ( int i = 0 ; i < 100 ; i++) for (int j = 0 ; j < 80 ; j ++) { ... } ``` i splitted it to 8 threads. ``` pthread_t thread1, thread2,thread3,thread4,thread5,thread6,thread7,thread8; int rc1,rc2,rc3,rc4,rc5,rc6,rc7,rc8; struct threads { ... } void *Prin...
2015/10/26
[ "https://Stackoverflow.com/questions/33352386", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2921443/" ]
`pthread_join(thread1,NULL);` is going to halt execution of the main thread until `thread1` finishes. You need to move all of the `pthread_join`s to after you construct all of the threads so they can all run concurrently. You are also using `thread1` for every `pthread_create(&thread1, NULL,PrintHello,threads);`. You ...
Additionally to @NathanOliver and @JustSid it is not really great to define 8 threads separatly and write 8 times the same code if they all do the same work. Much better to use something like ``` pthread_t threadlist[8]; int results[8]; ``` To initialize it a simple for loop will do. ``` for(int i = 0; i < 8; i++) ...
33,352,386
i have this following code: ``` for ( int i = 0 ; i < 100 ; i++) for (int j = 0 ; j < 80 ; j ++) { ... } ``` i splitted it to 8 threads. ``` pthread_t thread1, thread2,thread3,thread4,thread5,thread6,thread7,thread8; int rc1,rc2,rc3,rc4,rc5,rc6,rc7,rc8; struct threads { ... } void *Prin...
2015/10/26
[ "https://Stackoverflow.com/questions/33352386", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2921443/" ]
Besides of what @NathanOliver said, keep in mind that spawning a thread comes at a significant cost, so whatever work you intend the threads to do, it has to be more costly than the penalty you get for actually spawning all these threads. So if your `PrintHello` method actually does exactly that, you will probably stil...
Additionally to @NathanOliver and @JustSid it is not really great to define 8 threads separatly and write 8 times the same code if they all do the same work. Much better to use something like ``` pthread_t threadlist[8]; int results[8]; ``` To initialize it a simple for loop will do. ``` for(int i = 0; i < 8; i++) ...
49,649,080
I am currently coding an autocompletion component in Javascript which completes two input fields `plz` (postal code) and `ort` (city) based on postal code. The autocomplete fires as soon as you have entered 3 digits. Now sadly many postal codes in Germany do not work as identifiers - several small cities can all have ...
2018/04/04
[ "https://Stackoverflow.com/questions/49649080", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3744304/" ]
I would simply add this on cursor up and cursor down at the end: ``` suggestList.scrollTop = suggestList.querySelector('.active').offsetTop; ``` It will make the list scroll with the active element. Full code: ```js let plz = [{"plz":"56244","ort":"Rückeroth","bundesland":"Rheinland-Pfalz","kreis":"Westerwaldkreis...
For those interested, here's how I ended up implementing it: ```js let plz = [{"plz":"56244","ort":"Rückeroth","bundesland":"Rheinland-Pfalz","kreis":"Westerwaldkreis"},{"plz":"56244","ort":"Ötzingen","bundesland":"Rheinland-Pfalz","kreis":"Westerwaldkreis"},{"plz":"56244","ort":"Niedersayn","bundesland":"Rheinland-Pf...
8,522
My mom and I have kept in touch with my ex's parents, mostly his mom "Suzanne" and grandma. So we wanted and decided to send a Christmas card. My mom also wanted to make something for Suzanne, which she thought she would appreciate. (My mom is into crafts and is really good at sewing). She also wanted to send grandma ...
2017/12/28
[ "https://interpersonal.stackexchange.com/questions/8522", "https://interpersonal.stackexchange.com", "https://interpersonal.stackexchange.com/users/4084/" ]
You don't owe Suzanne an explanation or an apology. The ball is in Suzanne's court. You sent a gift, she should send a thank you note. I would not email to ask if she enjoyed the gifts since you know that she received them. If you do decide to email, you don't need to bring up the delay in opening the package or that...
First of all, I'd just let it drop in this case. I don't see any good way to ask about it here without causing awkwardness. I mean, if there were high stakes, I'd probably suggest something that would only be a little bit awkward, but here, it seems different. Suzanne should absolutely make sure to thank you, obviously...
8,522
My mom and I have kept in touch with my ex's parents, mostly his mom "Suzanne" and grandma. So we wanted and decided to send a Christmas card. My mom also wanted to make something for Suzanne, which she thought she would appreciate. (My mom is into crafts and is really good at sewing). She also wanted to send grandma ...
2017/12/28
[ "https://interpersonal.stackexchange.com/questions/8522", "https://interpersonal.stackexchange.com", "https://interpersonal.stackexchange.com/users/4084/" ]
You don't owe Suzanne an explanation or an apology. The ball is in Suzanne's court. You sent a gift, she should send a thank you note. I would not email to ask if she enjoyed the gifts since you know that she received them. If you do decide to email, you don't need to bring up the delay in opening the package or that...
A gift is a gift. That means, it is given freely, not on a basis of an obligation. You don't owe anyone a gift. If someone thinks you owe him a gift, it is his problem not yours. So you don't owe any explanation, let alone apology to anyone for not having given them a gift. And not to open the package in order that som...
72,892,606
For compliance reasons we want to block SQL analysts from running `SELECT *` on a table. Instead, we want to force them to explicitly ask for the columns they want to select. How can I enforce this with Snowflake? I saw a tip for SQL server using a calculated column, does Snowflake have an equivalent? [![enter image ...
2022/07/07
[ "https://Stackoverflow.com/questions/72892606", "https://Stackoverflow.com", "https://Stackoverflow.com/users/132438/" ]
Sure, you can create tables with derived/computed columns in Snowflake: ```sql create or replace table mytable ( i number, s string , no_select_star number as (1/0)); ``` Once that table has data, you won't be able to run `select *` on it, as the division by 0 is an invalid number: [![enter image descriptio...
Here's an alternative approach. 1. No dodgy columns 2. No schema pollution 3. Education message to user customisable 4. Native Snowflake functionality 5. Handles '\*' in any position (select col , \* ...) 6. Does take more thought to set up -> must be applied to each column 7. Can update ALL your tables with new error...
72,892,606
For compliance reasons we want to block SQL analysts from running `SELECT *` on a table. Instead, we want to force them to explicitly ask for the columns they want to select. How can I enforce this with Snowflake? I saw a tip for SQL server using a calculated column, does Snowflake have an equivalent? [![enter image ...
2022/07/07
[ "https://Stackoverflow.com/questions/72892606", "https://Stackoverflow.com", "https://Stackoverflow.com/users/132438/" ]
> > *it's a workaround and by definition workarounds are not ideal solutions. What I'm wondering is if there's some way to get a message to the user that it's the select \* that's causing the error. I tried a JS UDF that throws an error, but that can't be used as a default for a column.* > > > It is possible to us...
Here's an alternative approach. 1. No dodgy columns 2. No schema pollution 3. Education message to user customisable 4. Native Snowflake functionality 5. Handles '\*' in any position (select col , \* ...) 6. Does take more thought to set up -> must be applied to each column 7. Can update ALL your tables with new error...
72,892,606
For compliance reasons we want to block SQL analysts from running `SELECT *` on a table. Instead, we want to force them to explicitly ask for the columns they want to select. How can I enforce this with Snowflake? I saw a tip for SQL server using a calculated column, does Snowflake have an equivalent? [![enter image ...
2022/07/07
[ "https://Stackoverflow.com/questions/72892606", "https://Stackoverflow.com", "https://Stackoverflow.com/users/132438/" ]
Why not use a row access policy, instead? It might take some tweaking, but you could create a row access policy similar to: ``` create or replace row access policy test_policy as (val varchar) returns boolean -> case when lower(current_statement()) like '%select%*%' then false else true end; ``` Applying th...
Here's an alternative approach. 1. No dodgy columns 2. No schema pollution 3. Education message to user customisable 4. Native Snowflake functionality 5. Handles '\*' in any position (select col , \* ...) 6. Does take more thought to set up -> must be applied to each column 7. Can update ALL your tables with new error...
20,426,086
Hi I am trying to compile a child class, Car.java that extends the abstract class Vehicle.java and also implements the interface Comparable. I am getting the following errors when I try to compile the Car.java class: Car is not abstract and does not override Abstract Method get PassengerCapacity() in Vehicle, cannot ...
2013/12/06
[ "https://Stackoverflow.com/questions/20426086", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3074723/" ]
You have to implement `getPassengerCapacity()` method in your `Car` class or Mark your `Car` class as `abstract`. You cannot extend an abstract class and leave a method without implementing the body. If you don't want to implement that method, then this class needs to be marked as `abstract` as well.
your error message states that your class Car must implement the abstract method PassengerCapacity() defined in Vehicle. If you think you've done it may be you just mistyped a keyword in the signature of the method ?
20,426,086
Hi I am trying to compile a child class, Car.java that extends the abstract class Vehicle.java and also implements the interface Comparable. I am getting the following errors when I try to compile the Car.java class: Car is not abstract and does not override Abstract Method get PassengerCapacity() in Vehicle, cannot ...
2013/12/06
[ "https://Stackoverflow.com/questions/20426086", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3074723/" ]
You have to implement `getPassengerCapacity()` method in your `Car` class or Mark your `Car` class as `abstract`. You cannot extend an abstract class and leave a method without implementing the body. If you don't want to implement that method, then this class needs to be marked as `abstract` as well.
The existing answers are good - but just to add, if you use the @override annotation where you implement the abstract methods then you will immediately get an error at that point if you get something wrong in the method signature.
34,752,085
How can I simplify those three simple if conditions? ``` if(v.x < 0) { v.x *= -1; } if(v.y < 0) { v.y *= -1; } if(v.z < 0) { v.z *= -1; } ```
2016/01/12
[ "https://Stackoverflow.com/questions/34752085", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5586664/" ]
``` #include <stdlib.h> ... v.x = abs(v.x); v.y = abs(v.y); v.z = abs(v.z); ``` Or `labs`, `llabs`, `fabs` (`<math.h>`), etc. depending of type of your numbers.
You can do something like this : ``` v.x = (v.x < 0) ? (v.x * -1) : (v.x) ; v.y = (v.y < 0) ? (v.y * -1) : (v.y) ; v.z = (v.z < 0) ? (v.z * -1) : (v.z) ; ``` This uses the C [ternary operator](https://en.wikipedia.org/wiki/%3F:).
1,166,250
I have Ubuntu 19.04 dual booted alongside Windows 10. I had not used my PC for a month. The last time I used my PC, Ubuntu was working great. Today (after a month), when I turned on my PC, the boot process got stuck on a black screen with some text written on it. I don't understand what is written (too much technical t...
2019/08/16
[ "https://askubuntu.com/questions/1166250", "https://askubuntu.com", "https://askubuntu.com/users/851736/" ]
we can find the solution in this part of the error: ``` /dev/sda10: UNEXPECTED INCONSISTENCY: RUN fsck MANUALLY. (i.e., without -a or -p options) fsck exited with status code 4 The root filesystem on /dev/sda10 requires a manual fsck Busybox v1.227.2 (Ubuntu 1:1.27.2-2ubuntu7) built in shell (ash) Enter 'help...
Run the following command to try to fix the error: ``` sudo fsck -fy /dev/sda10 ```
39,418,627
Actually, i have a list with image URIs. Inside a foreach-loop i create Image objects from these URIs like this: ``` foreach (Uri imageUri in uriList) { BitmapImage bmi = new BitmapImage(new Uri(imageUri)); Image image = new Image(); image.source = bmi; flipView.Items.Add(image); } ``` Now the probl...
2016/09/09
[ "https://Stackoverflow.com/questions/39418627", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5990549/" ]
Actually working ================ If you want to extract text: * import Presentation from pptx (pip install python-pptx) * for each file in the directory (using glob module) * look in every slides and in every shape in each slide * if there is a shape with text attribute, print the shape.text --- ``` from pptx impo...
`python-pptx` can be used to do what you propose. Just at a high level, you would do something like this (not working code, just and idea of overall approach): ``` from pptx import Presentation for pptx_filename in directory: prs = Presentation(pptx_filename) for slide in prs.slides: for shape in slid...
39,418,627
Actually, i have a list with image URIs. Inside a foreach-loop i create Image objects from these URIs like this: ``` foreach (Uri imageUri in uriList) { BitmapImage bmi = new BitmapImage(new Uri(imageUri)); Image image = new Image(); image.source = bmi; flipView.Items.Add(image); } ``` Now the probl...
2016/09/09
[ "https://Stackoverflow.com/questions/39418627", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5990549/" ]
**tika-python** A Python port of the Apache Tika library, According to the documentation Apache tika supports text extraction from over 1500 file formats. **Note:** It also works charmingly with **pyinstaller** Install with pip : ``` pip install tika ``` **Sample:** ``` #!/usr/bin/env python from tika import p...
`python-pptx` can be used to do what you propose. Just at a high level, you would do something like this (not working code, just and idea of overall approach): ``` from pptx import Presentation for pptx_filename in directory: prs = Presentation(pptx_filename) for slide in prs.slides: for shape in slid...
39,418,627
Actually, i have a list with image URIs. Inside a foreach-loop i create Image objects from these URIs like this: ``` foreach (Uri imageUri in uriList) { BitmapImage bmi = new BitmapImage(new Uri(imageUri)); Image image = new Image(); image.source = bmi; flipView.Items.Add(image); } ``` Now the probl...
2016/09/09
[ "https://Stackoverflow.com/questions/39418627", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5990549/" ]
`python-pptx` can be used to do what you propose. Just at a high level, you would do something like this (not working code, just and idea of overall approach): ``` from pptx import Presentation for pptx_filename in directory: prs = Presentation(pptx_filename) for slide in prs.slides: for shape in slid...
**Textract-Plus** Use textract-plus which can extract text from most of the document extensions including pptx and pptm. [refer docs](https://textract-plus.readthedocs.io/en/latest/index.html) Install- ``` pip install textract-plus ``` Sample- ``` import textractplus as tp text=tp.process('path/to/yourfile.pptx')...
39,418,627
Actually, i have a list with image URIs. Inside a foreach-loop i create Image objects from these URIs like this: ``` foreach (Uri imageUri in uriList) { BitmapImage bmi = new BitmapImage(new Uri(imageUri)); Image image = new Image(); image.source = bmi; flipView.Items.Add(image); } ``` Now the probl...
2016/09/09
[ "https://Stackoverflow.com/questions/39418627", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5990549/" ]
`python-pptx` can be used to do what you propose. Just at a high level, you would do something like this (not working code, just and idea of overall approach): ``` from pptx import Presentation for pptx_filename in directory: prs = Presentation(pptx_filename) for slide in prs.slides: for shape in slid...
``` import os import textract files_csv = [] your_dir = '.' for f in os.listdir(your_dir): if f.endswith('pptx') or f.endswith('pptm'): text = tp.process(os.path.join('sample.pptx')) print(text) ```
39,418,627
Actually, i have a list with image URIs. Inside a foreach-loop i create Image objects from these URIs like this: ``` foreach (Uri imageUri in uriList) { BitmapImage bmi = new BitmapImage(new Uri(imageUri)); Image image = new Image(); image.source = bmi; flipView.Items.Add(image); } ``` Now the probl...
2016/09/09
[ "https://Stackoverflow.com/questions/39418627", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5990549/" ]
Actually working ================ If you want to extract text: * import Presentation from pptx (pip install python-pptx) * for each file in the directory (using glob module) * look in every slides and in every shape in each slide * if there is a shape with text attribute, print the shape.text --- ``` from pptx impo...
**tika-python** A Python port of the Apache Tika library, According to the documentation Apache tika supports text extraction from over 1500 file formats. **Note:** It also works charmingly with **pyinstaller** Install with pip : ``` pip install tika ``` **Sample:** ``` #!/usr/bin/env python from tika import p...
39,418,627
Actually, i have a list with image URIs. Inside a foreach-loop i create Image objects from these URIs like this: ``` foreach (Uri imageUri in uriList) { BitmapImage bmi = new BitmapImage(new Uri(imageUri)); Image image = new Image(); image.source = bmi; flipView.Items.Add(image); } ``` Now the probl...
2016/09/09
[ "https://Stackoverflow.com/questions/39418627", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5990549/" ]
Actually working ================ If you want to extract text: * import Presentation from pptx (pip install python-pptx) * for each file in the directory (using glob module) * look in every slides and in every shape in each slide * if there is a shape with text attribute, print the shape.text --- ``` from pptx impo...
**Textract-Plus** Use textract-plus which can extract text from most of the document extensions including pptx and pptm. [refer docs](https://textract-plus.readthedocs.io/en/latest/index.html) Install- ``` pip install textract-plus ``` Sample- ``` import textractplus as tp text=tp.process('path/to/yourfile.pptx')...
39,418,627
Actually, i have a list with image URIs. Inside a foreach-loop i create Image objects from these URIs like this: ``` foreach (Uri imageUri in uriList) { BitmapImage bmi = new BitmapImage(new Uri(imageUri)); Image image = new Image(); image.source = bmi; flipView.Items.Add(image); } ``` Now the probl...
2016/09/09
[ "https://Stackoverflow.com/questions/39418627", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5990549/" ]
Actually working ================ If you want to extract text: * import Presentation from pptx (pip install python-pptx) * for each file in the directory (using glob module) * look in every slides and in every shape in each slide * if there is a shape with text attribute, print the shape.text --- ``` from pptx impo...
``` import os import textract files_csv = [] your_dir = '.' for f in os.listdir(your_dir): if f.endswith('pptx') or f.endswith('pptm'): text = tp.process(os.path.join('sample.pptx')) print(text) ```
39,418,627
Actually, i have a list with image URIs. Inside a foreach-loop i create Image objects from these URIs like this: ``` foreach (Uri imageUri in uriList) { BitmapImage bmi = new BitmapImage(new Uri(imageUri)); Image image = new Image(); image.source = bmi; flipView.Items.Add(image); } ``` Now the probl...
2016/09/09
[ "https://Stackoverflow.com/questions/39418627", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5990549/" ]
**tika-python** A Python port of the Apache Tika library, According to the documentation Apache tika supports text extraction from over 1500 file formats. **Note:** It also works charmingly with **pyinstaller** Install with pip : ``` pip install tika ``` **Sample:** ``` #!/usr/bin/env python from tika import p...
**Textract-Plus** Use textract-plus which can extract text from most of the document extensions including pptx and pptm. [refer docs](https://textract-plus.readthedocs.io/en/latest/index.html) Install- ``` pip install textract-plus ``` Sample- ``` import textractplus as tp text=tp.process('path/to/yourfile.pptx')...
39,418,627
Actually, i have a list with image URIs. Inside a foreach-loop i create Image objects from these URIs like this: ``` foreach (Uri imageUri in uriList) { BitmapImage bmi = new BitmapImage(new Uri(imageUri)); Image image = new Image(); image.source = bmi; flipView.Items.Add(image); } ``` Now the probl...
2016/09/09
[ "https://Stackoverflow.com/questions/39418627", "https://Stackoverflow.com", "https://Stackoverflow.com/users/5990549/" ]
**tika-python** A Python port of the Apache Tika library, According to the documentation Apache tika supports text extraction from over 1500 file formats. **Note:** It also works charmingly with **pyinstaller** Install with pip : ``` pip install tika ``` **Sample:** ``` #!/usr/bin/env python from tika import p...
``` import os import textract files_csv = [] your_dir = '.' for f in os.listdir(your_dir): if f.endswith('pptx') or f.endswith('pptm'): text = tp.process(os.path.join('sample.pptx')) print(text) ```
54,318,041
I am trying to add some Open Graph tags to each Article of my blog that is hosted in Wordpress. This code is working when I run "npm run dev", but when I run "npm run generate && firebase deploy" is not doing the same. This is the code that I am using: ``` head() { return { title: 'This', meta: [ { hid...
2019/01/22
[ "https://Stackoverflow.com/questions/54318041", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7657911/" ]
My problem was using `spa` (single page application) mode instead of `universal`. My working settings in `nuxt.config.js`: ```js export default { mode: 'universal', // changed from mode: 'spa' ... } ```
I would try using the [nuxt-seo](https://www.npmjs.com/package/nuxt-seo) package. It adds full support for setting the most common social media tags, including auto generating canonical tags for each of your articles/pages. You can [checkout the docs](https://nuxt-seo.frostbutter.com) site, which has a full [nuxt blog...
840,741
I have some Delphi code that did this needs to be re-coded in C#: ``` procedure TDocSearchX.Decompress; var BlobStream:TBlobStream; DecompressionStream:TDecompressionStream; FileStream:TFileStream; Buffer:array[0..2047] of byte; count:integer; begin BlobStream:=TBlobStream.Create(DocQueryDATA,bmRead); Decompre...
2009/05/08
[ "https://Stackoverflow.com/questions/840741", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
It looks like `TDecompressionStream` probably uses ZLib. Here is a .NET library for ZLIB: <http://www.componentace.com/zlib_.NET.htm>
To my knowledge there is no .Net Framework equivalent to the TDecompressionStream class. Are you able to write a small converter app in Delphi that decompresses the image? Then you are free to use whatever compression library (e.g. SharpZipLib) supporting .Net within your C# code.
840,741
I have some Delphi code that did this needs to be re-coded in C#: ``` procedure TDocSearchX.Decompress; var BlobStream:TBlobStream; DecompressionStream:TDecompressionStream; FileStream:TFileStream; Buffer:array[0..2047] of byte; count:integer; begin BlobStream:=TBlobStream.Create(DocQueryDATA,bmRead); Decompre...
2009/05/08
[ "https://Stackoverflow.com/questions/840741", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
To my knowledge there is no .Net Framework equivalent to the TDecompressionStream class. Are you able to write a small converter app in Delphi that decompresses the image? Then you are free to use whatever compression library (e.g. SharpZipLib) supporting .Net within your C# code.
If you have to keep the same compression already used, roll the Delphi decompression routine into a DLL and use it from C# using PInvoke. If you want to replace the compression, write a batch process to extract the Delphi compressed images, decompress them to their original format and re-compress them with your favour...
840,741
I have some Delphi code that did this needs to be re-coded in C#: ``` procedure TDocSearchX.Decompress; var BlobStream:TBlobStream; DecompressionStream:TDecompressionStream; FileStream:TFileStream; Buffer:array[0..2047] of byte; count:integer; begin BlobStream:=TBlobStream.Create(DocQueryDATA,bmRead); Decompre...
2009/05/08
[ "https://Stackoverflow.com/questions/840741", "https://Stackoverflow.com", "https://Stackoverflow.com/users/-1/" ]
It looks like `TDecompressionStream` probably uses ZLib. Here is a .NET library for ZLIB: <http://www.componentace.com/zlib_.NET.htm>
If you have to keep the same compression already used, roll the Delphi decompression routine into a DLL and use it from C# using PInvoke. If you want to replace the compression, write a batch process to extract the Delphi compressed images, decompress them to their original format and re-compress them with your favour...
22,908,653
I have a async function, which can recurse into itself. I'm adding jQuery deferreds to an array each time the function runs, an use `$.when()` to check if all promises have resolved. My issue is that I can't seem to do this without an arbitary timeout, as I simply don't know when the function stops recursing and addin...
2014/04/07
[ "https://Stackoverflow.com/questions/22908653", "https://Stackoverflow.com", "https://Stackoverflow.com/users/808699/" ]
Do push to `promises` only synchronously, so that you know when you are finished. Since your function is recursive and returns a promise, you can just use the result promises of the recursive calls for this. Use `$.when()` only for the results of the *current* recursion level, not for all promises in the call stack. A...
Just to add to what Bergi said, and to clarify the underlying issue: There is no way to know when no more promises will be chained to a promise with `.then`. Just like there is no way to know from a function where it returns: ``` myPromise().then(function(vale){ // I have no easy way to know when handlers wil...
5,241,915
When using simple-xml, is there a way to let it ignore the nodes it does not recognize?
2011/03/09
[ "https://Stackoverflow.com/questions/5241915", "https://Stackoverflow.com", "https://Stackoverflow.com/users/496949/" ]
Yes. If you annotate your class with `@Root(strict=false)` it will ignore any elements that are not mapped. See the documentation for additional details: <http://simple.sourceforge.net/download/stream/doc/tutorial/tutorial.php#loosemap> On a related note, you can also handle optional elements using `@Element(required...
Discliamer: If simple-xml means anything but a [simple XML](http://en.wikipedia.org/wiki/Simple_XML) then the following answer is irrelevant First, look at: <http://www.w3.org/TR/xmlschema-1/#element-any> An example schema allowing such any elements is: ``` <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs=...
2,242,333
I have tried to substitute $\tan (x)$ and $\cot (x)$ with sine and cosine and it got really messy $$1-\frac{\sin^2x}{1+\cot(x)}-\frac{\cos^2x}{1+\tan x}=?$$ **a)** $1$ **b)** $\sin^2x$ **c)** $\sin (x)+\cos (x)$ **d)** $\sin (x)\cdot \cos (x)$
2017/04/19
[ "https://math.stackexchange.com/questions/2242333", "https://math.stackexchange.com", "https://math.stackexchange.com/users/411175/" ]
We can write this as : here I put $$\cot x= \frac{\cos x}{\sin x}$$ and $$\tan x= \frac{\sin x}{\cos x}$$ $$\sin^2x+\cos^2x-\frac{\sin^3x}{\sin x+\cos x}-\frac{\cos^3x}{\sin x+\cos x}$$ Now take take the $\operatorname{lcm}$ and you'll get something like this: $$\frac {\sin^3x+\cos^3x+ \sin x\cos^2x+\cos x \sin^2x-\...
note that $$\cot(x)=\frac{\cos(x)}{\sin(x)}$$ and $$\tan(x)=\frac{\sin(x)}{\cos(x)}$$ the result is $$\sin(x)\cos(x)$$ we have $$\frac{(1+\cot(x))(1+\tan(x))-\sin^2(x)(1+\tan(x))-\cos^2(x)(1+\cot(x))}{(1+\cot(x))(1+\tan(x))}$$ multiplying out and we otain $$\frac{1+\frac{\cos(x)}{\sin(x)}+\frac{\sin(x)}{\cos(x)}-\frac{...
184,305
Which one is grammatically correct or better to use? About before pronoun: > > I haven’t listened to the album about which you were talking. > > > About after verb: > > I haven’t listened to the album which you were talking about. > > >
2018/10/31
[ "https://ell.stackexchange.com/questions/184305", "https://ell.stackexchange.com", "https://ell.stackexchange.com/users/6341/" ]
They're both technically correct. I would personally prefer the second one, though, as it sounds more natural. Students of English used to be taught that it was bad grammar to end a sentence with a preposition (like "about"). Following this rule produces sentences like your first example ("about which you were talking...
Ah, well, this gets into the ["ending a sentence with a preposition" debate](https://www.merriam-webster.com/words-at-play/prepositions-ending-a-sentence-with). Some people think it's fine, others don't like it. Personally, I'm in the middle and avoid doing it if possible -- unless the alternative is even more awkwar...
16,498
We upgrade to web 8 and upgraded an existing .NET DD4T 1.31 website to .NET DD4T 2.0. We have made necessary changes to compile the Website with latest DD4T 2.0 DLL and web 8 DLLs and JAR files successfully. While Most of the websites works few of the Page templates which uses RenderComponentPresentationsByView is givi...
2017/02/11
[ "https://tridion.stackexchange.com/questions/16498", "https://tridion.stackexchange.com", "https://tridion.stackexchange.com/users/1222/" ]
I've found the issues with the DD4T 2.x Core. It happens when using Dynamic Component Presentations. The 1.x Templates don't render Component Template data for the Dynamic Component Presentations, only the Component data. However, the Component Template data is still in the Page. I've made a small fix for this and te...
Have you checked your logs - ultimately RenderComponentPresentationsByView() calls into the DefaultComponentPresentationRenderer (unless you've provided you own IComponentPresentationRenderer implementation)? Where DefaultComponentPresentationRenderer [checks if the template of the presentation uses a view](https://gi...
597,675
In the datasheet of the "MC33887 5.0 A H-bridge with load current feedback" there is a section on "Output avalanche protection", in which it is explained that an inductive flyback event, namely when the outputs are suddenly disabled and V+ is lost, could result in electrical overstress of the drivers. To prevent this,...
2021/12/03
[ "https://electronics.stackexchange.com/questions/597675", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/301342/" ]
The TC is just like an ordinary transformer, but it doesn't have an iron core. At the time NT hadn't a HF power source, so he used a rotary spark to load the capacitor that caused the primary L and C to start oscillating at HF. Then he used the secondary circuit that has a matched resonating frequency. Since the impeda...
> > We know that the Tesla coil has a low coupling coefficient so most of the energy is transferred by using electric resonance. > > > It has a large spacing between the primary and the high voltage end of the secondary for electrical insulation. This spacing means that the coupling coefficient ends up in the 0.1 ...
597,675
In the datasheet of the "MC33887 5.0 A H-bridge with load current feedback" there is a section on "Output avalanche protection", in which it is explained that an inductive flyback event, namely when the outputs are suddenly disabled and V+ is lost, could result in electrical overstress of the drivers. To prevent this,...
2021/12/03
[ "https://electronics.stackexchange.com/questions/597675", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/301342/" ]
> > *How exactly does it transfer the energy?* > > > It transfers energy using magnetic induction. The fact that the coupling is small serves only to limit the energy transferred. And, the fact that the coupling is small allows the primary and secondary coils to have rather large resonant peaks at the same frequen...
> > We know that the Tesla coil has a low coupling coefficient so most of the energy is transferred by using electric resonance. > > > It has a large spacing between the primary and the high voltage end of the secondary for electrical insulation. This spacing means that the coupling coefficient ends up in the 0.1 ...
6,840,579
I am using tabcontainer control of Ajaxtoolkit.I want to load aspx page for each of the tabs asynchronously i.e when i click on tab at that time an aspx page should be loaded
2011/07/27
[ "https://Stackoverflow.com/questions/6840579", "https://Stackoverflow.com", "https://Stackoverflow.com/users/367339/" ]
Valid from Symfony v2.1 through v6.0+ If you want the base URL to a Symfony application, you should use `getSchemeAndHttpHost()` concatenated together with `getBaseUrl()`, similar to how `getUri()` works, except without the router path and query string. ``` {{ app.request.schemeAndHttpHost ~ app.request.baseUrl }} `...
Also for js/css/image urls there's handy function asset() ``` <img src="{{ asset('image/logo.png') }}"/> ``` This creates an absolute url starting with `/`.
6,840,579
I am using tabcontainer control of Ajaxtoolkit.I want to load aspx page for each of the tabs asynchronously i.e when i click on tab at that time an aspx page should be loaded
2011/07/27
[ "https://Stackoverflow.com/questions/6840579", "https://Stackoverflow.com", "https://Stackoverflow.com/users/367339/" ]
Base url is defined inside `Symfony\Component\Routing\RequestContext`. It can be fetched from controller like this: ``` $this->container->get('router')->getContext()->getBaseUrl() ```
Instead of passing variable to template globally, you can define a base template and render the 'global part' in it. The base template can be inherited. Example of rendering template From the symfony Documentation: ``` <div id="sidebar"> {% render "AcmeArticleBundle:Article:recentArticles" with {'max': 3} %} </div>...
6,840,579
I am using tabcontainer control of Ajaxtoolkit.I want to load aspx page for each of the tabs asynchronously i.e when i click on tab at that time an aspx page should be loaded
2011/07/27
[ "https://Stackoverflow.com/questions/6840579", "https://Stackoverflow.com", "https://Stackoverflow.com/users/367339/" ]
In Symfony 5 and in the common situation of a controller method use the injected *Request* object: ``` public function controllerFunction(Request $request, LoggerInterface $logger) ... $scheme = $request->getSchemeAndHttpHost(); $logger->info('Domain is: ' . $scheme); ... //prepare to render $retarray = ar...
In one situation involving a multi-domain application, `app.request.getHttpHost` helped me out. It returns something like `example.com` or `subdomain.example.com` (or `example.com:8000` when the port is not standard). This was in Symfony 3.4.
6,840,579
I am using tabcontainer control of Ajaxtoolkit.I want to load aspx page for each of the tabs asynchronously i.e when i click on tab at that time an aspx page should be loaded
2011/07/27
[ "https://Stackoverflow.com/questions/6840579", "https://Stackoverflow.com", "https://Stackoverflow.com/users/367339/" ]
Why do you need to get this root url ? Can't you generate directly absolute URL's ? ``` {{ url('_demo_hello', { 'name': 'Thomas' }) }} ``` This Twig code will generate the full http:// url to the \_demo\_hello route. In fact, getting the base url of the website is only getting the full url of the homepage route : ...
For Symfony 2.3+, to get the base url in a controller should be ``` $this->get('request')->getSchemeAndHttpHost(); ```
6,840,579
I am using tabcontainer control of Ajaxtoolkit.I want to load aspx page for each of the tabs asynchronously i.e when i click on tab at that time an aspx page should be loaded
2011/07/27
[ "https://Stackoverflow.com/questions/6840579", "https://Stackoverflow.com", "https://Stackoverflow.com/users/367339/" ]
Valid from Symfony v2.1 through v6.0+ If you want the base URL to a Symfony application, you should use `getSchemeAndHttpHost()` concatenated together with `getBaseUrl()`, similar to how `getUri()` works, except without the router path and query string. ``` {{ app.request.schemeAndHttpHost ~ app.request.baseUrl }} `...
For current Symfony version (as of writing this answer it's Symfony 4.1) do not directly access the service container as done in some of the other answers. Instead (unless you don't use the standard services configuration), inject the request object by type-hinting. ``` <?php namespace App\Service; use Symfony\Comp...
6,840,579
I am using tabcontainer control of Ajaxtoolkit.I want to load aspx page for each of the tabs asynchronously i.e when i click on tab at that time an aspx page should be loaded
2011/07/27
[ "https://Stackoverflow.com/questions/6840579", "https://Stackoverflow.com", "https://Stackoverflow.com/users/367339/" ]
Why do you need to get this root url ? Can't you generate directly absolute URL's ? ``` {{ url('_demo_hello', { 'name': 'Thomas' }) }} ``` This Twig code will generate the full http:// url to the \_demo\_hello route. In fact, getting the base url of the website is only getting the full url of the homepage route : ...
This is now available for free in twig templates (tested on sf2 version 2.0.14) ``` {{ app.request.getBaseURL() }} ``` In later Symfony versions (tested on 2.5), try : ``` {{ app.request.getSchemeAndHttpHost() }} ```
6,840,579
I am using tabcontainer control of Ajaxtoolkit.I want to load aspx page for each of the tabs asynchronously i.e when i click on tab at that time an aspx page should be loaded
2011/07/27
[ "https://Stackoverflow.com/questions/6840579", "https://Stackoverflow.com", "https://Stackoverflow.com/users/367339/" ]
You can use the new request method `getSchemeAndHttpHost()`: ``` {{ app.request.getSchemeAndHttpHost() }} ```
In one situation involving a multi-domain application, `app.request.getHttpHost` helped me out. It returns something like `example.com` or `subdomain.example.com` (or `example.com:8000` when the port is not standard). This was in Symfony 3.4.
6,840,579
I am using tabcontainer control of Ajaxtoolkit.I want to load aspx page for each of the tabs asynchronously i.e when i click on tab at that time an aspx page should be loaded
2011/07/27
[ "https://Stackoverflow.com/questions/6840579", "https://Stackoverflow.com", "https://Stackoverflow.com/users/367339/" ]
Also for js/css/image urls there's handy function asset() ``` <img src="{{ asset('image/logo.png') }}"/> ``` This creates an absolute url starting with `/`.
In Symfony 5 and in the common situation of a controller method use the injected *Request* object: ``` public function controllerFunction(Request $request, LoggerInterface $logger) ... $scheme = $request->getSchemeAndHttpHost(); $logger->info('Domain is: ' . $scheme); ... //prepare to render $retarray = ar...
6,840,579
I am using tabcontainer control of Ajaxtoolkit.I want to load aspx page for each of the tabs asynchronously i.e when i click on tab at that time an aspx page should be loaded
2011/07/27
[ "https://Stackoverflow.com/questions/6840579", "https://Stackoverflow.com", "https://Stackoverflow.com/users/367339/" ]
For current Symfony version (as of writing this answer it's Symfony 4.1) do not directly access the service container as done in some of the other answers. Instead (unless you don't use the standard services configuration), inject the request object by type-hinting. ``` <?php namespace App\Service; use Symfony\Comp...
In one situation involving a multi-domain application, `app.request.getHttpHost` helped me out. It returns something like `example.com` or `subdomain.example.com` (or `example.com:8000` when the port is not standard). This was in Symfony 3.4.
6,840,579
I am using tabcontainer control of Ajaxtoolkit.I want to load aspx page for each of the tabs asynchronously i.e when i click on tab at that time an aspx page should be loaded
2011/07/27
[ "https://Stackoverflow.com/questions/6840579", "https://Stackoverflow.com", "https://Stackoverflow.com/users/367339/" ]
Valid from Symfony v2.1 through v6.0+ If you want the base URL to a Symfony application, you should use `getSchemeAndHttpHost()` concatenated together with `getBaseUrl()`, similar to how `getUri()` works, except without the router path and query string. ``` {{ app.request.schemeAndHttpHost ~ app.request.baseUrl }} `...
``` <base href="{{ app.request.getSchemeAndHttpHost() }}"/> ``` or from controller ``` $this->container->get('router')->getContext()->getSchemeAndHttpHost() ```
33,587,676
Trying to call Dropbox API v2. ``` Dim client = New RestClient("https://api.dropboxapi.com/2/") Dim request = New RestRequest("files/search", Method.POST) request.AddHeader("Authorization", "Bearer " & MYTOKEN) request.AddHeader("Content-Type", "application/json") 'request.RequestFormat = DataFormat.Json 'request.Json...
2015/11/07
[ "https://Stackoverflow.com/questions/33587676", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2105488/" ]
If my guesses are right, and this is Visual Basic code using RestSharp, then I think you need something like this (apologies if it's not quite right; I don't know VB syntax): ``` Dim client = New RestClient("https://api.dropboxapi.com/2/") Dim request = New RestRequest("files/search", Method.POST) request.AddHeader("A...
Solved it like this. There could be better ways to do it but this works for now. ``` Dim client = New RestClient("https://api.dropboxapi.com/2/") Dim request = New RestRequest("files/search", Method.POST) request.AddHeader("Authorization", "Bearer " & MYTOKEN) request.AddHeader("Content-Type", "application/json") '...
259,410
If I have multiple downloads I can have them all download simultaneously or pause one and let the other download and then when the 1st is done I manually pause it and have the second download, afterward I let both seed for a while. But How can I set it so that the 2nd torrent will start downloading only after the 1st h...
2011/03/18
[ "https://superuser.com/questions/259410", "https://superuser.com", "https://superuser.com/users/72413/" ]
For your first question: Options → Preferences → Queuing → Max. number of active downloads = 1 ![enter image description here](https://i.stack.imgur.com/uS83a.png) For the second one, under seeding goals, keep it as zero and if required, put a limit on the upload rate.
Go to Options>Preferences>Queuing You can set it there.
69,252,723
appols if this is a repeat, but I couldn't find a similar issue anywhere. I've a number of select and input elements wihtin td elements as part of a table that I want to collect the values of for some validation within Javascript. I was hoping to use getElementsByName javascript to collect said data, but it appears as ...
2021/09/20
[ "https://Stackoverflow.com/questions/69252723", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14764338/" ]
### Fixing the indices The range of your indices is inconsistent with the way you use them in the loop. You can use either of the following two possible loops, but don't mix them: ```py for n in range(1, N+1): x[n] = r**n * x[0] ``` ```py for n in range(0, N): x[n+1] = r**(n+1) * x[0] ``` ### Optimization...
The length of your array is 11, which means the last element is accessed by `x[10]`. But in the loop, the value being called when n is 10 is `x[11]` which makes it go out of range. I'm not sure about the constraints of your problem, but if you want to access `x[11]`, change the total size of the array to `x = (N+2)...
69,252,723
appols if this is a repeat, but I couldn't find a similar issue anywhere. I've a number of select and input elements wihtin td elements as part of a table that I want to collect the values of for some validation within Javascript. I was hoping to use getElementsByName javascript to collect said data, but it appears as ...
2021/09/20
[ "https://Stackoverflow.com/questions/69252723", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14764338/" ]
I think your problem that you should remember the index of any element in the `list` starting from **zero** and the index of the last element is `N - 1` where `N` is the count of the elements in the `list`. So you should make this change in your `for` loop: ``` for n in range(0, N): ``` Also, your using of `print...
The length of your array is 11, which means the last element is accessed by `x[10]`. But in the loop, the value being called when n is 10 is `x[11]` which makes it go out of range. I'm not sure about the constraints of your problem, but if you want to access `x[11]`, change the total size of the array to `x = (N+2)...
69,252,723
appols if this is a repeat, but I couldn't find a similar issue anywhere. I've a number of select and input elements wihtin td elements as part of a table that I want to collect the values of for some validation within Javascript. I was hoping to use getElementsByName javascript to collect said data, but it appears as ...
2021/09/20
[ "https://Stackoverflow.com/questions/69252723", "https://Stackoverflow.com", "https://Stackoverflow.com/users/14764338/" ]
### Fixing the indices The range of your indices is inconsistent with the way you use them in the loop. You can use either of the following two possible loops, but don't mix them: ```py for n in range(1, N+1): x[n] = r**n * x[0] ``` ```py for n in range(0, N): x[n+1] = r**(n+1) * x[0] ``` ### Optimization...
I think your problem that you should remember the index of any element in the `list` starting from **zero** and the index of the last element is `N - 1` where `N` is the count of the elements in the `list`. So you should make this change in your `for` loop: ``` for n in range(0, N): ``` Also, your using of `print...
454,414
Noise-canceling headphones can reduce a lot of ambient sound, but they are not 100% perfect. (Especially in the human vocal range.) 1. Is there any physical principle preventing the creation of perfect sound-canceling headphones? In other words, headphones that can cancel or block 100% of all external sound before it ...
2019/01/15
[ "https://physics.stackexchange.com/questions/454414", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/134671/" ]
Light waves in a linear medium such as the vacuum do not interact with each other at all, so the answer is "no".
No, photons create pressure when they interact with electrons in matter. Photon waves travel right through each other, similar to water waves, they do superimpose but only temporarily and then continue on their way.
454,414
Noise-canceling headphones can reduce a lot of ambient sound, but they are not 100% perfect. (Especially in the human vocal range.) 1. Is there any physical principle preventing the creation of perfect sound-canceling headphones? In other words, headphones that can cancel or block 100% of all external sound before it ...
2019/01/15
[ "https://physics.stackexchange.com/questions/454414", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/134671/" ]
The scattering of light by light is a very tiny quantum effect that was first observed in 2016 with high-energy photons at the Large Hadron Collider. <https://en.wikipedia.org/wiki/Two-photon_physics> Most of the time, photons do not interact with each other. When they occasionally do, they do not do so directly but ...
Light waves in a linear medium such as the vacuum do not interact with each other at all, so the answer is "no".
454,414
Noise-canceling headphones can reduce a lot of ambient sound, but they are not 100% perfect. (Especially in the human vocal range.) 1. Is there any physical principle preventing the creation of perfect sound-canceling headphones? In other words, headphones that can cancel or block 100% of all external sound before it ...
2019/01/15
[ "https://physics.stackexchange.com/questions/454414", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/134671/" ]
Light waves in a linear medium such as the vacuum do not interact with each other at all, so the answer is "no".
TLDR: no, photons do not normally react with each other. All of the answers above are technically correct (*the best kind of correct*), but I'm not sure they really explain what's going on if I'm reading your post correctly. I'll try using a toy model to illustrate some of the main features. Particles with electrical...
454,414
Noise-canceling headphones can reduce a lot of ambient sound, but they are not 100% perfect. (Especially in the human vocal range.) 1. Is there any physical principle preventing the creation of perfect sound-canceling headphones? In other words, headphones that can cancel or block 100% of all external sound before it ...
2019/01/15
[ "https://physics.stackexchange.com/questions/454414", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/134671/" ]
The scattering of light by light is a very tiny quantum effect that was first observed in 2016 with high-energy photons at the Large Hadron Collider. <https://en.wikipedia.org/wiki/Two-photon_physics> Most of the time, photons do not interact with each other. When they occasionally do, they do not do so directly but ...
No, photons create pressure when they interact with electrons in matter. Photon waves travel right through each other, similar to water waves, they do superimpose but only temporarily and then continue on their way.