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
22,856,931
I am trying to insert `java.util.Date` after converting it to java.sql.Timestamp and I am using the following snippet: ``` java.util.Date utilDate = new java.util.Date(); java.sql.Timestamp sq = new java.sql.Timestamp(utilDate.getTime()); ``` But this is giving me `sq` as `2014-04-04 13:30:17.533` Is there any way ...
2014/04/04
[ "https://Stackoverflow.com/questions/22856931", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1518078/" ]
Take a look at `SimpleDateFormat`: ``` java.util.Date utilDate = new java.util.Date(); java.sql.Timestamp sq = new java.sql.Timestamp(utilDate.getTime()); SimpleDateFormat sdf = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss"); System.out.println(sdf.format(sq)); ```
``` java.util.Date utilDate = new java.util.Date(); java.sql.Date sqlDate = new java.sql.Date(utilDate.getTime()); System.out.println("utilDate:" + utilDate); System.out.println("sqlDate:" + sqlDate); ``` This gives me the following output: ``` utilDate:Fri Apr 04 12:07:37 MSK 2014 sqlDate:2014-04-04 ```
22,856,931
I am trying to insert `java.util.Date` after converting it to java.sql.Timestamp and I am using the following snippet: ``` java.util.Date utilDate = new java.util.Date(); java.sql.Timestamp sq = new java.sql.Timestamp(utilDate.getTime()); ``` But this is giving me `sq` as `2014-04-04 13:30:17.533` Is there any way ...
2014/04/04
[ "https://Stackoverflow.com/questions/22856931", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1518078/" ]
Take a look at `SimpleDateFormat`: ``` java.util.Date utilDate = new java.util.Date(); java.sql.Timestamp sq = new java.sql.Timestamp(utilDate.getTime()); SimpleDateFormat sdf = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss"); System.out.println(sdf.format(sq)); ```
I suggest using DateUtils from apache.commons library. ``` long millis = DateUtils.truncate(utilDate, Calendar.MILLISECOND).getTime(); java.sql.Timestamp sq = new java.sql.Timestamp(millis ); ``` Edit: Fixed `Calendar.MILISECOND` to `Calendar.MILLISECOND`
22,856,931
I am trying to insert `java.util.Date` after converting it to java.sql.Timestamp and I am using the following snippet: ``` java.util.Date utilDate = new java.util.Date(); java.sql.Timestamp sq = new java.sql.Timestamp(utilDate.getTime()); ``` But this is giving me `sq` as `2014-04-04 13:30:17.533` Is there any way ...
2014/04/04
[ "https://Stackoverflow.com/questions/22856931", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1518078/" ]
You can cut off the milliseconds using a `Calendar`: ``` java.util.Date utilDate = new java.util.Date(); Calendar cal = Calendar.getInstance(); cal.setTime(utilDate); cal.set(Calendar.MILLISECOND, 0); System.out.println(new java.sql.Timestamp(utilDate.getTime())); System.out.println(new java.sql.Timestamp(cal.getTimeI...
Take a look at `SimpleDateFormat`: ``` java.util.Date utilDate = new java.util.Date(); java.sql.Timestamp sq = new java.sql.Timestamp(utilDate.getTime()); SimpleDateFormat sdf = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss"); System.out.println(sdf.format(sq)); ```
22,856,931
I am trying to insert `java.util.Date` after converting it to java.sql.Timestamp and I am using the following snippet: ``` java.util.Date utilDate = new java.util.Date(); java.sql.Timestamp sq = new java.sql.Timestamp(utilDate.getTime()); ``` But this is giving me `sq` as `2014-04-04 13:30:17.533` Is there any way ...
2014/04/04
[ "https://Stackoverflow.com/questions/22856931", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1518078/" ]
The problem is with the way you are printing the Time data ``` java.util.Date utilDate = new java.util.Date(); java.sql.Timestamp sq = new java.sql.Timestamp(utilDate.getTime()); System.out.println(sa); //this will print the milliseconds as the toString() has been written in that format SimpleDateFormat sdf = new Sim...
``` java.util.Date utilDate = new java.util.Date(); java.sql.Date sqlDate = new java.sql.Date(utilDate.getTime()); System.out.println("utilDate:" + utilDate); System.out.println("sqlDate:" + sqlDate); ``` This gives me the following output: ``` utilDate:Fri Apr 04 12:07:37 MSK 2014 sqlDate:2014-04-04 ```
22,856,931
I am trying to insert `java.util.Date` after converting it to java.sql.Timestamp and I am using the following snippet: ``` java.util.Date utilDate = new java.util.Date(); java.sql.Timestamp sq = new java.sql.Timestamp(utilDate.getTime()); ``` But this is giving me `sq` as `2014-04-04 13:30:17.533` Is there any way ...
2014/04/04
[ "https://Stackoverflow.com/questions/22856931", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1518078/" ]
The problem is with the way you are printing the Time data ``` java.util.Date utilDate = new java.util.Date(); java.sql.Timestamp sq = new java.sql.Timestamp(utilDate.getTime()); System.out.println(sa); //this will print the milliseconds as the toString() has been written in that format SimpleDateFormat sdf = new Sim...
I suggest using DateUtils from apache.commons library. ``` long millis = DateUtils.truncate(utilDate, Calendar.MILLISECOND).getTime(); java.sql.Timestamp sq = new java.sql.Timestamp(millis ); ``` Edit: Fixed `Calendar.MILISECOND` to `Calendar.MILLISECOND`
22,856,931
I am trying to insert `java.util.Date` after converting it to java.sql.Timestamp and I am using the following snippet: ``` java.util.Date utilDate = new java.util.Date(); java.sql.Timestamp sq = new java.sql.Timestamp(utilDate.getTime()); ``` But this is giving me `sq` as `2014-04-04 13:30:17.533` Is there any way ...
2014/04/04
[ "https://Stackoverflow.com/questions/22856931", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1518078/" ]
You can cut off the milliseconds using a `Calendar`: ``` java.util.Date utilDate = new java.util.Date(); Calendar cal = Calendar.getInstance(); cal.setTime(utilDate); cal.set(Calendar.MILLISECOND, 0); System.out.println(new java.sql.Timestamp(utilDate.getTime())); System.out.println(new java.sql.Timestamp(cal.getTimeI...
The problem is with the way you are printing the Time data ``` java.util.Date utilDate = new java.util.Date(); java.sql.Timestamp sq = new java.sql.Timestamp(utilDate.getTime()); System.out.println(sa); //this will print the milliseconds as the toString() has been written in that format SimpleDateFormat sdf = new Sim...
22,856,931
I am trying to insert `java.util.Date` after converting it to java.sql.Timestamp and I am using the following snippet: ``` java.util.Date utilDate = new java.util.Date(); java.sql.Timestamp sq = new java.sql.Timestamp(utilDate.getTime()); ``` But this is giving me `sq` as `2014-04-04 13:30:17.533` Is there any way ...
2014/04/04
[ "https://Stackoverflow.com/questions/22856931", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1518078/" ]
I suggest using DateUtils from apache.commons library. ``` long millis = DateUtils.truncate(utilDate, Calendar.MILLISECOND).getTime(); java.sql.Timestamp sq = new java.sql.Timestamp(millis ); ``` Edit: Fixed `Calendar.MILISECOND` to `Calendar.MILLISECOND`
``` java.util.Date utilDate = new java.util.Date(); java.sql.Date sqlDate = new java.sql.Date(utilDate.getTime()); System.out.println("utilDate:" + utilDate); System.out.println("sqlDate:" + sqlDate); ``` This gives me the following output: ``` utilDate:Fri Apr 04 12:07:37 MSK 2014 sqlDate:2014-04-04 ```
22,856,931
I am trying to insert `java.util.Date` after converting it to java.sql.Timestamp and I am using the following snippet: ``` java.util.Date utilDate = new java.util.Date(); java.sql.Timestamp sq = new java.sql.Timestamp(utilDate.getTime()); ``` But this is giving me `sq` as `2014-04-04 13:30:17.533` Is there any way ...
2014/04/04
[ "https://Stackoverflow.com/questions/22856931", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1518078/" ]
You can cut off the milliseconds using a `Calendar`: ``` java.util.Date utilDate = new java.util.Date(); Calendar cal = Calendar.getInstance(); cal.setTime(utilDate); cal.set(Calendar.MILLISECOND, 0); System.out.println(new java.sql.Timestamp(utilDate.getTime())); System.out.println(new java.sql.Timestamp(cal.getTimeI...
``` java.util.Date utilDate = new java.util.Date(); java.sql.Date sqlDate = new java.sql.Date(utilDate.getTime()); System.out.println("utilDate:" + utilDate); System.out.println("sqlDate:" + sqlDate); ``` This gives me the following output: ``` utilDate:Fri Apr 04 12:07:37 MSK 2014 sqlDate:2014-04-04 ```
22,856,931
I am trying to insert `java.util.Date` after converting it to java.sql.Timestamp and I am using the following snippet: ``` java.util.Date utilDate = new java.util.Date(); java.sql.Timestamp sq = new java.sql.Timestamp(utilDate.getTime()); ``` But this is giving me `sq` as `2014-04-04 13:30:17.533` Is there any way ...
2014/04/04
[ "https://Stackoverflow.com/questions/22856931", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1518078/" ]
You can cut off the milliseconds using a `Calendar`: ``` java.util.Date utilDate = new java.util.Date(); Calendar cal = Calendar.getInstance(); cal.setTime(utilDate); cal.set(Calendar.MILLISECOND, 0); System.out.println(new java.sql.Timestamp(utilDate.getTime())); System.out.println(new java.sql.Timestamp(cal.getTimeI...
I suggest using DateUtils from apache.commons library. ``` long millis = DateUtils.truncate(utilDate, Calendar.MILLISECOND).getTime(); java.sql.Timestamp sq = new java.sql.Timestamp(millis ); ``` Edit: Fixed `Calendar.MILISECOND` to `Calendar.MILLISECOND`
1,093,163
I am using cpufreq gnome extension and it give's me warning [irqbalance detected](https://i.stack.imgur.com/xjnKd.jpg). Is that something to worry about? And if I somehow stop irqbalance will that affect the processor?
2018/11/15
[ "https://askubuntu.com/questions/1093163", "https://askubuntu.com", "https://askubuntu.com/users/893106/" ]
If you want the second field of the last line using that field separator: ``` awk -F"[()]" 'END {print $2}' /home/jj1/.pia_manager/log/pia_nw.log ```
Pipe the output of the first awk to the second awk: ``` awk 'END{print}' /home/jj1/.pia_manager/log/pia_nw.log | awk -F"[()]" '{print $2}' ``` This variant is more safe (ignore last empty lines in file): ``` awk '/^$/ {nlstack=nlstack "\n";next;} END{printf "%s",nlstack; nlstack=""; print;}' /home/jj1/.pia_manager/...
60,525,320
Actually, I want to update a flag in Db using a service call(Delete method) once the user close the browser. I am able to detect browser close action using `onbeforeunload` and `onunload` events but async call doesn't work for me(sometimes in debugging mode it works fine but on higher env it doesn't work). Then, I tri...
2020/03/04
[ "https://Stackoverflow.com/questions/60525320", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10289185/" ]
Just filter the `List` only for the values higher or equal to your number and get the lowest value: ```dart var n = 8; // Number to match var l = [3, 7, 12, 19]; // List of values var greater = l.where((e) => e >= n).toList()..sort(); //List of the greater values print(greater.first); // Print the first value. -> 12...
``` List<int> arr = [6, 12, 11, 18, 24,5,6,99,10,9]; arr.sort((a, b) => a.compareTo(b)); print(arr); print(Utils.getNextLargerNumber(8, arr)); ``` and below is the logic: ``` static int getNextLargerNumber(int number, List<int> array) { for (var i = 0; i < array.length; i++) { if (number < ar...
60,525,320
Actually, I want to update a flag in Db using a service call(Delete method) once the user close the browser. I am able to detect browser close action using `onbeforeunload` and `onunload` events but async call doesn't work for me(sometimes in debugging mode it works fine but on higher env it doesn't work). Then, I tri...
2020/03/04
[ "https://Stackoverflow.com/questions/60525320", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10289185/" ]
``` List<int> arr = [6, 12, 11, 18, 24,5,6,99,10,9]; arr.sort((a, b) => a.compareTo(b)); print(arr); print(Utils.getNextLargerNumber(8, arr)); ``` and below is the logic: ``` static int getNextLargerNumber(int number, List<int> array) { for (var i = 0; i < array.length; i++) { if (number < ar...
[Mattia](https://stackoverflow.com/a/60551837/11003497)'s answer is already good enough. (although the list cant have the length 0 and it might be not as efficient, as you have a `where()` as well as `sort()` in there). Here is a different approach, that solves those **concerns**: Nearest-Larger value ----------------...
60,525,320
Actually, I want to update a flag in Db using a service call(Delete method) once the user close the browser. I am able to detect browser close action using `onbeforeunload` and `onunload` events but async call doesn't work for me(sometimes in debugging mode it works fine but on higher env it doesn't work). Then, I tri...
2020/03/04
[ "https://Stackoverflow.com/questions/60525320", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10289185/" ]
``` List<int> arr = [6, 12, 11, 18, 24,5,6,99,10,9]; arr.sort((a, b) => a.compareTo(b)); print(arr); print(Utils.getNextLargerNumber(8, arr)); ``` and below is the logic: ``` static int getNextLargerNumber(int number, List<int> array) { for (var i = 0; i < array.length; i++) { if (number < ar...
To get Closest Value of number ``` import 'dart:math'; import 'dart:collection'; void main(){ List<double> value = [1,4,6,3,7,9,12,34,12,-12,-91]; print(value.getCloseValue(8)); // 7 print(value.getCloseValue(6)); // 6 print(value.getCloseValue(-11)); // -12 } extension on List<num> { num getCl...
60,525,320
Actually, I want to update a flag in Db using a service call(Delete method) once the user close the browser. I am able to detect browser close action using `onbeforeunload` and `onunload` events but async call doesn't work for me(sometimes in debugging mode it works fine but on higher env it doesn't work). Then, I tri...
2020/03/04
[ "https://Stackoverflow.com/questions/60525320", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10289185/" ]
Just filter the `List` only for the values higher or equal to your number and get the lowest value: ```dart var n = 8; // Number to match var l = [3, 7, 12, 19]; // List of values var greater = l.where((e) => e >= n).toList()..sort(); //List of the greater values print(greater.first); // Print the first value. -> 12...
[Mattia](https://stackoverflow.com/a/60551837/11003497)'s answer is already good enough. (although the list cant have the length 0 and it might be not as efficient, as you have a `where()` as well as `sort()` in there). Here is a different approach, that solves those **concerns**: Nearest-Larger value ----------------...
60,525,320
Actually, I want to update a flag in Db using a service call(Delete method) once the user close the browser. I am able to detect browser close action using `onbeforeunload` and `onunload` events but async call doesn't work for me(sometimes in debugging mode it works fine but on higher env it doesn't work). Then, I tri...
2020/03/04
[ "https://Stackoverflow.com/questions/60525320", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10289185/" ]
Just filter the `List` only for the values higher or equal to your number and get the lowest value: ```dart var n = 8; // Number to match var l = [3, 7, 12, 19]; // List of values var greater = l.where((e) => e >= n).toList()..sort(); //List of the greater values print(greater.first); // Print the first value. -> 12...
To get Closest Value of number ``` import 'dart:math'; import 'dart:collection'; void main(){ List<double> value = [1,4,6,3,7,9,12,34,12,-12,-91]; print(value.getCloseValue(8)); // 7 print(value.getCloseValue(6)); // 6 print(value.getCloseValue(-11)); // -12 } extension on List<num> { num getCl...
52,421,789
I'm having some trouble spoofing my MAC address on my new MacBook Pro (OSX 10.13.6): it simply doesn't change -.-" On my prevous MacBook I created and used this script: ``` #! /bin/bash echo "Old MAC:" sudo ifconfig en0 ether | grep ether MAC=$(openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//') sudo ifconfig en0 e...
2018/09/20
[ "https://Stackoverflow.com/questions/52421789", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2709069/" ]
What you can get from <https://forums.developer.apple.com/thread/106768> is: It has been actively removed and Apple is not willing to restore it It does not work with new devices (2018+), on these it does not even when used with external adapters (like USB-C to Ethernet Adapters). So it is NOT caused by hardware, it's...
Spoofing works again on Catalina (macOS 10.15) (thanks @[Life is complex](https://stackoverflow.com/users/6083423/life-is-complex) & [source](https://github.com/feross/SpoofMAC/issues/87))
52,421,789
I'm having some trouble spoofing my MAC address on my new MacBook Pro (OSX 10.13.6): it simply doesn't change -.-" On my prevous MacBook I created and used this script: ``` #! /bin/bash echo "Old MAC:" sudo ifconfig en0 ether | grep ether MAC=$(openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//') sudo ifconfig en0 e...
2018/09/20
[ "https://Stackoverflow.com/questions/52421789", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2709069/" ]
What you can get from <https://forums.developer.apple.com/thread/106768> is: It has been actively removed and Apple is not willing to restore it It does not work with new devices (2018+), on these it does not even when used with external adapters (like USB-C to Ethernet Adapters). So it is NOT caused by hardware, it's...
Trying now on BigSur and it doesn't appear to work.
52,421,789
I'm having some trouble spoofing my MAC address on my new MacBook Pro (OSX 10.13.6): it simply doesn't change -.-" On my prevous MacBook I created and used this script: ``` #! /bin/bash echo "Old MAC:" sudo ifconfig en0 ether | grep ether MAC=$(openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//') sudo ifconfig en0 e...
2018/09/20
[ "https://Stackoverflow.com/questions/52421789", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2709069/" ]
Spoofing works again on Catalina (macOS 10.15) (thanks @[Life is complex](https://stackoverflow.com/users/6083423/life-is-complex) & [source](https://github.com/feross/SpoofMAC/issues/87))
Trying now on BigSur and it doesn't appear to work.
1,827,007
I want to find the fourier transform of $\frac{1}{\sqrt{|x|}}$. I checked the table of common fourier transforms in Wikipedia, and I know the answer should be $$\sqrt{\frac{2\pi}{|\omega|}}$$ What I can't find out, however, is *why* that is the answer. I tried $$ \hat{f}(\omega) = \int\_{-\infty}^{\infty} \frac{1}{\...
2016/06/15
[ "https://math.stackexchange.com/questions/1827007", "https://math.stackexchange.com", "https://math.stackexchange.com/users/176952/" ]
You might find it easier to rearrange the equation as $$z=\frac{2w}{w-1}$$ and then apply the condition $$|z|=1\Rightarrow 2|w|=|w-1|$$. This leads to the equation of the circle $$3u^2+3v^2+2u-1=0$$ This has centre $(-\frac 13,0)$ and radius $\frac 23$, so there appears to be a misprint in the book.
If you do it the way you started, you have to push all the way for both $x$ and $y$: $$ \begin{align} u&=\Re\left(\frac{x+yi}{x+yi-2}\right)\\ v&=\Im\left(\frac{x+yi}{x+yi-2}\right) \end{align} $$ getting: $$ \begin{align} u&=\frac{x(x-2)+y^2}{(x-2)^2+y^2}\text{ (1)}\\ v&=\frac{y(x-2)-xy}{(x-2)^2+y^2} \end{align} $$...
3,506,606
Is there any way to fire off a data subscription from using the SSRS web services?
2010/08/17
[ "https://Stackoverflow.com/questions/3506606", "https://Stackoverflow.com", "https://Stackoverflow.com/users/180826/" ]
Unfortunately the SSRS web services do not support running data subscriptions. If you want to run subscriptions through a web service call, you could expose a web service on a server that runs a sp\_start\_job command to the SQL Server Agent job for the associated schedule. Sounds dangerous to me, but it is feasible.
Sure looks like it's possible: <http://geekswithblogs.net/shervin/archive/2007/06/20/113351.aspx>
260,581
ClipX always crashes these days. It seems to still work on my laptop, which I have not yet updated to Windows 7 SP1, but it crashes on my desktop PC and servers. I have started using Ditto, but after using ClipX for years, I am not taking to it. I don't like the way it does not automatically go to the previous clipboa...
2011/03/21
[ "https://superuser.com/questions/260581", "https://superuser.com", "https://superuser.com/users/8972/" ]
After a few months of using Ditto, and finally getting fed up with it, I tried using ClipX again, and found that it does indeed work perfectly well on Windows 7 SP1 and 2008 R2 SP1. I still have no idea why it was crashing before (on different OS installations).
The way that applications interact with the clipboard seems to have changed at a fundamental level with Win7/2k8R2. We have a few applications that rely on clipboard operation that need to be rewritten because of this. I think it's safe to assume that ClipX will probably not be usable unless it's updated.
53,351,647
I have a lambda expression: ``` query = query.Include(e => e.Product); ``` How do I represent `e => e.Product` via an Expression tree so that i can make it dynamically at runtime?
2018/11/17
[ "https://Stackoverflow.com/questions/53351647", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1893689/" ]
You can dynamically create such expression like this: ``` // Declare input parameter of dynamically generated lambda expression var parameterExpr = Expression.Parameter(typeof(e), "e"); // Select desired navigation property that should be included in a query result var propertyExpr = Expression.Property(parameterExpr...
As you didn't provide your types I created my own, so your expression will look a little different. ``` using System; using System.Linq; using System.Linq.Expressions; using Microsoft.EntityFrameworkCore; namespace ConsoleApp2 { class Product { } class Shop { } class SomeEntity { ...
26,616,463
I have 1 DataGridView with 3 columns, 1 button named as **AssignID**, 1 Database with **EmployeeList** Table. Columns of Datagridview 1. Column 1 = EmployeeID 2. Column 2 = EmployeeName 3. Column 3 = Department I'm pasting the data of **EmployeeName** and **Department** from excel into DataGridView leaving column 1 ...
2014/10/28
[ "https://Stackoverflow.com/questions/26616463", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4191059/" ]
Paraphrased from Eric Lippert's blog: <http://blogs.msdn.com/b/ericlippert/archive/2009/03/19/representation-and-identity.aspx> The C# cast operator is used for identity preserving conversions (e.g. interpret this reference to base class as a reference to derived class) and identity destroying conversions (e.g. conve...
First thing first: a cast of an `object` to `bool` is valid only when the `object` is a reference type wrapper for the `bool` or `Nullable<bool>` type: ``` bool val1 = true; object mydata1=val1; if ((bool) val1) { ... } // This is valid bool? val2 = false; object mydata2=val2; if ((bool) val2) { ... } // This is valid...
26,616,463
I have 1 DataGridView with 3 columns, 1 button named as **AssignID**, 1 Database with **EmployeeList** Table. Columns of Datagridview 1. Column 1 = EmployeeID 2. Column 2 = EmployeeName 3. Column 3 = Department I'm pasting the data of **EmployeeName** and **Department** from excel into DataGridView leaving column 1 ...
2014/10/28
[ "https://Stackoverflow.com/questions/26616463", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4191059/" ]
An `int` is not a `bool`. Try it and find out what happens (InvalidCastException). ![InvalidlCastException thrown](https://i.stack.imgur.com/pVMPM.png) One should note that most of the primitive types explicitly implement `IConvertible`, so you can get the cast you want this way: ``` int a = 37 ; object b = a ; b...
Probably your best course of action to reduce exceptions and make casting easy is to use the [as](http://msdn.microsoft.com/en-us/library/cscsdfbt.aspx) operator and a [nullable](http://msdn.microsoft.com/en-us/library/b3h38hb0(v=vs.110).aspx) boolean `bool?`. ``` object test1 = 1; object test2 = true; var testBool1 ...
26,616,463
I have 1 DataGridView with 3 columns, 1 button named as **AssignID**, 1 Database with **EmployeeList** Table. Columns of Datagridview 1. Column 1 = EmployeeID 2. Column 2 = EmployeeName 3. Column 3 = Department I'm pasting the data of **EmployeeName** and **Department** from excel into DataGridView leaving column 1 ...
2014/10/28
[ "https://Stackoverflow.com/questions/26616463", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4191059/" ]
Paraphrased from Eric Lippert's blog: <http://blogs.msdn.com/b/ericlippert/archive/2009/03/19/representation-and-identity.aspx> The C# cast operator is used for identity preserving conversions (e.g. interpret this reference to base class as a reference to derived class) and identity destroying conversions (e.g. conve...
``` use this code for convert object to Boolean ``` var t = propInfo.GetValue(item, null); bool state = Convert.ToBoolean(t);
26,616,463
I have 1 DataGridView with 3 columns, 1 button named as **AssignID**, 1 Database with **EmployeeList** Table. Columns of Datagridview 1. Column 1 = EmployeeID 2. Column 2 = EmployeeName 3. Column 3 = Department I'm pasting the data of **EmployeeName** and **Department** from excel into DataGridView leaving column 1 ...
2014/10/28
[ "https://Stackoverflow.com/questions/26616463", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4191059/" ]
Paraphrased from Eric Lippert's blog: <http://blogs.msdn.com/b/ericlippert/archive/2009/03/19/representation-and-identity.aspx> The C# cast operator is used for identity preserving conversions (e.g. interpret this reference to base class as a reference to derived class) and identity destroying conversions (e.g. conve...
use this code for convert object to Boolean ``` var t = propInfo.GetValue(item, null); bool state = Convert.ToBoolean(t); ```
26,616,463
I have 1 DataGridView with 3 columns, 1 button named as **AssignID**, 1 Database with **EmployeeList** Table. Columns of Datagridview 1. Column 1 = EmployeeID 2. Column 2 = EmployeeName 3. Column 3 = Department I'm pasting the data of **EmployeeName** and **Department** from excel into DataGridView leaving column 1 ...
2014/10/28
[ "https://Stackoverflow.com/questions/26616463", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4191059/" ]
First thing first: a cast of an `object` to `bool` is valid only when the `object` is a reference type wrapper for the `bool` or `Nullable<bool>` type: ``` bool val1 = true; object mydata1=val1; if ((bool) val1) { ... } // This is valid bool? val2 = false; object mydata2=val2; if ((bool) val2) { ... } // This is valid...
Probably your best course of action to reduce exceptions and make casting easy is to use the [as](http://msdn.microsoft.com/en-us/library/cscsdfbt.aspx) operator and a [nullable](http://msdn.microsoft.com/en-us/library/b3h38hb0(v=vs.110).aspx) boolean `bool?`. ``` object test1 = 1; object test2 = true; var testBool1 ...
26,616,463
I have 1 DataGridView with 3 columns, 1 button named as **AssignID**, 1 Database with **EmployeeList** Table. Columns of Datagridview 1. Column 1 = EmployeeID 2. Column 2 = EmployeeName 3. Column 3 = Department I'm pasting the data of **EmployeeName** and **Department** from excel into DataGridView leaving column 1 ...
2014/10/28
[ "https://Stackoverflow.com/questions/26616463", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4191059/" ]
First thing first: a cast of an `object` to `bool` is valid only when the `object` is a reference type wrapper for the `bool` or `Nullable<bool>` type: ``` bool val1 = true; object mydata1=val1; if ((bool) val1) { ... } // This is valid bool? val2 = false; object mydata2=val2; if ((bool) val2) { ... } // This is valid...
``` use this code for convert object to Boolean ``` var t = propInfo.GetValue(item, null); bool state = Convert.ToBoolean(t);
26,616,463
I have 1 DataGridView with 3 columns, 1 button named as **AssignID**, 1 Database with **EmployeeList** Table. Columns of Datagridview 1. Column 1 = EmployeeID 2. Column 2 = EmployeeName 3. Column 3 = Department I'm pasting the data of **EmployeeName** and **Department** from excel into DataGridView leaving column 1 ...
2014/10/28
[ "https://Stackoverflow.com/questions/26616463", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4191059/" ]
An `int` is not a `bool`. Try it and find out what happens (InvalidCastException). ![InvalidlCastException thrown](https://i.stack.imgur.com/pVMPM.png) One should note that most of the primitive types explicitly implement `IConvertible`, so you can get the cast you want this way: ``` int a = 37 ; object b = a ; b...
use this code for convert object to Boolean ``` var t = propInfo.GetValue(item, null); bool state = Convert.ToBoolean(t); ```
26,616,463
I have 1 DataGridView with 3 columns, 1 button named as **AssignID**, 1 Database with **EmployeeList** Table. Columns of Datagridview 1. Column 1 = EmployeeID 2. Column 2 = EmployeeName 3. Column 3 = Department I'm pasting the data of **EmployeeName** and **Department** from excel into DataGridView leaving column 1 ...
2014/10/28
[ "https://Stackoverflow.com/questions/26616463", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4191059/" ]
An `int` is not a `bool`. Try it and find out what happens (InvalidCastException). ![InvalidlCastException thrown](https://i.stack.imgur.com/pVMPM.png) One should note that most of the primitive types explicitly implement `IConvertible`, so you can get the cast you want this way: ``` int a = 37 ; object b = a ; b...
``` use this code for convert object to Boolean ``` var t = propInfo.GetValue(item, null); bool state = Convert.ToBoolean(t);
26,616,463
I have 1 DataGridView with 3 columns, 1 button named as **AssignID**, 1 Database with **EmployeeList** Table. Columns of Datagridview 1. Column 1 = EmployeeID 2. Column 2 = EmployeeName 3. Column 3 = Department I'm pasting the data of **EmployeeName** and **Department** from excel into DataGridView leaving column 1 ...
2014/10/28
[ "https://Stackoverflow.com/questions/26616463", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4191059/" ]
An `int` is not a `bool`. Try it and find out what happens (InvalidCastException). ![InvalidlCastException thrown](https://i.stack.imgur.com/pVMPM.png) One should note that most of the primitive types explicitly implement `IConvertible`, so you can get the cast you want this way: ``` int a = 37 ; object b = a ; b...
Paraphrased from Eric Lippert's blog: <http://blogs.msdn.com/b/ericlippert/archive/2009/03/19/representation-and-identity.aspx> The C# cast operator is used for identity preserving conversions (e.g. interpret this reference to base class as a reference to derived class) and identity destroying conversions (e.g. conve...
26,616,463
I have 1 DataGridView with 3 columns, 1 button named as **AssignID**, 1 Database with **EmployeeList** Table. Columns of Datagridview 1. Column 1 = EmployeeID 2. Column 2 = EmployeeName 3. Column 3 = Department I'm pasting the data of **EmployeeName** and **Department** from excel into DataGridView leaving column 1 ...
2014/10/28
[ "https://Stackoverflow.com/questions/26616463", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4191059/" ]
Paraphrased from Eric Lippert's blog: <http://blogs.msdn.com/b/ericlippert/archive/2009/03/19/representation-and-identity.aspx> The C# cast operator is used for identity preserving conversions (e.g. interpret this reference to base class as a reference to derived class) and identity destroying conversions (e.g. conve...
Probably your best course of action to reduce exceptions and make casting easy is to use the [as](http://msdn.microsoft.com/en-us/library/cscsdfbt.aspx) operator and a [nullable](http://msdn.microsoft.com/en-us/library/b3h38hb0(v=vs.110).aspx) boolean `bool?`. ``` object test1 = 1; object test2 = true; var testBool1 ...
316
There have been a number of questions focusing on mythical creatures where the logical approach to answering has been to scale up an existing animal. For example [dragon's wings](https://worldbuilding.stackexchange.com/questions/313/how-could-dragons-be-explained-without-magic-which-characteristics-are-impossib) can be...
2014/09/19
[ "https://worldbuilding.stackexchange.com/questions/316", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/18/" ]
You can scale them up to a certain extent, but there are a lot of limiting factors. **Weight** The main thing is increasing weight - bone and flesh and sinew and muscles no matter how thick are only able to cope with a limited amount of weight. Eventually the creature just cannot support itself against gravity. This...
To add to Tim B's answer, rather than to compete with it: **Eyes:** Eyes do not generally scale with the rest of an animal. If you examine a mouse, it has eyes that are proportionally bigger than those of a cat, which are proportionally bigger than those of a human, which are proportionally bigger than those of a wha...
316
There have been a number of questions focusing on mythical creatures where the logical approach to answering has been to scale up an existing animal. For example [dragon's wings](https://worldbuilding.stackexchange.com/questions/313/how-could-dragons-be-explained-without-magic-which-characteristics-are-impossib) can be...
2014/09/19
[ "https://worldbuilding.stackexchange.com/questions/316", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/18/" ]
You can scale them up to a certain extent, but there are a lot of limiting factors. **Weight** The main thing is increasing weight - bone and flesh and sinew and muscles no matter how thick are only able to cope with a limited amount of weight. Eventually the creature just cannot support itself against gravity. This...
**Insects several meters in Size** Dragonflies were able to have a much bigger wingspan 300 million years ago (thanks to a much higher oxygen content in the atmosphere, plus warm as today in the equator), animals can actually be scaled quite a bit up. In this case the limiting factors were feeding the organism enough...
316
There have been a number of questions focusing on mythical creatures where the logical approach to answering has been to scale up an existing animal. For example [dragon's wings](https://worldbuilding.stackexchange.com/questions/313/how-could-dragons-be-explained-without-magic-which-characteristics-are-impossib) can be...
2014/09/19
[ "https://worldbuilding.stackexchange.com/questions/316", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/18/" ]
You can scale them up to a certain extent, but there are a lot of limiting factors. **Weight** The main thing is increasing weight - bone and flesh and sinew and muscles no matter how thick are only able to cope with a limited amount of weight. Eventually the creature just cannot support itself against gravity. This...
I would suggest taking the appearances defining the creature and model it on a creature of the size you are looking for. For example if you were taking a husky and scaling it up to the size of a horse, take the horses proportions and then change what you need to, (tracing paper works well here) shortening the neck, ...
316
There have been a number of questions focusing on mythical creatures where the logical approach to answering has been to scale up an existing animal. For example [dragon's wings](https://worldbuilding.stackexchange.com/questions/313/how-could-dragons-be-explained-without-magic-which-characteristics-are-impossib) can be...
2014/09/19
[ "https://worldbuilding.stackexchange.com/questions/316", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/18/" ]
To add to Tim B's answer, rather than to compete with it: **Eyes:** Eyes do not generally scale with the rest of an animal. If you examine a mouse, it has eyes that are proportionally bigger than those of a cat, which are proportionally bigger than those of a human, which are proportionally bigger than those of a wha...
**Insects several meters in Size** Dragonflies were able to have a much bigger wingspan 300 million years ago (thanks to a much higher oxygen content in the atmosphere, plus warm as today in the equator), animals can actually be scaled quite a bit up. In this case the limiting factors were feeding the organism enough...
316
There have been a number of questions focusing on mythical creatures where the logical approach to answering has been to scale up an existing animal. For example [dragon's wings](https://worldbuilding.stackexchange.com/questions/313/how-could-dragons-be-explained-without-magic-which-characteristics-are-impossib) can be...
2014/09/19
[ "https://worldbuilding.stackexchange.com/questions/316", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/18/" ]
To add to Tim B's answer, rather than to compete with it: **Eyes:** Eyes do not generally scale with the rest of an animal. If you examine a mouse, it has eyes that are proportionally bigger than those of a cat, which are proportionally bigger than those of a human, which are proportionally bigger than those of a wha...
I would suggest taking the appearances defining the creature and model it on a creature of the size you are looking for. For example if you were taking a husky and scaling it up to the size of a horse, take the horses proportions and then change what you need to, (tracing paper works well here) shortening the neck, ...
316
There have been a number of questions focusing on mythical creatures where the logical approach to answering has been to scale up an existing animal. For example [dragon's wings](https://worldbuilding.stackexchange.com/questions/313/how-could-dragons-be-explained-without-magic-which-characteristics-are-impossib) can be...
2014/09/19
[ "https://worldbuilding.stackexchange.com/questions/316", "https://worldbuilding.stackexchange.com", "https://worldbuilding.stackexchange.com/users/18/" ]
**Insects several meters in Size** Dragonflies were able to have a much bigger wingspan 300 million years ago (thanks to a much higher oxygen content in the atmosphere, plus warm as today in the equator), animals can actually be scaled quite a bit up. In this case the limiting factors were feeding the organism enough...
I would suggest taking the appearances defining the creature and model it on a creature of the size you are looking for. For example if you were taking a husky and scaling it up to the size of a horse, take the horses proportions and then change what you need to, (tracing paper works well here) shortening the neck, ...
208
Yes, [vegetarian-diet](https://vegetarianism.stackexchange.com/questions/tagged/vegetarian-diet "show questions tagged 'vegetarian-diet'") is a bit more specific than [diet](https://vegetarianism.stackexchange.com/questions/tagged/diet "show questions tagged 'diet'"), but it's mostly identical. Consider also that [veg...
2017/05/10
[ "https://vegetarianism.meta.stackexchange.com/questions/208", "https://vegetarianism.meta.stackexchange.com", "https://vegetarianism.meta.stackexchange.com/users/6/" ]
Half (22) of the questions tagged with [diet](https://vegetarianism.stackexchange.com/questions/tagged/diet "show questions tagged 'diet'") are also tagged with [veganism](https://vegetarianism.stackexchange.com/questions/tagged/veganism "show questions tagged 'veganism'"). This seems to indicate a pattern of tagging d...
### Keep [vegetarian-diet](https://vegetarianism.stackexchange.com/questions/tagged/vegetarian-diet "show questions tagged 'vegetarian-diet'") and burninate [diet](https://vegetarianism.stackexchange.com/questions/tagged/diet "show questions tagged 'diet'") It seems that the original usage of [diet] on this site was t...
57,824,449
Implemented every kind of step exactly as described. App open successfully but, no URL data fetched. Implemented every kind of step exactly as described. Send links from gmail and the links open the app so yes, it works. BUT here is 2 problems 1- How on earth can I debug and print the app since you have to close the...
2019/09/06
[ "https://Stackoverflow.com/questions/57824449", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9416553/" ]
So after many trials trying to get the app run and fetch url data It seems like something has changed in iOS where "userActivity" will always be nil unless you get it from an overload from "application" function so @Simon McLoughlin solution did solve half of the problem by suggesting to use this function ``` func ap...
> > 1- How on earth can I debug and print the app > > > Edit your scheme and select "wait for executable to be launched" Then, implement `func application(:continue:restorationHandler:)` and check `userActivity.webpageURL` to determine what you need to do.
57,824,449
Implemented every kind of step exactly as described. App open successfully but, no URL data fetched. Implemented every kind of step exactly as described. Send links from gmail and the links open the app so yes, it works. BUT here is 2 problems 1- How on earth can I debug and print the app since you have to close the...
2019/09/06
[ "https://Stackoverflow.com/questions/57824449", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9416553/" ]
So after many trials trying to get the app run and fetch url data It seems like something has changed in iOS where "userActivity" will always be nil unless you get it from an overload from "application" function so @Simon McLoughlin solution did solve half of the problem by suggesting to use this function ``` func ap...
The apple documentation on how to handle universal links says to use a different application function to the one you are using. `didFinishLaunchingWithOptions` will only be called once when the app is completely closed, leading to the issues you are already facing. However: ``` func application(_ application: UIAppli...
57,824,449
Implemented every kind of step exactly as described. App open successfully but, no URL data fetched. Implemented every kind of step exactly as described. Send links from gmail and the links open the app so yes, it works. BUT here is 2 problems 1- How on earth can I debug and print the app since you have to close the...
2019/09/06
[ "https://Stackoverflow.com/questions/57824449", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9416553/" ]
So after many trials trying to get the app run and fetch url data It seems like something has changed in iOS where "userActivity" will always be nil unless you get it from an overload from "application" function so @Simon McLoughlin solution did solve half of the problem by suggesting to use this function ``` func ap...
IOS version > 13.0 only running app (from universal link) SceneDelegate.swift ```swift func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { ... if let activity: NSUserActivity = connectionOptions.userActivities.first, let url: URL...
4,178,421
I have intermediate knowledge of flash and actionscript, but I have never done 3D animations in flash. Now I'm into a project that requires me to make a menu that looks like a DNA molecule, with each atom being a link to something. I want to make the DNA molecule looks like a real rotating 3D object. Can anyone help me...
2010/11/14
[ "https://Stackoverflow.com/questions/4178421", "https://Stackoverflow.com", "https://Stackoverflow.com/users/364651/" ]
A database schema should be designed on paper or with an [ERD](http://en.wikipedia.org/wiki/Entity-relationship_model) tool. It should be implemented in the database. Are you thinking about [ORMs](http://en.wikipedia.org/wiki/Object-relational_mapping) like [Entity Framework](http://msdn.microsoft.com/en-us/library/...
Before VS.NET 2010 I was using SQL Server Management Studio to design my databases, now I am using EF 4.0 designer, for me it's the best way to go.
4,178,421
I have intermediate knowledge of flash and actionscript, but I have never done 3D animations in flash. Now I'm into a project that requires me to make a menu that looks like a DNA molecule, with each atom being a link to something. I want to make the DNA molecule looks like a real rotating 3D object. Can anyone help me...
2010/11/14
[ "https://Stackoverflow.com/questions/4178421", "https://Stackoverflow.com", "https://Stackoverflow.com/users/364651/" ]
A database schema should be designed on paper or with an [ERD](http://en.wikipedia.org/wiki/Entity-relationship_model) tool. It should be implemented in the database. Are you thinking about [ORMs](http://en.wikipedia.org/wiki/Object-relational_mapping) like [Entity Framework](http://msdn.microsoft.com/en-us/library/...
If your problem domain is complex or its complexity grows as the system evolves you'll soon discover you need some meta data to make life easier. C# can be a good choice as a host language for such stuff as you can utilize its type-system to enforce some invariants (like char-columns length, null/not null restrictions ...
4,178,421
I have intermediate knowledge of flash and actionscript, but I have never done 3D animations in flash. Now I'm into a project that requires me to make a menu that looks like a DNA molecule, with each atom being a link to something. I want to make the DNA molecule looks like a real rotating 3D object. Can anyone help me...
2010/11/14
[ "https://Stackoverflow.com/questions/4178421", "https://Stackoverflow.com", "https://Stackoverflow.com/users/364651/" ]
A database schema should be designed on paper or with an [ERD](http://en.wikipedia.org/wiki/Entity-relationship_model) tool. It should be implemented in the database. Are you thinking about [ORMs](http://en.wikipedia.org/wiki/Object-relational_mapping) like [Entity Framework](http://msdn.microsoft.com/en-us/library/...
ORMs have their place, that place is NOT database design. There are many considerations in designing a database that need to be thought through not automatically generated no matter how appealing the idea of not thinking about design might be. There are often many things that need to be considered that have nothing to ...
53,142,822
I have been trying to implement a singleton class in C++. ``` #include<iostream> using namespace std; class Singleton { private: static Singleton* singleton; public: static Singleton& Get() { return *singleton; } static void display() { cout << "Hello world\n"; } }; Singleton* Singleton::singleton = nullptr...
2018/11/04
[ "https://Stackoverflow.com/questions/53142822", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10604188/" ]
This is covered by [core language issue 315: Is call of static member function through null pointer undefined?](http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_closed.html#315) which says: > > Another instance to consider is that of invoking a member function > from a null pointer: > > > > ``` > struct A { voi...
Basically, that's because everything in `Singleton` is static. Add a data element and do something with it and you'll be more likely to see problems.
21,004,311
I have implemented custom authorization attribute in ASP.NET MVC4 by overriding the `AuthorizeAttribute` to do custom authorization. I want to implement this over certain controllers and controller actions to make them reject unauthorized requests like that of user not logged in and/or certain rights issue. I don't wan...
2014/01/08
[ "https://Stackoverflow.com/questions/21004311", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3070051/" ]
You can make a multiple messages and with different types. Follow these steps below: 1. Create a file: "`app/Components/FlashMessages.php`" > > > ``` > namespace App\Components; > > trait FlashMessages > { > protected static function message($level = 'info', $message = null) > { > if (session()->has('mes...
In Controller: ``` Redirect::to('/path')->with('message', 'your message'); ``` Or ``` Session::flash('message', 'your message'); ``` in Blade show message in Blade As ur Desired Pattern: ``` @if(Session::has('message')) <div class="alert alert-className"> {{session('message')}} </div> @endif `...
21,004,311
I have implemented custom authorization attribute in ASP.NET MVC4 by overriding the `AuthorizeAttribute` to do custom authorization. I want to implement this over certain controllers and controller actions to make them reject unauthorized requests like that of user not logged in and/or certain rights issue. I don't wan...
2014/01/08
[ "https://Stackoverflow.com/questions/21004311", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3070051/" ]
Not a big fan of the solutions provided (ie: multiple variables, helper classes, looping through 'possibly existing variables'). Below is a solution that instead uses an array as opposed to two separate variables. It's also easily extendable to handle multiple errors should you wish but for simplicity, I've kept it to ...
You could use Laravel Macros. You can create `macros.php` in `app/helpers` and include it routes.php. if you wish to put your macros in a class file instead, you can look at this tutorial: <http://chrishayes.ca/blog/code/laravel-4-object-oriented-form-html-macros-classes-service-provider> ``` HTML::macro('alert', fu...
21,004,311
I have implemented custom authorization attribute in ASP.NET MVC4 by overriding the `AuthorizeAttribute` to do custom authorization. I want to implement this over certain controllers and controller actions to make them reject unauthorized requests like that of user not logged in and/or certain rights issue. I don't wan...
2014/01/08
[ "https://Stackoverflow.com/questions/21004311", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3070051/" ]
You could use Laravel Macros. You can create `macros.php` in `app/helpers` and include it routes.php. if you wish to put your macros in a class file instead, you can look at this tutorial: <http://chrishayes.ca/blog/code/laravel-4-object-oriented-form-html-macros-classes-service-provider> ``` HTML::macro('alert', fu...
I came across this elegant way to flash messages. It was made by Jeffrey Way from Laracast. check it out... <https://github.com/laracasts/flash>
21,004,311
I have implemented custom authorization attribute in ASP.NET MVC4 by overriding the `AuthorizeAttribute` to do custom authorization. I want to implement this over certain controllers and controller actions to make them reject unauthorized requests like that of user not logged in and/or certain rights issue. I don't wan...
2014/01/08
[ "https://Stackoverflow.com/questions/21004311", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3070051/" ]
I think the following would work well with lesser line of codes. ``` session()->flash('toast', [ 'status' => 'success', 'body' => 'Body', 'topic' => 'Success'] ); ``` I'm using a toaster package, but you can have something like this in your view. ``` toastr.{{sessio...
I came across this elegant way to flash messages. It was made by Jeffrey Way from Laracast. check it out... <https://github.com/laracasts/flash>
21,004,311
I have implemented custom authorization attribute in ASP.NET MVC4 by overriding the `AuthorizeAttribute` to do custom authorization. I want to implement this over certain controllers and controller actions to make them reject unauthorized requests like that of user not logged in and/or certain rights issue. I don't wan...
2014/01/08
[ "https://Stackoverflow.com/questions/21004311", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3070051/" ]
You can make a multiple messages and with different types. Follow these steps below: 1. Create a file: "`app/Components/FlashMessages.php`" > > > ``` > namespace App\Components; > > trait FlashMessages > { > protected static function message($level = 'info', $message = null) > { > if (session()->has('mes...
I think the following would work well with lesser line of codes. ``` session()->flash('toast', [ 'status' => 'success', 'body' => 'Body', 'topic' => 'Success'] ); ``` I'm using a toaster package, but you can have something like this in your view. ``` toastr.{{sessio...
21,004,311
I have implemented custom authorization attribute in ASP.NET MVC4 by overriding the `AuthorizeAttribute` to do custom authorization. I want to implement this over certain controllers and controller actions to make them reject unauthorized requests like that of user not logged in and/or certain rights issue. I don't wan...
2014/01/08
[ "https://Stackoverflow.com/questions/21004311", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3070051/" ]
My way is to always Redirect::back() or Redirect::to(): ``` Redirect::back()->with('message', 'error|There was an error...'); Redirect::back()->with('message', 'message|Record updated.'); Redirect::to('/')->with('message', 'success|Record updated.'); ``` I have a helper function to make it work for me, usually thi...
Another solution would be to create a helper class [How to Create helper classes here](https://stackoverflow.com/questions/17088917/what-are-the-best-practices-and-best-places-for-laravel-4-helpers-or-basic-funct) ``` class Helper{ public static function format_message($message,$type) { return '<p cl...
21,004,311
I have implemented custom authorization attribute in ASP.NET MVC4 by overriding the `AuthorizeAttribute` to do custom authorization. I want to implement this over certain controllers and controller actions to make them reject unauthorized requests like that of user not logged in and/or certain rights issue. I don't wan...
2014/01/08
[ "https://Stackoverflow.com/questions/21004311", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3070051/" ]
In your view: ``` <div class="flash-message"> @foreach (['danger', 'warning', 'success', 'info'] as $msg) @if(Session::has('alert-' . $msg)) <p class="alert alert-{{ $msg }}">{{ Session::get('alert-' . $msg) }}</p> @endif @endforeach </div> ``` Then set a flash message in the controller: ``` Session...
We can use session() global helper instead of Session ``` // flash message create session()->flash('message', 'This is a message!'); session()->flash('alert-class', 'alert-danger'); // get flash message by key from your blade file @if(session()->has('message')) <p class="alert {{ session('alert-class') }}">{{ sessi...
21,004,311
I have implemented custom authorization attribute in ASP.NET MVC4 by overriding the `AuthorizeAttribute` to do custom authorization. I want to implement this over certain controllers and controller actions to make them reject unauthorized requests like that of user not logged in and/or certain rights issue. I don't wan...
2014/01/08
[ "https://Stackoverflow.com/questions/21004311", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3070051/" ]
Another solution would be to create a helper class [How to Create helper classes here](https://stackoverflow.com/questions/17088917/what-are-the-best-practices-and-best-places-for-laravel-4-helpers-or-basic-funct) ``` class Helper{ public static function format_message($message,$type) { return '<p cl...
You could use Laravel Macros. You can create `macros.php` in `app/helpers` and include it routes.php. if you wish to put your macros in a class file instead, you can look at this tutorial: <http://chrishayes.ca/blog/code/laravel-4-object-oriented-form-html-macros-classes-service-provider> ``` HTML::macro('alert', fu...
21,004,311
I have implemented custom authorization attribute in ASP.NET MVC4 by overriding the `AuthorizeAttribute` to do custom authorization. I want to implement this over certain controllers and controller actions to make them reject unauthorized requests like that of user not logged in and/or certain rights issue. I don't wan...
2014/01/08
[ "https://Stackoverflow.com/questions/21004311", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3070051/" ]
In your view: ``` <div class="flash-message"> @foreach (['danger', 'warning', 'success', 'info'] as $msg) @if(Session::has('alert-' . $msg)) <p class="alert alert-{{ $msg }}">{{ Session::get('alert-' . $msg) }}</p> @endif @endforeach </div> ``` Then set a flash message in the controller: ``` Session...
Another solution would be to create a helper class [How to Create helper classes here](https://stackoverflow.com/questions/17088917/what-are-the-best-practices-and-best-places-for-laravel-4-helpers-or-basic-funct) ``` class Helper{ public static function format_message($message,$type) { return '<p cl...
21,004,311
I have implemented custom authorization attribute in ASP.NET MVC4 by overriding the `AuthorizeAttribute` to do custom authorization. I want to implement this over certain controllers and controller actions to make them reject unauthorized requests like that of user not logged in and/or certain rights issue. I don't wan...
2014/01/08
[ "https://Stackoverflow.com/questions/21004311", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3070051/" ]
You can make a multiple messages and with different types. Follow these steps below: 1. Create a file: "`app/Components/FlashMessages.php`" > > > ``` > namespace App\Components; > > trait FlashMessages > { > protected static function message($level = 'info', $message = null) > { > if (session()->has('mes...
Just send an array in the session rather than a string, like this: ``` Session::flash('message', ['text'=>'this is a danger message','type'=>'danger']); @if(Session::has('message')) <div class="alert alert-{{session('message')['type']}}"> {{session('message')['text']}} </div> @endif ```
30,060,853
I have this code. Can someone help me on how to remove fakepath on file uploading? thankyou html code ``` <div id="file">Chose file</div> <input type="file" name="file" style="display:none;"/> ``` jquery code ``` var wrapper = $('<div/>').css({height:0,width:0,'overflow':'hidden'}); var fileInput = $(':file').wra...
2015/05/05
[ "https://Stackoverflow.com/questions/30060853", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4580391/" ]
Inside `fileInput.change(function(){...})` you can add some code to change the fakepath. For example, you can take the filename from the fakepath, like this: ``` var text = $('#file').html(); text = text.substring(text.lastIndexOf("\\") + 1, text.length); $('#file').html(text); ``` You can see an example here: <http...
Inside `fileInput.change(function(){...})` replace this: ``` $('#file').text($this.val()); ``` with ``` $('#file').text($this.get(0).files.item(0).name); ```
34,523,026
Let's say we have strings\_test.xml, which stores string values for testing and should be shown in a debug-release. When the apk gets build as a release version all values should be change to an empty string e.g. `<string name="test_some_card_text">@string/empty</string>`. Is there a possibility to achieve this? As a...
2015/12/30
[ "https://Stackoverflow.com/questions/34523026", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2533290/" ]
Yes, Gradle lets you override strings. * Add this inside buildTypes{} in your app/build.gradle debug { applicationIdSuffix "debug" } * That should create a directory titled `debug` next to `main`. If not then manually create one. (Seriously, I haven't tried this, but I know this is possible.) * Then if your `stri...
It is not possible to change the string value after creation of the apk. But you can assing the value to text or edittext ... etx dynamically after creation of the apk.
34,523,026
Let's say we have strings\_test.xml, which stores string values for testing and should be shown in a debug-release. When the apk gets build as a release version all values should be change to an empty string e.g. `<string name="test_some_card_text">@string/empty</string>`. Is there a possibility to achieve this? As a...
2015/12/30
[ "https://Stackoverflow.com/questions/34523026", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2533290/" ]
As @Aditya Naik said it is possible using Flavors. Official doc says > > BuildType -> Flavor -> main -> Dependencies. > > > This means that if a resource is declared in both the Build Type and in main, the one from Build Type will be selected. > > > Note that for the scope of the merging, resources of the same (...
It is not possible to change the string value after creation of the apk. But you can assing the value to text or edittext ... etx dynamically after creation of the apk.
34,523,026
Let's say we have strings\_test.xml, which stores string values for testing and should be shown in a debug-release. When the apk gets build as a release version all values should be change to an empty string e.g. `<string name="test_some_card_text">@string/empty</string>`. Is there a possibility to achieve this? As a...
2015/12/30
[ "https://Stackoverflow.com/questions/34523026", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2533290/" ]
Yes you can do that inside your app gradle under buildTypes.. ``` buildTypes { mybuild { resValue "string", "test_some_card_text", '"test"' resValue "string", "other_text", '"other"' } debug { resValue "string", "test_some_card_text",...
It is not possible to change the string value after creation of the apk. But you can assing the value to text or edittext ... etx dynamically after creation of the apk.
34,523,026
Let's say we have strings\_test.xml, which stores string values for testing and should be shown in a debug-release. When the apk gets build as a release version all values should be change to an empty string e.g. `<string name="test_some_card_text">@string/empty</string>`. Is there a possibility to achieve this? As a...
2015/12/30
[ "https://Stackoverflow.com/questions/34523026", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2533290/" ]
It is not possible to change the string value after creation of the apk. But you can assing the value to text or edittext ... etx dynamically after creation of the apk.
For those who come here looking for some way to apply a similar method to `raw` resources, I dealt with it using `buildConfigField`. ``` gradle ... buildTypes { debug { ... buildConfigField "int", "shared_resource_name", 'R.raw.debug_resource_name' ... } prod { ... ...
34,523,026
Let's say we have strings\_test.xml, which stores string values for testing and should be shown in a debug-release. When the apk gets build as a release version all values should be change to an empty string e.g. `<string name="test_some_card_text">@string/empty</string>`. Is there a possibility to achieve this? As a...
2015/12/30
[ "https://Stackoverflow.com/questions/34523026", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2533290/" ]
Yes you can do that inside your app gradle under buildTypes.. ``` buildTypes { mybuild { resValue "string", "test_some_card_text", '"test"' resValue "string", "other_text", '"other"' } debug { resValue "string", "test_some_card_text",...
Yes, Gradle lets you override strings. * Add this inside buildTypes{} in your app/build.gradle debug { applicationIdSuffix "debug" } * That should create a directory titled `debug` next to `main`. If not then manually create one. (Seriously, I haven't tried this, but I know this is possible.) * Then if your `stri...
34,523,026
Let's say we have strings\_test.xml, which stores string values for testing and should be shown in a debug-release. When the apk gets build as a release version all values should be change to an empty string e.g. `<string name="test_some_card_text">@string/empty</string>`. Is there a possibility to achieve this? As a...
2015/12/30
[ "https://Stackoverflow.com/questions/34523026", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2533290/" ]
Yes, Gradle lets you override strings. * Add this inside buildTypes{} in your app/build.gradle debug { applicationIdSuffix "debug" } * That should create a directory titled `debug` next to `main`. If not then manually create one. (Seriously, I haven't tried this, but I know this is possible.) * Then if your `stri...
For those who come here looking for some way to apply a similar method to `raw` resources, I dealt with it using `buildConfigField`. ``` gradle ... buildTypes { debug { ... buildConfigField "int", "shared_resource_name", 'R.raw.debug_resource_name' ... } prod { ... ...
34,523,026
Let's say we have strings\_test.xml, which stores string values for testing and should be shown in a debug-release. When the apk gets build as a release version all values should be change to an empty string e.g. `<string name="test_some_card_text">@string/empty</string>`. Is there a possibility to achieve this? As a...
2015/12/30
[ "https://Stackoverflow.com/questions/34523026", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2533290/" ]
Yes you can do that inside your app gradle under buildTypes.. ``` buildTypes { mybuild { resValue "string", "test_some_card_text", '"test"' resValue "string", "other_text", '"other"' } debug { resValue "string", "test_some_card_text",...
As @Aditya Naik said it is possible using Flavors. Official doc says > > BuildType -> Flavor -> main -> Dependencies. > > > This means that if a resource is declared in both the Build Type and in main, the one from Build Type will be selected. > > > Note that for the scope of the merging, resources of the same (...
34,523,026
Let's say we have strings\_test.xml, which stores string values for testing and should be shown in a debug-release. When the apk gets build as a release version all values should be change to an empty string e.g. `<string name="test_some_card_text">@string/empty</string>`. Is there a possibility to achieve this? As a...
2015/12/30
[ "https://Stackoverflow.com/questions/34523026", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2533290/" ]
As @Aditya Naik said it is possible using Flavors. Official doc says > > BuildType -> Flavor -> main -> Dependencies. > > > This means that if a resource is declared in both the Build Type and in main, the one from Build Type will be selected. > > > Note that for the scope of the merging, resources of the same (...
For those who come here looking for some way to apply a similar method to `raw` resources, I dealt with it using `buildConfigField`. ``` gradle ... buildTypes { debug { ... buildConfigField "int", "shared_resource_name", 'R.raw.debug_resource_name' ... } prod { ... ...
34,523,026
Let's say we have strings\_test.xml, which stores string values for testing and should be shown in a debug-release. When the apk gets build as a release version all values should be change to an empty string e.g. `<string name="test_some_card_text">@string/empty</string>`. Is there a possibility to achieve this? As a...
2015/12/30
[ "https://Stackoverflow.com/questions/34523026", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2533290/" ]
Yes you can do that inside your app gradle under buildTypes.. ``` buildTypes { mybuild { resValue "string", "test_some_card_text", '"test"' resValue "string", "other_text", '"other"' } debug { resValue "string", "test_some_card_text",...
For those who come here looking for some way to apply a similar method to `raw` resources, I dealt with it using `buildConfigField`. ``` gradle ... buildTypes { debug { ... buildConfigField "int", "shared_resource_name", 'R.raw.debug_resource_name' ... } prod { ... ...
395,256
I would like to write a LaTeX3 function `\f`, which takes a single argument `#1` whose type is a LaTeX3 string, and prints > > Hello, #1! > > > A first attempt is ``` \documentclass{article} \usepackage{expl3,xparse} \ExplSyntaxOn \cs_new:Nn \f:n {Hello, #1} \cs_gset_eq:NN \f \f:n \ExplSyntaxOff \begin{d...
2017/10/09
[ "https://tex.stackexchange.com/questions/395256", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/21685/" ]
Just split the code into two parts. On the other hand, I consider this a recipe to produce dull texts. ``` \documentclass{article} \usepackage{xparse} \usepackage{amsmath,amsthm} \theoremstyle{definition} \newtheorem{definition}{Definition} % the text \NewDocumentCommand{\definitiontext}{mmmm}{% \begin{definition}...
You can use `~` but if there are long document level strings it's an indication that the command lives in the document level interface not in the expl3 code layer so you could define it outside the expl3 code convention block as long as you do expose a suitable code command that can be called in that environment, eg `...
395,256
I would like to write a LaTeX3 function `\f`, which takes a single argument `#1` whose type is a LaTeX3 string, and prints > > Hello, #1! > > > A first attempt is ``` \documentclass{article} \usepackage{expl3,xparse} \ExplSyntaxOn \cs_new:Nn \f:n {Hello, #1} \cs_gset_eq:NN \f \f:n \ExplSyntaxOff \begin{d...
2017/10/09
[ "https://tex.stackexchange.com/questions/395256", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/21685/" ]
You can use `~` but if there are long document level strings it's an indication that the command lives in the document level interface not in the expl3 code layer so you could define it outside the expl3 code convention block as long as you do expose a suitable code command that can be called in that environment, eg `...
Based on [egreg's answer](https://tex.stackexchange.com/a/395263/21685) I've created a file `expl3x.tex` (the extra `x` in the file name standing for "e**x**port"), whose sole purpose is to "export" select `expl3` functions and variables, which is to say to rename them in a systematic way so they can be used inside the...
395,256
I would like to write a LaTeX3 function `\f`, which takes a single argument `#1` whose type is a LaTeX3 string, and prints > > Hello, #1! > > > A first attempt is ``` \documentclass{article} \usepackage{expl3,xparse} \ExplSyntaxOn \cs_new:Nn \f:n {Hello, #1} \cs_gset_eq:NN \f \f:n \ExplSyntaxOff \begin{d...
2017/10/09
[ "https://tex.stackexchange.com/questions/395256", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/21685/" ]
Just split the code into two parts. On the other hand, I consider this a recipe to produce dull texts. ``` \documentclass{article} \usepackage{xparse} \usepackage{amsmath,amsthm} \theoremstyle{definition} \newtheorem{definition}{Definition} % the text \NewDocumentCommand{\definitiontext}{mmmm}{% \begin{definition}...
Based on [egreg's answer](https://tex.stackexchange.com/a/395263/21685) I've created a file `expl3x.tex` (the extra `x` in the file name standing for "e**x**port"), whose sole purpose is to "export" select `expl3` functions and variables, which is to say to rename them in a systematic way so they can be used inside the...
548,611
I have a 11.1 V Li-ion battery pack that I use for a 9-12V device as backup power. When I charge the battery pack, it draws 1-1.25 A of current from the DC charger which has caused more than 1 charger to burn up. How can I limit the current to 0.5 A? I tried using a 47 ohms resistor in series with the battery but it dr...
2021/02/17
[ "https://electronics.stackexchange.com/questions/548611", "https://electronics.stackexchange.com", "https://electronics.stackexchange.com/users/276960/" ]
The problem is that you don't have a lithium battery charger, and you are directly connecting a 12V power supply to your batteries. Don't do that, as it will damage the power supply and the lithium batteries, and they may explode or burst into flames. Only charge the lithium batteries with a lithium battery charger.
A Lithium ion battery pack *must* be charged with a circuit specifically designed to do so, and should be discharged with a protection circuit as well. Batteries with multiple cells in series(like yours) should be charged with an appropriate BMS(Battery management system). If you're using Lithium ion for a project, do ...
67,593
I am traveling from the US to Australia. What type of under the seat bag is practical, and what should be stored in it for the flight?
2016/05/01
[ "https://travel.stackexchange.com/questions/67593", "https://travel.stackexchange.com", "https://travel.stackexchange.com/users/43012/" ]
When I'm on flights that long what I like to do is carry a larger backpack with a smaller bag inside of it that has the stuff I'll want in-flight. The larger backpack additionally has stuff that I want access to in an airport or in case of getting stranded overnight from a flight cancellation or missed connection. Putt...
To add to all the great answers given; * It can be very cold in the airplane, I like to take a pair of warm socks with me. * The air can be very dry and rough on the skin, I prefer to take a moisturising cream and lipbalm with me, so I don't start my holiday with itchy, cracked skin and lips.
67,593
I am traveling from the US to Australia. What type of under the seat bag is practical, and what should be stored in it for the flight?
2016/05/01
[ "https://travel.stackexchange.com/questions/67593", "https://travel.stackexchange.com", "https://travel.stackexchange.com/users/43012/" ]
Under the seat? Hopefully nothing. That's where I store my feet. There's not enough space for a bag.
To add to all the great answers given; * It can be very cold in the airplane, I like to take a pair of warm socks with me. * The air can be very dry and rough on the skin, I prefer to take a moisturising cream and lipbalm with me, so I don't start my holiday with itchy, cracked skin and lips.
67,593
I am traveling from the US to Australia. What type of under the seat bag is practical, and what should be stored in it for the flight?
2016/05/01
[ "https://travel.stackexchange.com/questions/67593", "https://travel.stackexchange.com", "https://travel.stackexchange.com/users/43012/" ]
When I'm on flights that long what I like to do is carry a larger backpack with a smaller bag inside of it that has the stuff I'll want in-flight. The larger backpack additionally has stuff that I want access to in an airport or in case of getting stranded overnight from a flight cancellation or missed connection. Putt...
Anything valuable and *all* important documents for your travel should be as close to you as possible. This means your passport, boarding passes (unless using electronic ones but I will bring a printed copy too), address at your destination plus any other necessary documentation to pass immigration and customs at your ...
67,593
I am traveling from the US to Australia. What type of under the seat bag is practical, and what should be stored in it for the flight?
2016/05/01
[ "https://travel.stackexchange.com/questions/67593", "https://travel.stackexchange.com", "https://travel.stackexchange.com/users/43012/" ]
Anything valuable and *all* important documents for your travel should be as close to you as possible. This means your passport, boarding passes (unless using electronic ones but I will bring a printed copy too), address at your destination plus any other necessary documentation to pass immigration and customs at your ...
Under the seat? Hopefully nothing. That's where I store my feet. There's not enough space for a bag.
67,593
I am traveling from the US to Australia. What type of under the seat bag is practical, and what should be stored in it for the flight?
2016/05/01
[ "https://travel.stackexchange.com/questions/67593", "https://travel.stackexchange.com", "https://travel.stackexchange.com/users/43012/" ]
When I'm on flights that long what I like to do is carry a larger backpack with a smaller bag inside of it that has the stuff I'll want in-flight. The larger backpack additionally has stuff that I want access to in an airport or in case of getting stranded overnight from a flight cancellation or missed connection. Putt...
Under the seat? Hopefully nothing. That's where I store my feet. There's not enough space for a bag.
67,593
I am traveling from the US to Australia. What type of under the seat bag is practical, and what should be stored in it for the flight?
2016/05/01
[ "https://travel.stackexchange.com/questions/67593", "https://travel.stackexchange.com", "https://travel.stackexchange.com/users/43012/" ]
A few bonus tips to go with [Roddy of the Frozen Peas](https://travel.stackexchange.com/a/67602/16725) excellent answer: * Don't make the bag too big, as it will be taking up some of your legroom. Some aircraft have electronics boxes for the in-flight entertainment system under the seat, which further reduces the avai...
Anything valuable and *all* important documents for your travel should be as close to you as possible. This means your passport, boarding passes (unless using electronic ones but I will bring a printed copy too), address at your destination plus any other necessary documentation to pass immigration and customs at your ...
67,593
I am traveling from the US to Australia. What type of under the seat bag is practical, and what should be stored in it for the flight?
2016/05/01
[ "https://travel.stackexchange.com/questions/67593", "https://travel.stackexchange.com", "https://travel.stackexchange.com/users/43012/" ]
A few bonus tips to go with [Roddy of the Frozen Peas](https://travel.stackexchange.com/a/67602/16725) excellent answer: * Don't make the bag too big, as it will be taking up some of your legroom. Some aircraft have electronics boxes for the in-flight entertainment system under the seat, which further reduces the avai...
When I'm on flights that long what I like to do is carry a larger backpack with a smaller bag inside of it that has the stuff I'll want in-flight. The larger backpack additionally has stuff that I want access to in an airport or in case of getting stranded overnight from a flight cancellation or missed connection. Putt...
67,593
I am traveling from the US to Australia. What type of under the seat bag is practical, and what should be stored in it for the flight?
2016/05/01
[ "https://travel.stackexchange.com/questions/67593", "https://travel.stackexchange.com", "https://travel.stackexchange.com/users/43012/" ]
The following is a list of the sort of items you should include in your cabin luggage (eg. not your checked luggage): * All valuables (jewelry, money, etc) * Important documents (passport, itinerary, hotel reservations, medical prescriptions, etc) * All electronics (phone, laptop, mp3 players, etc) * Anything fragile ...
A few bonus tips to go with [Roddy of the Frozen Peas](https://travel.stackexchange.com/a/67602/16725) excellent answer: * Don't make the bag too big, as it will be taking up some of your legroom. Some aircraft have electronics boxes for the in-flight entertainment system under the seat, which further reduces the avai...
67,593
I am traveling from the US to Australia. What type of under the seat bag is practical, and what should be stored in it for the flight?
2016/05/01
[ "https://travel.stackexchange.com/questions/67593", "https://travel.stackexchange.com", "https://travel.stackexchange.com/users/43012/" ]
The following is a list of the sort of items you should include in your cabin luggage (eg. not your checked luggage): * All valuables (jewelry, money, etc) * Important documents (passport, itinerary, hotel reservations, medical prescriptions, etc) * All electronics (phone, laptop, mp3 players, etc) * Anything fragile ...
To add to all the great answers given; * It can be very cold in the airplane, I like to take a pair of warm socks with me. * The air can be very dry and rough on the skin, I prefer to take a moisturising cream and lipbalm with me, so I don't start my holiday with itchy, cracked skin and lips.
67,593
I am traveling from the US to Australia. What type of under the seat bag is practical, and what should be stored in it for the flight?
2016/05/01
[ "https://travel.stackexchange.com/questions/67593", "https://travel.stackexchange.com", "https://travel.stackexchange.com/users/43012/" ]
A few bonus tips to go with [Roddy of the Frozen Peas](https://travel.stackexchange.com/a/67602/16725) excellent answer: * Don't make the bag too big, as it will be taking up some of your legroom. Some aircraft have electronics boxes for the in-flight entertainment system under the seat, which further reduces the avai...
To add to all the great answers given; * It can be very cold in the airplane, I like to take a pair of warm socks with me. * The air can be very dry and rough on the skin, I prefer to take a moisturising cream and lipbalm with me, so I don't start my holiday with itchy, cracked skin and lips.
46,173,343
I want to hide all products that are not checked. for example:- I have a checkbox button in product.template model and i want to hide hide all those products that are unchecked.
2017/09/12
[ "https://Stackoverflow.com/questions/46173343", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7640700/" ]
None of these answers worked for me because every answer assumes the namespace is `kube-system`, which is not always true. Thus, you need to first see the names space: ``` $ kubectl get deployments -A NAMESPACE NAME READY UP-TO-DATE AVAILABLE AGE default nginx-d...
I use "minikube start" create.Then use "minikube dashboard" create the dashboard.Finally,I use "minikube config set dashboard false" to stop and delete the dashboard resources(including service,deployment,...).
46,173,343
I want to hide all products that are not checked. for example:- I have a checkbox button in product.template model and i want to hide hide all those products that are unchecked.
2017/09/12
[ "https://Stackoverflow.com/questions/46173343", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7640700/" ]
Using a label selector: ``` kubectl --namespace=kube-system delete deployment,service,role,rolebinding,sa,secret -l k8s-app=kubernetes-dashboard ```
I use "minikube start" create.Then use "minikube dashboard" create the dashboard.Finally,I use "minikube config set dashboard false" to stop and delete the dashboard resources(including service,deployment,...).
46,173,343
I want to hide all products that are not checked. for example:- I have a checkbox button in product.template model and i want to hide hide all those products that are unchecked.
2017/09/12
[ "https://Stackoverflow.com/questions/46173343", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7640700/" ]
Just click "Delete" when selecting the dashboard under the namespaces using the [vs code kubernetes extension](https://marketplace.visualstudio.com/items?itemName=ms-kubernetes-tools.vscode-kubernetes-tools). [![enter image description here](https://i.stack.imgur.com/jIPAY.png)](https://i.stack.imgur.com/jIPAY.png) Y...
I use "minikube start" create.Then use "minikube dashboard" create the dashboard.Finally,I use "minikube config set dashboard false" to stop and delete the dashboard resources(including service,deployment,...).
46,173,343
I want to hide all products that are not checked. for example:- I have a checkbox button in product.template model and i want to hide hide all those products that are unchecked.
2017/09/12
[ "https://Stackoverflow.com/questions/46173343", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7640700/" ]
Update December 2020: --------------------- `kubectl delete -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0/aio/deploy/recommended.yaml` You can also have a look this link: [Kubernetes Dashboard](https://kubernetes.io/docs/tasks/access-application-cluster/web-ui-dashboard/#deploying-the-dashboard-ui)...
``` kubectl delete ([-f FILENAME] | TYPE [(NAME | -l label | --all)]) ``` <https://kubernetes-v1-4.github.io/docs/user-guide/kubectl/kubectl_delete/>
46,173,343
I want to hide all products that are not checked. for example:- I have a checkbox button in product.template model and i want to hide hide all those products that are unchecked.
2017/09/12
[ "https://Stackoverflow.com/questions/46173343", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7640700/" ]
Using a label selector: ``` kubectl --namespace=kube-system delete deployment,service,role,rolebinding,sa,secret -l k8s-app=kubernetes-dashboard ```
Just delete the `Deployment`, all the related pods will be terminated automatically.
46,173,343
I want to hide all products that are not checked. for example:- I have a checkbox button in product.template model and i want to hide hide all those products that are unchecked.
2017/09/12
[ "https://Stackoverflow.com/questions/46173343", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7640700/" ]
Simply go with `kubectl --namespace kube-system delete deployment kubernetes-dashboard` and you'll have no more dashboard in your cluster
'minikube addons disable dashboard' worked for me. Using v1.6.2.
46,173,343
I want to hide all products that are not checked. for example:- I have a checkbox button in product.template model and i want to hide hide all those products that are unchecked.
2017/09/12
[ "https://Stackoverflow.com/questions/46173343", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7640700/" ]
Update December 2020: --------------------- `kubectl delete -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0/aio/deploy/recommended.yaml` You can also have a look this link: [Kubernetes Dashboard](https://kubernetes.io/docs/tasks/access-application-cluster/web-ui-dashboard/#deploying-the-dashboard-ui)...
Just delete the `Deployment`, all the related pods will be terminated automatically.
46,173,343
I want to hide all products that are not checked. for example:- I have a checkbox button in product.template model and i want to hide hide all those products that are unchecked.
2017/09/12
[ "https://Stackoverflow.com/questions/46173343", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7640700/" ]
Using a label selector: ``` kubectl --namespace=kube-system delete deployment,service,role,rolebinding,sa,secret -l k8s-app=kubernetes-dashboard ```
'minikube addons disable dashboard' worked for me. Using v1.6.2.
46,173,343
I want to hide all products that are not checked. for example:- I have a checkbox button in product.template model and i want to hide hide all those products that are unchecked.
2017/09/12
[ "https://Stackoverflow.com/questions/46173343", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7640700/" ]
**UPDATE MAY 2020:** Thanks to [Lee Richardson](https://stackoverflow.com/users/40783/lee-richardson) for his comment ;) They have changed the organisation of the files in the repo and as well the command on [Kubernetes manual](https://kubernetes.io/docs/tasks/access-application-cluster/web-ui-dashboard/#deploying-th...
Just delete the `Deployment`, all the related pods will be terminated automatically.
46,173,343
I want to hide all products that are not checked. for example:- I have a checkbox button in product.template model and i want to hide hide all those products that are unchecked.
2017/09/12
[ "https://Stackoverflow.com/questions/46173343", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7640700/" ]
Update December 2020: --------------------- `kubectl delete -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.0.0/aio/deploy/recommended.yaml` You can also have a look this link: [Kubernetes Dashboard](https://kubernetes.io/docs/tasks/access-application-cluster/web-ui-dashboard/#deploying-the-dashboard-ui)...
'minikube addons disable dashboard' worked for me. Using v1.6.2.
419,215
I already know that "anthropology" refers to mankind and "ecology" or something like that can refer to nature, but I was wondering if there was a fancy word that meant something along the lines of the intersection of human and nature. There probably isn't, but this is worth a shot. Sample: "On the topic of [word], Ki...
2017/11/21
[ "https://english.stackexchange.com/questions/419215", "https://english.stackexchange.com", "https://english.stackexchange.com/users/267189/" ]
How about "Ethnography"? A quote from [Wikipedia](https://en.wikipedia.org/wiki/Ethnography) says: > > The typical ethnography is a holistic study and so includes a brief history, and an analysis of the terrain, the climate, and the habitat. In all cases, it should be reflexive, make a substantial contribution towar...
"Anthropocene" is the term used by anthropologists to denote the era in which human behaviour is the most dominant factor in shaping the environment.
37,823
I'm using `beamer` and `tikz` to create an animation of a photon travelling between snowflakes. I have ten `Koch snowflake`s (hence the `\newcommand` in my MWE) typeset with `decorate{ decorate{ decorate{ decorate{...`, and subsequently I have many slides within a frame. Since each slide takes about 20 seconds to types...
2011/12/10
[ "https://tex.stackexchange.com/questions/37823", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/8141/" ]
The quick fix is a simple addition of two ampersands before opening the large curly brackets. In the `amsmath` `align` environment, along with the starred version, the ampersand tells LaTeX what elements should be aligned. ``` \begin{align*} &\left\{ \begin{array}{ll} i = x^2 + y^2 \\ j = a^2 + b^2 ...
Here is one way of aligning these two components: ![enter image description here](https://i.stack.imgur.com/wJi0Z.png) ``` \documentclass{article} \usepackage{amsmath}% http://ctan.org/pkg/amsmath \begin{document} \begin{align*} \left\{ \begin{array}{r@{\;}l} i &= x^2 + y^2 \\ j &= a^2 + b^2 \e...
37,823
I'm using `beamer` and `tikz` to create an animation of a photon travelling between snowflakes. I have ten `Koch snowflake`s (hence the `\newcommand` in my MWE) typeset with `decorate{ decorate{ decorate{ decorate{...`, and subsequently I have many slides within a frame. Since each slide takes about 20 seconds to types...
2011/12/10
[ "https://tex.stackexchange.com/questions/37823", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/8141/" ]
To simplify, in this case, you can use two `cases` environments inside a `align*` using `&` to align both structures: ``` \documentclass{article} \usepackage{amsmath} \begin{document} \begin{align*} &\begin{cases} \rlap{$i$}\phantom{j} = x^2 + y^2 \\ j = a^2 + b^2 \end{cases}\\ &\begin{cases} ...
Here is one way of aligning these two components: ![enter image description here](https://i.stack.imgur.com/wJi0Z.png) ``` \documentclass{article} \usepackage{amsmath}% http://ctan.org/pkg/amsmath \begin{document} \begin{align*} \left\{ \begin{array}{r@{\;}l} i &= x^2 + y^2 \\ j &= a^2 + b^2 \e...
37,823
I'm using `beamer` and `tikz` to create an animation of a photon travelling between snowflakes. I have ten `Koch snowflake`s (hence the `\newcommand` in my MWE) typeset with `decorate{ decorate{ decorate{ decorate{...`, and subsequently I have many slides within a frame. Since each slide takes about 20 seconds to types...
2011/12/10
[ "https://tex.stackexchange.com/questions/37823", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/8141/" ]
The quick fix is a simple addition of two ampersands before opening the large curly brackets. In the `amsmath` `align` environment, along with the starred version, the ampersand tells LaTeX what elements should be aligned. ``` \begin{align*} &\left\{ \begin{array}{ll} i = x^2 + y^2 \\ j = a^2 + b^2 ...
To simplify, in this case, you can use two `cases` environments inside a `align*` using `&` to align both structures: ``` \documentclass{article} \usepackage{amsmath} \begin{document} \begin{align*} &\begin{cases} \rlap{$i$}\phantom{j} = x^2 + y^2 \\ j = a^2 + b^2 \end{cases}\\ &\begin{cases} ...
127,820
maximum sound output in dB provided by 3.5mm Audio port in Raspberry pi3?
2021/07/01
[ "https://raspberrypi.stackexchange.com/questions/127820", "https://raspberrypi.stackexchange.com", "https://raspberrypi.stackexchange.com/users/135215/" ]
The reason it uses 10Mbps is because whatever it is connected to only supports 10Mbps. ``` Link partner advertised link modes: 10baseT/Half ``` A Gigabit router would say something like:- ``` Link partner advertised link modes: 10baseT/Half 10baseT/Full 100baseT/Half 100baseT...
According to the [specs](https://www.raspberrypi.org/products/raspberry-pi-3-model-b-plus/) your model (3B+) will not run at full gigabit ethernet speed due to the limitations of the USB bus: > > Gigabit Ethernet over USB 2.0 (maximum throughput 300 Mbps) > > > Consider upgrading to a RPI 4 if speed is important ...
51,747,361
In order to retrieve the equipment type I am using a that will retrieve the equipment model and then another that references the equipment type using the equipment model's field "typeID" to retrieve the equipment type. However it displays the following warning: > > Warning: Failed prop type: Invalid prop translateCh...
2018/08/08
[ "https://Stackoverflow.com/questions/51747361", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10197799/" ]
Not a perfect fix, but to get around the `translateChoice` issue, you can create a wrapper and pluck out that prop to prevent it from being passed. ```js const SubReference = ({ translateChoice, children, ...props }) => ( <ReferenceField {...props}>{children}</ReferenceField> ); ``` While troubleshooting this, I...
I have the same problem and I think this is an actual bug. I commented on the corresponding github issue <https://github.com/marmelab/react-admin/issues/2140> I looked into the code for `ReferenceField` and as far as I understood this is an actual bug. `ReferenceField` expects a function for the `translateChoice` prop...
51,747,361
In order to retrieve the equipment type I am using a that will retrieve the equipment model and then another that references the equipment type using the equipment model's field "typeID" to retrieve the equipment type. However it displays the following warning: > > Warning: Failed prop type: Invalid prop translateCh...
2018/08/08
[ "https://Stackoverflow.com/questions/51747361", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10197799/" ]
I found a better solution is kinda of an hack but seems to be more efficient. Taking the question example **where in order to get equipmentType is only needed `<ReferenceField>`**, it would be something like this: ```js const EquipList = ({...props}) => { <List {...props}> <Datagrid> <Ref...
I have the same problem and I think this is an actual bug. I commented on the corresponding github issue <https://github.com/marmelab/react-admin/issues/2140> I looked into the code for `ReferenceField` and as far as I understood this is an actual bug. `ReferenceField` expects a function for the `translateChoice` prop...
51,747,361
In order to retrieve the equipment type I am using a that will retrieve the equipment model and then another that references the equipment type using the equipment model's field "typeID" to retrieve the equipment type. However it displays the following warning: > > Warning: Failed prop type: Invalid prop translateCh...
2018/08/08
[ "https://Stackoverflow.com/questions/51747361", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10197799/" ]
I found a better solution is kinda of an hack but seems to be more efficient. Taking the question example **where in order to get equipmentType is only needed `<ReferenceField>`**, it would be something like this: ```js const EquipList = ({...props}) => { <List {...props}> <Datagrid> <Ref...
Not a perfect fix, but to get around the `translateChoice` issue, you can create a wrapper and pluck out that prop to prevent it from being passed. ```js const SubReference = ({ translateChoice, children, ...props }) => ( <ReferenceField {...props}>{children}</ReferenceField> ); ``` While troubleshooting this, I...
11,206,631
I have a need to sort a collection of these based upon criteria determined at run-time. I was using the code from [this](https://stackoverflow.com/questions/41244/dynamic-linq-orderby) article to perform the sorting - originally my code used the dynamic class. Then I hit issues with serialization over WCF so I switch...
2012/06/26
[ "https://Stackoverflow.com/questions/11206631", "https://Stackoverflow.com", "https://Stackoverflow.com/users/571117/" ]
Here's some code using [FastMember](http://nuget.org/packages/FastMember) for this, which works for both reflection-based and `dynamic`-based objects (depending on what you pass to `TypeAccessor.Create`) ``` using System; using System.Collections; using System.Collections.Generic; using System.Dynamic; using FastMembe...
Marc Gravell's answer gave me the answer to complete this - I needed to implement a sorter that could handle multiple sort criteria, not known until runtime. I'm accepting Marc's answer, but posting this as someone may find it useful too. There may be a more elegant way of achieving this, if so please let me know and ...
24,544,448
In the [elasticsearch-py docs](http://elasticsearch-py.readthedocs.org/en/master/api.html) I can't find an example registering a mapping, which performs what these REST API [docs](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-put-mapping.html#indices-put-mapping) say: The put mapping AP...
2014/07/03
[ "https://Stackoverflow.com/questions/24544448", "https://Stackoverflow.com", "https://Stackoverflow.com/users/290150/" ]
Doing anything with the index involves the Indices APIs. PUTing mapping is also one of many Indices API. They can be found in the `Indices` section under `API Documentation` of the Python client docs. And you need [this: put\_mapping(\*args, \*\*kwargs)](http://elasticsearch-py.readthedocs.org/en/master/api.html#elast...
Here is a complete example : ``` from elasticsearch import Elasticsearch def fMap(document_type): mapping={document_type:{\ "properties":{\ "a_field":{"type":"integer","store":"yes"},\ "other_field": {"type":"string","index":"analyzed","store":"no"},\ "title":{"t...